digiKam
vkontakte_userinfojob.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_USERINFOJOB_H
25 #define DIGIKAM_VKONTAKTE_USERINFOJOB_H
26 
27 // Qt includes
28 
29 #include <QStringList>
30 #include <QJsonDocument>
31 #include <QJsonObject>
32 
33 // Local includes
34 
35 #include "vkontakte_jobs.h"
36 #include "vkontakte_userinfo.h"
37 
38 namespace Vkontakte
39 {
40 
46 // TODO: support working with more than 1000 users
47 class UserInfoJob : public VkontakteJob
48 {
49  Q_OBJECT
50 
51 public:
52 
57  explicit UserInfoJob(const QString& accessToken);
58 
64  UserInfoJob(const QString& accessToken, int uid);
65 
66  UserInfoJob(const QString& accessToken, const QList<int>& uids);
67  ~UserInfoJob() override;
68 
72  QList<UserInfo> userInfo() const;
73 
74  void setFields(const QStringList& fields);
75 
76 protected:
77 
82  void handleData(const QJsonValue& data) override;
83 
87  void prepareQueryItems() override;
88 
89 private:
90 
91  // Disable
92  UserInfoJob(QObject*) = delete;
93 
94 private:
95 
96  class Private;
97  Private* const d;
98 };
99 
100 } // namespace Vkontakte
101 
102 #endif // DIGIKAM_VKONTAKTE_USERINFOJOB_H