File indexing completed on 2025-01-05 03:53:24

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2018-05-20
0007  * Description : a tool to export images to Box web service
0008  *
0009  * SPDX-FileCopyrightText: 2018      by Tarek Talaat <tarektalaat93 at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_BOX_WINDOW_H
0016 #define DIGIKAM_BOX_WINDOW_H
0017 
0018 // Qt includes
0019 
0020 #include <QList>
0021 #include <QUrl>
0022 #include <QPair>
0023 
0024 // Local includes
0025 
0026 #include "wstooldialog.h"
0027 #include "dinfointerface.h"
0028 
0029 class QCloseEvent;
0030 
0031 using namespace Digikam;
0032 
0033 namespace DigikamGenericBoxPlugin
0034 {
0035 
0036 class BOXWindow : public WSToolDialog
0037 {
0038     Q_OBJECT
0039 
0040 public:
0041 
0042     explicit BOXWindow(DInfoInterface* const iface, QWidget* const parent);
0043     ~BOXWindow() override;
0044 
0045     void reactivate();
0046 
0047     void setItemsList(const QList<QUrl>& urls);
0048 
0049 private:
0050 
0051     void readSettings();
0052     void writeSettings();
0053 
0054     void uploadNextPhoto();
0055 
0056     void buttonStateChange(bool state);
0057     void closeEvent(QCloseEvent*) override;
0058 
0059 private Q_SLOTS:
0060 
0061     void slotImageListChanged();
0062     void slotUserChangeRequest();
0063     void slotNewAlbumRequest();
0064     void slotReloadAlbumsRequest();
0065     void slotStartTransfer();
0066 
0067     void slotBusy(bool);
0068     void slotSignalLinkingFailed();
0069     void slotSignalLinkingSucceeded();
0070     void slotSetUserName(const QString& msg);
0071     void slotListAlbumsFailed(const QString& msg);
0072     void slotListAlbumsDone(const QList<QPair<QString, QString> >& list);
0073     void slotCreateFolderFailed(const QString& msg);
0074     void slotCreateFolderSucceeded();
0075     void slotAddPhotoFailed(const QString& msg);
0076     void slotAddPhotoSucceeded();
0077     void slotTransferCancel();
0078 
0079     void slotFinished();
0080 
0081 private:
0082 
0083     class Private;
0084     Private* const d;
0085 };
0086 
0087 } // namespace DigikamGenericBoxPlugin
0088 
0089 #endif // DIGIKAM_BOX_WINDOW_H