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 class Akonadi::TagFetchScopePrivate
13 {
14 public:
15  TagFetchScopePrivate()
16  {
17  }
18 
19  QSet<QByteArray> mAttributes;
20  bool mFetchIdOnly = false;
21  bool mFetchAllAttrs = true;
22  bool mFetchRemotId = false;
23 };
24 
26  : d(new TagFetchScopePrivate)
27 {
28 }
29 
31 {
32 }
33 
35  : d(new TagFetchScopePrivate)
36 {
37  operator=(other);
38 }
39 
41 {
42  d->mAttributes = other.d->mAttributes;
43  d->mFetchIdOnly = other.d->mFetchIdOnly;
44  d->mFetchRemotId = other.d->mFetchRemotId;
45  d->mFetchAllAttrs = other.d->mFetchAllAttrs;
46  return *this;
47 }
48 
50 {
51  return d->mAttributes;
52 }
53 
54 void TagFetchScope::fetchAttribute(const QByteArray &type, bool fetch)
55 {
56  if (fetch) {
57  d->mAttributes.insert(type);
58  } else {
59  d->mAttributes.remove(type);
60  }
61 }
62 
64 {
65  d->mFetchIdOnly = idOnly;
66  d->mAttributes.clear();
67 }
68 
70 {
71  return d->mFetchIdOnly;
72 }
73 
74 void TagFetchScope::setFetchRemoteId(bool fetchRemoteId)
75 {
76  d->mFetchRemotId = fetchRemoteId;
77 }
78 
80 {
81  return d->mFetchRemotId;
82 }
83 
84 void TagFetchScope::setFetchAllAttributes(bool fetchAllAttrs)
85 {
86  d->mFetchAllAttrs = fetchAllAttrs;
87 }
88 
90 {
91  return d->mFetchAllAttrs;
92 }
Specifies which parts of a tag should be fetched from the Akonadi storage.
Definition: tagfetchscope.h:22
bool fetchAllAttributes() const
Returns whether to fetch all attributes.
void setFetchRemoteId(bool fetchRemoteId)
Sets whether to fetch tag remote ID.
TagFetchScope & operator=(const TagFetchScope &other)
Assigns the other to this scope and returns a reference to this scope.
~TagFetchScope()
Destroys the tag fetch scope.
bool fetchIdOnly() const
Sets whether only the id of the tags should be retrieved or the complete tag.
bool fetchRemoteId() const
Returns whether tag remote ID should be fetched.
TagFetchScope()
Creates an empty tag fetch scope.
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
void fetchAttribute(const QByteArray &type, bool fetch=true)
Sets whether the attribute of the given type should be fetched.
void setFetchAllAttributes(bool fetchAllAttributes)
Sets whether to fetch all attributes.
void setFetchIdOnly(bool fetchIdOnly)
Sets whether only the id or the complete tag should be fetched.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jun 27 2022 04:01:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.