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

KDE's Doxygen guidelines are available online.