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

akonadi

  • sources
  • kde-4.14
  • kdepimlibs
  • akonadi
collectionfetchscope.cpp
1 /*
2  Copyright (c) 2008 Kevin Krammer <kevin.krammer@gmx.at>
3  Copyright (c) 2009 Volker Krause <vkrause@kde.org>
4 
5  This library is free software; you can redistribute it and/or modify it
6  under the terms of the GNU Library General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or (at your
8  option) any later version.
9 
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13  License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to the
17  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301, USA.
19 */
20 
21 #include "collectionfetchscope.h"
22 
23 #include <QString>
24 #include <QStringList>
25 
26 namespace Akonadi {
27 
28 class CollectionFetchScopePrivate : public QSharedData
29 {
30 public:
31  CollectionFetchScopePrivate()
32  : ancestorDepth(CollectionFetchScope::None)
33  , statistics(false)
34  , listFilter(CollectionFetchScope::Enabled)
35  {
36  }
37 
38  CollectionFetchScopePrivate(const CollectionFetchScopePrivate &other)
39  : QSharedData(other)
40  {
41  resource = other.resource;
42  contentMimeTypes = other.contentMimeTypes;
43  ancestorDepth = other.ancestorDepth;
44  statistics = other.statistics;
45  listFilter = other.listFilter;
46  }
47 
48 public:
49  QString resource;
50  QStringList contentMimeTypes;
51  CollectionFetchScope::AncestorRetrieval ancestorDepth;
52  bool statistics;
53  CollectionFetchScope::ListFilter listFilter;
54 };
55 
56 CollectionFetchScope::CollectionFetchScope()
57 {
58  d = new CollectionFetchScopePrivate();
59 }
60 
61 CollectionFetchScope::CollectionFetchScope(const CollectionFetchScope &other)
62  : d(other.d)
63 {
64 }
65 
66 CollectionFetchScope::~CollectionFetchScope()
67 {
68 }
69 
70 CollectionFetchScope &CollectionFetchScope::operator=(const CollectionFetchScope &other)
71 {
72  if (&other != this) {
73  d = other.d;
74  }
75 
76  return *this;
77 }
78 
79 bool CollectionFetchScope::isEmpty() const
80 {
81  return d->resource.isEmpty() && d->contentMimeTypes.isEmpty() && !d->statistics && d->ancestorDepth == None && d->listFilter == Enabled;
82 }
83 
84 bool CollectionFetchScope::includeUnubscribed() const
85 {
86  return includeUnsubscribed();
87 }
88 
89 bool CollectionFetchScope::includeUnsubscribed() const
90 {
91  return (d->listFilter == NoFilter);
92 }
93 
94 void CollectionFetchScope::setIncludeUnsubscribed(bool include)
95 {
96  if (include) {
97  d->listFilter = NoFilter;
98  } else {
99  d->listFilter = Enabled;
100  }
101 }
102 
103 bool CollectionFetchScope::includeStatistics() const
104 {
105  return d->statistics;
106 }
107 
108 void CollectionFetchScope::setIncludeStatistics(bool include)
109 {
110  d->statistics = include;
111 }
112 
113 QString CollectionFetchScope::resource() const
114 {
115  return d->resource;
116 }
117 
118 void CollectionFetchScope::setResource(const QString &resource)
119 {
120  d->resource = resource;
121 }
122 
123 QStringList CollectionFetchScope::contentMimeTypes() const
124 {
125  return d->contentMimeTypes;
126 }
127 
128 void CollectionFetchScope::setContentMimeTypes(const QStringList &mimeTypes)
129 {
130  d->contentMimeTypes = mimeTypes;
131 }
132 
133 CollectionFetchScope::AncestorRetrieval CollectionFetchScope::ancestorRetrieval() const
134 {
135  return d->ancestorDepth;
136 }
137 
138 void CollectionFetchScope::setAncestorRetrieval(AncestorRetrieval ancestorDepth)
139 {
140  d->ancestorDepth = ancestorDepth;
141 }
142 
143 CollectionFetchScope::ListFilter CollectionFetchScope::listFilter() const
144 {
145  return d->listFilter;
146 }
147 
148 void CollectionFetchScope::setListFilter(CollectionFetchScope::ListFilter listFilter)
149 {
150  d->listFilter = listFilter;
151 }
152 
153 
154 }
Akonadi::CollectionFetchScope::CollectionFetchScope
CollectionFetchScope()
Creates an empty collection fetch scope.
Definition: collectionfetchscope.cpp:56
Akonadi::CollectionFetchScope::setAncestorRetrieval
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval. ...
Definition: collectionfetchscope.cpp:138
Akonadi::CollectionFetchScope::setIncludeUnsubscribed
AKONADI_DEPRECATED void setIncludeUnsubscribed(bool include)
Sets whether unsubscribed collections should be included in the collection listing.
Definition: collectionfetchscope.cpp:94
Akonadi::CollectionFetchScope
Specifies which parts of a collection should be fetched from the Akonadi storage. ...
Definition: collectionfetchscope.h:68
Akonadi::CollectionFetchScope::includeUnsubscribed
AKONADI_DEPRECATED bool includeUnsubscribed() const
Returns whether unsubscribed collection should be included.
Definition: collectionfetchscope.cpp:89
Akonadi::CollectionFetchScope::setResource
void setResource(const QString &resource)
Sets a resource filter, that is only collections owned by the specified resource are retrieved...
Definition: collectionfetchscope.cpp:118
Akonadi::CollectionFetchScope::setListFilter
void setListFilter(ListFilter)
Sets a filter for the collections to be listed.
Definition: collectionfetchscope.cpp:148
Akonadi::CollectionFetchScope::setIncludeStatistics
void setIncludeStatistics(bool include)
Sets whether collection statistics should be included in the retrieved results.
Definition: collectionfetchscope.cpp:108
Akonadi::CollectionFetchScope::resource
QString resource() const
Returns the resource identifier that is used as filter.
Definition: collectionfetchscope.cpp:113
Akonadi::CollectionFetchScope::ListFilter
ListFilter
Describes the list filter.
Definition: collectionfetchscope.h:132
QSharedData
Akonadi::CollectionFetchScope::operator=
CollectionFetchScope & operator=(const CollectionFetchScope &other)
Assigns the other to this scope and returns a reference to this scope.
Definition: collectionfetchscope.cpp:70
Akonadi::CollectionFetchScope::isEmpty
bool isEmpty() const
Returns true if there is nothing to fetch.
Definition: collectionfetchscope.cpp:79
Akonadi::CollectionFetchScope::setContentMimeTypes
void setContentMimeTypes(const QStringList &mimeTypes)
Sets a content mimetypes filter, that is only collections that contain at least one of the given mime...
Definition: collectionfetchscope.cpp:128
Akonadi::CollectionFetchScope::includeStatistics
bool includeStatistics() const
Returns whether collection statistics should be included in the retrieved results.
Definition: collectionfetchscope.cpp:103
QString
Akonadi::CollectionFetchScope::includeUnubscribed
AKONADI_DEPRECATED bool includeUnubscribed() const
Returns whether unsubscribed collection should be included.
Definition: collectionfetchscope.cpp:84
QStringList
Akonadi::CollectionFetchScope::NoFilter
No filtering, retrieve all collections.
Definition: collectionfetchscope.h:133
Akonadi::CollectionFetchScope::contentMimeTypes
QStringList contentMimeTypes() const
Returns the content mimetypes filter.
Definition: collectionfetchscope.cpp:123
Akonadi::CollectionFetchScope::AncestorRetrieval
AncestorRetrieval
Describes the ancestor retrieval depth.
Definition: collectionfetchscope.h:74
Akonadi::CollectionFetchScope::ancestorRetrieval
AncestorRetrieval ancestorRetrieval() const
Returns the ancestor retrieval depth.
Definition: collectionfetchscope.cpp:133
Akonadi::CollectionFetchScope::Enabled
Only retrieve enabled collections, ignoring the local preference. This is the same as setIncludeUnsub...
Definition: collectionfetchscope.h:137
Akonadi::CollectionFetchScope::~CollectionFetchScope
~CollectionFetchScope()
Destroys the collection fetch scope.
Definition: collectionfetchscope.cpp:66
Akonadi::CollectionFetchScope::None
No ancestor retrieval at all (the default)
Definition: collectionfetchscope.h:75
Akonadi::CollectionFetchScope::listFilter
ListFilter listFilter() const
Returns the list filter.
Definition: collectionfetchscope.cpp:143
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:02 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
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

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