Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_undo_adapter.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2003 Patrick Julien <freak@codepimps.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_UNDO_ADAPTER_H_
8#define KIS_UNDO_ADAPTER_H_
9
10#include <QObject>
11
12#include <kritaimage_export.h>
13#include <kis_undo_store.h>
14
15
16class KRITAIMAGE_EXPORT KisUndoAdapter : public QObject
17{
18 Q_OBJECT
19
20public:
21 KisUndoAdapter(KisUndoStore *undoStore, QObject *parent = 0);
22 ~KisUndoAdapter() override;
23
24public:
25 void emitSelectionChanged();
26
27 virtual const KUndo2Command* presentCommand() = 0;
28 virtual void undoLastCommand() = 0;
29 virtual void addCommand(KUndo2Command *cmd) = 0;
30 virtual void beginMacro(const KUndo2MagicString& macroName) = 0;
31 virtual void endMacro() = 0;
32
33 inline void setUndoStore(KisUndoStore *undoStore) {
34 m_undoStore = undoStore;
35 }
36
37Q_SIGNALS:
39
40protected:
42 return m_undoStore;
43 }
44
45private:
46 Q_DISABLE_COPY(KisUndoAdapter)
47 KisUndoStore *m_undoStore;
48};
49
50
51#endif // KIS_UNDO_ADAPTER_H_
52
virtual void undoLastCommand()=0
void setUndoStore(KisUndoStore *undoStore)
virtual const KUndo2Command * presentCommand()=0
virtual void beginMacro(const KUndo2MagicString &macroName)=0
virtual void endMacro()=0
void selectionChanged()
KisUndoStore * undoStore()
virtual void addCommand(KUndo2Command *cmd)=0