Akonadi

tagfetchscope.cpp
1 /*
2  SPDX-FileCopyrightText: 2014 Christian Mollekopf <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "tagfetchscope.h"
8 #include <QSet>
9 
10 using namespace Akonadi;
11 
12 struct Q_DECL_HIDDEN Akonadi::TagFetchScope::Private {
13  Private()
14  {
15  }
16 
17  QSet<QByteArray> mAttributes;
18  bool mFetchIdOnly = false;
19  bool mFetchAllAttrs = true;
20  bool mFetchRemotId = false;
21 };
22 
24  : d(new Private)
25 {
26 
27 }
28 
30 {
31 }
32 
34  : d(new Private)
35 {
36  operator=(other);
37 }
38 
40 {
41  d->mAttributes = other.d->mAttributes;
42  d->mFetchIdOnly = other.d->mFetchIdOnly;
43  d->mFetchRemotId = other.d->mFetchRemotId;
44  d->mFetchAllAttrs = other.d->mFetchAllAttrs;
45  return *this;
46 }
47 
49 {
50  return d->mAttributes;
51 }
52 
53 void TagFetchScope::fetchAttribute(const QByteArray &type, bool fetch)
54 {
55  if (fetch) {
56  d->mAttributes.insert(type);
57  } else {
58  d->mAttributes.remove(type);
59  }
60 }
61 
63 {
64  d->mFetchIdOnly = idOnly;
65  d->mAttributes.clear();
66 }
67 
69 {
70  return d->mFetchIdOnly;
71 }
72 
74 {
75  d->mFetchRemotId = fetchRemoteId;
76 }
77 
79 {
80  return d->mFetchRemotId;
81 }
82 
83 void TagFetchScope::setFetchAllAttributes(bool fetchAllAttrs)
84 {
85  d->mFetchAllAttrs = fetchAllAttrs;
86 }
87 
89 {
90  return d->mFetchAllAttrs;
91 }
92 
Specifies which parts of a tag should be fetched from the Akonadi storage.
Definition: tagfetchscope.h:22
void fetchAttribute(const QByteArray &type, bool fetch=true)
Sets whether the attribute of the given type should be fetched.
bool fetchRemoteId() const
Returns whether tag remote ID should be fetched.
void setFetchIdOnly(bool fetchIdOnly)
Sets whether only the id or the complete tag should be fetched.
bool fetchIdOnly() const
Sets whether only the id of the tags should be retieved or the complete tag.
TagFetchScope()
Creates an empty tag fetch scope.
Helper integration between Akonadi and Qt.
void setFetchRemoteId(bool fetchRemoteId)
Sets whether to fetch tag remote ID.
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
bool fetchAllAttributes() const
Returns whether to fetch all attributes.
TagFetchScope & operator=(const TagFetchScope &other)
Assigns the other to this scope and returns a reference to this scope.
void setFetchAllAttributes(bool fetchAllAttributes)
Sets whether to fetch all attributes.
~TagFetchScope()
Destroys the tag fetch scope.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jul 12 2020 23:16:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.