1 /* This file is part of Clementine.
2    Copyright 2010, David Sansome <me@davidsansome.com>
3 
4    Clementine is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8 
9    Clementine is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13 
14    You should have received a copy of the GNU General Public License
15    along with Clementine.  If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef PLAYLISTHEADER_H
19 #define PLAYLISTHEADER_H
20 
21 #include "widgets/stretchheaderview.h"
22 
23 class PlaylistView;
24 
25 class QMenu;
26 
27 class PlaylistHeader : public StretchHeaderView {
28   Q_OBJECT
29 
30  public:
31   PlaylistHeader(Qt::Orientation orientation, PlaylistView* view,
32                  QWidget* parent = nullptr);
33 
34   // QWidget
35   void contextMenuEvent(QContextMenuEvent* e);
36   void enterEvent(QEvent*);
37 
38 signals:
39   void SectionVisibilityChanged(int logical, bool visible);
40   void SectionRatingLockStatusChanged(bool state);
41   void MouseEntered();
42 
43  private slots:
44   void HideCurrent();
45   void ToggleVisible(int section);
46   void ToggleRatingEditStatus();
47   void SetColumnAlignment(QAction* action);
48 
49  private:
50   void AddColumnAction(int index);
51 
52  private:
53   PlaylistView* view_;
54 
55   int menu_section_;
56   QMenu* menu_;
57   QAction* hide_action_;
58   QAction* rating_lock_;
59   QAction* stretch_action_;
60   QAction* align_left_action_;
61   QAction* align_center_action_;
62   QAction* align_right_action_;
63   QList<QAction*> show_actions_;
64 
65 };
66 
67 #endif  // PLAYLISTHEADER_H
68