MyGUI
3.2.1
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
mygui
MyGUIEngine
include
MyGUI_TextChangeHistory.h
Go to the documentation of this file.
1
/*
2
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
3
* Distributed under the MIT License
4
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5
*/
6
7
#ifndef __MYGUI_TEXT_CHANGE_HISTORY_H__
8
#define __MYGUI_TEXT_CHANGE_HISTORY_H__
9
10
#include "
MyGUI_Prerequest.h
"
11
#include "
MyGUI_Macros.h
"
12
#include "
MyGUI_UString.h
"
13
#include <deque>
14
15
namespace
MyGUI
16
{
17
18
// инфо об одной операции
19
struct
TextCommandInfo
20
{
21
// типы операций
22
enum
CommandType
23
{
24
COMMAND_POSITION
,
25
COMMAND_INSERT
,
26
COMMAND_ERASE
27
};
28
29
// для удаления и вставки текста
30
TextCommandInfo
(
const
UString
& _text,
size_t
_start,
CommandType
_type) :
31
text
(_text),
32
type
(_type),
33
start
(_start),
34
undo
(
ITEM_NONE
),
35
redo
(
ITEM_NONE
),
36
length
(
ITEM_NONE
)
37
{
38
}
39
40
// для указания позиции
41
TextCommandInfo
(
size_t
_undo,
size_t
_redo,
size_t
_length) :
42
type
(
COMMAND_POSITION
),
43
start
(
ITEM_NONE
),
44
undo
(_undo),
45
redo
(_redo),
46
length
(_length)
47
{
48
}
49
50
// строка харрактиризуещая изменения
51
UString
text
;
52
// тип операции
53
CommandType
type
;
54
// инфа о начале позиции
55
size_t
start
;
56
// инфа о псевдо позиции
57
size_t
undo
,
redo
,
length
;
58
};
59
60
typedef
std::vector<TextCommandInfo>
VectorChangeInfo
;
61
typedef
std::deque<VectorChangeInfo>
DequeUndoRedoInfo
;
62
63
}
// namespace MyGUI
64
65
#endif // __MYGUI_TEXT_CHANGE_HISTORY_H__
Generated on Wed Aug 20 2014 00:03:33 for MyGUI by
1.8.3.1