2 * SPDX-FileCopyrightText: 2013 Dawit Alemayehu <adawit@kde.org>
3 * SPDX-FileCopyrightText: 2017 Elvis Angelaccio <elvis.angelaccio@kde.org>
5 * SPDX-License-Identifier: GPL-2.0-or-later
8 #ifndef DOLPHINREMOVEACTION_H
9 #define DOLPHINREMOVEACTION_H
11 #include "dolphin_export.h"
13 #include <KActionCollection>
19 * A QAction that manages the delete based on the current state of
20 * the Shift key or the parameter passed to update.
22 * This class expects the presence of both the KStandardAction::MoveToTrash and
23 * KStandardAction::DeleteFile actions in @ref collection.
25 class DOLPHIN_EXPORT DolphinRemoveAction
: public QAction
30 enum class ShiftState
{
36 DolphinRemoveAction(QObject
* parent
, KActionCollection
* collection
);
39 * Updates this action key based on @p shiftState.
40 * Default value is QueryShiftState, meaning it will query QGuiApplication::modifiers().
42 void update(ShiftState shiftState
= ShiftState::Unknown
);
45 void slotRemoveActionTriggered();
48 QPointer
<KActionCollection
> m_collection
;
49 QPointer
<QAction
> m_action
;