Game Develop Core: EventsEditorSelection.h Source File

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
EventsEditorSelection.h
Go to the documentation of this file.
1
6 #if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
7
8 #ifndef EVENTSEDITORSELECTION_H
9 #define EVENTSEDITORSELECTION_H
10 #include <set>
11 #include <boost/weak_ptr.hpp>
12 #include <boost/shared_ptr.hpp>
13 #include <boost/unordered_set.hpp>
14 #include "GDCore/IDE/EventsEditorItemsAreas.h"
15 namespace gd { class BaseEvent; }
16 namespace gd { class EventsEditorRefreshCallbacks; }
17
18 namespace gd {
19
25 class GD_CORE_API EventsEditorSelection
26 {
27 public:
28 EventsEditorSelection(gd::EventsEditorRefreshCallbacks & eventsEditorCallback_);
29 virtual ~EventsEditorSelection() {};
30
34 void ClearSelection(bool refresh = true);
35
39 void AddEvent(const gd::EventItem & event);
40
44 void AddInstruction(const gd::InstructionItem & event);
45
49 bool EventSelected(const gd::EventItem & event);
50
54 bool InstructionSelected(const gd::InstructionItem & event);
55
59 void SetHighlighted(const gd::EventItem & event);
60
64 void SetHighlighted(const gd::InstructionItem & item);
65
69 void SetHighlighted(const InstructionListItem & item);
70
74 void SetHighlighted(const ParameterItem & parameter);
75
79 void InstructionHighlightedOnBottomPart(bool isOnbottomHandSide);
80
84 void EventHighlightedOnBottomPart(bool isOnbottomHandSide);
85
89 bool EventHighlighted(const gd::EventItem & event) { return eventHighlighted == event; };
90
94 bool IsEventHighlightedOnBottomPart(){ return isOnbottomHandSideOfEvent; };
95
99 bool InstructionHighlighted(const gd::InstructionItem & instr) { return instructionHighlighted == instr; };
100
104 bool IsInstructionHighlightedOnBottomPart() { return isOnbottomHandSideOfInstruction; };
105
109 bool InstructionListHighlighted(const InstructionListItem & list) { return instructionListHighlighted == list; };
110
114 bool ParameterHighLighted(const ParameterItem & parameter) { return parameterHighlighted == parameter; };
115
119 gd::EventItem & GetHighlightedEvent() { return eventHighlighted; };
120
124 InstructionListItem & GetHighlightedInstructionList() { return instructionListHighlighted; };
125
129 bool HasSelectedEvents() { return !eventsSelected.empty(); };
130
134 bool HasSelectedInstructions() { return !instructionsSelected.empty(); };
135
139 bool HasSelectedActions();
140
144 bool HasSelectedConditions();
145
149 std::vector < EventItem > GetAllSelectedEvents();
150
154 std::vector < EventItem > GetAllSelectedEventsWithoutSubEvents();
155
159 std::vector < gd::InstructionItem > GetAllSelectedInstructions();
160
164 void DeleteAllInstructionSelected();
165
166 void BeginDragEvent();
167 bool IsDraggingEvent();
168 bool EndDragEvent(bool deleteDraggedEvent = true, bool dropAfterHighlightedElement = false);
169
170 void BeginDragInstruction();
171 bool IsDraggingInstruction();
172 std::vector<gd::Instruction> * EndDragInstruction(bool deleteDraggedInstruction = true, bool dropAfterHighlightedElement = false);
173
174 private:
175
176 boost::unordered_set< EventItem > eventsSelected;
177 boost::unordered_set< gd::InstructionItem > instructionsSelected;
178
179 EventItem eventHighlighted;
180 bool isOnbottomHandSideOfEvent;
181 gd::InstructionItem instructionHighlighted;
182 bool isOnbottomHandSideOfInstruction;
183 InstructionListItem instructionListHighlighted;
184 ParameterItem parameterHighlighted;
185
186 bool dragging;
187 bool draggingInstruction;
188
192 bool FindInEventsAndSubEvents(std::vector<boost::shared_ptr<gd::BaseEvent> > & list, boost::shared_ptr<gd::BaseEvent> eventToSearch);
196 bool FindInInstructionsAndSubInstructions(std::vector<gd::Instruction> & list, const gd::Instruction * instrToSearch);
197
198 gd::EventsEditorRefreshCallbacks & eventsEditorCallback;
199 };
200
206 class GD_CORE_API EventsEditorRefreshCallbacks
207 {
208 public:
209 EventsEditorRefreshCallbacks() {};
210 virtual ~EventsEditorRefreshCallbacks() {};
211
212 virtual void Refresh() = 0;
213 };
214
215 }
216
217 #endif // EVENTSEDITORSELECTION_H
218 #endif