KVIrc  4.9.2
DeveloperAPIs
RegisteredUsersDialog.h
Go to the documentation of this file.
1 #ifndef _DIALOG_H_
2 #define _DIALOG_H_
3 //=============================================================================
4 //
5 // File : RegisteredUserEntryDialog.h
6 // Creation date : Sun Dec 24 2000 15:16:17 CEST by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "KviCString.h"
29 #include "KviSelectors.h"
30 #include "KviPointerHashTable.h"
31 #include <QTreeWidget>
32 #include "KviTalListWidget.h"
33 
34 #include <QWidget>
35 #include <QLineEdit>
36 #include <QPushButton>
37 #include <QStyledItemDelegate>
38 #include <QTextDocument>
39 #include <QMenu>
40 
41 class KviRegisteredUsersListView : public QTreeWidget
42 {
43  Q_OBJECT
44 public:
45  KviRegisteredUsersListView(QWidget *);
47 
48 protected:
49  void mousePressEvent(QMouseEvent * e);
50 signals:
51  void rightButtonPressed(QTreeWidgetItem *, QPoint);
52 };
53 
54 class RegisteredUsersDialogItemDelegate : public QStyledItemDelegate
55 {
56 public:
58  : QStyledItemDelegate(pWidget){};
60  QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
61  void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
62 };
63 
64 class RegisteredUsersDialogItemBase : public QTreeWidgetItem
65 {
66 public:
67  enum Types
68  {
71  };
72 
73 protected:
75  : QTreeWidgetItem(par), m_iType(type){};
76  RegisteredUsersDialogItemBase(Types type, QTreeWidgetItem * par)
77  : QTreeWidgetItem(par), m_iType(type){};
79 
80 private:
82 
83 public:
85 };
86 
88 {
89 protected:
91 
92 public:
95  {
96  setText(0, m_pGroup->name());
97  }
99  {
100  }
102 };
103 
105 {
107 
108 protected:
110  QTextDocument m_pText;
111 
112 public:
113  RegisteredUsersDialogItem(QTreeWidgetItem * par, KviRegisteredUser * u);
115 
116 public:
117  KviRegisteredUser * user() { return m_pUser; };
119  virtual QString key(int, bool) const;
120 };
121 
122 class RegisteredUsersDialog : public QWidget
123 {
124  Q_OBJECT
125 public:
126  RegisteredUsersDialog(QWidget * par = 0);
128 
129 public:
131  QPushButton * m_pAddButton;
132  QPushButton * m_pWizardAddButton;
133  QPushButton * m_pRemoveButton;
134  QPushButton * m_pEditButton;
135  QPushButton * m_pImportButton;
136  QPushButton * m_pExportButton;
137  QPushButton * m_pAddGroupButton;
138  QPushButton * m_pSelectAllButton;
139 
140 protected:
141  void fillList();
143  void editGroup(KviRegisteredUserGroup * group);
144  virtual void closeEvent(QCloseEvent *);
145 protected slots:
146  void cancelClicked();
147  void okClicked();
148  void addClicked();
149  void removeClicked();
150  void editClicked();
151  void selectionChanged();
152  void importClicked();
153  void exportClicked();
154  void addWizardClicked();
155  void addGroupClicked();
156  void selectAllClicked();
157  void itemPressed(QTreeWidgetItem * it, int c);
158  void itemDoubleClicked(QTreeWidgetItem * it, int);
159  void rightButtonPressed(QTreeWidgetItem *, QPoint);
160  void moveToGroupMenuClicked(QAction * pAction);
161 };
162 
163 #endif
void rightButtonPressed(QTreeWidgetItem *, QPoint)
Definition: KviRegisteredUserGroup.h:35
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
~RegisteredUsersDialog()
Definition: RegisteredUsersDialog.cpp:337
KviRegisteredUser * m_pUser
Definition: RegisteredUsersDialog.h:109
void selectionChanged()
Definition: RegisteredUsersDialog.cpp:688
RegisteredUsersDialogItem(QTreeWidgetItem *par, KviRegisteredUser *u)
Definition: RegisteredUsersDialog.cpp:112
~RegisteredUsersGroupItem()
Definition: RegisteredUsersDialog.h:98
void importClicked()
Definition: RegisteredUsersDialog.cpp:852
QPushButton * m_pAddGroupButton
Definition: RegisteredUsersDialog.h:137
void mousePressEvent(QMouseEvent *e)
Definition: RegisteredUsersDialog.cpp:101
void editClicked()
Definition: RegisteredUsersDialog.cpp:629
Definition: KviRegisteredUser.h:35
QPushButton * m_pRemoveButton
Definition: RegisteredUsersDialog.h:133
~RegisteredUsersDialogItemBase()
Definition: RegisteredUsersDialog.h:78
QPushButton * m_pAddButton
Definition: RegisteredUsersDialog.h:131
#define e
Definition: detector.cpp:69
virtual QString key(int, bool) const
Definition: RegisteredUsersDialog.cpp:152
QPushButton * m_pImportButton
Definition: RegisteredUsersDialog.h:135
#define i
Definition: detector.cpp:73
KviRegisteredUsersListView(QWidget *)
Definition: RegisteredUsersDialog.cpp:76
Pointer Hash Table.
Definition: RegisteredUsersDialog.h:41
void itemPressed(QTreeWidgetItem *it, int c)
Definition: RegisteredUsersDialog.cpp:353
Types
Definition: RegisteredUsersDialog.h:67
void addWizardClicked()
Definition: RegisteredUsersDialog.cpp:598
virtual void closeEvent(QCloseEvent *)
Definition: RegisteredUsersDialog.cpp:561
RegisteredUsersDialog(QWidget *par=0)
Definition: RegisteredUsersDialog.cpp:224
RegisteredUsersDialogItemDelegate(KviRegisteredUsersListView *pWidget=0)
Definition: RegisteredUsersDialog.h:57
RegisteredUsersDialogItemBase(Types type, KviRegisteredUsersListView *par)
Definition: RegisteredUsersDialog.h:74
RegisteredUsersDialogItemBase(Types type, QTreeWidgetItem *par)
Definition: RegisteredUsersDialog.h:76
void fillList()
Definition: RegisteredUsersDialog.cpp:517
#define g
Definition: detector.cpp:71
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: RegisteredUsersDialog.cpp:157
~KviRegisteredUsersListView()
Definition: RegisteredUsersDialog.h:46
KviRegisteredUserGroup * m_pGroup
Definition: RegisteredUsersDialog.h:90
QPushButton * m_pEditButton
Definition: RegisteredUsersDialog.h:134
RegisteredUsersGroupItem(KviRegisteredUsersListView *par, KviRegisteredUserGroup *g)
Definition: RegisteredUsersDialog.h:93
void addClicked()
Definition: RegisteredUsersDialog.cpp:583
~RegisteredUsersDialogItemDelegate()
Definition: RegisteredUsersDialog.h:59
QPushButton * m_pSelectAllButton
Definition: RegisteredUsersDialog.h:138
Definition: RegisteredUsersDialog.h:64
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: RegisteredUsersDialog.cpp:206
KviRegisteredUserGroup * group()
Definition: RegisteredUsersDialog.h:101
void editGroup(KviRegisteredUserGroup *group)
Definition: RegisteredUsersDialog.cpp:436
const QString & name()
Definition: KviRegisteredUserGroup.h:48
void setUser(KviRegisteredUser *u)
Definition: RegisteredUsersDialog.h:118
void selectAllClicked()
Definition: RegisteredUsersDialog.cpp:847
KviRegisteredUser * user()
Definition: RegisteredUsersDialog.h:117
void editItem(RegisteredUsersDialogItem *i)
Definition: RegisteredUsersDialog.cpp:646
QPushButton * m_pWizardAddButton
Definition: RegisteredUsersDialog.h:132
#define u
Definition: detector.cpp:85
Definition: RegisteredUsersDialog.h:70
void okClicked()
Definition: RegisteredUsersDialog.cpp:569
KviRegisteredUsersListView * m_pListView
Definition: RegisteredUsersDialog.h:130
RegisteredUsersDialogItemBase::Types type()
Definition: RegisteredUsersDialog.h:84
QPushButton * m_pExportButton
Definition: RegisteredUsersDialog.h:136
void itemDoubleClicked(QTreeWidgetItem *it, int)
Definition: RegisteredUsersDialog.cpp:407
Definition: RegisteredUsersDialog.h:87
Definition: RegisteredUsersDialog.h:122
Definition: RegisteredUsersDialog.h:69
void rightButtonPressed(QTreeWidgetItem *, QPoint)
Definition: RegisteredUsersDialog.cpp:476
void exportClicked()
Definition: RegisteredUsersDialog.cpp:707
void addGroupClicked()
Definition: RegisteredUsersDialog.cpp:423
void cancelClicked()
Definition: RegisteredUsersDialog.cpp:577
RegisteredUsersDialogItemBase::Types m_iType
Definition: RegisteredUsersDialog.h:78
Definition: RegisteredUsersDialog.h:104
void removeClicked()
Definition: RegisteredUsersDialog.cpp:611
QTextDocument m_pText
Definition: RegisteredUsersDialog.h:110
void moveToGroupMenuClicked(QAction *pAction)
Definition: RegisteredUsersDialog.cpp:501
Definition: RegisteredUsersDialog.h:54