File indexing completed on 2024-05-19 04:49:49
0001 /**************************************************************************************** 0002 * Copyright (c) 2009 Nikolaj Hald Nielsen <nhn@kde.org> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify it under * 0005 * the terms of the GNU General Public License as published by the Free Software * 0006 * Foundation; either version 2 of the License, or (at your option) any later * 0007 * version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 0010 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 0011 * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 0012 * * 0013 * You should have received a copy of the GNU General Public License along with * 0014 * this program. If not, see <http://www.gnu.org/licenses/>. * 0015 ****************************************************************************************/ 0016 0017 #ifndef LAYOUTEDITWIDGET_H 0018 #define LAYOUTEDITWIDGET_H 0019 0020 #include "LayoutItemConfig.h" 0021 0022 #include "widgets/TokenWithLayout.h" 0023 0024 #include <QWidget> 0025 0026 class QCheckBox; 0027 class TokenDropTarget; 0028 0029 namespace Playlist { 0030 0031 /** 0032 * A widget to define the layout of a single type of playlist item ( head, body or single ) 0033 * @author Nikolaj Hald Nielsen <nhn@kde.org> 0034 */ 0035 class LayoutEditWidget : public QWidget 0036 { 0037 Q_OBJECT 0038 0039 public: 0040 /** 0041 * Constructor. 0042 * @param parent The parent widget. 0043 */ 0044 explicit LayoutEditWidget( QWidget *parent ); 0045 0046 /** 0047 * Destructor. 0048 */ 0049 ~LayoutEditWidget() override; 0050 0051 /** 0052 * Setup the edit widget to represent an existing LayoutItemConfig. 0053 * @param config The config to read. 0054 */ 0055 void readLayout( const Playlist::LayoutItemConfig &config ); 0056 0057 /** 0058 * Create and return a LayoutItemConfig corresponding to the current state of the editor 0059 * @return LayoutItemConfig matching the contents of the editor. 0060 */ 0061 Playlist::LayoutItemConfig config(); 0062 0063 /** 0064 * Clear the editor. 0065 */ 0066 void clear(); 0067 0068 Q_SIGNALS: 0069 0070 /** 0071 * Signal emitted when the token drop target receives input focus. 0072 * The parameter is a widget that received the focus. 0073 */ 0074 void focuseReceived( QWidget* ); 0075 void changed(); 0076 0077 private: 0078 QCheckBox *m_showCoverCheckBox; 0079 TokenDropTarget *m_dragstack; 0080 }; 0081 0082 } 0083 0084 #endif