Sayonara Player
ColumnHeader.h
1 /* MyColumnHeader.h */
2 
3 /* Copyright 2011-2017 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 /*
22  *
23  * Created on: 19.12.2012
24  * Author: luke
25  */
26 
27 #ifndef MYCOLUMNHEADER_H_
28 #define MYCOLUMNHEADER_H_
29 
30 #include <QObject>
31 
32 #include "Utils/Library/Sortorder.h"
33 #include "Utils/Pimpl.h"
34 
35 class QAction;
36 
37 class ColumnHeader : public QObject
38 {
39  Q_OBJECT
40  PIMPL(ColumnHeader)
41 
42  public:
43  enum class SizeType : uint8_t
44  {
45  Abs=0,
46  Rel,
47  Undefined
48  };
49 
50  enum HeaderType
51  {
52  Sharp,
53  Artist,
54  Album,
55  Title,
56  NumTracks,
57  Duration,
58  DurationShort,
59  Year,
60  Rating,
61  Bitrate,
62  Filesize
63  };
64 
65  private:
66  ColumnHeader(HeaderType type, bool switchable, Library::SortOrder sort_asc, Library::SortOrder sort_desc);
67  virtual ~ColumnHeader();
68 
69  public:
70  ColumnHeader(HeaderType type, bool switchable, Library::SortOrder sort_asc, Library::SortOrder sort_desc, int preferred_size_abs);
71  ColumnHeader(HeaderType type, bool switchable, Library::SortOrder sort_asc, Library::SortOrder sort_desc, double preferred_size_rel, int min_size);
72 
73  int preferred_size_abs() const;
74  double preferred_size_rel() const;
75 
76  Library::SortOrder sortorder_asc() const;
77  Library::SortOrder sortorder_desc() const;
78 
79  ColumnHeader::SizeType size_type() const;
80 
81  bool is_visible() const;
82  bool is_hidden() const;
83 
84  void retranslate();
85 
86  QAction* action();
87  QString title() const;
88 };
89 
91  public QList<ColumnHeader*>
92 {
93  public:
94  int visible_columns() const;
95  int visible_column(int n) const;
96 };
97 
98 #endif /* MYCOLUMNHEADER_H_ */
Definition: ColumnHeader.h:90
Definition: ColumnHeader.h:37
The Album class.
Definition: Album.h:38
The Artist class.
Definition: Artist.h:35
Definition: org_mpris_media_player2_adaptor.h:20