CUserManagerDialog.h
Go to the documentation of this file.
1 #ifndef _qqtauth_CUserManagerDialog_included
2 #define _qqtauth_CUserManagerDialog_included
3 
4 
5 // Qt includes
6 #include <QtCore/QString>
7 #include<QtCore/QtGlobal>
8 #if QT_VERSION >= 0x050000
9 #include <QtWidgets/QItemDelegate>
10 #include <QtWidgets/QDialog>
11 #else
12 #include <QtGui/QItemDelegate>
13 #include <QtGui/QDialog>
14 #endif
15 
16 // ACF includes
18 
19 // ACF-Solutions includes
20 #include "iauth/ILogin.h"
21 #include "iauth/IUsersManager.h"
22 
23 #include "GeneratedFiles/iqtauth/ui_CUserManagerDialog.h"
24 
25 
26 namespace iqtauth
27 {
28 
29 
31  public QDialog,
32  public Ui::CUserManagerDialog
33 {
34  Q_OBJECT
35 public:
37 
38  void SaveCurUsername(const QString& Username);
39  int GetUserGroupSize();
40 
41 protected Q_SLOTS:
45  void OnCancel();
46 
47 private:
48  enum ListColumn
49  {
50  LC_NAME_COLUMN,
51  LC_GROUP
52  };
53 
54  class CUserManagerItemDelegate: public QItemDelegate
55  {
56  public:
57  typedef QItemDelegate BaseClass;
58 
59  CUserManagerItemDelegate(CUserManagerDialog& parent);
60 
61  // reimplemented (QItemDelegate)
62  virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
63 
64  // reimplemented (QAbstractItemDelegate)
65  virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
66 
67  // reimplemented (QWidget)
68  virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
69 
70  private:
71  CUserManagerDialog& m_parent;
72  int m_loggedUserLevel;
73  };
74 
75  const iauth::ILogin& m_login;
76  iauth::IUsersManager& m_manager;
77 
78  void ResetGui();
79  void UpdateUserList();
80 
81  QString m_curUserName;
82 
83  void* userManagerMemBufferPtr;
84  int userManagerMemBufferSize;
85 
86  iser::CMemoryWriteArchive m_storedUsersManager;
87 };
88 
89 
90 } // namespace iqtauth
91 
92 
93 #endif // !_qqtauth_CUserManagerDialog_included
94 
95 
CUserManagerDialog(const iauth::ILogin &login, iauth::IUsersManager &manager)
Provide management of users.
Definition: IUsersManager.h:23
void SaveCurUsername(const QString &Username)

© 2007-2011 Witold Gantzke and Kirill Lepskiy