diff options
author | Fabien Proriol <fabien.proriol@kazoe.org> | 2025-05-25 12:13:31 +0200 |
---|---|---|
committer | Fabien Proriol <fabien.proriol@kazoe.org> | 2025-05-25 12:13:31 +0200 |
commit | 1dbc0e3c88ba271ba35bc3f82e7864c4f35e1236 (patch) | |
tree | 8c491cd196e2eff4c59f8c23f566f7ff26981586 /src/lib/xdgnotificationactions.h |
Initial Commit
Diffstat (limited to 'src/lib/xdgnotificationactions.h')
-rw-r--r-- | src/lib/xdgnotificationactions.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/lib/xdgnotificationactions.h b/src/lib/xdgnotificationactions.h new file mode 100644 index 0000000..1d1e449 --- /dev/null +++ b/src/lib/xdgnotificationactions.h @@ -0,0 +1,40 @@ +#ifndef XDGNOTIFICATIONACTIONS_H +#define XDGNOTIFICATIONACTIONS_H + +#include <QAbstractListModel> + +namespace xdg { + + class NotificationActions: public QAbstractListModel + { + Q_OBJECT + + QList<QPair<QString, QString>> m_actions; + + Q_PROPERTY(QStringList actionslist READ actionslist WRITE setActionslist NOTIFY actionslistChanged) + + public: + NotificationActions(QObject *parent = nullptr); + + enum NotificationActionsRoles { + KeyRole = Qt::UserRole + 1, + TextRole, + }; + + QStringList actionslist() const; + void setActionslist(const QStringList &newActionslist); + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QHash<int, QByteArray> roleNames() const override; + + signals: + void actionslistChanged(); + private: + QStringList m_actionslist; + }; + +} + + +#endif // XDGNOTIFICATIONACTIONS_H |