Akonadi

core/notificationsubscriber.cpp
1 /*
2  SPDX-FileCopyrightText: 2016 Daniel Vr├ítil <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "notificationsubscriber.h"
8 #include "collectionfetchscope.h"
9 #include "itemfetchscope.h"
10 #include "tagfetchscope.h"
11 
12 namespace Akonadi
13 {
14 class NotificationSubscriberPrivate : public QSharedData
15 {
16 public:
17  QByteArray subscriber;
18  QByteArray sessionId;
19  QSet<qint64> collections;
20  QSet<qint64> items;
21  QSet<qint64> tags;
24  QSet<QByteArray> resources;
25  QSet<QByteArray> ignoredSessions;
26  ItemFetchScope itemFetchScope;
27  CollectionFetchScope collectionFetchScope;
28  TagFetchScope tagFetchScope;
29  bool isAllMonitored = false;
30  bool isExclusive = false;
31 };
32 
33 } // namespace Akonadi
34 
35 using namespace Akonadi;
36 
37 NotificationSubscriber::NotificationSubscriber()
38  : d(new NotificationSubscriberPrivate)
39 {
40 }
41 
42 NotificationSubscriber::NotificationSubscriber(const NotificationSubscriber &other)
43  : d(other.d)
44 {
45 }
46 
47 NotificationSubscriber::~NotificationSubscriber()
48 {
49 }
50 
51 NotificationSubscriber &NotificationSubscriber::operator=(const NotificationSubscriber &other)
52 {
53  d = other.d;
54  return *this;
55 }
56 
57 bool NotificationSubscriber::isValid() const
58 {
59  return !d->subscriber.isEmpty();
60 }
61 
62 QByteArray NotificationSubscriber::subscriber() const
63 {
64  return d->subscriber;
65 }
66 
67 void NotificationSubscriber::setSubscriber(const QByteArray &subscriber)
68 {
69  d->subscriber = subscriber;
70 }
71 
72 QByteArray NotificationSubscriber::sessionId() const
73 {
74  return d->sessionId;
75 }
76 
77 void NotificationSubscriber::setSessionId(const QByteArray &sessionId)
78 {
79  d->sessionId = sessionId;
80 }
81 
82 QSet<qint64> NotificationSubscriber::monitoredCollections() const
83 {
84  return d->collections;
85 }
86 
87 void NotificationSubscriber::setMonitoredCollections(const QSet<qint64> &collections)
88 {
89  d->collections = collections;
90 }
91 
92 QSet<qint64> NotificationSubscriber::monitoredItems() const
93 {
94  return d->items;
95 }
96 
97 void NotificationSubscriber::setMonitoredItems(const QSet<qint64> &items)
98 {
99  d->items = items;
100 }
101 
102 QSet<qint64> NotificationSubscriber::monitoredTags() const
103 {
104  return d->tags;
105 }
106 
107 void NotificationSubscriber::setMonitoredTags(const QSet<qint64> &tags)
108 {
109  d->tags = tags;
110 }
111 
112 QSet<Monitor::Type> NotificationSubscriber::monitoredTypes() const
113 {
114  return d->types;
115 }
116 
117 void NotificationSubscriber::setMonitoredTypes(const QSet<Monitor::Type> &types)
118 {
119  d->types = types;
120 }
121 
122 QSet<QString> NotificationSubscriber::monitoredMimeTypes() const
123 {
124  return d->mimeTypes;
125 }
126 
127 void NotificationSubscriber::setMonitoredMimeTypes(const QSet<QString> &mimeTypes)
128 {
129  d->mimeTypes = mimeTypes;
130 }
131 
132 QSet<QByteArray> NotificationSubscriber::monitoredResources() const
133 {
134  return d->resources;
135 }
136 
137 void NotificationSubscriber::setMonitoredResources(const QSet<QByteArray> &resources)
138 {
139  d->resources = resources;
140 }
141 
142 QSet<QByteArray> NotificationSubscriber::ignoredSessions() const
143 {
144  return d->ignoredSessions;
145 }
146 
147 void NotificationSubscriber::setIgnoredSessions(const QSet<QByteArray> &ignoredSessions)
148 {
149  d->ignoredSessions = ignoredSessions;
150 }
151 
152 bool NotificationSubscriber::isAllMonitored() const
153 {
154  return d->isAllMonitored;
155 }
156 
157 void NotificationSubscriber::setIsAllMonitored(bool isAllMonitored)
158 {
159  d->isAllMonitored = isAllMonitored;
160 }
161 
162 bool NotificationSubscriber::isExclusive() const
163 {
164  return d->isExclusive;
165 }
166 
167 void NotificationSubscriber::setIsExclusive(bool isExclusive)
168 {
169  d->isExclusive = isExclusive;
170 }
171 
172 ItemFetchScope NotificationSubscriber::itemFetchScope() const
173 {
174  return d->itemFetchScope;
175 }
176 
177 void NotificationSubscriber::setItemFetchScope(const ItemFetchScope &itemFetchScope)
178 {
179  d->itemFetchScope = itemFetchScope;
180 }
181 
182 CollectionFetchScope NotificationSubscriber::collectionFetchScope() const
183 {
184  return d->collectionFetchScope;
185 }
186 
187 void NotificationSubscriber::setCollectionFetchScope(const CollectionFetchScope &fetchScope)
188 {
189  d->collectionFetchScope = fetchScope;
190 }
191 
192 TagFetchScope NotificationSubscriber::tagFetchScope() const
193 {
194  return d->tagFetchScope;
195 }
196 
197 void NotificationSubscriber::setTagFetchScope(const TagFetchScope &tagFetchScope)
198 {
199  d->tagFetchScope = tagFetchScope;
200 }
Specifies which parts of a tag should be fetched from the Akonadi storage.
Definition: tagfetchscope.h:22
QStringList types(Mode mode=Writing)
Specifies which parts of a collection should be fetched from the Akonadi storage.
QStringList mimeTypes(Mode mode=Writing)
Specifies which parts of an item should be fetched from the Akonadi storage.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:00:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.