1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date        : 2018-06-29
7  * Description : a tool to export images to Twitter social network
8  *
9  * Copyright (C) 2018 by Tarek Talaat <tarektalaat93 at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * ============================================================ */
22 
23 #ifndef DIGIKAM_TWITTER_WINDOW_H
24 #define DIGIKAM_TWITTER_WINDOW_H
25 
26 // Qt includes
27 
28 #include <QList>
29 
30 // Local includes
31 
32 #include "dinfointerface.h"
33 #include "wstooldialog.h"
34 
35 using namespace Digikam;
36 
37 class QCloseEvent;
38 class QUrl;
39 
40 namespace DigikamGenericTwitterPlugin
41 {
42 
43 class TwAlbum;
44 
45 class TwWindow : public WSToolDialog
46 {
47     Q_OBJECT
48 
49 public:
50 
51     explicit TwWindow(DInfoInterface* const iface, QWidget* const parent);
52     ~TwWindow()                     override;
53 
54     void reactivate();
55 
56     void setItemsList(const QList<QUrl>& urls);
57 
58 private:
59 
60     void readSettings();
61     void writeSettings();
62 
63     void uploadNextPhoto();
64 
65     void buttonStateChange(bool state);
66     void closeEvent(QCloseEvent*)   override;
67 
68 private Q_SLOTS:
69 
70     void slotImageListChanged();
71     void slotUserChangeRequest();
72     void slotNewAlbumRequest();
73 /*
74     void slotReloadAlbumsRequest();
75 */
76     void slotStartTransfer();
77 
78     void slotBusy(bool);
79     void slotSignalLinkingFailed();
80     void slotSignalLinkingSucceeded();
81     void slotSetUserName(const QString& msg);
82     void slotListAlbumsFailed(const QString& msg);
83     void slotListAlbumsDone(const QList<QPair<QString, QString> >& list);
84     void slotCreateFolderFailed(const QString& msg);
85     void slotCreateFolderSucceeded();
86     void slotAddPhotoFailed(const QString& msg);
87     void slotAddPhotoSucceeded();
88     void slotTransferCancel();
89 
90     void slotFinished();
91 
92 private:
93 
94     class Private;
95     Private* const d;
96 };
97 
98 } // namespace DigikamGenericTwitterPlugin
99 
100 #endif // DIGIKAM_TWITTER_WINDOW_H
101