NotificationManager::Server

Search for usage in LXR

#include <server.h>

Inheritance diagram for NotificationManager::Server:

Public Types

enum class  CloseReason { Expired = 1 , DismissedByUser = 2 , Revoked = 3 }
 
- Public Types inherited from QObject
typedef  QObjectList
 

Properties

NotificationManager::ServerInfocurrentOwner
 
bool inhibited
 
QML_SINGLETONbool valid
 
- Properties inherited from QObject
 objectName
 

Signals

void inhibitedByApplicationChanged (bool inhibited)
 
void inhibitedChanged (bool inhibited)
 
void inhibitionApplicationsChanged ()
 
void notificationAdded (const Notification &notification)
 
void notificationRemoved (uint id, CloseReason reason)
 
void notificationReplaced (uint replacedId, const Notification &notification)
 
void serviceOwnershipLost ()
 
void validChanged ()
 

Public Member Functions

uint add (const Notification &notification)
 
void clearInhibitions ()
 
void closeNotification (uint id, CloseReason reason)
 
ServerInfocurrentOwner () const
 
bool inhibited () const
 
bool inhibitedByApplication () const
 
QStringList inhibitionApplications () const
 
QStringList inhibitionReasons () const
 
bool init ()
 
void invokeAction (uint id, const QString &actionName, const QString &xdgActivationToken, Notifications::InvokeBehavior behavior)
 
void invokeAction (uint id, const QString &actionName, const QString &xdgActivationToken, Notifications::InvokeBehavior behavior, QWindow *window)
 
bool isValid () const
 
void reply (const QString &dbusService, uint id, const QString &text, Notifications::InvokeBehavior behavior)
 
void setInhibited (bool inhibited)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static Servercreate (QQmlEngine *, QJSEngine *)
 
static Serverself ()
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

A notification DBus server.

Author
Kai Uwe Broulik kde@p.nosp@m.riva.nosp@m.t.bro.nosp@m.ulik.nosp@m..de

Definition at line 29 of file server.h.

Member Enumeration Documentation

◆ CloseReason

The reason a notification was closed.

Enumerator
Expired 

The notification timed out.

DismissedByUser 

The user explicitly closed or acknowledged the notification.

Revoked 

The notification was revoked by the issuing app because it is no longer relevant.

Definition at line 69 of file server.h.

Property Documentation

◆ currentOwner

NotificationManager::ServerInfo * NotificationManager::Server::currentOwner
read

Information about the current owner of the Notification service.

This can be used to tell the user which application is currently owning the service in case service registration failed.

This is never null, even if there is no notification service running.

Since
5.18

Definition at line 51 of file server.h.

◆ inhibited

bool NotificationManager::Server::inhibited
readwrite

Whether notifications are currently inhibited.

This is what is announced to other applications on the bus.

Note
This does not keep track of inhibitions on its own, you need to calculate this yourself and update the property accordingly.

Definition at line 61 of file server.h.

◆ valid

QML_SINGLETONbool NotificationManager::Server::valid
read

Whether the notification service could be registered.

Call init() to register.

Definition at line 39 of file server.h.

Member Function Documentation

◆ add()

uint Server::add ( const Notification & notification)

Adds a notification.

Note
The notification isn't actually broadcast but just emitted locally.
Returns
the ID of the notification

Definition at line 115 of file server.cpp.

◆ clearInhibitions()

void Server::clearInhibitions ( )

Remove all inhibitions.

Note
The applications are not explicitly informed about this.

Definition at line 157 of file server.cpp.

◆ closeNotification()

void Server::closeNotification ( uint id,
CloseReason reason )

Sends a notification closed event.

Parameters
idThe notification ID
reasonThe reason why it was closed

Definition at line 67 of file server.cpp.

◆ create()

Server * Server::create ( QQmlEngine * ,
QJSEngine *  )
static

Definition at line 46 of file server.cpp.

◆ currentOwner()

ServerInfo * Server::currentOwner ( ) const

Information about the current owner of the Notification service.

Since
5.18

Definition at line 62 of file server.cpp.

◆ inhibited()

bool Server::inhibited ( ) const

Whether notifications are currently inhibited.

Since
5.17

Definition at line 120 of file server.cpp.

◆ inhibitedByApplication()

bool Server::inhibitedByApplication ( ) const

Whether an application requested to inhibit notifications.

Definition at line 130 of file server.cpp.

◆ inhibitedByApplicationChanged

void NotificationManager::Server::inhibitedByApplicationChanged ( bool inhibited)
signal

Emitted when inhibitions by application have been changed.

Becomes true as soon as there is one inhibition and becomes false again when all inhibitions have been lifted.

Since
5.17

◆ inhibitedChanged

void NotificationManager::Server::inhibitedChanged ( bool inhibited)
signal

Emitted when the inhibited state changed.

◆ inhibitionApplications()

QStringList Server::inhibitionApplications ( ) const

Definition at line 135 of file server.cpp.

◆ inhibitionApplicationsChanged

void NotificationManager::Server::inhibitionApplicationsChanged ( )
signal

Emitted when the list of applications holding a notification inhibition changes.

Normally you would only want to listen do inhibitedChanged

◆ inhibitionReasons()

QStringList Server::inhibitionReasons ( ) const

Definition at line 146 of file server.cpp.

◆ init()

bool Server::init ( )

Registers the Notification Service on DBus.

Returns
true if it succeeded, false otherwise.

Definition at line 52 of file server.cpp.

◆ invokeAction() [1/2]

void NotificationManager::Server::invokeAction ( uint id,
const QString & actionName,
const QString & xdgActivationToken,
Notifications::InvokeBehavior behavior )
inline

Convenience call to maintain ABI.

Deprecated

Definition at line 151 of file server.h.

◆ invokeAction() [2/2]

void Server::invokeAction ( uint id,
const QString & actionName,
const QString & xdgActivationToken,
Notifications::InvokeBehavior behavior,
QWindow * window )

Sends an action invocation request.

Parameters
idThe notification ID
actionNameThe name of the action, e.g. "Action 1", or "default"
xdgActivationTokenThe token the application needs to send to raise itself.
windowthe window that invokes the action

Definition at line 73 of file server.cpp.

◆ isValid()

bool Server::isValid ( ) const

Whether the notification service could be registered.

Definition at line 57 of file server.cpp.

◆ notificationAdded

void NotificationManager::Server::notificationAdded ( const Notification & notification)
signal

Emitted when a notification was added.

This is emitted regardless of any filtering rules or user settings.

Parameters
notificationThe notification

◆ notificationRemoved

void NotificationManager::Server::notificationRemoved ( uint id,
CloseReason reason )
signal

Emitted when a notification got removed (closed)

Parameters
idThe notification ID
reasonThe reason why it was closed

◆ notificationReplaced

void NotificationManager::Server::notificationReplaced ( uint replacedId,
const Notification & notification )
signal

Emitted when a notification is supposed to be updated This is emitted regardless of any filtering rules or user settings.

Parameters
replacedIdThe ID of the notification it replaces
notificationThe new notification to use instead

◆ reply()

void Server::reply ( const QString & dbusService,
uint id,
const QString & text,
Notifications::InvokeBehavior behavior )

Sends a notification reply text.

Parameters
dbusServiceThe bus name of the receiving application
idThe notification ID
textThe reply message text
Since
5.18

Definition at line 110 of file server.cpp.

◆ self()

Server & Server::self ( )
static

Definition at line 40 of file server.cpp.

◆ serviceOwnershipLost

void NotificationManager::Server::serviceOwnershipLost ( )
signal

Emitted when the ownership of the Notification DBus Service is lost.

◆ setInhibited()

void Server::setInhibited ( bool inhibited)

Whether notifications are currently effectively inhibited.

Note
You need to keep track of inhibitions and call this yourself when appropriate.
Since
5.17

Definition at line 125 of file server.cpp.

◆ validChanged

void NotificationManager::Server::validChanged ( )
signal

Emitted when the notification service validity changes, because it successfully registered the service or lost ownership of it.

Since
5.18

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.