Kgapi

contactsgroup.cpp
1 /*
2  * This file is part of LibKGAPI library
3  *
4  * SPDX-FileCopyrightText: 2013 Daniel Vr├ítil <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7  */
8 
9 #include "contactsgroup.h"
10 #include "../debug.h"
11 
12 using namespace KGAPI2;
13 
14 
15 class Q_DECL_HIDDEN ContactsGroup::Private
16 {
17  public:
18  Private();
19 
20  ~Private();
21 
22  QString id;
23  QString title;
24  QString content;
25  QDateTime updated;
26  bool isSystemGroup = false;
27 
28 };
29 
30 ContactsGroup::Private::Private()
31 {
32 }
33 
34 ContactsGroup::Private::~Private()
35 {
36 }
37 
39  Object(),
40  d(new Private)
41 {
42 }
43 
45  Object(other),
46  d(new Private(*(other.d)))
47 {
48 }
49 
51 {
52  delete d;
53 }
54 
55 bool ContactsGroup::operator==(const ContactsGroup &other) const
56 {
57  if (d->id != other.d->id) {
58  qCDebug(KGAPIDebug) << "IDs don't match";
59  return false;
60  }
61  if (d->title != other.d->title) {
62  qCDebug(KGAPIDebug) << "Titles don't match";
63  return false;
64  }
65  if (d->content != other.d->content) {
66  qCDebug(KGAPIDebug) << "Contents don't match";
67  return false;
68  }
69  if (d->updated != other.d->updated) {
70  qCDebug(KGAPIDebug) << "Updated does not match";
71  return false;
72  }
73  if (d->isSystemGroup != other.d->isSystemGroup) {
74  qCDebug(KGAPIDebug) << "SystemGroup does not match";
75  return false;
76  }
77 
78  return true;
79 }
80 
82 {
83  d->id = id;
84 }
85 
87 {
88  return d->id;
89 }
90 
92 {
93  d->title = title;
94 }
95 
97 {
98  return d->title;
99 }
100 
102 {
103  d->content = content;
104 }
105 
107 {
108  return d->content;
109 }
110 
112 {
113  d->updated = updated;
114 }
115 
117 {
118  return d->updated;
119 }
120 
122 {
123  d->isSystemGroup = isSystemGroup;
124 }
125 
127 {
128  return d->isSystemGroup;
129 }
~ContactsGroup() override
Destructor.
void setContent(const QString &content)
Sets description what kind of contacts the group contains.
QString content() const
Returns description of group content.
Base class for all objects.
Definition: object.h:30
bool operator==(const ContactsGroup &other) const
Compares the groups.
void setId(const QString &id)
Sets group ID.
QDateTime updated() const
Returns date and time of last update.
Represents a contacts group.
Definition: contactsgroup.h:33
void setUpdated(const QDateTime &updated)
Sets when was the group updated last time.
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:15
void setTitle(const QString &title)
Sets group name.
QString id() const
Returns group ID.
ContactsGroup()
Constructor.
QString title() const
Returns group name.
void setIsSystemGroup(const bool isSystemGroup)
Sets whether this group is a system group.
bool isSystemGroup() const
Returns whether the group is a system group.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Oct 24 2021 23:11:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.