digiKam
imgurwindow.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 : 2012-02-12
7  * Description : a tool to export images to Imgur web service
8  *
9  * Copyright (C) 2010-2012 by Marius Orcsik <marius at habarnam dot ro>
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_IMGUR_WINDOW_H
25 #define DIGIKAM_IMGUR_WINDOW_H
26 
27 // Qt includes
28 
29 #include <QObject>
30 #include <QLabel>
31 #include <QList>
32 #include <QUrl>
33 
34 // Local includes
35 
36 #include "imgurimageslist.h"
37 #include "wstooldialog.h"
38 #include "imgurtalker.h"
39 #include "dinfointerface.h"
40 
41 using namespace Digikam;
42 
44 {
45 
46 class ImgurWindow : public WSToolDialog
47 {
48  Q_OBJECT
49 
50 public:
51 
52  explicit ImgurWindow(DInfoInterface* const iface, QWidget* const parent = nullptr);
53  ~ImgurWindow() override;
54 
55 public:
56 
57  void reactivate();
58 
59  void setItemsList(const QList<QUrl>& urls);
60 
61 public Q_SLOTS:
62 
63  // UI callbacks
64 
65  void slotForgetButtonClicked();
66  void slotUpload();
67  void slotAnonUpload();
68  void slotFinished();
69  void slotCancel();
70 
71  // ImgurTalker callbacks
72 
73  void slotApiAuthorized(bool success, const QString& username);
74  void slotApiAuthError(const QString& msg);
75  void slotApiProgress(unsigned int percent, const ImgurTalkerAction& action);
76  void slotApiRequestPin(const QUrl& url);
77  void slotApiSuccess(const ImgurTalkerResult& result);
78  void slotApiError(const QString& msg, const ImgurTalkerAction& action);
79  void slotApiBusy(bool busy);
80 
81 private:
82 
83  void closeEvent(QCloseEvent* e) override;
84  void setContinueUpload(bool state);
85  void readSettings();
86  void saveSettings();
87 
88 private:
89 
90  class Private;
91  Private* const d;
92 };
93 
94 } // namespace DigikamGenericImgUrPlugin
95 
96 #endif // DIGIKAM_IMGUR_WINDOW_H
Definition: imgurwindow.h:47
Definition: dinfointerface.h:56
Definition: wstooldialog.h:43
Definition: imgurimageslist.cpp:47
Definition: datefolderview.cpp:43