Qt 4.8
qundostack_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QUNDOSTACK_P_H
43 #define QUNDOSTACK_P_H
44 
45 #include <private/qobject_p.h>
46 #include <QtCore/qlist.h>
47 #include <QtCore/qstring.h>
48 #include <QtGui/qaction.h>
49 
50 #include "qundostack.h"
51 
53 class QUndoCommand;
54 class QUndoGroup;
55 
56 //
57 // W A R N I N G
58 // -------------
59 //
60 // This file is not part of the Qt API. It exists for the convenience
61 // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
62 // file may change from version to version without notice, or even be removed.
63 //
64 // We mean it.
65 //
66 
68 {
69 public:
74  int id;
75 };
76 
77 #ifndef QT_NO_UNDOSTACK
78 
80 {
82 public:
83  QUndoStackPrivate() : index(0), clean_index(0), group(0), undo_limit(0) {}
84 
87  int index;
91 
92  void setIndex(int idx, bool clean);
93  bool checkUndoLimit();
94 };
95 
96 #ifndef QT_NO_ACTION
97 class QUndoAction : public QAction
98 {
99  Q_OBJECT
100 public:
101  QUndoAction(const QString &prefix, QObject *parent = 0);
102  void setTextFormat(const QString &textFormat, const QString &defaultText);
103 public Q_SLOTS:
104  void setPrefixedText(const QString &text);
105 private:
108 };
109 #endif // QT_NO_ACTION
110 
111 
113 #endif // QT_NO_UNDOSTACK
114 #endif // QUNDOSTACK_P_H
QList< QUndoCommand * > macro_stack
Definition: qundostack_p.h:86
QList< QUndoCommand * > command_list
Definition: qundostack_p.h:85
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QUndoGroup * group
Definition: qundostack_p.h:89
QList< QUndoCommand * > child_list
Definition: qundostack_p.h:71
#define Q_SLOTS
Definition: qobjectdefs.h:71
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
The QUndoGroup class is a group of QUndoStack objects.
Definition: qundogroup.h:60
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QString m_defaultText
Definition: qundostack_p.h:107
The QUndoStack class is a stack of QUndoCommand objects.
Definition: qundostack.h:91
#define Q_OBJECT
Definition: qobjectdefs.h:157
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
QString m_prefix
Definition: qundostack_p.h:106
static void setIndex(int *index, int candidate, int min, int max, bool isIncreasing)
Definition: qmdiarea.cpp:226
quint16 index
The QUndoCommand class is the base class of all commands stored on a QUndoStack.
Definition: qundostack.h:60
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64
The QList class is a template class that provides lists.
Definition: qdatastream.h:62