ICF 3.0.5.47
Technical documentation of ICF Libraries
CUserManagerDialog.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// Qt includes
10#include <QtCore/QString>
11#include<QtCore/QtGlobal>
12#include <QtWidgets/QItemDelegate>
13#include <QtWidgets/QDialog>
14
15// ICF includes
17#include <iauth/ILogin.h>
18#include <iauth/IUsersManager.h>
19
20#include <GeneratedFiles/iauthgui/ui_CUserManagerDialog.h>
21
22
23namespace iauthgui
24{
25
26
28 public QDialog,
29 public Ui::CUserManagerDialog
30{
31 Q_OBJECT
32public:
34
35 void SaveCurUsername(const QString& Username);
37
38protected Q_SLOTS:
42 void OnCancel();
43
44private:
45 enum ListColumn
46 {
47 LC_NAME_COLUMN,
48 LC_GROUP
49 };
50
51 class CUserManagerItemDelegate: public QItemDelegate
52 {
53 public:
54 typedef QItemDelegate BaseClass;
55
56 CUserManagerItemDelegate(CUserManagerDialog& parent);
57
58 // reimplemented (QItemDelegate)
59 virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
60
61 // reimplemented (QAbstractItemDelegate)
62 virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
63
64 // reimplemented (QWidget)
65 virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
66
67 private:
68 CUserManagerDialog& m_parent;
69 int m_loggedUserLevel;
70 };
71
72 const iauth::ILogin& m_login;
73 iauth::IUsersManager& m_manager;
74
75 void ResetGui();
76 void UpdateUserList();
77
78 QString m_curUserName;
79
80 void* userManagerMemBufferPtr;
81 int userManagerMemBufferSize;
82
83 iser::CMemoryWriteArchive m_storedUsersManager;
84};
85
86
87} // namespace iauthgui
88
89
Provide management of users.
CUserManagerDialog(const iauth::ILogin &login, iauth::IUsersManager &manager)
void SaveCurUsername(const QString &Username)
Implementation of archive using memory buffer to store the persistent objects.
Contains implementations of GUI components related to right management.

© Witold Gantzke and Kirill Lepskiy