-
Notifications
You must be signed in to change notification settings - Fork 1
/
UndoBuffer.h
66 lines (55 loc) · 1.19 KB
/
UndoBuffer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// UndoBuffer.h
#ifndef UndoBuffer_h
#define UndoBuffer_h
#include "CharChange.h"
#include "CharSelection.h"
#include <vector>
class CharBuffer;
class UndoChange
{
public:
CharChange change;
CharSelection selection;
};
//class UndoAction
//{
//public:
// enum Type { insertion, deletion };
//
// UndoAction( Type type, size_t pos, size_t count, size_t savedTextPos );
//
// Type type;
// size_t pos;
// size_t count;
// size_t savedTextPos;
//};
//
//class UndoGroup
//{
//public:
// UndoGroup( CharRange selection );
//
// void RecordInsertion( CharBuffer&, size_t pos, size_t length, size_t savedTextPos );
// void RecordDeletion ( CharBuffer&, size_t pos, size_t length, size_t savedTextPos );
//
// UndoChange Undo( CharBuffer&, UTF16Ref savedText ) const;
// CharChange Redo( CharBuffer&, UTF16Ref savedText ) const;
//
//private:
// std::vector<UndoAction> m_actions;
// CharRange m_selection;
//};
class UndoBuffer
{
public:
UndoBuffer( CharBuffer& );
bool CanUndo() const { return false; }
bool CanRedo() const { return false; }
//UndoChange Undo( CharBuffer& );
//CharChange Redo( CharBuffer& );
private:
CharBuffer& m_charBuffer;
//bool m_endCurrentGroup;
//size_t m_index;
};
#endif