Kgapi

contact.h
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 #ifndef LIBKGAPI2_CONTACT_H
10 #define LIBKGAPI2_CONTACT_H
11 
12 #include "object.h"
13 #include "types.h"
14 #include "kgapicontacts_export.h"
15 
16 #include <KContacts/Addressee>
17 #include <QDateTime>
18 
19 namespace KGAPI2
20 {
21 
28 class KGAPICONTACTS_EXPORT Contact : public KGAPI2::Object,
30 {
31  public:
32 
36  enum IMProtocol {
37  Jabber,
38  ICQ,
39  GoogleTalk,
40  QQ,
41  Skype,
42  Yahoo,
43  MSN,
44  AIM,
45  Other
46  };
47 
51  Contact();
52 
56  explicit Contact(const KContacts::Addressee &other);
57 
61  Contact(const Contact &other);
62 
63 
67  ~Contact();
68 
69  bool operator==(const Contact &other) const;
70 
76  void setDeleted(bool deleted);
77 
81  bool deleted() const;
82 
88  void setPhotoUrl(const QString &photoUrl);
89 
94  void setPhotoUrl(const QUrl &photoUrl);
95 
99  QUrl photoUrl() const;
100 
106  void setCreated(const QDateTime &created);
107 
111  QDateTime created() const;
112 
118  void setUpdated(const QDateTime &updated);
119 
123  QDateTime updated() const;
124 
130  void setGroups(const QStringList &groups);
131 
137  void addGroup(const QString &group);
138 
148  void removeGroup(const QString &group);
149 
153  void clearGroups();
154 
158  QStringList groups() const;
159 
165  bool groupIsDeleted(const QString &group) const;
166 
172  static QString IMProtocolToScheme(const IMProtocol protocol);
173 
179  static QString IMSchemeToProtocolName(const QString &scheme);
180 
186  static QString IMProtocolNameToScheme(const QString &protocolName);
187 
193  static IMProtocol IMSchemeToProtocol(const QString &scheme);
194 
200  static QString phoneTypeToScheme(const KContacts::PhoneNumber::Type type);
201 
207  static KContacts::PhoneNumber::Type phoneSchemeToType(const QString &scheme);
208 
215  static QString addressTypeToScheme(const KContacts::Address::Type type, bool *primary = nullptr);
216 
223  static KContacts::Address::Type addressSchemeToType(const QString &scheme, bool primary = false);
224 
228  static QString emailSchemeToProtocolName(const QString &scheme);
229 
230  private:
231  class Private;
232  Private * const d;
233 
234 };
235 
236 } // namespace KGAPI2
237 
238 #endif /* LIBKGAPI2_CONTACT_H */
Base class for all objects.
Definition: object.h:31
IMProtocol
Instant Messaging Protocols.
Definition: contact.h:36
Represents a single contact.
Definition: contact.h:28
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Sep 22 2020 23:10:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.