OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ManageOwner.h
Go to the documentation of this file.
1#pragma once
2
3// OpenTwin header
4#include "OTWidgets/Table.h"
5#include "OTWidgets/Dialog.h"
6
7namespace ot {
8 class LineEdit;
9 class CheckBox;
10}
11
13 Q_OBJECT
14public:
16 ManageOwnerTable(int _row, int _column);
17 virtual ~ManageOwnerTable();
18
19 void addRow(const std::array<QTableWidgetItem *, 2> &_columns);
20
21 void Clear(void);
22
23 virtual void mouseMoveEvent(QMouseEvent * _event) override;
24
25 virtual void leaveEvent(QEvent * _event) override;
26
27 void getSelectedItems(QTableWidgetItem *&first, QTableWidgetItem *&second);
28
29Q_SIGNALS:
31
32private Q_SLOTS:
33 void slotSelectionChanged();
34
35private:
36 std::vector<std::array<QTableWidgetItem *, 2>> my_dataRowItems;
37
38 int my_selectedRow;
39};
40
41class ManageOwner : public ot::Dialog {
42 Q_OBJECT
43
44public:
45 ManageOwner(const std::string &authServerURL, const std::string &assetType, const std::string &assetName, const std::string &ownerName);
46 virtual ~ManageOwner();
47
48public Q_SLOTS:
50 void slotGroupsFilter(void);
51 void slotGroupsSelection(void);
52 virtual void slotGroupCheckBoxChanged(bool state, int row) = 0;
53
54protected:
55 void fillOwnerList(void);
56 std::string tolower(std::string s);
57 bool hasSuccessful(const std::string &response);
58 bool hasError(const std::string &response);
59 void readUserList(void);
60
63
64 std::string m_authServerURL;
65 std::string m_assetType;
66 std::string m_assetName;
67 std::string m_assetOwner;
69
70 std::list<std::string> m_userList;
71
72 ManageOwner() = delete;
75};
76
78 Q_OBJECT
79
80public:
81 ManageGroupOwner(const std::string &authServerURL, const std::string &assetName, const std::string &ownerName) : ManageOwner(authServerURL, "Group", assetName, ownerName) {};
82 virtual ~ManageGroupOwner() {};
83
84 virtual void slotGroupCheckBoxChanged(bool state, int row);
85};
86
88 Q_OBJECT
89
90public:
91 ManageProjectOwner(const std::string &authServerURL, const std::string &assetName, const std::string &ownerName) : ManageOwner(authServerURL, "Project", assetName, ownerName) {};
92 virtual ~ManageProjectOwner() {};
93
94 virtual void slotGroupCheckBoxChanged(bool state, int row);
95};
96
Definition ManageOwner.h:77
virtual void slotGroupCheckBoxChanged(bool state, int row)
Definition ManageOwner.cpp:380
virtual ~ManageGroupOwner()
Definition ManageOwner.h:82
ManageGroupOwner(const std::string &authServerURL, const std::string &assetName, const std::string &ownerName)
Definition ManageOwner.h:81
Definition ManageOwner.h:41
ot::CheckBox * m_ownerCheckBox
Definition ManageOwner.h:68
bool hasSuccessful(const std::string &response)
Definition ManageOwner.cpp:237
void slotShowGroupsWithAccessOnly(void)
Definition ManageOwner.cpp:222
ManageOwnerTable * m_ownersList
Definition ManageOwner.h:62
void fillOwnerList(void)
Definition ManageOwner.cpp:311
ManageOwner & operator=(ManageOwner &)=delete
void slotGroupsSelection(void)
Definition ManageOwner.cpp:232
std::string m_authServerURL
Definition ManageOwner.h:64
std::string m_assetOwner
Definition ManageOwner.h:67
ot::LineEdit * m_filterGroups
Definition ManageOwner.h:61
std::list< std::string > m_userList
Definition ManageOwner.h:70
ManageOwner(ManageOwner &)=delete
ManageOwner()=delete
std::string m_assetType
Definition ManageOwner.h:65
bool hasError(const std::string &response)
Definition ManageOwner.cpp:253
virtual void slotGroupCheckBoxChanged(bool state, int row)=0
std::string m_assetName
Definition ManageOwner.h:66
void slotGroupsFilter(void)
Definition ManageOwner.cpp:227
virtual ~ManageOwner()
Definition ManageOwner.cpp:214
std::string tolower(std::string s)
Definition ManageOwner.cpp:262
void readUserList(void)
Definition ManageOwner.cpp:268
Definition ManageOwner.h:12
void getSelectedItems(QTableWidgetItem *&first, QTableWidgetItem *&second)
Definition ManageOwner.cpp:130
void addRow(const std::array< QTableWidgetItem *, 2 > &_columns)
Definition ManageOwner.cpp:50
void Clear(void)
Definition ManageOwner.cpp:61
ManageOwnerTable()
Definition ManageOwner.cpp:26
void selectionChanged()
virtual void mouseMoveEvent(QMouseEvent *_event) override
Definition ManageOwner.cpp:73
virtual ~ManageOwnerTable()
Definition ManageOwner.cpp:46
virtual void leaveEvent(QEvent *_event) override
Definition ManageOwner.cpp:99
Definition ManageOwner.h:87
ManageProjectOwner(const std::string &authServerURL, const std::string &assetName, const std::string &ownerName)
Definition ManageOwner.h:91
virtual void slotGroupCheckBoxChanged(bool state, int row)
Definition ManageOwner.cpp:429
virtual ~ManageProjectOwner()
Definition ManageOwner.h:92
Definition CheckBox.h:17
Definition Dialog.h:19
Definition LineEdit.h:17
Definition Table.h:22
Definition Connector.h:8