1 | /* This file is part of the KDE project |
2 | Copyright (C) 2006 Peter Simonsson <peter.simonsson@gmail.com> |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. |
8 | |
9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 | Boston, MA 02110-1301, USA. |
18 | */ |
19 | |
20 | #ifndef KUNDOSTACK_H |
21 | #define KUNDOSTACK_H |
22 | |
23 | #include <kdeui_export.h> |
24 | |
25 | #include <QtGui/QUndoStack> |
26 | |
27 | class KActionCollection; |
28 | |
29 | /** |
30 | * Extends QUndoStack with functions that creates actions with KDE's default icons and shortcuts. |
31 | * See QUndoStack for more information. |
32 | */ |
33 | class KDEUI_EXPORT KUndoStack : public QUndoStack |
34 | { |
35 | Q_OBJECT |
36 | public: |
37 | /** |
38 | * Constructs a KUndoStack with @p parent as parent |
39 | * @param parent parent of the object |
40 | */ |
41 | KUndoStack(QObject* parent = 0); |
42 | |
43 | /** |
44 | * Creates an redo action with the default shortcut and icon and adds it to @p actionCollection |
45 | * @param actionCollection the KActionCollection that should be the parent of the action |
46 | * @param actionName the created action's object name, empty string will set it to the KDE default |
47 | * @return the created action. |
48 | */ |
49 | QAction* createRedoAction(KActionCollection* actionCollection, const QString& actionName = QString()); |
50 | /** |
51 | * Creates an undo action with the default KDE shortcut and icon and adds it to @p actionCollection |
52 | * @param actionCollection the KActionCollection that should be the parent of the action |
53 | * @param actionName the created action's object name, empty string will set it to the KDE default |
54 | * @return the created action. |
55 | */ |
56 | QAction* createUndoAction(KActionCollection* actionCollection, const QString& actionName = QString()); |
57 | }; |
58 | |
59 | #endif |
60 | |