From 1dbc0e3c88ba271ba35bc3f82e7864c4f35e1236 Mon Sep 17 00:00:00 2001 From: Fabien Proriol Date: Sun, 25 May 2025 12:13:31 +0200 Subject: Initial Commit --- src/lib/xdgnotificationactions.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/lib/xdgnotificationactions.h (limited to 'src/lib/xdgnotificationactions.h') 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 + +namespace xdg { + + class NotificationActions: public QAbstractListModel + { + Q_OBJECT + + QList> 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 roleNames() const override; + + signals: + void actionslistChanged(); + private: + QStringList m_actionslist; + }; + +} + + +#endif // XDGNOTIFICATIONACTIONS_H -- cgit v1.2.3