47 lines
754 B
C++
47 lines
754 B
C++
#ifndef ACTOR_H
|
|
#define ACTOR_H
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
class Actor : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
static const uint8_t ACTION_DEFAULT = 0;
|
|
static const uint8_t ACTION_TOGGLE = 1;
|
|
static const uint8_t ACTION_ON = 2;
|
|
static const uint8_t ACTION_OFF = 3;
|
|
static const uint8_t ACTION_TRIGGER_ONLY = 4;
|
|
|
|
QString name;
|
|
|
|
protected:
|
|
uint8_t action_ = 0;
|
|
|
|
void performAction();
|
|
|
|
private:
|
|
bool active = false;
|
|
|
|
signals:
|
|
void on();
|
|
void off();
|
|
void trigger();
|
|
void toggle();
|
|
|
|
public slots:
|
|
|
|
public:
|
|
Actor();
|
|
virtual ~Actor();
|
|
|
|
virtual bool isActive();
|
|
virtual bool makeActive();
|
|
virtual bool makeInactive();
|
|
|
|
void setAction(uint8_t action);
|
|
};
|
|
|
|
#endif // ACTOR_H
|