File indexing completed on 2025-01-05 03:53:35
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2012-02-12 0007 * Description : a tool to export images to IPFS web service 0008 * 0009 * SPDX-FileCopyrightText: 2018 by Amar Lakshya <amar dot lakshya at xaviers dot edu dot in> 0010 * SPDX-FileCopyrightText: 2018-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_IPFS_WINDOW_H 0017 #define DIGIKAM_IPFS_WINDOW_H 0018 0019 // Qt includes 0020 0021 #include <QObject> 0022 #include <QLabel> 0023 0024 // Local includes 0025 0026 #include "ipfsimageslist.h" 0027 #include "ipfstalker.h" 0028 #include "wstooldialog.h" 0029 #include "dinfointerface.h" 0030 0031 using namespace Digikam; 0032 0033 namespace DigikamGenericIpfsPlugin 0034 { 0035 0036 class IpfsWindow : public WSToolDialog 0037 { 0038 Q_OBJECT 0039 0040 public: 0041 0042 explicit IpfsWindow(DInfoInterface* const iface, QWidget* const parent = nullptr); 0043 ~IpfsWindow() override; 0044 0045 void reactivate(); 0046 0047 public Q_SLOTS: 0048 0049 // UI callbacks 0050 0051 void slotUpload(); 0052 void slotFinished(); 0053 void slotCancel(); 0054 0055 // IpfsTalker callbacks 0056 0057 /* 0058 void apiAuthorized(bool success, const QString& username); 0059 void apiAuthError(const QString& msg); 0060 */ 0061 void apiProgress(unsigned int percent, const IpfsTalkerAction& action); 0062 void apiRequestPin(const QUrl& url); 0063 void apiSuccess(const IpfsTalkerResult& result); 0064 void apiError(const QString& msg, const IpfsTalkerAction& action); 0065 void apiBusy(bool busy); 0066 0067 private: 0068 0069 void closeEvent(QCloseEvent* e) override; 0070 void setContinueUpload(bool state); 0071 void readSettings(); 0072 void saveSettings(); 0073 0074 private: 0075 0076 class Private; 0077 Private* const d; 0078 }; 0079 0080 } // namespace DigikamGenericIpfsPlugin 0081 0082 #endif // DIGIKAM_IPFS_WINDOW_H