33 lines
738 B
C++
33 lines
738 B
C++
#ifndef ACTIONMANAGER_H
|
|
#define ACTIONMANAGER_H
|
|
|
|
#include <QObject>
|
|
#include "udatabase.h"
|
|
|
|
class ActionManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit ActionManager(uDataBase *db, QObject *parent = nullptr);
|
|
|
|
bool addAction(const ActionData &action);
|
|
bool updateAction(int id, const ActionData &action);
|
|
bool deleteAction(int id);
|
|
QList<ActionData> getAllActions() const;
|
|
bool loadFromDatabase();
|
|
ActionData getAction(int id) const;
|
|
|
|
|
|
signals:
|
|
void actionAdded(const ActionData &action);
|
|
void actionUpdated(int id, const ActionData &action);
|
|
void actionRemoved(int id);
|
|
void dataChanged();
|
|
|
|
private:
|
|
uDataBase *m_db;
|
|
QList<ActionData> m_actions;
|
|
};
|
|
|
|
#endif // ACTIONMANAGER_H
|