Akonadi

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

KDE's Doxygen guidelines are available online.