blob: 63afa395ecb4d892b924fc74a0c35436c2c0e7cc (
plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright : (C) 2014 Eran Ifrah
// file name : cl_unredo.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifndef CLUNREDO_H
#define CLUNREDO_H
#include "unredobase.h"
class LEditor;
class CLTextCommand : public CLCommand
{
public:
CLTextCommand(CLC_types type, const wxString& name="") : CLCommand(type, name)
{}
virtual ~CLTextCommand() {}
virtual bool GetIsAppendable() const { // We can append to a text command
return true;
}
protected:
};
class CLInsertTextCommand : public CLTextCommand
{
public:
CLInsertTextCommand(const wxString& name="insertion:") : CLTextCommand(CLC_insert, name) {}
virtual ~CLInsertTextCommand() {}
protected:
};
class CLDeleteTextCommand : public CLTextCommand
{
public:
CLDeleteTextCommand(const wxString& name="deletion:") : CLTextCommand(CLC_delete, name) {}
virtual ~CLDeleteTextCommand() {}
protected:
};
class CLCommandProcessor : public CommandProcessorBase
{
public:
CLCommandProcessor();
virtual ~CLCommandProcessor() {}
void StartNewTextCommand(CLC_types type, const wxString& text = "");
void AppendToTextCommand(const wxString& text, int position);
virtual void ProcessOpenCommand();
LEditor* GetParent() const {
return m_parent;
}
void SetParent(LEditor* parent) {
m_parent = parent;
}
void Reset() { // Like Clear() but retain m_initialCommand. Used when an editor is reloaded
m_commands.clear();
}
void CloseSciUndoAction() const; // Closes any open undo action at the scintilla level
virtual bool DoUndo();
virtual bool DoRedo();
protected:
LEditor* m_parent;
};
#endif // CLUNREDO_H
|