OpenCPN Partial API docs
Loading...
Searching...
No Matches
undo.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2012 Jesper Weissglas *
3 * Copyright (C) 2012 by David S. Register *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
25#ifndef UNDO_H
26#define UNDO_H
27
28#include <wx/string.h>
29
30#include <vector>
31#include <deque>
32
33#include "undo_defs.h"
34#include "chcanv.h"
35
36class Undo {
37public:
38 Undo(ChartCanvas* parent);
39 ~Undo();
40 bool AnythingToUndo();
41 bool AnythingToRedo();
42 void InvalidateRedo();
43 void InvalidateUndo();
44 void Invalidate();
45 bool InUndoableAction() { return isInsideUndoableAction; }
46 UndoAction* GetNextUndoableAction();
47 UndoAction* GetNextRedoableAction();
48 bool UndoLastAction();
49 bool RedoNextAction();
50 bool BeforeUndoableAction(UndoType type, UndoItemPointer before,
51 UndoBeforePointerType beforeType,
52 UndoItemPointer selectable);
53 bool AfterUndoableAction(UndoItemPointer after);
54 bool CancelUndoableAction(bool noDataDelete = false);
55 ChartCanvas* GetParent() { return m_parent; }
56
57private:
58 ChartCanvas* m_parent;
59 bool isInsideUndoableAction;
60 UndoAction* candidate;
61 unsigned int stackpointer;
62 unsigned int depthSetting;
63 std::deque<UndoAction*> undoStack;
64};
65
66#endif
Generic Chart canvas base.
ChartCanvas - Main chart display and interaction component.
Definition chcanv.h:173
Definition undo.h:36
Undo features argument definitions.