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