MyGUI 3.5.3
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#include <vector>
15
16namespace MyGUI
17{
18
19 // information about single text change operation
21 {
23 {
27 };
28
29 // for COMMAND_INSERT and COMMAND_ERASE
30 TextCommandInfo(UString _text, size_t _start, CommandType _type) :
31 text(std::move(_text)),
32 type(_type),
33 start(_start),
37 {
38 }
39
40 // for COMMAND_POSITION
41 TextCommandInfo(size_t _undo, size_t _redo, size_t _length) :
44 undo(_undo),
45 redo(_redo),
46 length(_length)
47 {
48 }
49
50 // inserted/erased string
51 UString text;
53 // text start position
54 size_t start;
55 // pseudo position
56 size_t undo, redo, length;
57 };
58
59 using VectorChangeInfo = std::vector<TextCommandInfo>;
60 using DequeUndoRedoInfo = std::deque<VectorChangeInfo>;
61
62} // namespace MyGUI
63
64#endif // MYGUI_TEXT_CHANGE_HISTORY_H_
std::vector< TextCommandInfo > VectorChangeInfo
constexpr size_t ITEM_NONE
std::deque< VectorChangeInfo > DequeUndoRedoInfo
TextCommandInfo(UString _text, size_t _start, CommandType _type)
TextCommandInfo(size_t _undo, size_t _redo, size_t _length)