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        : 2013-11-18
0007  * Description : a tool to export images to Dropbox web service
0008  *
0009  * SPDX-FileCopyrightText: 2013      by Pankaj Kumar <me at panks dot me>
0010  * SPDX-FileCopyrightText: 2013-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_DB_WINDOW_H
0017 #define DIGIKAM_DB_WINDOW_H
0018 
0019 // Qt includes
0020 
0021 #include <QList>
0022 #include <QUrl>
0023 #include <QPair>
0024 
0025 // Local includes
0026 
0027 #include "wstooldialog.h"
0028 #include "dinfointerface.h"
0029 
0030 class QCloseEvent;
0031 
0032 using namespace Digikam;
0033 
0034 namespace DigikamGenericDropBoxPlugin
0035 {
0036 
0037 class DBWindow : public WSToolDialog
0038 {
0039     Q_OBJECT
0040 
0041 public:
0042 
0043     explicit DBWindow(DInfoInterface* const iface, QWidget* const parent);
0044     ~DBWindow() override;
0045 
0046     void reactivate();
0047 
0048     void setItemsList(const QList<QUrl>& urls);
0049 
0050 private:
0051 
0052     void readSettings();
0053     void writeSettings();
0054 
0055     void uploadNextPhoto();
0056 
0057     void buttonStateChange(bool state);
0058     void closeEvent(QCloseEvent*) override;
0059 
0060 private Q_SLOTS:
0061 
0062     void slotImageListChanged();
0063     void slotUserChangeRequest();
0064     void slotNewAlbumRequest();
0065     void slotReloadAlbumsRequest();
0066     void slotStartTransfer();
0067 
0068     void slotBusy(bool);
0069     void slotSignalLinkingFailed();
0070     void slotSignalLinkingSucceeded();
0071     void slotSetUserName(const QString& msg);
0072     void slotListAlbumsFailed(const QString& msg);
0073     void slotListAlbumsDone(const QList<QPair<QString, QString> >& list);
0074     void slotCreateFolderFailed(const QString& msg);
0075     void slotCreateFolderSucceeded();
0076     void slotAddPhotoFailed(const QString& msg);
0077     void slotAddPhotoSucceeded();
0078     void slotTransferCancel();
0079 
0080     void slotFinished();
0081 
0082 private:
0083 
0084     class Private;
0085     Private* const d;
0086 };
0087 
0088 } // namespace DigikamGenericDropBoxPlugin
0089 
0090 #endif // DIGIKAM_DB_WINDOW_H