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