+ награды за баллы
- создание - изменение - удаление - отображение
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// action.h
|
||||
#ifndef ACTION_H
|
||||
#define ACTION_H
|
||||
|
||||
#include <QString>
|
||||
#include <QVariantMap>
|
||||
|
||||
class Action {
|
||||
public:
|
||||
enum Type { KeyPress, Sound, Notification, File };
|
||||
virtual ~Action() = default;
|
||||
virtual Type type() const = 0;
|
||||
virtual void execute() = 0;
|
||||
virtual QVariantMap toJson() const = 0;
|
||||
virtual void fromJson(const QVariantMap &data) = 0;
|
||||
};
|
||||
|
||||
// Конкретные действия
|
||||
class KeyPressAction : public Action {
|
||||
public:
|
||||
Type type() const override { return KeyPress; }
|
||||
void execute() override;
|
||||
QVariantMap toJson() const override;
|
||||
void fromJson(const QVariantMap &data) override;
|
||||
private:
|
||||
int keyCode;
|
||||
Qt::KeyboardModifiers modifiers;
|
||||
};
|
||||
|
||||
class SoundAction : public Action {
|
||||
// ...
|
||||
};
|
||||
|
||||
// ... и т.д.
|
||||
#endif // ACTION_H
|
||||
Reference in New Issue
Block a user