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/xdgstatusnotifierhost.h |
Initial Commit
Diffstat (limited to 'src/lib/xdgstatusnotifierhost.h')
-rw-r--r-- | src/lib/xdgstatusnotifierhost.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/lib/xdgstatusnotifierhost.h b/src/lib/xdgstatusnotifierhost.h new file mode 100644 index 0000000..20c36ed --- /dev/null +++ b/src/lib/xdgstatusnotifierhost.h @@ -0,0 +1,44 @@ +#ifndef XDGSTATUSNOTIFIERHOST_H +#define XDGSTATUSNOTIFIERHOST_H + +#include <QAbstractListModel> +#include <QObject> +#include <QScopedPointer> + +namespace xdg { + class StatusNotifierHostPrivate; + + class StatusNotifierHost : public QAbstractListModel + { + Q_OBJECT + public: + explicit StatusNotifierHost(QObject *parent = nullptr); + virtual ~StatusNotifierHost(); + + enum XdgDesktopEntriesRoles { + CategoryRole = Qt::UserRole + 1, + IdRole, + TitleRole, + StatusRole, + WindowIdRole, + IconNameRole, + OverlayIconNameRole, + AttentionIconNameRole, + AttentionMovieNameRole + }; + + 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; + + public slots: + void activate(int x, int y, QString id, int mode); + + private: + Q_DISABLE_COPY(StatusNotifierHost) + Q_DECLARE_PRIVATE(StatusNotifierHost) + QScopedPointer<StatusNotifierHostPrivate> const d_ptr; + }; +}; + +#endif // XDGSTATUSNOTIFIERHOST_H |