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

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2010-02-15
0007  * Description : a tool to export items to Google web services
0008  *
0009  * SPDX-FileCopyrightText: 2010      by Jens Mueller <tschenser at gmx dot de>
0010  * SPDX-FileCopyrightText: 2013-2020 by Caulier Gilles <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_GS_REPLACE_DLG_H
0017 #define DIGIKAM_GS_REPLACE_DLG_H
0018 
0019 // Qt includes
0020 
0021 #include <QDialog>
0022 #include <QString>
0023 #include <QUrl>
0024 #include <QNetworkReply>
0025 
0026 // Local includes
0027 
0028 #include "dinfointerface.h"
0029 #include "thumbnailloadthread.h"
0030 
0031 using namespace Digikam;
0032 
0033 namespace DigikamGenericGoogleServicesPlugin
0034 {
0035 
0036 enum ReplaceDialog_Result
0037 {
0038     PWR_CANCEL      = 0,
0039     PWR_ADD         = 1,
0040     PWR_ADD_ALL     = 2,
0041     PWR_REPLACE     = 3,
0042     PWR_REPLACE_ALL = 4
0043 };
0044 
0045 class ReplaceDialog : public QDialog
0046 {
0047     Q_OBJECT
0048 
0049 public:
0050 
0051     ReplaceDialog(QWidget* const parent,
0052                   const QString& caption,
0053                   DInfoInterface* const iface,
0054                   const QUrl& src,
0055                   const QUrl& dest);
0056     ~ReplaceDialog() override;
0057 
0058     int getResult();
0059 
0060 public Q_SLOTS:
0061 
0062     void cancelPressed();
0063     void addPressed();
0064     void addAllPressed();
0065     void replacePressed();
0066     void replaceAllPressed();
0067 
0068 private Q_SLOTS:
0069 
0070     void slotFinished(QNetworkReply* reply);
0071     void slotThumbnail(const LoadingDescription&, const QPixmap&);
0072     void slotProgressTimerDone();
0073 
0074 private:
0075 
0076     QPixmap setProgressAnimation(const QPixmap& thumb, const QPixmap& pix);
0077 
0078 private:
0079 
0080     class Private;
0081     Private* const d;
0082 };
0083 
0084 } // namespace DigikamGenericGoogleServicesPlugin
0085 
0086 #endif // DIGIKAM_GS_REPLACE_DLG_H