OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
aSignalLinker.h
Go to the documentation of this file.
1/*
2 * File: aSignalLinker.h
3 * Package: akGui
4 *
5 * Created on: February 21, 2020
6 * Author: Alexander Kuester
7 * Copyright (c) 2022 Alexander Kuester
8 * This file is part of the uiCore component.
9 * This file is subject to the terms and conditions defined in
10 * file 'LICENSE', which is part of this source code package.
11 */
12
13#pragma once
14
15// C++ header
16#include <map>
17
18// Qt header
19#include <qobject.h> // base class
20
21// AK header
23#include <akCore/akCore.h>
24
25// Forward declaration
26class QKeyEvent;
27class QTreeWidgetItem;
28
29namespace ak {
30
31 // Forward declaration
32 class aMessenger;
33 class aUidManager;
34 class aObjectManager;
35 class aAction;
36 class aCheckBoxWidget;
37 class aLineEditWidget;
38 class aNiceLineEditWidget;
39 class aTimer;
40 class aToolButtonWidget;
41
46 class UICORE_API_EXPORT aSignalLinker : public QObject {
47 Q_OBJECT
48 public:
49
54 aMessenger * _messanger,
55 aUidManager * _uidManager
56 );
57
59 virtual ~aSignalLinker();
60
61 // ###################################################################################
62 // Add objects
63
67 UID addLink(
68 aAction * _object,
69 UID _objectUid = invalidUID
70 );
71
75 UID addLink(
76 aCheckBoxWidget * _object,
77 UID _objectUid = invalidUID
78 );
79
83 UID addLink(
84 aLineEditWidget * _object,
85 UID _objectUid = invalidUID
86 );
87
91 UID addLink(
92 aNiceLineEditWidget * _object,
93 UID _objectUid = invalidUID
94 );
95
99 UID addLink(
100 aTimer * _object,
101 UID _objectUid = invalidUID
102 );
103
107 UID addLink(
108 aToolButtonWidget * _object,
109 UID _objectUid = invalidUID
110 );
111
112 private Q_SLOTS:
113
114 // ###################################################################################
115 // ###################################################################################
116 // ###################################################################################
117 // SLOTS
118
119 void slotIndexActivated(int);
120 void slotChanged();
121 void slotCleared();
122 void slotClicked();
123 void slotCursorPositionChanged();
124 void slotCursorPositionChangedIndex(int _oldPos, int _newPos);
125 void slotFocused();
126 void slotFocusLost();
127 void slotIndexChanged(int);
128 void slotKeyPressed(QKeyEvent *);
129 void slotKeyReleased(QKeyEvent *);
130 void slotSelectionChanged();
131 void slotStateChanged(int);
132 void slotToggled(bool);
133 void slotTimeout(void);
134 void slotClosing(void);
135 void slotReturnPressed(void);
136 void slotEditingFinished(void);
137 void slotKeyCombinationPressed(void);
138
139 // ##### Items
140
141 void slotItemChanged(ID);
142 void slotItemDeleted(ID);
143 void slotItemClicked(ID);
144 void slotItemCloseRequested(ID);
145 void slotItemDoubleClicked(ID);
146
147 // ##### Table
148
149 void tableCellActivated(int row, int coloumn);
150 void tableCellChanged(int row, int coloumn);
151 void tableCellClicked(int row, int coloumn);
152 void tableCellDoubleClicked(int row, int coloumn);
153 void tableCellEntered(int row, int coloumn);
154 //void tableCellPressed(int row, int coloumn);
155
156 // ##### Tree
157
158 // ###################################################################################
159 // ###################################################################################
160 // ###################################################################################
161 // Private members
162
163 private:
164
165 UID m_uid;
167 aMessenger * m_messanger;
168
169 struct struct_object {
170 QObject * object;
171 objectType type;
172 };
173
174 std::map<UID, struct_object> m_objects;
175 typedef std::map<UID, struct_object>::iterator m_objectsIterator;
176
182 void raiseEvent(
183 UID _senderUid,
184 eventType _eventType,
185 int _info1,
186 int _info2
187 );
188
191 UID getSenderUid(QObject * _sender);
192
193 }; // class signalLinker
194} // namespace ak
#define UICORE_API_EXPORT
Definition globalDataTypes.h:20
This class combines the functionallity of a QAction and a ak::ui::core::aPaintable.
Definition aAction.h:29
This class combines the functionallity of a QCheckBox and a ak::object.
Definition aCheckBoxWidget.h:30
This class combines the functionallity of a QTextEdit and a ak::ui::core::aWidget.
Definition aLineEditWidget.h:30
Class used to forward messages to receivers This class is used to forward a message to receivers....
Definition aMessenger.h:34
Definition aNiceLineEditWidget.h:29
Used to link [Widget] signals to the messaging system Every added widget will get all its possible/mo...
Definition aSignalLinker.h:46
Definition aTimer.h:23
Definition aToolButtonWidget.h:31
This class is used to manage UIDs. This UID manager is incrementing the UID on each getId call.
Definition aUidMangager.h:25
Definition uiAPI.h:45
const UID invalidUID
Represents the invalid UID for an object.
Definition globalDataTypes.h:71
unsigned long long UID
The UID datatype used for objects.
Definition globalDataTypes.h:65
objectType
Describes the type of an object.
Definition akCore.h:167
eventType
Describes the type of an event.
Definition akCore.h:86
int ID
The ID datatype used for items.
Definition globalDataTypes.h:68
static ak::aUidManager * m_uidManager
The messenger used in this API.
Definition uiAPI.cpp:59