NotificationManager::Server
#include <server.h>
Public Types | |
enum class | CloseReason { Expired = 1 , DismissedByUser = 2 , Revoked = 3 } |
Public Types inherited from QObject | |
typedef | QObjectList |
Properties | |
NotificationManager::ServerInfo * | currentOwner |
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 ¬ification) |
void | notificationRemoved (uint id, CloseReason reason) |
void | notificationReplaced (uint replacedId, const Notification ¬ification) |
void | serviceOwnershipLost () |
void | validChanged () |
Public Member Functions | |
uint | add (const Notification ¬ification) |
void | clearInhibitions () |
void | closeNotification (uint id, CloseReason reason) |
ServerInfo * | currentOwner () 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< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () 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< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | 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 QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () 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 | |
T | qobject_cast (const QObject *object) |
T | 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) |
QThread * | thread () const const |
Static Public Member Functions | |
static Server * | create (QQmlEngine *, QJSEngine *) |
static Server & | self () |
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 |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
Member Enumeration Documentation
◆ CloseReason
|
strong |
Property Documentation
◆ 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
◆ inhibited
|
readwrite |
◆ valid
|
read |
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
-
id The notification ID reason The reason why it was closed
Definition at line 67 of file server.cpp.
◆ create()
|
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 |
◆ inhibitedByApplication()
bool Server::inhibitedByApplication | ( | ) | const |
Whether an application requested to inhibit notifications.
Definition at line 130 of file server.cpp.
◆ inhibitedByApplicationChanged
|
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
|
signal |
Emitted when the inhibited state changed.
◆ inhibitionApplications()
QStringList Server::inhibitionApplications | ( | ) | const |
Definition at line 135 of file server.cpp.
◆ 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]
◆ 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
-
id The notification ID actionName The name of the action, e.g. "Action 1", or "default" xdgActivationToken The token the application needs to send to raise itself. window the 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
|
signal |
Emitted when a notification was added.
This is emitted regardless of any filtering rules or user settings.
- Parameters
-
notification The notification
◆ notificationRemoved
|
signal |
Emitted when a notification got removed (closed)
- Parameters
-
id The notification ID reason The reason why it was closed
◆ notificationReplaced
|
signal |
Emitted when a notification is supposed to be updated This is emitted regardless of any filtering rules or user settings.
- Parameters
-
replacedId The ID of the notification it replaces notification The 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
-
dbusService The bus name of the receiving application id The notification ID text The reply message text
- Since
- 5.18
Definition at line 110 of file server.cpp.
◆ self()
|
static |
Definition at line 40 of file server.cpp.
◆ 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
|
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:
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.