Sayonara Player
ColumnHeader.h
1 /* MyColumnHeader.h */
2 
3 /* Copyright 2011-2019 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 HeaderType
45  {
46  Sharp,
47  Artist,
48  Album,
49  Discnumber,
50  Title,
51  NumTracks,
52  Duration,
53  DurationShort,
54  Year,
55  Rating,
56  Bitrate,
57  Filesize
58  };
59 
60  public:
61  ColumnHeader(HeaderType type, bool switchable, SortOrder sort_asc, SortOrder sort_desc, int preferred_size, bool stretchable=false);
62  virtual ~ColumnHeader();
63 
64  bool stretchable() const;
65  int default_size() const;
66  int preferred_size() const;
67  void set_preferred_size(int size);
68 
69 
70  SortOrder sortorder_asc() const;
71  SortOrder sortorder_desc() const;
72 
73  bool is_visible() const;
74  bool is_hidden() const;
75 
76  void retranslate();
77 
78  QAction* action();
79  QString title() const;
80  };
81 
82  using ColumnHeaderPtr = std::shared_ptr<ColumnHeader>;
84  public QList<ColumnHeaderPtr>
85  {
86  public:
87  int visible_columns() const;
88  int visible_column(int n) const;
89  };
90 }
91 
92 #endif /* MYCOLUMNHEADER_H_ */
Definition: ColumnHeader.h:83
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