MyGUI  3.2.0
MyGUI_TextChangeHistory.h
Go to the documentation of this file.
1 
6 /*
7  This file is part of MyGUI.
8 
9  MyGUI is free software: you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  MyGUI is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_TEXT_CHANGE_HISTORY_H__
23 #define __MYGUI_TEXT_CHANGE_HISTORY_H__
24 
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_Macros.h"
27 #include "MyGUI_UString.h"
28 #include <deque>
29 
30 namespace MyGUI
31 {
32 
33  // инфо об одной операции
35  {
36  // типы операций
38  {
42  };
43 
44  // для удаления и вставки текста
45  TextCommandInfo(const UString& _text, size_t _start, CommandType _type) :
46  text(_text),
47  type(_type),
48  start(_start),
49  undo(ITEM_NONE),
50  redo(ITEM_NONE),
52  {
53  }
54 
55  // для указания позиции
56  TextCommandInfo(size_t _undo, size_t _redo, size_t _length) :
59  undo(_undo),
60  redo(_redo),
61  length(_length)
62  {
63  }
64 
65  // строка харрактиризуещая изменения
67  // тип операции
69  // инфа о начале позиции
70  size_t start;
71  // инфа о псевдо позиции
72  size_t undo, redo, length;
73  };
74 
75  typedef std::vector<TextCommandInfo> VectorChangeInfo;
76  typedef std::deque<VectorChangeInfo> DequeUndoRedoInfo;
77 
78 } // namespace MyGUI
79 
80 #endif // __MYGUI_TEXT_CHANGE_HISTORY_H__