1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
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
28 friend class CGeorgesEditDoc
;
31 // Type of modification performed
62 IAction (TTypeAction type
, uint selId
, uint slot
);
65 void setLabel (const char *logLabel
, CGeorgesEditDoc
&doc
);
70 virtual ~IAction () {};
80 // Selection Id of the Undo
89 std::string _LogLabel
;
91 // Do the modification
92 virtual bool doAction (CGeorgesEditDoc
&doc
, bool redo
, bool &modified
, bool firstTime
);
102 void update (bool updateLeftView
, TUpdateRightView rightView
, CGeorgesEditDoc
&doc
, const char *_FormName
);
105 // String modification action
106 class CActionString
: public IAction
111 CActionString (IAction::TTypeAction type
, const char *newValue
, CGeorgesEditDoc
&doc
, const char *formName
, const char *userData
, uint selId
, uint slot
);
116 std::string _Value
[2];
119 std::string _FormName
;
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
134 CActionStringVector (IAction::TTypeAction type
, const std::vector
<std::string
> &stringVector
, CGeorgesEditDoc
&doc
, const char *formName
, uint selId
, uint slot
);
139 std::vector
<std::string
> _Value
[2];
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
154 CActionStringVectorVector (IAction::TTypeAction type
, const std::vector
<std::vector
<std::string
> > &stringVectorVector
, CGeorgesEditDoc
&doc
, uint selId
, uint slot
);
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
171 CActionBuffer (IAction::TTypeAction type
, const uint8
*buffer
, uint bufferSize
, CGeorgesEditDoc
&doc
, const char *formName
, const char *userData
, uint selId
, uint slot
);
176 std::vector
<uint8
> _Value
[2];
179 std::string _FormName
;
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 */