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
15class KActionCollection;
16class QAction;
17class QUndoStack;
18
19/**
20 * Provides functions that creates undo/redo actions for a QUndoStack with KDE's default icons and shortcuts.
21 * See QUndoStack for more information.
22 *
23 * @since 5.0
24 */
25namespace KUndoActions
26{
27/**
28 * Creates an redo action with the default shortcut and icon and adds it to @p actionCollection
29 * @param undoStack the QUndoStack the action triggers the redo on
30 * @param actionCollection the KActionCollection that should be the parent of the action
31 * @param actionName the created action's object name, empty string will set it to the KDE default
32 * @return the created action.
33 */
34KXMLGUI_EXPORT QAction *createRedoAction(QUndoStack *undoStack, KActionCollection *actionCollection, const QString &actionName = QString());
35
36/**
37 * Creates an undo action with the default KDE shortcut and icon and adds it to @p actionCollection
38 * @param undoStack the QUndoStack the action triggers the undo on
39 * @param actionCollection the KActionCollection that should be the parent of the action
40 * @param actionName the created action's object name, empty string will set it to the KDE default
41 * @return the created action.
42 */
43KXMLGUI_EXPORT QAction *createUndoAction(QUndoStack *undoStack, KActionCollection *actionCollection, const QString &actionName = QString());
44}
45
46#endif
47

source code of kxmlgui/src/kundoactions.h