Linux multi-monitor fullscreen support
[ryzomcore.git] / ryzom / tools / leveldesign / georges_dll / action.h
blobcade0a34d4b0522b1f558849ff72a74af707ba65
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef GEORGES_EDIT_ACTION_H
21 #define GEORGES_EDIT_ACTION_H
23 #include "nel/misc/types_nl.h"
25 // Document modification action
26 class IAction
28 friend class CGeorgesEditDoc;
29 public:
31 // Type of modification performed
32 enum TTypeAction
34 HeaderVersion,
35 HeaderState,
36 HeaderComments,
37 TypeType,
38 TypeUI,
39 TypeDefault,
40 TypeMin,
41 TypeMax,
42 TypeIncrement,
43 TypePredef,
44 DfnParents,
45 DfnStructure,
46 FormParents,
47 FormArraySize,
48 FormArrayRename,
49 /*FormArrayReplace,
50 FormArrayAppend,*/
51 FormArrayInsert,
52 FormArrayDelete,
53 FormVirtualDfnName,
54 FormValue,
55 FormTypeValue,
56 FormPaste,
59 protected:
61 // Constructor
62 IAction (TTypeAction type, uint selId, uint slot);
64 // Init log label
65 void setLabel (const char *logLabel, CGeorgesEditDoc &doc);
67 public:
69 // Virtual destructor
70 virtual ~IAction () {};
72 protected:
74 // Action type
75 TTypeAction _Type;
77 // Original value ?
78 bool _Original;
80 // Selection Id of the Undo
81 uint _SelId;
83 // Action slot
84 uint _Slot;
86 // Old and new value
87 bool _LogPresent[2];
88 std::string _Log[2];
89 std::string _LogLabel;
91 // Do the modification
92 virtual bool doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool firstTime);
94 // Update the views
95 enum TUpdateRightView
97 DoNothing,
98 UpdateLabels,
99 UpdateValues,
100 Redraw
102 void update (bool updateLeftView, TUpdateRightView rightView, CGeorgesEditDoc &doc, const char *_FormName);
105 // String modification action
106 class CActionString : public IAction
108 public:
110 // Constructor
111 CActionString (IAction::TTypeAction type, const char *newValue, CGeorgesEditDoc &doc, const char *formName, const char *userData, uint selId, uint slot);
113 protected:
115 // Old and new value
116 std::string _Value[2];
118 // The form name
119 std::string _FormName;
121 // The form name
122 std::string _UserData;
124 // Do the modification
125 virtual bool doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool firstTime);
128 // Vector string modification action
129 class CActionStringVector : public IAction
131 public:
133 // Constructor
134 CActionStringVector (IAction::TTypeAction type, const std::vector<std::string> &stringVector, CGeorgesEditDoc &doc, const char *formName, uint selId, uint slot);
136 protected:
138 // Old and new value
139 std::vector<std::string> _Value[2];
141 // The form name
142 std::string _FormName;
144 // Do the modification
145 virtual bool doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool firstTime);
148 // Vector vector string modification action
149 class CActionStringVectorVector : public IAction
151 public:
153 // Constructor
154 CActionStringVectorVector (IAction::TTypeAction type, const std::vector<std::vector<std::string> > &stringVectorVector, CGeorgesEditDoc &doc, uint selId, uint slot);
156 protected:
158 // Old and new value
159 std::vector<std::vector<std::string> > _Value[2];
161 // Do the modification
162 virtual bool doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool firstTime);
165 // Vector vector string modification action
166 class CActionBuffer : public IAction
168 public:
170 // Constructor
171 CActionBuffer (IAction::TTypeAction type, const uint8 *buffer, uint bufferSize, CGeorgesEditDoc &doc, const char *formName, const char *userData, uint selId, uint slot);
173 protected:
175 // Old and new value
176 std::vector<uint8> _Value[2];
178 // The form name
179 std::string _FormName;
181 // User data
182 std::string _UserData;
184 // Do the modification
185 virtual bool doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool firstTime);
188 #endif /* GEORGES_EDIT_ACTION_H */