Debian Codegraph @

src/playlist/layouts/LayoutEditWidget.h

raw
1 /****************************************************************************************
2 * Copyright (c) 2009 Nikolaj Hald Nielsen <[email protected]> *
3 * *
4 * This program is free software; you can redistribute it and/or modify it under *
5 * the terms of the GNU General Public License as published by the Free Software *
6 * Foundation; either version 2 of the License, or (at your option) any later *
7 * version. *
8 * *
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
11 * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
12 * *
13 * You should have received a copy of the GNU General Public License along with *
14 * this program. If not, see <http://www.gnu.org/licenses/>. *
15 ****************************************************************************************/
16
17 #ifndef LAYOUTEDITWIDGET_H
18 #define LAYOUTEDITWIDGET_H
19
20 #include "LayoutItemConfig.h"
21
22 #include "widgets/TokenWithLayout.h"
23
24 #include <QWidget>
25
26 class QCheckBox;
27 class TokenDropTarget;
28
29 namespace Playlist {
30
31 /**
32 * A widget to define the layout of a single type of playlist item ( head, body or single )
33 * @author Nikolaj Hald Nielsen <[email protected]>
34 */
35 class LayoutEditWidget : public QWidget
36 {
37 Q_OBJECT
38
39 public:
40 /**
41 * Constructor.
42 * @param parent The parent widget.
43 */
44 explicit LayoutEditWidget( QWidget *parent );
45
46 /**
47 * Destructor.
48 */
49 ~LayoutEditWidget() override;
50
51 /**
52 * Setup the edit widget to represent an existing LayoutItemConfig.
53 * @param config The config to read.
54 */
55 void readLayout( const Playlist::LayoutItemConfig &config );
56
57 /**
58 * Create and return a LayoutItemConfig corresponding to the current state of the editor
59 * @return LayoutItemConfig matching the contents of the editor.
60 */
61 Playlist::LayoutItemConfig config();
62
63 /**
64 * Clear the editor.
65 */
66 void clear();
67
68 Q_SIGNALS:
69
70 /**
71 * Signal emitted when the token drop target receives input focus.
72 * The parameter is a widget that received the focus.
73 */
74 void focuseReceived( QWidget* );
75 void changed();
76
77 private:
78 QCheckBox *m_showCoverCheckBox;
79 TokenDropTarget *m_dragstack;
80 };
81
82 }
83
84 #endif