/***************************************************************************
- * Copyright (C) 2013 by Dawit Alemayehu <adawit@kde.org *
+ * Copyright (C) 2013 by Dawit Alemayehu <adawit@kde.org> *
+ * Copyright (C) 2017 by Elvis Angelaccio <elvis.angelaccio@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
#ifndef DOLPHINREMOVEACTION_H
#define DOLPHINREMOVEACTION_H
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
+
+#include <KActionCollection>
#include <QAction>
#include <QPointer>
-#include <KActionCollection>
-
/**
* A QAction that manages the delete based on the current state of
* the Shift key or the parameter passed to update.
*
- * This class expects the presence of both the "move_to_trash" and "delete"
- * actions in @ref collection.
+ * This class expects the presence of both the KStandardAction::MoveToTrash and
+ * KStandardAction::DeleteFile actions in @ref collection.
*/
-class LIBDOLPHINPRIVATE_EXPORT DolphinRemoveAction : public QAction
+class DOLPHIN_EXPORT DolphinRemoveAction : public QAction
{
Q_OBJECT
public:
+
+ enum class ShiftState {
+ Unknown,
+ Pressed,
+ Released
+ };
+
DolphinRemoveAction(QObject* parent, KActionCollection* collection);
+
/**
- * Updates this action key based on the state of the Shift key.
+ * Updates this action key based on @p shiftState.
+ * Default value is QueryShiftState, meaning it will query QGuiApplication::modifiers().
*/
- void update();
+ void update(ShiftState shiftState = ShiftState::Unknown);
private Q_SLOTS:
void slotRemoveActionTriggered();