3
* KMix -- KDE's full featured mini mixer
5
* Copyright Christian Esken <esken@kde.org>
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Library General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
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 GNU
15
* Library General Public License for more details.
17
* You should have received a copy of the GNU Library General Public
18
* License along with this program; if not, write to the Free
19
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
#ifndef DIALOGVIEWCONFIGURATION_H
22
#define DIALOGVIEWCONFIGURATION_H
27
#include <QGridLayout>
30
#include <QListWidget>
35
#include <QDragEnterEvent>
43
#include "guiprofile.h"
46
class DialogViewConfigurationItem : public QListWidgetItem
48
friend class QDataStream;
52
DialogViewConfigurationItem( QListWidget *parent);
53
DialogViewConfigurationItem( QListWidget *parent, QString id, bool shown, QString name, int splitted, const QString& iconName );
64
class DialogViewConfigurationWidget : public QListWidget
68
DialogViewConfigurationWidget(QWidget *parent=0);
70
void setActiveList(bool isActiveList) {
71
m_activeList = isActiveList;
73
bool isActiveList() const { return m_activeList; };
76
void dropped(DialogViewConfigurationWidget* list, int index, DialogViewConfigurationItem* item, bool sourceIsActiveList);
79
virtual QMimeData* mimeData(const QList<QListWidgetItem*> items) const;
80
virtual bool dropMimeData(int index, const QMimeData * mimeData, Qt::DropAction action);
82
virtual Qt::DropActions supportedDropActions() const
84
//kDebug() << "supportedDropActions!";
85
return Qt::MoveAction;
87
virtual QStringList mimeTypes() const
89
//kDebug() << "mimeTypes!";
90
return QStringList() << "application/x-kde-action-list";
93
// Skip internal dnd handling in QListWidget ---- how is one supposed to figure this out
94
// without reading the QListWidget code !?
95
virtual void dropEvent(QDropEvent* ev) {
96
QAbstractItemView::dropEvent(ev);
104
class DialogViewConfiguration : public KDialog
108
DialogViewConfiguration(QWidget* parent, ViewBase& view);
109
~DialogViewConfiguration();
112
// QSize sizeHint() const;
117
void slotDropped(DialogViewConfigurationWidget* list, int index, DialogViewConfigurationItem* item, bool sourceIsActiveList );
120
//void dragEnterEvent(QDragEnterEvent *event);
121
void prepareControls(QAbstractItemModel* model, bool isActiveView, GUIProfile::ControlSet& oldCtlSet, GUIProfile::ControlSet& newCtlSet);
123
QVBoxLayout* _layout;
125
//QWidget* vboxForScrollView;
128
//QHBoxLayout *_hlayout;
129
QGridLayout *_glayout;
131
//QScrollArea* scrollArea;
133
// QList<QCheckBox *> _qEnabledCB;
134
// QList<QCheckBox *> _qSplitCB;
135
// QList<QCheckBox *> _qLimitCB;
136
DialogViewConfigurationWidget *_qlw;
137
DialogViewConfigurationWidget *_qlwInactive;