Krita Source Code Documentation
Loading...
Searching...
No Matches
kundo2group.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation (qt-info@nokia.com)
6**
7** This file is part of the QtGui module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** No Commercial Usage
11** This file contains pre-release code and may not be distributed.
12** You may use this file in accordance with the terms and conditions
13** contained in the Technology Preview License Agreement accompanying
14** this package.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** If you have questions regarding the use of this file, please contact
29** Nokia at qt-info@nokia.com.
30**
31**
32**
33**
34**
35**
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef KUNDO2GROUP_H
43#define KUNDO2GROUP_H
44
45#include <QObject>
46#include <QString>
47
48#include "kritacommand_export.h"
49
50class KUndo2GroupPrivate;
51class KUndo2QStack;
52class QAction;
53
54#ifndef QT_NO_UNDOGROUP
55
56class KRITACOMMAND_EXPORT KUndo2Group : public QObject
57{
58 Q_OBJECT
59 Q_DECLARE_PRIVATE(KUndo2Group)
60
61public:
62 explicit KUndo2Group(QObject *parent = 0);
63 ~KUndo2Group() override;
64
65 void addStack(KUndo2QStack *stack);
66 void removeStack(KUndo2QStack *stack);
67 QList<KUndo2QStack*> stacks() const;
68 KUndo2QStack *activeStack() const;
69
70#ifndef QT_NO_ACTION
71 QAction *createUndoAction(QObject *parent) const;
72 QAction *createRedoAction(QObject *parent) const;
73#endif // QT_NO_ACTION
74 bool canUndo() const;
75 bool canRedo() const;
76 QString undoText() const;
77 QString redoText() const;
78 bool isClean() const;
79
80public Q_SLOTS:
81 void undo();
82 void redo();
83 void setActiveStack(KUndo2QStack *stack);
84
85Q_SIGNALS:
87 void indexChanged(int idx);
88 void cleanChanged(bool clean);
89 void canUndoChanged(bool canUndo);
90 void canRedoChanged(bool canRedo);
91 void undoTextChanged(const QString &undoActionText);
92 void redoTextChanged(const QString &redoActionText);
93
94private:
95 // from QUndoGroupPrivate
98
99 Q_DISABLE_COPY(KUndo2Group)
100};
101
102#endif // QT_NO_UNDOGROUP
103
104#endif // KUNDO2GROUP_H
The KUndo2Group class is a group of KUndo2QStack objects.
Definition kundo2group.h:57
void undoTextChanged(const QString &undoActionText)
void activeStackChanged(KUndo2QStack *stack)
void redoTextChanged(const QString &redoActionText)
void canUndoChanged(bool canUndo)
KUndo2QStack * m_active
Definition kundo2group.h:96
void canRedoChanged(bool canRedo)
void indexChanged(int idx)
QList< KUndo2QStack * > m_stack_list
Definition kundo2group.h:97
void cleanChanged(bool clean)
The KUndo2QStack class is a stack of KUndo2Command objects.