Debian Codegraph @

src/playlist/layouts/LayoutConfigAction.h

raw
1 /****************************************************************************************
2 * Copyright (c) 2008 Nikolaj Hald Nielsen <[email protected]> *
3 * Copyright (c) 2009 Téo Mrnjavac <[email protected]> *
4 * *
5 * This program is free software; you can redistribute it and/or modify it under *
6 * the terms of the GNU General Public License as published by the Free Software *
7 * Foundation; either version 2 of the License, or (at your option) any later *
8 * version. *
9 * *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
11 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
12 * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License along with *
15 * this program. If not, see <http://www.gnu.org/licenses/>. *
16 ****************************************************************************************/
17
18 #ifndef LAYOUTCONFIGACTION_H
19 #define LAYOUTCONFIGACTION_H
20
21 #include <QAction>
22 #include <QMenu>
23
24
25 namespace Playlist {
26
27 class PlaylistLayoutEditDialog;
28
29 /**
30 * Action used to show a menu for selecting active playlist layout. Also contains an entry for showing the
31 * playlist layout editor.
32 * @author Nikolaj Hald Nielsen <[email protected]>
33 */
34 class LayoutConfigAction : public QAction
35 {
36 Q_OBJECT
37
38 public:
39 /**
40 * Constructor.
41 * @param parent Parent widget.
42 */
43 explicit LayoutConfigAction( QWidget * parent );
44
45 /**
46 * Destructor.
47 */
48 ~LayoutConfigAction() override;
49
50 protected Q_SLOTS:
51
52 /**
53 * Set the currently active layout based on the selected action.
54 * @param layoutAction The layoutAction triggered.
55 */
56 void setActiveLayout( QAction *layoutAction );
57
58 /**
59 * Notify the action that the list of selectable layouts have changed. Clears the list of layouts
60 * and refetches it from the LayoutManager.
61 */
62 void layoutListChanged();
63
64 /**
65 * Launch the playlist layout editor.
66 */
67 void configureLayouts();
68
69 /**
70 * The active layout has changed. Update the selected item to represent this.
71 */
72 void onActiveLayoutChanged();
73
74 private:
75 QAction *m_configAction;
76 QActionGroup *m_layoutActions;
77 QMenu *m_layoutMenu;
78 PlaylistLayoutEditDialog * m_layoutDialog;
79 };
80
81 }
82
83 #endif