| 1 | /* |
| 2 | This file is part of the KDE project |
| 3 | SPDX-FileCopyrightText: 2006 Peter Simonsson <peter.simonsson@gmail.com> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef KUNDOACTIONS_H |
| 9 | #define KUNDOACTIONS_H |
| 10 | |
| 11 | #include <kxmlgui_export.h> |
| 12 | |
| 13 | #include <QString> |
| 14 | |
| 15 | class KActionCollection; |
| 16 | class QAction; |
| 17 | class QUndoStack; |
| 18 | |
| 19 | /*! |
| 20 | * \brief Provides functions that creates undo/redo actions for a QUndoStack with KDE's default icons and shortcuts. |
| 21 | * |
| 22 | * \namespace KUndoActions |
| 23 | * \inmodule KXmlGui |
| 24 | * |
| 25 | * See QUndoStack for more information. |
| 26 | * |
| 27 | * \since 5.0 |
| 28 | */ |
| 29 | namespace KUndoActions |
| 30 | { |
| 31 | /*! |
| 32 | * \brief Creates an redo action with the default shortcut and icon |
| 33 | * and adds it to \a actionCollection. |
| 34 | * |
| 35 | * \a undoStack the QUndoStack the action triggers the redo on |
| 36 | * |
| 37 | * \a actionCollection the KActionCollection that should be the parent of the action |
| 38 | * |
| 39 | * \a actionName the created action's object name, empty string will set it to the KDE default |
| 40 | * |
| 41 | * Returns the created action. |
| 42 | */ |
| 43 | KXMLGUI_EXPORT QAction *createRedoAction(QUndoStack *undoStack, KActionCollection *actionCollection, const QString &actionName = QString()); |
| 44 | |
| 45 | /*! |
| 46 | * \brief Creates an undo action with the default KDE shortcut and icon |
| 47 | * and adds it to \a actionCollection. |
| 48 | * |
| 49 | * Returns the created action. |
| 50 | * |
| 51 | * \a undoStack The QUndoStack the action triggers the undo on. |
| 52 | * |
| 53 | * \a actionCollection The KActionCollection that should be the parent of the action. |
| 54 | * |
| 55 | * \a actionName The created action's object name, empty string |
| 56 | * will set it to the KDE default. |
| 57 | */ |
| 58 | KXMLGUI_EXPORT QAction *createUndoAction(QUndoStack *undoStack, KActionCollection *actionCollection, const QString &actionName = QString()); |
| 59 | } |
| 60 | |
| 61 | #endif |
| 62 | |