File indexing completed on 2024-05-12 15:56:14
0001 /**************************************************************************** 0002 ** 0003 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 0004 ** All rights reserved. 0005 ** Contact: Nokia Corporation (qt-info@nokia.com) 0006 ** 0007 ** This file is part of the QtGui module of the Qt Toolkit. 0008 ** 0009 ** $QT_BEGIN_LICENSE:LGPL$ 0010 ** No Commercial Usage 0011 ** This file contains pre-release code and may not be distributed. 0012 ** You may use this file in accordance with the terms and conditions 0013 ** contained in the Technology Preview License Agreement accompanying 0014 ** this package. 0015 ** 0016 ** GNU Lesser General Public License Usage 0017 ** Alternatively, this file may be used under the terms of the GNU Lesser 0018 ** General Public License version 2.1 as published by the Free Software 0019 ** Foundation and appearing in the file LICENSE.LGPL included in the 0020 ** packaging of this file. Please review the following information to 0021 ** ensure the GNU Lesser General Public License version 2.1 requirements 0022 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 0023 ** 0024 ** In addition, as a special exception, Nokia gives you certain additional 0025 ** rights. These rights are described in the Nokia Qt LGPL Exception 0026 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 0027 ** 0028 ** If you have questions regarding the use of this file, please contact 0029 ** Nokia at qt-info@nokia.com. 0030 ** 0031 ** 0032 ** 0033 ** 0034 ** 0035 ** 0036 ** 0037 ** 0038 ** $QT_END_LICENSE$ 0039 ** 0040 ****************************************************************************/ 0041 0042 #ifndef KUNDO2STACK_P_H 0043 #define KUNDO2STACK_P_H 0044 0045 #include <QList> 0046 #include <QString> 0047 #include <QAction> 0048 0049 #include "kundo2stack.h" 0050 0051 class KUndo2Command; 0052 0053 // 0054 // W A R N I N G 0055 // ------------- 0056 // 0057 // This file is not part of the Qt API. It exists for the convenience 0058 // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header 0059 // file may change from version to version without notice, or even be removed. 0060 // 0061 // We mean it. 0062 // 0063 0064 class KUndo2CommandPrivate 0065 { 0066 public: 0067 KUndo2CommandPrivate() : id(-1) {} 0068 QList<KUndo2Command*> child_list; 0069 QString actionText; 0070 KUndo2MagicString text; 0071 int id; 0072 0073 QScopedPointer<KUndo2CommandExtraData> extraData; 0074 }; 0075 0076 #ifndef QT_NO_UNDOSTACK 0077 0078 #ifndef QT_NO_ACTION 0079 class KUndo2Action : public QAction 0080 { 0081 Q_OBJECT 0082 public: 0083 KUndo2Action(const QString &textTemplate, const QString &defaultText, QObject *parent = 0); 0084 public Q_SLOTS: 0085 void setPrefixedText(const QString &text); 0086 private: 0087 QString m_textTemplate; 0088 QString m_defaultText; 0089 }; 0090 #endif // QT_NO_ACTION 0091 0092 #endif // QT_NO_UNDOSTACK 0093 #endif // KUNDO2STACK_P_H