Plasma-workspace

notifications.h
1/*
2 SPDX-FileCopyrightText: 2019 Kai Uwe Broulik <kde@privat.broulik.de>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#pragma once
8
9#include <QQmlParserStatus>
10#include <QSortFilterProxyModel>
11#include <QWindow>
12
13#include <memory>
14
15#include "notificationmanager_export.h"
16
17#include <qqmlregistration.h>
18
19namespace NotificationManager
20{
21/**
22 * @brief A model with notifications and jobs
23 *
24 * This model contains application notifications as well as jobs
25 * and lets you apply fine-grained filter, sorting, and grouping rules.
26 *
27 * @author Kai Uwe Broulik <kde@privat.broulik.de>
28 **/
29class NOTIFICATIONMANAGER_EXPORT Notifications : public QSortFilterProxyModel, public QQmlParserStatus
30{
31 Q_OBJECT
32 QML_ELEMENT
33 Q_INTERFACES(QQmlParserStatus)
34
35 /**
36 * The number of notifications the model should at most contain.
37 *
38 * Default is 0, which is no limit.
39 */
40 Q_PROPERTY(int limit READ limit WRITE setLimit NOTIFY limitChanged)
41
42 /**
43 * Whether to show expired notifications.
44 *
45 * Expired notifications are those that timed out, i.e. ones that were not explicitly
46 * closed or acted upon by the user, nor revoked by the issuing application.
47 *
48 * An expired notification has its actions removed.
49 *
50 * Default is false.
51 */
52 Q_PROPERTY(bool showExpired READ showExpired WRITE setShowExpired NOTIFY showExpiredChanged)
53
54 /**
55 * Whether to show dismissed notifications.
56 *
57 * Dismissed notifications are those that are temporarily hidden by the user.
58 * This can e.g. be a copy job that has its popup closed but still continues in the background.
59 *
60 * Default is false.
61 */
62 Q_PROPERTY(bool showDismissed READ showDismissed WRITE setShowDismissed NOTIFY showDismissedChanged)
63
64 /**
65 * A list of desktop entries for which no notifications should be shown.
66 *
67 * If the same desktop entry is present in both blacklist and whitelist,
68 * the blacklist takes precedence, i.e. the notification is not shown.
69 */
70 Q_PROPERTY(QStringList blacklistedDesktopEntries READ blacklistedDesktopEntries WRITE setBlacklistedDesktopEntries NOTIFY blacklistedDesktopEntriesChanged)
71
72 /**
73 * A list of notifyrc names for which no notifications should be shown.
74 *
75 * If the same notifyrc name is present in both blacklist and whitelist,
76 * the blacklist takes precedence, i.e. the notification is not shown.
77 */
78 Q_PROPERTY(QStringList blacklistedNotifyRcNames READ blacklistedNotifyRcNames WRITE setBlacklistedNotifyRcNames NOTIFY blacklistedNotifyRcNamesChanged)
79
80 /**
81 * A list of desktop entries for which notifications should be shown.
82 *
83 * This bypasses any filtering for urgency.
84 *
85 * If the same desktop entry is present in both whitelist and blacklist,
86 * the blacklist takes precedence, i.e. the notification is not shown.
87 *
88 * Default is empty list, which means normal filtering is applied.
89 */
90 Q_PROPERTY(QStringList whitelistedDesktopEntries READ whitelistedDesktopEntries WRITE setWhitelistedDesktopEntries NOTIFY whitelistedDesktopEntriesChanged)
91
92 /**
93 * A list of notifyrc names for which notifications should be shown.
94 *
95 * This bypasses any filtering for urgency.
96 *
97 * If the same notifyrc name is present in both whitelist and blacklist,
98 * the blacklist takes precedence, i.e. the notification is not shown.
99 *
100 * Default is empty list, which means normal filtering is applied.
101 */
102 Q_PROPERTY(QStringList whitelistedNotifyRcNames READ whitelistedNotifyRcNames WRITE setWhitelistedNotifyRcNames NOTIFY whitelistedNotifyRcNamesChanged)
103
104 /**
105 * Whether to show notifications.
106 *
107 * Default is true.
108 */
109 Q_PROPERTY(bool showNotifications READ showNotifications WRITE setShowNotifications NOTIFY showNotificationsChanged)
110
111 /**
112 * Whether to show application jobs.
113 *
114 * Default is false.
115 */
116 Q_PROPERTY(bool showJobs READ showJobs WRITE setShowJobs NOTIFY showJobsChanged)
117
118 /**
119 * The notification urgency types the model should contain.
120 *
121 * Default is all urgencies: low, normal, critical.
122 */
123 Q_PROPERTY(Urgencies urgencies READ urgencies WRITE setUrgencies NOTIFY urgenciesChanged)
124
125 /**
126 * The sort mode for notifications.
127 *
128 * Default is strictly by date created/updated.
129 */
130 Q_PROPERTY(SortMode sortMode READ sortMode WRITE setSortMode NOTIFY sortModeChanged)
131
132 /**
133 * The sort order for notifications.
134 *
135 * This only affects the sort order by date. When @c sortMode is set to SortByTypeAndUrgency
136 * the order of notification groups (e.g. high - jobs - normal - low) is unaffected, and only
137 * notifications within the same group are either sorted ascending or descending by their
138 * creation/update date.
139 *
140 * Default is DescendingOrder, i.e. newest notifications come first.
141 *
142 * @since 5.19
143 */
144 Q_PROPERTY(Qt::SortOrder sortOrder READ sortOrder WRITE setSortOrder NOTIFY sortOrderChanged)
145
146 /**
147 * The group mode for notifications.
148 *
149 * Default is ungrouped.
150 */
151 Q_PROPERTY(GroupMode groupMode READ groupMode WRITE setGroupMode NOTIFY groupModeChanged)
152
153 /**
154 * How many notifications are shown in each group.
155 *
156 * You can expand a group by setting the IsGroupExpandedRole to true.
157 *
158 * Default is 0, which means no limit.
159 */
160 Q_PROPERTY(int groupLimit READ groupLimit WRITE setGroupLimit NOTIFY groupLimitChanged)
161
162 /**
163 * Whether to automatically show notifications that are unread.
164 *
165 * This is any notification that was created or updated after the value of @c lastRead.
166 */
167 Q_PROPERTY(bool expandUnread READ expandUnread WRITE setExpandUnread NOTIFY expandUnreadChanged)
168
169 /**
170 * The number of notifications in the model
171 */
172 Q_PROPERTY(int count READ count NOTIFY countChanged)
173
174 /**
175 * The number of active, i.e. non-expired notifications
176 */
177 Q_PROPERTY(int activeNotificationsCount READ activeNotificationsCount NOTIFY activeNotificationsCountChanged)
178
179 /**
180 * The number of inactive, i.e. non-expired notifications
181 */
182 Q_PROPERTY(int expiredNotificationsCount READ expiredNotificationsCount NOTIFY expiredNotificationsCountChanged)
183
184 /**
185 * The time when the user last could read the notifications.
186 * This is typically reset whenever the list of notifications is opened and is used to determine
187 * the @c unreadNotificationsCount
188 */
189 Q_PROPERTY(QDateTime lastRead READ lastRead WRITE setLastRead RESET resetLastRead NOTIFY lastReadChanged)
190
191 /**
192 * The number of notifications added since lastRead
193 *
194 * This can be used to show a "n unread notifications" label
195 */
196 Q_PROPERTY(int unreadNotificationsCount READ unreadNotificationsCount NOTIFY unreadNotificationsCountChanged)
197
198 /**
199 * The number of active jobs
200 */
201 Q_PROPERTY(int activeJobsCount READ activeJobsCount NOTIFY activeJobsCountChanged)
202 /**
203 * The combined percentage of all jobs.
204 *
205 * This is the average of all percentages and could can be used to show
206 * a global progress bar.
207 */
208 Q_PROPERTY(int jobsPercentage READ jobsPercentage NOTIFY jobsPercentageChanged)
209
210 /**
211 * The window that will render the notifications
212 *
213 * This is used to tell the xdg_activation_v1 protocol who is requesting the activation.
214 */
215 Q_PROPERTY(QWindow *window READ window WRITE setWindow NOTIFY windowChanged)
216public:
217 explicit Notifications(QObject *parent = nullptr);
218 ~Notifications() override;
219
220 enum Roles {
221 IdRole = Qt::UserRole + 1, ///< A notification identifier. This can be uint notification ID or string application job source.
222 SummaryRole = Qt::DisplayRole, ///< The notification summary.
223 ImageRole = Qt::DecorationRole, ///< The notification main image, which is not the application icon. Only valid for pixmap icons.
224
225 IsGroupRole = Qt::UserRole + 2, ///< Whether the item is a group
226 GroupChildrenCountRole, ///< The number of children in a group.
227 ExpandedGroupChildrenCountRole, ///< The number of children in a group that are expanded.
228 IsGroupExpandedRole, ///< Whether the group is expanded, this role is writable.
229
230 IsInGroupRole, ///< Whether the notification is currently inside a group.
231 TypeRole, ///< The type of model entry, either NotificationType or JobType.
232 CreatedRole, ///< When the notification was first created.
233 UpdatedRole, ///< When the notification was last updated, invalid when it hasn't been updated.
234
235 BodyRole, ///< The notification body text.
236 IconNameRole, ///< The notification main icon name, which is not the application icon. Only valid for icon names, if a URL supplied, it is loaded and
237 ///< exposed as ImageRole instead.
238
239 DesktopEntryRole, ///< The desktop entry (without .desktop suffix, e.g. org.kde.spectacle) of the application that sent the notification.
240 NotifyRcNameRole, ///< The notifyrc name (e.g. spectaclerc) of the application that sent the notification.
241
242 ApplicationNameRole, ///< The user-visible name of the application (e.g. Spectacle)
243 ApplicationIconNameRole, ///< The icon name of the application
244 OriginNameRole, ///< The name of the device or account the notification originally came from, e.g. "My Phone" (in case of device sync) or
245 ///< "foo@example.com" (in case of an email notification)
246
247 // Jobs
248 JobStateRole, ///< The state of the job, either JobStateJopped, JobStateSuspended, or JobStateRunning.
249 PercentageRole, ///< The percentage of the job. Use @c jobsPercentage to get a global percentage for all jobs.
250 JobErrorRole, ///< The error id of the job, zero in case of no error.
251 SuspendableRole, ///< Whether the job can be suspended @sa suspendJob
252 KillableRole, ///< Whether the job can be killed/canceled @sa killJob
253 JobDetailsRole, ///< A pointer to a Job item itself containing more detailed information about the job
254
255 ActionNamesRole, ///< The IDs of the actions, excluding the default and settings action, e.g. [action1, action2]
256 ActionLabelsRole, ///< The user-visible labels of the actions, excluding the default and settings action, e.g. ["Accept", "Reject"]
257 HasDefaultActionRole, ///< Whether the notification has a default action, which is one that is invoked when the popup itself is clicked
258 DefaultActionLabelRole, ///< The user-visible label of the default action, typically not shown as the popup itself becomes clickable
259
260 UrlsRole, ///< A list of URLs associated with the notification, e.g. a path to a screenshot that was just taken or image received
261
262 UrgencyRole, ///< The notification urgency, either LowUrgency, NormalUrgency, or CriticalUrgency. Jobs do not have an urgency.
263 TimeoutRole, ///< The timeout for the notification in milliseconds. 0 means the notification should not timeout, -1 means a sensible default should be
264 ///< applied.
265
266 ConfigurableRole, ///< Whether the notification can be configured because a desktopEntry or notifyRcName is known, or the notification has a setting
267 ///< action. @sa configure
268 ConfigureActionLabelRole, ///< The user-visible label for the settings action
269 ClosableRole, ///< Whether the item can be closed. Notifications are always closable, jobs are only when in JobStateStopped.
270
271 ExpiredRole, ///< The notification timed out and closed. Actions on it cannot be invoked anymore.
272 DismissedRole, ///< The notification got temporarily hidden by the user but could still be interacted with.
273 ReadRole, ///< Whether the notification got read by the user. If true, the notification isn't considered unread even if created after lastRead.
274 ///< @since 5.17
275
276 UserActionFeedbackRole, ///< Whether this notification is a response/confirmation to an explicit user action. @since 5.18
277
278 HasReplyActionRole, ///< Whether the notification has a reply action. @since 5.18
279 ReplyActionLabelRole, ///< The user-visible label for the reply action. @since 5.18
280 ReplyPlaceholderTextRole, ///< A custom placeholder text for the reply action, e.g. "Reply to Max...". @since 5.18
281 ReplySubmitButtonTextRole, ///< A custom text for the reply submit button, e.g. "Submit Comment". @since 5.18
282 ReplySubmitButtonIconNameRole, ///< A custom icon name for the reply submit button. @since 5.18
283 CategoryRole, ///< The (optional) category of the notification. Notifications can optionally have a type indicator. Although neither client or nor
284 ///< server must support this, some may choose to. Those servers implementing categories may use them to intelligently display the
285 ///< notification in a certain way, or group notifications of similar types. @since 5.21
286 ResidentRole, ///< Whether the notification should keep its actions even when they were invoked. @since 5.22
287 TransientRole, ///< Whether the notification is transient and should not be kept in history. @since 5.22
288 };
289 Q_ENUM(Roles)
290
291 /**
292 * The type of model item.
293 */
294 enum Type {
295 NoType,
296 NotificationType, ///< This item represents a notification.
297 JobType, ///< This item represents an application job.
298 };
299 Q_ENUM(Type)
300
301 /**
302 * The notification urgency.
303 *
304 * @note jobs do not have an urgency, yet still might be above normal urgency notifications.
305 */
306 enum Urgency {
307 // these don't match the spec's value
308 LowUrgency = 1 << 0, ///< The notification has low urgency, it is not important and may not be shown or added to a history.
309 NormalUrgency = 1 << 1, ///< The notification has normal urgency. This is also the default if no urgecny is supplied.
310 CriticalUrgency = 1 << 2,
311 };
312 Q_ENUM(Urgency)
313 Q_DECLARE_FLAGS(Urgencies, Urgency)
314 Q_FLAG(Urgencies)
315
316 /**
317 * Which items should be cleared in a call to @c clear
318 */
320 ClearExpired = 1 << 1,
321 // TODO more
322 };
323 Q_ENUM(ClearFlag)
324 Q_DECLARE_FLAGS(ClearFlags, ClearFlag)
325 Q_FLAG(ClearFlags)
326
327 /**
328 * The state an application job is in.
329 */
330 enum JobState {
331 JobStateStopped, ///< The job is stopped. It has either finished (error is 0) or failed (error is not 0)
332 JobStateRunning, ///< The job is currently running.
333 JobStateSuspended, ///< The job is currentl paused
334 };
335 Q_ENUM(JobState)
336
337 /**
338 * The sort mode for the model.
339 */
340 enum SortMode {
341 SortByDate = 0, ///< Sort notifications strictly by the date they were updated or created.
342 // should this be flags? SortJobsFirst | SortByUrgency | ...?
343 SortByTypeAndUrgency, ///< Sort notifications taking into account their type and urgency. The order is (descending): Critical, jobs, Normal, Low.
344 };
345 Q_ENUM(SortMode)
346
347 /**
348 * The group mode for the model.
349 */
351 GroupDisabled = 0,
352 // GroupApplicationsTree, // TODO make actual tree
353 GroupApplicationsFlat,
354 };
355 Q_ENUM(GroupMode)
356
357 enum InvokeBehavior {
358 None = 0,
359 Close = 1,
360 };
361 Q_ENUM(InvokeBehavior)
362 Q_DECLARE_FLAGS(InvokeBehaviors, InvokeBehavior)
363 Q_FLAG(InvokeBehaviors)
364
365 int limit() const;
366 void setLimit(int limit);
367
368 bool showExpired() const;
369 void setShowExpired(bool show);
370
371 bool showDismissed() const;
372 void setShowDismissed(bool show);
373
374 QStringList blacklistedDesktopEntries() const;
375 void setBlacklistedDesktopEntries(const QStringList &blacklist);
376
377 QStringList blacklistedNotifyRcNames() const;
378 void setBlacklistedNotifyRcNames(const QStringList &blacklist);
379
380 QStringList whitelistedDesktopEntries() const;
381 void setWhitelistedDesktopEntries(const QStringList &whitelist);
382
383 QStringList whitelistedNotifyRcNames() const;
384 void setWhitelistedNotifyRcNames(const QStringList &whitelist);
385
386 bool showNotifications() const;
387 void setShowNotifications(bool showNotifications);
388
389 bool showJobs() const;
390 void setShowJobs(bool showJobs);
391
392 Urgencies urgencies() const;
393 void setUrgencies(Urgencies urgencies);
394
395 SortMode sortMode() const;
396 void setSortMode(SortMode sortMode);
397
398 Qt::SortOrder sortOrder() const;
399 void setSortOrder(Qt::SortOrder sortOrder);
400
401 GroupMode groupMode() const;
402 void setGroupMode(GroupMode groupMode);
403
404 int groupLimit() const;
405 void setGroupLimit(int limit);
406
407 bool expandUnread() const;
408 void setExpandUnread(bool expand);
409
410 QWindow *window() const;
411 void setWindow(QWindow *window);
412
413 int count() const;
414
415 int activeNotificationsCount() const;
416 int expiredNotificationsCount() const;
417
418 QDateTime lastRead() const;
419 void setLastRead(const QDateTime &lastRead);
420 void resetLastRead();
421
422 int unreadNotificationsCount() const;
423
424 int activeJobsCount() const;
425 int jobsPercentage() const;
426
427 /**
428 * Convert the given QModelIndex into a QPersistentModelIndex
429 */
430 Q_INVOKABLE QPersistentModelIndex makePersistentModelIndex(const QModelIndex &idx) const;
431
432 /**
433 * @brief Expire a notification
434 *
435 * Closes the notification in response to its timeout running out.
436 *
437 * Call this if you have an implementation that handles the timeout itself
438 * by having called @c stopTimeout
439 *
440 * @sa stopTimeout
441 */
442 Q_INVOKABLE void expire(const QModelIndex &idx);
443 /**
444 * @brief Close a notification
445 *
446 * Closes the notification in response to the user explicitly closing it.
447 *
448 * When the model index belongs to a group, the entire group is closed.
449 */
450 Q_INVOKABLE void close(const QModelIndex &idx);
451 /**
452 * @brief Configure a notification
453 *
454 * This will invoke the settings action, if available, otherwise open the
455 * kcm_notifications KCM for configuring the respective application and event.
456 */
457 Q_INVOKABLE void configure(const QModelIndex &idx); // TODO pass ctx for transient handling
458 /**
459 * @brief Invoke the default notification action
460 *
461 * Invokes the action that should be triggered when clicking
462 * the notification bubble itself.
463 */
464 Q_INVOKABLE void invokeDefaultAction(const QModelIndex &idx, InvokeBehavior behavior = None);
465 /**
466 * @brief Invoke a notification action
467 *
468 * Invokes the action with the given actionId on the notification.
469 * For invoking the default action, i.e. the one that is triggered
470 * when clicking the notification bubble, use invokeDefaultAction
471 */
472 Q_INVOKABLE void invokeAction(const QModelIndex &idx, const QString &actionId, InvokeBehavior = None);
473
474 /**
475 * @brief Reply to a notification
476 *
477 * Replies to the given notification with the given text.
478 * @since 5.18
479 */
480 Q_INVOKABLE void reply(const QModelIndex &idx, const QString &text, InvokeBehavior behavior);
481
482 /**
483 * @brief Start automatic timeout of notifications
484 *
485 * Call this if you no longer handle the timeout yourself.
486 *
487 * @sa stopTimeout
488 */
489 Q_INVOKABLE void startTimeout(const QModelIndex &idx);
490
491 Q_INVOKABLE void startTimeout(uint notificationId);
492 /**
493 * @brief Stop the automatic timeout of notifications
494 *
495 * Call this if you have an implementation that handles the timeout itself
496 * taking into account e.g. whether the user is currently interacting with
497 * the notification to not close it under their mouse. Call @c expire
498 * once your custom timer has run out.
499 *
500 * @sa expire
501 */
502 Q_INVOKABLE void stopTimeout(const QModelIndex &idx);
503
504 /**
505 * @brief Suspend a job
506 */
507 Q_INVOKABLE void suspendJob(const QModelIndex &idx);
508 /**
509 * @brief Resume a job
510 */
511 Q_INVOKABLE void resumeJob(const QModelIndex &idx);
512 /**
513 * @brief Kill a job
514 */
515 Q_INVOKABLE void killJob(const QModelIndex &idx);
516
517 /**
518 * @brief Clear notifications
519 *
520 * Removes the notifications matching th ClearFlags from the model.
521 * This can be used for e.g. a "Clear History" action.
522 */
523 Q_INVOKABLE void clear(ClearFlags flags);
524
525 /**
526 * Returns a model index pointing to the group of a notification.
527 */
528 Q_INVOKABLE QModelIndex groupIndex(const QModelIndex &idx) const;
529
530 Q_INVOKABLE void collapseAllGroups();
531
532 QVariant data(const QModelIndex &index, int role) const override;
533 bool setData(const QModelIndex &index, const QVariant &value, int role) override;
534 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
535 QHash<int, QByteArray> roleNames() const override;
536
537 bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
538 bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
539
540Q_SIGNALS:
541 void limitChanged();
542 void showExpiredChanged();
543 void showDismissedChanged();
544 void blacklistedDesktopEntriesChanged();
545 void blacklistedNotifyRcNamesChanged();
546 void whitelistedDesktopEntriesChanged();
547 void whitelistedNotifyRcNamesChanged();
548 void showNotificationsChanged();
549 void showJobsChanged();
550 void urgenciesChanged();
551 void sortModeChanged();
552 void sortOrderChanged();
553 void groupModeChanged();
554 void groupLimitChanged();
555 void expandUnreadChanged();
556 void countChanged();
557 void activeNotificationsCountChanged();
558 void expiredNotificationsCountChanged();
559 void lastReadChanged();
560 void unreadNotificationsCountChanged();
561 void activeJobsCountChanged();
562 void jobsPercentageChanged();
563 void windowChanged(QWindow *window);
564
565protected:
566 void classBegin() override;
567 void componentComplete() override;
568
569private:
570 class Private;
571 std::unique_ptr<Private> d;
572};
573
574} // namespace NotificationManager
575
576Q_DECLARE_OPERATORS_FOR_FLAGS(NotificationManager::Notifications::Urgencies)
A model with notifications and jobs.
SortMode
The sort mode for the model.
@ SortByTypeAndUrgency
Sort notifications taking into account their type and urgency. The order is (descending): Critical,...
@ JobType
This item represents an application job.
@ NotificationType
This item represents a notification.
Urgency
The notification urgency.
JobState
The state an application job is in.
@ JobStateStopped
The job is stopped. It has either finished (error is 0) or failed (error is not 0)
@ JobStateRunning
The job is currently running.
@ JobStateSuspended
The job is currentl paused.
GroupMode
The group mode for the model.
ClearFlag
Which items should be cleared in a call to clear.
@ ApplicationNameRole
The user-visible name of the application (e.g. Spectacle)
@ HasReplyActionRole
Whether the notification has a reply action.
@ UpdatedRole
When the notification was last updated, invalid when it hasn't been updated.
@ NotifyRcNameRole
The notifyrc name (e.g. spectaclerc) of the application that sent the notification.
@ BodyRole
The notification body text.
@ JobDetailsRole
A pointer to a Job item itself containing more detailed information about the job.
@ ResidentRole
Whether the notification should keep its actions even when they were invoked.
@ SuspendableRole
Whether the job can be suspended.
@ DismissedRole
The notification got temporarily hidden by the user but could still be interacted with.
@ DefaultActionLabelRole
The user-visible label of the default action, typically not shown as the popup itself becomes clickab...
@ ActionLabelsRole
The user-visible labels of the actions, excluding the default and settings action,...
@ ReplySubmitButtonTextRole
A custom text for the reply submit button, e.g. "Submit Comment".
@ IsGroupExpandedRole
Whether the group is expanded, this role is writable.
@ IsInGroupRole
Whether the notification is currently inside a group.
@ HasDefaultActionRole
Whether the notification has a default action, which is one that is invoked when the popup itself is ...
@ JobStateRole
The state of the job, either JobStateJopped, JobStateSuspended, or JobStateRunning.
@ DesktopEntryRole
The desktop entry (without .desktop suffix, e.g. org.kde.spectacle) of the application that sent the ...
@ ApplicationIconNameRole
The icon name of the application.
@ ConfigureActionLabelRole
The user-visible label for the settings action.
@ KillableRole
Whether the job can be killed/canceled.
@ ReplySubmitButtonIconNameRole
A custom icon name for the reply submit button.
@ ActionNamesRole
The IDs of the actions, excluding the default and settings action, e.g. [action1, action2].
@ ExpiredRole
The notification timed out and closed. Actions on it cannot be invoked anymore.
@ JobErrorRole
The error id of the job, zero in case of no error.
@ CreatedRole
When the notification was first created.
@ UserActionFeedbackRole
Whether this notification is a response/confirmation to an explicit user action.
@ ReplyPlaceholderTextRole
A custom placeholder text for the reply action, e.g. "Reply to Max...".
@ ClosableRole
Whether the item can be closed. Notifications are always closable, jobs are only when in JobStateStop...
@ UrgencyRole
The notification urgency, either LowUrgency, NormalUrgency, or CriticalUrgency. Jobs do not have an u...
@ ReplyActionLabelRole
The user-visible label for the reply action.
@ UrlsRole
A list of URLs associated with the notification, e.g. a path to a screenshot that was just taken or i...
@ ExpandedGroupChildrenCountRole
The number of children in a group that are expanded.
@ TypeRole
The type of model entry, either NotificationType or JobType.
@ GroupChildrenCountRole
The number of children in a group.
@ PercentageRole
The percentage of the job. Use jobsPercentage to get a global percentage for all jobs.
@ TransientRole
Whether the notification is transient and should not be kept in history.
UserRole
SortOrder
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.