File indexing completed on 2025-01-19 03:52:59

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2005-17-06
0007  * Description : a tool to export images to Flickr web service
0008  *
0009  * SPDX-FileCopyrightText: 2005-2008 by Vardhman Jain <vardhman at gmail dot com>
0010  * SPDX-FileCopyrightText: 2008-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_FLICKR_WINDOW_H
0017 #define DIGIKAM_FLICKR_WINDOW_H
0018 
0019 // Qt includes
0020 
0021 #include <QUrl>
0022 #include <QHash>
0023 #include <QList>
0024 #include <QPair>
0025 #include <QLabel>
0026 #include <QDialog>
0027 #include <QLineEdit>
0028 #include <QComboBox>
0029 
0030 // Local includes
0031 
0032 #include "wscomboboxintermediate.h"
0033 #include "dinfointerface.h"
0034 #include "wstooldialog.h"
0035 
0036 using namespace Digikam;
0037 
0038 namespace DigikamGenericFlickrPlugin
0039 {
0040 
0041 class FlickrWindow : public WSToolDialog
0042 {
0043     Q_OBJECT
0044 
0045 public:
0046 
0047     explicit FlickrWindow(DInfoInterface* const iface,
0048                           QWidget* const parent,
0049                           const QString& serviceName = QLatin1String("Flickr"));
0050     ~FlickrWindow()                                                   override;
0051 
0052     /**
0053      * Use this method to (re-)activate the dialog after it has been created
0054      * to display it. This also loads the currently selected images.
0055      */
0056     void reactivate();
0057 
0058     void setItemsList(const QList<QUrl>& urls);
0059 
0060 private Q_SLOTS:
0061 
0062     void slotLinkingSucceeded();
0063     void slotBusy(bool val);
0064     void slotError(const QString& msg);
0065     void slotFinished();
0066     void slotUser1();
0067     void slotCancelClicked();
0068 
0069     void slotCreateNewPhotoSet();
0070     void slotUserChangeRequest();
0071     void slotRemoveAccount();
0072     void slotPopulatePhotoSetComboBox();
0073     void slotAddPhotoNext();
0074     void slotAddPhotoSucceeded(const QString& photoId);
0075     void slotAddPhotoFailed(const QString& msg);
0076     void slotAddPhotoSetSucceeded();
0077     void slotListPhotoSetsFailed(const QString& msg);
0078     void slotAddPhotoCancelAndClose();
0079     void slotAuthCancel();
0080     void slotImageListChanged();
0081     void slotReloadPhotoSetRequest();
0082 
0083 private:
0084 
0085     QString guessSensibleSetName(const QList<QUrl>& urlList)    const;
0086 
0087     void closeEvent(QCloseEvent*)                                     override;
0088     void readSettings(const QString& uname);
0089     void writeSettings();
0090 
0091     void setUiInProgressState(bool inProgress);
0092 
0093 private:
0094 
0095     class Private;
0096     Private* const d;
0097 };
0098 
0099 } // namespace DigikamGenericFlickrPlugin
0100 
0101 #endif // DIGIKAM_FLICKR_WINDOW_H