Sayonara Player
LibraryHeaderView.h
1
2/* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
3 *
4 * This file is part of sayonara player
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBRARY_HEADERVIEW_H
21#define LIBRARY_HEADERVIEW_H
22
23#include "Gui/Library/Header/ColumnHeader.h"
24#include "Gui/Utils/Widgets/HeaderView.h"
25#include "Utils/Library/Sortorder.h"
26#include "Utils/Pimpl.h"
27
28namespace Library
29{
30 class HeaderView :
31 public Gui::HeaderView
32 {
33 Q_OBJECT
34 PIMPL(HeaderView)
35
36 signals:
37 void sigAutoResizeToggled(bool b);
38
39 public:
40 HeaderView(Qt::Orientation orientation, QWidget* parent = nullptr);
41 ~HeaderView() override;
42
43 void init(const ColumnHeaderList& columnHeaderList, const QByteArray& state, Library::SortOrder sortOrder,
44 bool autoResizeState);
45 void resizeColumnsAutomatically();
46
47 Library::SortOrder sortorder(int index, Qt::SortOrder sortOrder);
48 [[nodiscard]] QString columnText(int index) const;
49 void reloadColumnTexts();
50
51 protected:
52 void languageChanged() override;
53 void showEvent(QShowEvent* e) override;
54 void resizeEvent(QResizeEvent* e) override;
55
56 private:
57 void initializeView();
58
59 private slots:
60 void actionTriggered(bool b);
61 void actionResizeTriggered();
62 void actionAutoResizeTriggered(bool b);
63 };
64}
65
66#endif // LIBRARY_HEADERVIEW_H
Definition: HeaderView.h:31
Definition: LibraryHeaderView.h:32
Definition: EngineUtils.h:33
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31