File indexing completed on 2024-04-21 03:59:40

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 2006 Peter Simonsson <peter.simonsson@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef KUNDOACTIONS_H
0009 #define KUNDOACTIONS_H
0010 
0011 #include <kxmlgui_export.h>
0012 
0013 #include <QString>
0014 
0015 class KActionCollection;
0016 class QAction;
0017 class QUndoStack;
0018 
0019 /**
0020  * Provides functions that creates undo/redo actions for a QUndoStack with KDE's default icons and shortcuts.
0021  * See QUndoStack for more information.
0022  *
0023  * @since 5.0
0024  */
0025 namespace KUndoActions
0026 {
0027 /**
0028  * Creates an redo action with the default shortcut and icon and adds it to @p actionCollection
0029  * @param undoStack the QUndoStack the action triggers the redo on
0030  * @param actionCollection the KActionCollection that should be the parent of the action
0031  * @param actionName the created action's object name, empty string will set it to the KDE default
0032  * @return the created action.
0033  */
0034 KXMLGUI_EXPORT QAction *createRedoAction(QUndoStack *undoStack, KActionCollection *actionCollection, const QString &actionName = QString());
0035 
0036 /**
0037  * Creates an undo action with the default KDE shortcut and icon and adds it to @p actionCollection
0038  * @param undoStack the QUndoStack the action triggers the undo on
0039  * @param actionCollection the KActionCollection that should be the parent of the action
0040  * @param actionName the created action's object name, empty string will set it to the KDE default
0041  * @return the created action.
0042  */
0043 KXMLGUI_EXPORT QAction *createUndoAction(QUndoStack *undoStack, KActionCollection *actionCollection, const QString &actionName = QString());
0044 }
0045 
0046 #endif