digiKam
vkontakte_getphotouploadserverjob.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_GETPHOTOUPLOADSERVERJOB_H
25 #define DIGIKAM_VKONTAKTE_GETPHOTOUPLOADSERVERJOB_H
26 
27 // Local includes
28 
29 #include "vkontakte_jobs.h"
31 
32 namespace Vkontakte
33 {
34 
35 // This class is not exported, so:
36 // - we don't care about ABI of this class (not using Pimpl)
37 // - library's users should use class UploadPhotosJob
38 class GetPhotoUploadServerJob : public VkontakteJob
39 {
40  Q_OBJECT
41 
42 public:
43 
44  GetPhotoUploadServerJob(const QString& accessToken, Vkontakte::UploadPhotosJob::Dest m_dest);
45 
46  void initUploadAlbum(int aid, int gid = -1);
47  QUrl uploadUrl() const;
48 
49 protected:
50 
51  void prepareQueryItems() override;
52  void handleData(const QJsonValue& data) override;
53 
54  static QString getMethod(enum UploadPhotosJob::Dest dest);
55 
56 private:
57 
58  UploadPhotosJob::Dest m_dest;
59  QUrl m_uploadUrl;
60  int m_aid;
61  int m_gid;
62  int m_uid;
63 
64 private:
65 
66  // Disable
67  GetPhotoUploadServerJob(QObject*) = delete;
68 };
69 
70 } // namespace Vkontakte
71 
72 #endif // DIGIKAM_VKONTAKTE_GETPHOTOUPLOADSERVERJOB_H