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
29 enum class ShiftState
{ Unknown
, Pressed
, Released
};
31 DolphinRemoveAction(QObject
*parent
, KActionCollection
*collection
);
34 * Updates this action key based on @p shiftState.
35 * Default value is QueryShiftState, meaning it will query QGuiApplication::modifiers().
37 void update(ShiftState shiftState
= ShiftState::Unknown
);
40 void slotRemoveActionTriggered();
43 QPointer
<KActionCollection
> m_collection
;
44 QPointer
<QAction
> m_action
;