File indexing completed on 2024-05-05 04:22:01
0001 // SPDX-FileCopyrightText: 2003-2022 Jesper K. Pedersen <blackie@kde.org> 0002 // 0003 // SPDX-License-Identifier: GPL-2.0-or-later 0004 0005 #ifndef IMPORTEXPORT_IMPORT_H 0006 #define IMPORTEXPORT_IMPORT_H 0007 0008 #include <QObject> 0009 #include <QUrl> 0010 0011 class QTemporaryFile; 0012 0013 class KJob; 0014 namespace KIO 0015 { 0016 class Job; 0017 } 0018 0019 namespace ImportExport 0020 { 0021 0022 class Import : public QObject 0023 { 0024 Q_OBJECT 0025 0026 public: 0027 static void imageImport(); 0028 static void imageImport(const QUrl &url); 0029 0030 private Q_SLOTS: 0031 void downloadKimJobCompleted(KJob *); 0032 void data(KIO::Job *, const QByteArray &); 0033 0034 private: 0035 void exec(const QString &fileName); 0036 void downloadUrl(const QUrl &url); 0037 0038 private: 0039 Import(); 0040 ~Import() override; 0041 QTemporaryFile *m_tmp; 0042 QUrl m_kimFileUrl; 0043 }; 0044 0045 } 0046 0047 #endif // IMPORTEXPORT_IMPORT_H 0048 0049 // vi:expandtab:tabstop=4 shiftwidth=4: