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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 
26 using namespace Akonadi;
27 
28 ItemFetchScope::ItemFetchScope()
29 {
30  d = new ItemFetchScopePrivate();
31 }
32 
33 ItemFetchScope::ItemFetchScope( const ItemFetchScope &other )
34  : d( other.d )
35 {
36 }
37 
38 ItemFetchScope::~ItemFetchScope()
39 {
40 }
41 
42 ItemFetchScope &ItemFetchScope::operator=( const ItemFetchScope &other )
43 {
44  if ( &other != this )
45  d = other.d;
46 
47  return *this;
48 }
49 
50 QSet< QByteArray > ItemFetchScope::payloadParts() const
51 {
52  return d->mPayloadParts;
53 }
54 
55 void ItemFetchScope::fetchPayloadPart(const QByteArray & part, bool fetch)
56 {
57  if ( fetch )
58  d->mPayloadParts.insert( part );
59  else
60  d->mPayloadParts.remove( part );
61 }
62 
63 bool ItemFetchScope::fullPayload() const
64 {
65  return d->mFullPayload;
66 }
67 
68 void ItemFetchScope::fetchFullPayload(bool fetch)
69 {
70  d->mFullPayload = fetch;
71 }
72 
73 QSet< QByteArray > ItemFetchScope::attributes() const
74 {
75  return d->mAttributes;
76 }
77 
78 void ItemFetchScope::fetchAttribute(const QByteArray & type, bool fetch)
79 {
80  if ( fetch )
81  d->mAttributes.insert( type );
82  else
83  d->mAttributes.remove( type );
84 }
85 
86 bool ItemFetchScope::allAttributes() const
87 {
88  return d->mAllAttributes;
89 }
90 
91 void ItemFetchScope::fetchAllAttributes(bool fetch)
92 {
93  d->mAllAttributes = fetch;
94 }
95 
96 bool ItemFetchScope::isEmpty() const
97 {
98  return d->mPayloadParts.isEmpty() && d->mAttributes.isEmpty() && !d->mFullPayload && !d->mAllAttributes;
99 }
100 
101 bool ItemFetchScope::cacheOnly() const
102 {
103  return d->mCacheOnly;
104 }
105 
106 void ItemFetchScope::setCacheOnly(bool cacheOnly)
107 {
108  d->mCacheOnly = cacheOnly;
109 }
110 
111 void ItemFetchScope::setCheckForCachedPayloadPartsOnly( bool check )
112 {
113  if ( check )
114  setCacheOnly(true);
115  d->mCheckCachedPayloadPartsOnly = check;
116 }
117 
118 bool ItemFetchScope::checkForCachedPayloadPartsOnly() const
119 {
120  return d->mCheckCachedPayloadPartsOnly;
121 }
122 
123 ItemFetchScope::AncestorRetrieval ItemFetchScope::ancestorRetrieval() const
124 {
125  return d->mAncestorDepth;
126 }
127 
128 void ItemFetchScope::setAncestorRetrieval( AncestorRetrieval depth )
129 {
130  d->mAncestorDepth = depth;
131 }
132 
133 void ItemFetchScope::setFetchModificationTime( bool retrieveMtime )
134 {
135  d->mFetchMtime = retrieveMtime;
136 }
137 
138 bool ItemFetchScope::fetchModificationTime() const
139 {
140  return d->mFetchMtime;
141 }
142 
143 void ItemFetchScope::setFetchGid( bool retrieveGid )
144 {
145  d->mFetchGid = retrieveGid;
146 }
147 
148 bool ItemFetchScope::fetchGid() const
149 {
150  return d->mFetchGid;
151 }
152 
153 void ItemFetchScope::setIgnoreRetrievalErrors( bool ignore )
154 {
155  d->mIgnoreRetrievalErrors = ignore;
156 }
157 
158 bool ItemFetchScope::ignoreRetrievalErrors() const
159 {
160  return d->mIgnoreRetrievalErrors;
161 }
162 
163 void ItemFetchScope::setFetchChangedSince( const KDateTime &changedSince )
164 {
165  d->mChangedSince = changedSince;
166 }
167 
168 KDateTime ItemFetchScope::fetchChangedSince() const
169 {
170  return d->mChangedSince;
171 }
172 
173 void ItemFetchScope::setFetchRemoteIdentification(bool retrieveRid)
174 {
175  d->mFetchRid = retrieveRid;
176 }
177 
178 bool ItemFetchScope::fetchRemoteIdentification() const
179 {
180  return d->mFetchRid;
181 }
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:78
Akonadi::ItemFetchScope::setIgnoreRetrievalErrors
void setIgnoreRetrievalErrors(bool enabled)
Ignore retrieval errors while fetching items, and always deliver what is available.
Definition: itemfetchscope.cpp:153
Akonadi::ItemFetchScope::ancestorRetrieval
AncestorRetrieval ancestorRetrieval() const
Returns the ancestor retrieval depth.
Definition: itemfetchscope.cpp:123
Akonadi::ItemFetchScope::fetchAllAttributes
void fetchAllAttributes(bool fetch=true)
Sets whether all available attributes should be fetched.
Definition: itemfetchscope.cpp:91
Akonadi::ItemFetchScopePrivate
Definition: itemfetchscope_p.h:33
Akonadi::ItemFetchScope::setFetchChangedSince
void setFetchChangedSince(const KDateTime &changedSince)
Only fetch items that were added or modified after given timestamp.
Definition: itemfetchscope.cpp:163
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:111
Akonadi::ItemFetchScope::fullPayload
bool fullPayload() const
Returns whether the full payload should be fetched.
Definition: itemfetchscope.cpp:63
Akonadi::ItemFetchScope::~ItemFetchScope
~ItemFetchScope()
Destroys the item fetch scope.
Definition: itemfetchscope.cpp:38
Akonadi::ItemFetchScope::fetchModificationTime
bool fetchModificationTime() const
Returns whether item modification time should be retrieved.
Definition: itemfetchscope.cpp:138
Akonadi::ItemFetchScope::fetchFullPayload
void fetchFullPayload(bool fetch=true)
Sets whether the full payload shall be fetched.
Definition: itemfetchscope.cpp:68
Akonadi::ItemFetchScope::ItemFetchScope
ItemFetchScope()
Creates an empty item fetch scope.
Definition: itemfetchscope.cpp:28
Akonadi::ItemFetchScope::AncestorRetrieval
AncestorRetrieval
Describes the ancestor retrieval depth.
Definition: itemfetchscope.h:75
Akonadi::ItemFetchScope::setFetchRemoteIdentification
void setFetchRemoteIdentification(bool retrieveRid)
Fetch remote identification for items.
Definition: itemfetchscope.cpp:173
Akonadi::ItemFetchScope::attributes
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
Definition: itemfetchscope.cpp:73
Akonadi::ItemFetchScope::fetchRemoteIdentification
bool fetchRemoteIdentification() const
Returns whether item remote identification should be retrieved.
Definition: itemfetchscope.cpp:178
Akonadi::ItemFetchScope::isEmpty
bool isEmpty() const
Returns true if there is nothing to fetch.
Definition: itemfetchscope.cpp:96
Akonadi::ItemFetchScope::payloadParts
QSet< QByteArray > payloadParts() const
Returns the payload parts that should be fetched.
Definition: itemfetchscope.cpp:50
Akonadi::ItemFetchScope::fetchChangedSince
KDateTime fetchChangedSince() const
Returns timestamp of the oldest item to fetch.
Definition: itemfetchscope.cpp:168
Akonadi::ItemFetchScope
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition: itemfetchscope.h:68
Akonadi::ItemFetchScope::setAncestorRetrieval
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval. ...
Definition: itemfetchscope.cpp:128
Akonadi::ItemFetchScope::fetchGid
bool fetchGid() const
Returns whether item GID should be retrieved.
Definition: itemfetchscope.cpp:148
Akonadi::ItemFetchScope::checkForCachedPayloadPartsOnly
bool checkForCachedPayloadPartsOnly() const
Returns whether payload data should be fetched or only checked for presence in the cache...
Definition: itemfetchscope.cpp:118
Akonadi::ItemFetchScope::setFetchModificationTime
void setFetchModificationTime(bool retrieveMtime)
Enables retrieval of the item modification time.
Definition: itemfetchscope.cpp:133
Akonadi::ItemFetchScope::setFetchGid
void setFetchGid(bool retrieveGID)
Enables retrieval of the item GID.
Definition: itemfetchscope.cpp:143
Akonadi::ItemFetchScope::ignoreRetrievalErrors
bool ignoreRetrievalErrors() const
Returns whether retrieval errors should be ignored.
Definition: itemfetchscope.cpp:158
Akonadi::ItemFetchScope::allAttributes
bool allAttributes() const
Returns whether all available attributes should be fetched.
Definition: itemfetchscope.cpp:86
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:101
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::fetchPayloadPart
void fetchPayloadPart(const QByteArray &part, bool fetch=true)
Sets which payload parts shall be fetched.
Definition: itemfetchscope.cpp:55
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:106
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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