• 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
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  unsubscribed( false ),
34  statistics( false )
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  unsubscribed = other.unsubscribed;
45  statistics = other.statistics;
46  }
47 
48  public:
49  QString resource;
50  QStringList contentMimeTypes;
51  CollectionFetchScope::AncestorRetrieval ancestorDepth;
52  bool unsubscribed;
53  bool statistics;
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->unsubscribed && d->ancestorDepth == None;
82 }
83 
84 bool CollectionFetchScope::includeUnubscribed () const
85 {
86  return includeUnsubscribed();
87 }
88 
89 bool CollectionFetchScope::includeUnsubscribed () const
90 {
91  return d->unsubscribed;
92 }
93 
94 void CollectionFetchScope::setIncludeUnsubscribed (bool include)
95 {
96  d->unsubscribed = include;
97 }
98 
99 bool CollectionFetchScope::includeStatistics () const
100 {
101  return d->statistics;
102 }
103 
104 void CollectionFetchScope::setIncludeStatistics (bool include)
105 {
106  d->statistics = include;
107 }
108 
109 QString CollectionFetchScope::resource () const
110 {
111  return d->resource;
112 }
113 
114 void CollectionFetchScope::setResource (const QString & resource)
115 {
116  d->resource = resource;
117 }
118 
119 QStringList CollectionFetchScope::contentMimeTypes () const
120 {
121  return d->contentMimeTypes;
122 }
123 
124 void CollectionFetchScope::setContentMimeTypes (const QStringList & mimeTypes)
125 {
126  d->contentMimeTypes = mimeTypes;
127 }
128 
129 CollectionFetchScope::AncestorRetrieval CollectionFetchScope::ancestorRetrieval() const
130 {
131  return d->ancestorDepth;
132 }
133 
134 void CollectionFetchScope::setAncestorRetrieval( AncestorRetrieval ancestorDepth )
135 {
136  d->ancestorDepth = ancestorDepth;
137 }
138 
139 }
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:134
Akonadi::CollectionFetchScope::setIncludeUnsubscribed
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
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:114
Akonadi::CollectionFetchScope::setIncludeStatistics
void setIncludeStatistics(bool include)
Sets whether collection statistics should be included in the retrieved results.
Definition: collectionfetchscope.cpp:104
Akonadi::CollectionFetchScope::resource
QString resource() const
Returns the resource identifier that is used as filter.
Definition: collectionfetchscope.cpp:109
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:124
Akonadi::CollectionFetchScope::includeStatistics
bool includeStatistics() const
Returns whether collection statistics should be included in the retrieved results.
Definition: collectionfetchscope.cpp:99
Akonadi::CollectionFetchScope::includeUnubscribed
AKONADI_DEPRECATED bool includeUnubscribed() const
Returns whether unsubscribed collection should be included.
Definition: collectionfetchscope.cpp:84
Akonadi::CollectionFetchScope::contentMimeTypes
QStringList contentMimeTypes() const
Returns the content mimetypes filter.
Definition: collectionfetchscope.cpp:119
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:129
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
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:26 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