digiKam
gdtalker.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 : 2013-11-18
7  * Description : a tool to export items to Google web services
8  *
9  * Copyright (C) 2013 by Pankaj Kumar <me at panks dot me>
10  * Copyright (C) 2013-2020 by Caulier Gilles <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_GD_TALKER_H
25 #define DIGIKAM_GD_TALKER_H
26 
27 // Qt includes
28 
29 #include <QList>
30 #include <QString>
31 #include <QObject>
32 #include <QStringList>
33 
34 // Local includes
35 
36 #include "gsitem.h"
37 #include "gstalkerbase.h"
38 
40 {
41 
42 class GDTalker : public GSTalkerBase
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit GDTalker(QWidget* const parent);
49  ~GDTalker() override;
50 
51 public:
52 
53  void getUserName();
54  void listFolders();
55  void createFolder(const QString& title, const QString& id);
56  bool addPhoto(const QString& imgPath,
57  const GSPhoto& info,
58  const QString& id,
59  bool original,
60  bool rescale,
61  int maxDim,
62  int imageQuality);
63  void cancel();
64 
65 Q_SIGNALS:
66 
67  void signalListAlbumsDone(int, const QString&, const QList <GSFolder>&);
68  void signalCreateFolderDone(int,const QString& msg);
69  void signalSetUserName(const QString& msg);
70  void signalAddPhotoDone(int,const QString& msg);
72  void signalUploadPhotoDone(int, const QString&, const QStringList&);
73 
74 private Q_SLOTS:
75 
76  void slotFinished(QNetworkReply* reply);
77  void slotUploadPhoto();
78 
79 private:
80 
81  void parseResponseListFolders(const QByteArray& data);
82  void parseResponseCreateFolder(const QByteArray& data);
83  void parseResponseAddPhoto(const QByteArray& data);
84  void parseResponseUserName(const QByteArray& data);
85 
86 private:
87 
88  class Private;
89  Private* const d;
90 };
91 
92 } // namespace DigikamGenericGoogleServicesPlugin
93 
94 #endif // DIGIKAM_GD_TALKER_H
void signalUploadPhotoDone(int, const QString &, const QStringList &)
GDTalker(QWidget *const parent)
Definition: gdtalker.cpp:113
void signalSetUserName(const QString &msg)
void signalListAlbumsDone(int, const QString &, const QList< GSFolder > &)
~GDTalker() override
Definition: gdtalker.cpp:126
void getUserName()
Definition: gdtalker.cpp:141
void createFolder(const QString &title, const QString &id)
Definition: gdtalker.cpp:180
void signalCreateFolderDone(int, const QString &msg)
bool addPhoto(const QString &imgPath, const GSPhoto &info, const QString &id, bool original, bool rescale, int maxDim, int imageQuality)
Definition: gdtalker.cpp:213
void signalAddPhotoDone(int, const QString &msg)
void listFolders()
Definition: gdtalker.cpp:159
void cancel()
Definition: gdtalker.cpp:485
Definition: piwigotalker.h:48
Definition: gdmpform.cpp:46