Disable clipboardsharing in view only mode.
[kdenetwork.git] / kget / conf / transfersgroupwidget.h
blobcdfb934ea67fc12cbb78221c8c8c49c17845f287
1 /* This file is part of the KDE project
3 Copyright (C) 2005 Dario Massarin <nekkar@libero.it>
4 Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org>
5 Copyright (C) 2007 Javier Goday <jgoday @ gmail.com>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU 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.
13 #ifndef TRANSFERS_GROUP_WIDGET_H
14 #define TRANSFERS_GROUP_WIDGET_H
16 #include <KLineEdit>
18 #include <QStyledItemDelegate>
19 #include <QVBoxLayout>
20 #include <QTreeView>
22 class QPushButton;
23 class QItemSelection;
24 class KIconButton;
26 class GroupEditor : public KLineEdit
28 Q_OBJECT
29 public:
30 GroupEditor(QModelIndex group, const QString contents, QWidget * parent=0)
31 : KLineEdit(contents, parent), m_groupIndex(group)
35 QModelIndex groupIndex() const {return m_groupIndex;}
37 private:
38 QModelIndex m_groupIndex;
41 class TransfersGroupDelegate : public QStyledItemDelegate
43 Q_OBJECT
44 public:
45 TransfersGroupDelegate(QObject * parent=0);
47 QWidget * createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const;
50 class TransfersGroupTree : public QTreeView
52 Q_OBJECT
53 public:
54 TransfersGroupTree(QWidget *parent=0);
56 public slots:
57 void editCurrent();
58 void addGroup();
59 void deleteSelectedGroup();
60 void renameSelectedGroup();
61 void changeIcon(const QString &icon);
62 void commitData(QWidget *editor);
65 class TransfersGroupWidget : public QVBoxLayout
67 Q_OBJECT
68 public:
69 TransfersGroupWidget(QWidget *parent=0);
71 private slots:
72 void slotSelectionChanged(const QItemSelection &current, const QItemSelection &old);
74 private:
75 TransfersGroupTree *m_view;
77 QPushButton *addButton;
78 QPushButton *deleteButton;
79 QPushButton *renameButton;
80 KIconButton *iconButton;
81 QPushButton *configureButton;
84 #endif