digiKam
vkontakte_userinfo.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2011-02-19
7  * Description : a tool to export images to VKontakte web service
8  *
9  * Copyright (C) 2011-2015 by Alexander Potashev <aspotashev at gmail dot com>
10  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_VKONTAKTE_USERINFO_H
25 #define DIGIKAM_VKONTAKTE_USERINFO_H
26 
27 // Qt includes
28 
29 #include <QMetaType>
30 #include <QJsonObject>
31 #include <QSharedDataPointer>
32 
33 namespace Vkontakte
34 {
35 
36 // https://vk.com/dev/fields
37 class UserInfo
38 {
39 public:
40 
41  enum
42  {
43  INVALID_TIMEZONE = 42
44  };
45 
46 public:
47 
48  UserInfo();
49  UserInfo(const UserInfo& other);
50  explicit UserInfo(const QJsonObject& jsonData);
51  ~UserInfo();
52 
53  UserInfo &operator=(const UserInfo& other);
54 
63  int userId() const;
64 
73  QString firstName() const;
74 
83  QString lastName() const;
84 
85  QString nickName() const;
86  QString domain() const;
87 
88  int sex() const;
89 
90  bool online() const;
91 
98  static QStringList allQueryFields();
99 
100 private:
101 
102  class Private;
103  QSharedDataPointer<Private> d;
104 };
105 
106 } // namespace Vkontakte
107 
108 Q_DECLARE_METATYPE(Vkontakte::UserInfo)
109 
110 #endif // DIGIKAM_VKONTAKTE_USERINFO_H