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 #include <memory>
35 
36 class QAction;
37 
38 namespace Library
39 {
40  class ColumnHeader : public QObject
41  {
42  Q_OBJECT
43  PIMPL(ColumnHeader)
44 
45  public:
46  enum class SizeType : uint8_t
47  {
48  Abs=0,
49  Rel,
50  Undefined
51  };
52 
53  enum HeaderType
54  {
55  Sharp,
56  Artist,
57  Album,
58  Discnumber,
59  Title,
60  NumTracks,
61  Duration,
62  DurationShort,
63  Year,
64  Rating,
65  Bitrate,
66  Filesize
67  };
68 
69  private:
70  ColumnHeader(HeaderType type, bool switchable, SortOrder sort_asc, SortOrder sort_desc);
71 
72  public:
73  ColumnHeader(HeaderType type, bool switchable, SortOrder sort_asc, SortOrder sort_desc, int preferred_size_abs);
74  ColumnHeader(HeaderType type, bool switchable, SortOrder sort_asc, SortOrder sort_desc, double preferred_size_rel, int min_size);
75  virtual ~ColumnHeader();
76 
77  int preferred_size_abs() const;
78  double preferred_size_rel() const;
79 
80  SortOrder sortorder_asc() const;
81  SortOrder sortorder_desc() const;
82 
83  ColumnHeader::SizeType size_type() const;
84 
85  bool is_visible() const;
86  bool is_hidden() const;
87 
88  void retranslate();
89 
90  QAction* action();
91  QString title() const;
92  };
93 
94  using ColumnHeaderPtr = std::shared_ptr<ColumnHeader>;
96  public QList<ColumnHeaderPtr>
97  {
98  public:
99  int visible_columns() const;
100  int visible_column(int n) const;
101  };
102 }
103 
104 #endif /* MYCOLUMNHEADER_H_ */
Definition: ColumnHeader.h:95
The Album class.
Definition: Album.h:38
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:31
The Artist class.
Definition: Artist.h:35
Definition: ColumnHeader.h:40
Definition: org_mpris_media_player2_adaptor.h:20