GlistEngine
Loading...
Searching...
No Matches
gGUIActionManager.h
Go to the documentation of this file.
1/*
2 * gGUIActionManager.h
3 *
4 * Created on: 22 Aug 2022
5 * Author: sevval
6 */
7
8#ifndef CORE_GGUIACTIONMANAGER_H_
9#define CORE_GGUIACTIONMANAGER_H_
10
11#include <gObject.h>
12class gBaseGUIObject;
13#include <deque>
14
15/*
16 * This class send information to the target classes when an event happend in the
17 * source class. It builded with a struct structure.
18 *
19 * gBaseGUIObject has a static variable that type is gGUIActionManager. When
20 * developers derive a class from gBaseGUIObject, they must use this variable
21 * to call this class'es functions.
22 *
23 * All the child classes makes their own operations in onGUIEvent() function which
24 * overrided from gBaseGUIObject class.
25 *
26 */
28public:
35
38
39 /*
40 * Adds events to a vector. This function creates a new struct object with
41 * given parameters. Then adds the struct object to the vector. When an event
42 * happened, this should be added to this vector.
43 *
44 * @param srcControl is the source resource class. An event must be happened
45 * in this class and it should effect other classes.
46 *
47 * @param srcEvent is the source classe's event number which defined at the
48 * gGUIEvents class.
49 *
50 * @param dstControl is the destination classes. If an event happened in the
51 * source class and if this event information should be known from other class,
52 * this other class is named by destination class.
53 *
54 * @param dstEvent is the destination classe's event number which defined at
55 * the gGUIEvents class.
56 *
57 * @param value is the variable which developers wants to send to one class to
58 * other class. If it is not given from developer, this parameter will be given
59 * as empty string.
60 *
61 */
62 void addAction(gBaseGUIObject* srcControl, int srcEvent, gBaseGUIObject* dstControl, int dstEvent);
63
67 void removeAction(gBaseGUIObject* srcControl, int srcEvent, gBaseGUIObject* dstControl, int dstEvent);
68
69 /*
70 * Uses for send information from one class to another class. This function
71 * compares the actions vector datas with given parameters. If they match,
72 * then the information is sended.
73 */
74 void onGUIEvent(int guiObjectId, int eventType, std::string value1 = "", std::string value2 = "");
75
76private:
77 std::deque<Action> actions;
78 std::deque<Action> happened;
79};
80
81#endif /* CORE_GGUIACTIONMANAGER_H_ */
Definition gBaseGUIObject.h:18
Definition gGUIActionManager.h:27
void onGUIEvent(int guiObjectId, int eventType, std::string value1="", std::string value2="")
void removeAction(gBaseGUIObject *srcControl, int srcEvent, gBaseGUIObject *dstControl, int dstEvent)
void addAction(gBaseGUIObject *srcControl, int srcEvent, gBaseGUIObject *dstControl, int dstEvent)
virtual ~gGUIActionManager()
Definition gObject.h:33
Definition gGUIActionManager.h:29
gBaseGUIObject * sourceControl
Definition gGUIActionManager.h:30
gBaseGUIObject * targetControl
Definition gGUIActionManager.h:32
int targetEvent
Definition gGUIActionManager.h:33
int sourceEvent
Definition gGUIActionManager.h:31