• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • akonadi
itemfetchscope.cpp
1/*
2 Copyright (c) 2008 Kevin Krammer <kevin.krammer@gmx.at>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#include "itemfetchscope.h"
21
22#include "itemfetchscope_p.h"
23
24#include <QtCore/QStringList>
25
26using namespace Akonadi;
27
28ItemFetchScope::ItemFetchScope()
29{
30 d = new ItemFetchScopePrivate();
31}
32
33ItemFetchScope::ItemFetchScope(const ItemFetchScope &other)
34 : d(other.d)
35{
36}
37
38ItemFetchScope::~ItemFetchScope()
39{
40}
41
42ItemFetchScope &ItemFetchScope::operator=(const ItemFetchScope &other)
43{
44 if (&other != this) {
45 d = other.d;
46 }
47
48 return *this;
49}
50
51QSet< QByteArray > ItemFetchScope::payloadParts() const
52{
53 return d->mPayloadParts;
54}
55
56void ItemFetchScope::fetchPayloadPart(const QByteArray &part, bool fetch)
57{
58 if (fetch) {
59 d->mPayloadParts.insert(part);
60 } else {
61 d->mPayloadParts.remove(part);
62 }
63}
64
65bool ItemFetchScope::fullPayload() const
66{
67 return d->mFullPayload;
68}
69
70void ItemFetchScope::fetchFullPayload(bool fetch)
71{
72 d->mFullPayload = fetch;
73}
74
75QSet< QByteArray > ItemFetchScope::attributes() const
76{
77 return d->mAttributes;
78}
79
80void ItemFetchScope::fetchAttribute(const QByteArray &type, bool fetch)
81{
82 if (fetch) {
83 d->mAttributes.insert(type);
84 } else {
85 d->mAttributes.remove(type);
86 }
87}
88
89bool ItemFetchScope::allAttributes() const
90{
91 return d->mAllAttributes;
92}
93
94void ItemFetchScope::fetchAllAttributes(bool fetch)
95{
96 d->mAllAttributes = fetch;
97}
98
99bool ItemFetchScope::isEmpty() const
100{
101 return d->mPayloadParts.isEmpty() && d->mAttributes.isEmpty() && !d->mFullPayload && !d->mAllAttributes && !d->mFetchTags && !d->mFetchVRefs;
102}
103
104bool ItemFetchScope::cacheOnly() const
105{
106 return d->mCacheOnly;
107}
108
109void ItemFetchScope::setCacheOnly(bool cacheOnly)
110{
111 d->mCacheOnly = cacheOnly;
112}
113
114void ItemFetchScope::setCheckForCachedPayloadPartsOnly(bool check)
115{
116 if (check) {
117 setCacheOnly(true);
118 }
119 d->mCheckCachedPayloadPartsOnly = check;
120}
121
122bool ItemFetchScope::checkForCachedPayloadPartsOnly() const
123{
124 return d->mCheckCachedPayloadPartsOnly;
125}
126
127ItemFetchScope::AncestorRetrieval ItemFetchScope::ancestorRetrieval() const
128{
129 return d->mAncestorDepth;
130}
131
132void ItemFetchScope::setAncestorRetrieval(AncestorRetrieval depth)
133{
134 d->mAncestorDepth = depth;
135}
136
137void ItemFetchScope::setFetchModificationTime(bool retrieveMtime)
138{
139 d->mFetchMtime = retrieveMtime;
140}
141
142bool ItemFetchScope::fetchModificationTime() const
143{
144 return d->mFetchMtime;
145}
146
147void ItemFetchScope::setFetchGid(bool retrieveGid)
148{
149 d->mFetchGid = retrieveGid;
150}
151
152bool ItemFetchScope::fetchGid() const
153{
154 return d->mFetchGid;
155}
156
157void ItemFetchScope::setIgnoreRetrievalErrors(bool ignore)
158{
159 d->mIgnoreRetrievalErrors = ignore;
160}
161
162bool ItemFetchScope::ignoreRetrievalErrors() const
163{
164 return d->mIgnoreRetrievalErrors;
165}
166
167void ItemFetchScope::setFetchChangedSince(const KDateTime &changedSince)
168{
169 d->mChangedSince = changedSince;
170}
171
172KDateTime ItemFetchScope::fetchChangedSince() const
173{
174 return d->mChangedSince;
175}
176
177void ItemFetchScope::setFetchRemoteIdentification(bool retrieveRid)
178{
179 d->mFetchRid = retrieveRid;
180}
181
182bool ItemFetchScope::fetchRemoteIdentification() const
183{
184 return d->mFetchRid;
185}
186
187void ItemFetchScope::setFetchTags(bool fetchTags)
188{
189 d->mFetchTags = fetchTags;
190}
191
192bool ItemFetchScope::fetchTags() const
193{
194 return d->mFetchTags;
195}
196
197void ItemFetchScope::setTagFetchScope(const TagFetchScope &tagFetchScope)
198{
199 d->mTagFetchScope = tagFetchScope;
200}
201
202TagFetchScope &ItemFetchScope::tagFetchScope()
203{
204 return d->mTagFetchScope;
205}
206
207TagFetchScope ItemFetchScope::tagFetchScope() const
208{
209 return d->mTagFetchScope;
210}
211
212void ItemFetchScope::setFetchVirtualReferences(bool fetchVRefs)
213{
214 d->mFetchVRefs = fetchVRefs;
215}
216
217bool ItemFetchScope::fetchVirtualReferences() const
218{
219 return d->mFetchVRefs;
220}
Akonadi::ItemFetchScopePrivate
Definition: itemfetchscope_p.h:35
Akonadi::ItemFetchScope
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition: itemfetchscope.h:70
Akonadi::ItemFetchScope::~ItemFetchScope
~ItemFetchScope()
Destroys the item fetch scope.
Definition: itemfetchscope.cpp:38
Akonadi::ItemFetchScope::fetchVirtualReferences
bool fetchVirtualReferences() const
Returns whether virtual references should be retrieved.
Definition: itemfetchscope.cpp:217
Akonadi::ItemFetchScope::setFetchTags
void setFetchTags(bool fetchTags)
Fetch tags for items.
Definition: itemfetchscope.cpp:187
Akonadi::ItemFetchScope::setFetchChangedSince
void setFetchChangedSince(const KDateTime &changedSince)
Only fetch items that were added or modified after given timestamp.
Definition: itemfetchscope.cpp:167
Akonadi::ItemFetchScope::setFetchRemoteIdentification
void setFetchRemoteIdentification(bool retrieveRid)
Fetch remote identification for items.
Definition: itemfetchscope.cpp:177
Akonadi::ItemFetchScope::allAttributes
bool allAttributes() const
Returns whether all available attributes should be fetched.
Definition: itemfetchscope.cpp:89
Akonadi::ItemFetchScope::setCacheOnly
void setCacheOnly(bool cacheOnly)
Sets whether payload data should be requested from remote sources or just from the local cache.
Definition: itemfetchscope.cpp:109
Akonadi::ItemFetchScope::fetchRemoteIdentification
bool fetchRemoteIdentification() const
Returns whether item remote identification should be retrieved.
Definition: itemfetchscope.cpp:182
Akonadi::ItemFetchScope::fullPayload
bool fullPayload() const
Returns whether the full payload should be fetched.
Definition: itemfetchscope.cpp:65
Akonadi::ItemFetchScope::fetchAttribute
void fetchAttribute(const QByteArray &type, bool fetch=true)
Sets whether the attribute of the given type should be fetched.
Definition: itemfetchscope.cpp:80
Akonadi::ItemFetchScope::setAncestorRetrieval
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval.
Definition: itemfetchscope.cpp:132
Akonadi::ItemFetchScope::fetchTags
bool fetchTags() const
Returns whether tags should be retrieved.
Definition: itemfetchscope.cpp:192
Akonadi::ItemFetchScope::cacheOnly
bool cacheOnly() const
Returns whether payload data should be requested from remote sources or just from the local cache.
Definition: itemfetchscope.cpp:104
Akonadi::ItemFetchScope::fetchModificationTime
bool fetchModificationTime() const
Returns whether item modification time should be retrieved.
Definition: itemfetchscope.cpp:142
Akonadi::ItemFetchScope::setFetchGid
void setFetchGid(bool retrieveGID)
Enables retrieval of the item GID.
Definition: itemfetchscope.cpp:147
Akonadi::ItemFetchScope::ItemFetchScope
ItemFetchScope()
Creates an empty item fetch scope.
Definition: itemfetchscope.cpp:28
Akonadi::ItemFetchScope::checkForCachedPayloadPartsOnly
bool checkForCachedPayloadPartsOnly() const
Returns whether payload data should be fetched or only checked for presence in the cache.
Definition: itemfetchscope.cpp:122
Akonadi::ItemFetchScope::fetchAllAttributes
void fetchAllAttributes(bool fetch=true)
Sets whether all available attributes should be fetched.
Definition: itemfetchscope.cpp:94
Akonadi::ItemFetchScope::attributes
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
Definition: itemfetchscope.cpp:75
Akonadi::ItemFetchScope::ignoreRetrievalErrors
bool ignoreRetrievalErrors() const
Returns whether retrieval errors should be ignored.
Definition: itemfetchscope.cpp:162
Akonadi::ItemFetchScope::payloadParts
QSet< QByteArray > payloadParts() const
Returns the payload parts that should be fetched.
Definition: itemfetchscope.cpp:51
Akonadi::ItemFetchScope::setFetchModificationTime
void setFetchModificationTime(bool retrieveMtime)
Enables retrieval of the item modification time.
Definition: itemfetchscope.cpp:137
Akonadi::ItemFetchScope::fetchGid
bool fetchGid() const
Returns whether item GID should be retrieved.
Definition: itemfetchscope.cpp:152
Akonadi::ItemFetchScope::ancestorRetrieval
AncestorRetrieval ancestorRetrieval() const
Returns the ancestor retrieval depth.
Definition: itemfetchscope.cpp:127
Akonadi::ItemFetchScope::tagFetchScope
TagFetchScope & tagFetchScope()
Returns the tag fetch scope.
Definition: itemfetchscope.cpp:202
Akonadi::ItemFetchScope::setTagFetchScope
void setTagFetchScope(const TagFetchScope &fetchScope)
Sets the tag fetch scope.
Definition: itemfetchscope.cpp:197
Akonadi::ItemFetchScope::setCheckForCachedPayloadPartsOnly
void setCheckForCachedPayloadPartsOnly(bool check=true)
Sets whether payload will be fetched or there will be only a test performed if the requested payload ...
Definition: itemfetchscope.cpp:114
Akonadi::ItemFetchScope::isEmpty
bool isEmpty() const
Returns true if there is nothing to fetch.
Definition: itemfetchscope.cpp:99
Akonadi::ItemFetchScope::setFetchVirtualReferences
void setFetchVirtualReferences(bool fetchVRefs)
Returns whether to fetch list of virtual collections the item is linked to.
Definition: itemfetchscope.cpp:212
Akonadi::ItemFetchScope::fetchFullPayload
void fetchFullPayload(bool fetch=true)
Sets whether the full payload shall be fetched.
Definition: itemfetchscope.cpp:70
Akonadi::ItemFetchScope::fetchPayloadPart
void fetchPayloadPart(const QByteArray &part, bool fetch=true)
Sets which payload parts shall be fetched.
Definition: itemfetchscope.cpp:56
Akonadi::ItemFetchScope::setIgnoreRetrievalErrors
void setIgnoreRetrievalErrors(bool enabled)
Ignore retrieval errors while fetching items, and always deliver what is available.
Definition: itemfetchscope.cpp:157
Akonadi::ItemFetchScope::operator=
ItemFetchScope & operator=(const ItemFetchScope &other)
Assigns the other to this scope and returns a reference to this scope.
Definition: itemfetchscope.cpp:42
Akonadi::ItemFetchScope::fetchChangedSince
KDateTime fetchChangedSince() const
Returns timestamp of the oldest item to fetch.
Definition: itemfetchscope.cpp:172
Akonadi::ItemFetchScope::AncestorRetrieval
AncestorRetrieval
Describes the ancestor retrieval depth.
Definition: itemfetchscope.h:76
Akonadi::TagFetchScope
Specifies which parts of a tag should be fetched from the Akonadi storage.
Definition: tagfetchscope.h:34
Akonadi
FreeBusyManager::Singleton.
Definition: actionstatemanager_p.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal