Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorServiceNotifications::NotificationModel Class Reference

List model over a NotificationServer's live notifications. More...

#include <PhosphorServiceNotifications/NotificationModel.h>

Inheritance diagram for PhosphorServiceNotifications::NotificationModel:
[legend]

Public Types

enum  Roles {
  NotificationRole = Qt::UserRole + 1 , IdRole , AppNameRole , AppIconRole ,
  SummaryRole , BodyRole , ActionsRole , UrgencyRole ,
  CategoryRole , DesktopEntryRole , ImageRole , HasImageRole ,
  ResidentRole , TransientRole , SuppressSoundRole , ValueRole ,
  ExpireTimeoutRole , TimestampRole
}

Signals

void serverChanged ()
void countChanged ()

Public Member Functions

 NotificationModel (QObject *parent=nullptr)
 ~NotificationModel () override
NotificationServer * server () const
void setServer (NotificationServer *server)
int rowCount (const QModelIndex &parent={}) const override
QVariant data (const QModelIndex &index, int role) const override
QHash< int, QByteArray > roleNames () const override

Detailed Description

List model over a NotificationServer's live notifications.

Bind server, then drive a ListView / Repeater off the rows. Rows are kept in ascending-id order (the same order the server vends): a new notification is inserted at its id-sorted position, a replaces_id update mutates the row in place and forwards as dataChanged, and a close removes the row. The model does NOT own the notifications; the server does.

Member Enumeration Documentation

◆ Roles

Enumerator
NotificationRole 
IdRole 
AppNameRole 
AppIconRole 
SummaryRole 
BodyRole 
ActionsRole 
UrgencyRole 
CategoryRole 
DesktopEntryRole 
ImageRole 
HasImageRole 
ResidentRole 
TransientRole 
SuppressSoundRole 
ValueRole 
ExpireTimeoutRole 
TimestampRole 

Constructor & Destructor Documentation

◆ NotificationModel()

PhosphorServiceNotifications::NotificationModel::NotificationModel ( QObject * parent = nullptr)
explicit

◆ ~NotificationModel()

PhosphorServiceNotifications::NotificationModel::~NotificationModel ( )
override

Member Function Documentation

◆ countChanged

void PhosphorServiceNotifications::NotificationModel::countChanged ( )
signal

◆ data()

QVariant PhosphorServiceNotifications::NotificationModel::data ( const QModelIndex & index,
int role ) const
nodiscardoverride

◆ roleNames()

QHash< int, QByteArray > PhosphorServiceNotifications::NotificationModel::roleNames ( ) const
nodiscardoverride

◆ rowCount()

int PhosphorServiceNotifications::NotificationModel::rowCount ( const QModelIndex & parent = {}) const
nodiscardoverride

◆ server()

NotificationServer * PhosphorServiceNotifications::NotificationModel::server ( ) const
nodiscard

◆ serverChanged

void PhosphorServiceNotifications::NotificationModel::serverChanged ( )
signal

◆ setServer()

void PhosphorServiceNotifications::NotificationModel::setServer ( NotificationServer * server)

The documentation for this class was generated from the following file: