Kgapi

accountinfo.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_ACCOUNTINFO_H
10 #define LIBKGAPI2_ACCOUNTINFO_H
11 
12 #include "object.h"
13 #include "kgapicore_export.h"
14 
15 namespace KGAPI2
16 {
17 
18 /**
19  * @brief AccountInfo contains information about user's Google account.
20  *
21  * It is possible to obtain only information about account to which
22  * we have access token.
23  *
24  * Some information might be empty, but id and email are guaranteed to
25  * be always filled.
26  *
27  * The accountInfo service provides read-only access.
28  *
29  * @author Daniel Vrátil <[email protected]>
30  * @since 0.2
31  */
32 class KGAPICORE_EXPORT AccountInfo : public KGAPI2::Object
33 {
34  public:
35  /**
36  * @brief Constructor
37  */
38  AccountInfo();
39 
40  /**
41  * @brief Copy constructor
42  */
43  AccountInfo(const AccountInfo &other);
44 
45  /**
46  * @brief destructor
47  */
48  virtual ~AccountInfo();
49 
50  bool operator==(const AccountInfo &other) const;
51  bool operator!=(const AccountInfo &other) const { return !operator==(other); }
52 
53  /**
54  * @brief Sets an account ID.
55  *
56  * @param id
57  */
58  void setId(const QString &id);
59 
60  /**
61  * @brief Returns account ID.
62  */
63  QString id() const;
64 
65  /**
66  * @brief Sets account email.
67  *
68  * @param email
69  */
70  void setEmail(const QString &email);
71 
72  /**
73  * @brief Returns account email address.
74  *
75  * Note that address does not have to be \@gmail.com.
76  */
77  QString email() const;
78 
79  /**
80  * @brief Sets user's real full name.
81  *
82  * @param name
83  */
84  void setName(const QString &name);
85 
86  /**
87  * @brief Returns user's real full name.
88  */
89  QString name() const;
90 
91  /**
92  * @brief Sets user's given name.
93  *
94  * @param givenName
95  */
96  void setGivenName(const QString &givenName);
97 
98  /**
99  * @brief Returns user's given name.
100  */
101  QString givenName() const;
102 
103  /**
104  * @brief Sets user's family name (surname).
105  *
106  * @param familyName
107  */
108  void setFamilyName(const QString &familyName);
109 
110  /**
111  * @brief Returns user's surname.
112  */
113  QString familyName() const;
114 
115  /**
116  * @brief Sets user's birthday
117  *
118  * @param birthday
119  */
120  void setBirthday(const QString &birthday);
121 
122  /**
123  * @brief Returns user's birthday.
124  */
125  QString birthday() const;
126 
127  /**
128  * @brief Sets user's gender.
129  *
130  * @param gender
131  */
132  void setGender(const QString &gender);
133 
134  /**
135  * @brief Returns user's gender.
136  */
137  QString gender() const;
138 
139  /**
140  * @brief Sets link to user's profile.
141  *
142  * @param link
143  */
144  void setLink(const QString &link);
145 
146  /**
147  * @brief Returns link to user's profile.
148  */
149  QString link() const;
150 
151  /**
152  * @brief Sets users locale settings.
153  *
154  * @param locale
155  */
156  void setLocale(const QString &locale);
157 
158  /**
159  * @brief Returns user's preferred locales.
160  */
161  QString locale() const;
162 
163  /**
164  * @brief Sets user's timezone name.
165  *
166  * @param timezone
167  */
168  void setTimezone(const QString &timezone);
169 
170  /**
171  * @brief Returns name of user's timezone.
172  */
173  QString timezone() const;
174 
175  /**
176  * @brief Sets whether the email address is verified.
177  *
178  * @param verified
179  */
180  void setVerifiedEmail(bool verified);
181 
182  /**
183  * @brief Returns whether the email is verified.
184  */
185  bool verifiedEmail() const;
186 
187  /**
188  * @brief Sets URL of user's photo.
189  *
190  * @param url
191  */
192  void setPhotoUrl(const QString &url);
193 
194  /**
195  * @brief Returns URL of user's photo.
196  */
197  QString photoUrl() const;
198 
199  /**
200  * @brief Parses raw JSON data into AccountInfo object.
201  *
202  * @param jsonData JSON data to parse
203  */
204  static AccountInfoPtr fromJSON(const QByteArray &jsonData);
205  private:
206  class Private;
207  Private * const d;
208  friend class Private;
209 
210 };
211 
212 } // namespace KGAPI2
213 
214 #endif // LIBKGAPI2_ACCOUNTINFO_H
Base class for all objects.
Definition: object.h:31
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:16
AccountInfo contains information about user&#39;s Google account.
Definition: accountinfo.h:32
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Mar 8 2021 23:10:40 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.