File indexing completed on 2024-04-21 16:32:41

0001 /*
0002     SPDX-FileCopyrightText: 2009 Csaba Karai <krusader@users.sourceforge.net>
0003     SPDX-FileCopyrightText: 2009-2022 Krusader Krew <https://krusader.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef PACKJOB_H
0009 #define PACKJOB_H
0010 
0011 // QtCore
0012 #include <QMap>
0013 
0014 #include "abstractthreadedjob.h"
0015 
0016 class PackThread;
0017 class TestArchiveThread;
0018 class UnpackThread;
0019 
0020 class PackJob : public AbstractThreadedJob
0021 {
0022     Q_OBJECT
0023 
0024 private:
0025     PackJob(const QUrl &srcUrl, const QUrl &destUrl, const QStringList &fileNames, const QString &type, const QMap<QString, QString> &packProps);
0026 
0027 public:
0028     static PackJob *
0029     createPacker(const QUrl &srcUrl, const QUrl &destUrl, const QStringList &fileNames, const QString &type, const QMap<QString, QString> &packProps);
0030 };
0031 
0032 class PackThread : public AbstractJobThread
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037     PackThread(const QUrl &srcUrl, const QUrl &destUrl, const QStringList &fileNames, const QString &type, const QMap<QString, QString> &packProps);
0038     ~PackThread() override = default;
0039 
0040 protected slots:
0041     void slotStart() override;
0042 
0043 private:
0044     QUrl _sourceUrl;
0045     QUrl _destUrl;
0046     QStringList _fileNames;
0047     QString _type;
0048     QMap<QString, QString> _packProperties;
0049 };
0050 
0051 class TestArchiveJob : public AbstractThreadedJob
0052 {
0053     Q_OBJECT
0054 
0055 private:
0056     TestArchiveJob(const QUrl &srcUrl, const QStringList &fileNames);
0057 
0058 public:
0059     static TestArchiveJob *testArchives(const QUrl &srcUrl, const QStringList &fileNames);
0060 };
0061 
0062 class TestArchiveThread : public AbstractJobThread
0063 {
0064     Q_OBJECT
0065 
0066 public:
0067     TestArchiveThread(const QUrl &srcUrl, const QStringList &fileNames);
0068     ~TestArchiveThread() override = default;
0069 
0070 protected slots:
0071     void slotStart() override;
0072 
0073 private:
0074     QUrl _sourceUrl;
0075     QStringList _fileNames;
0076 };
0077 
0078 class UnpackJob : public AbstractThreadedJob
0079 {
0080     Q_OBJECT
0081 
0082 private:
0083     UnpackJob(const QUrl &srcUrl, const QUrl &destUrl, const QStringList &fileNames);
0084 
0085 public:
0086     static UnpackJob *createUnpacker(const QUrl &srcUrl, const QUrl &destUrl, const QStringList &fileNames);
0087 };
0088 
0089 class UnpackThread : public AbstractJobThread
0090 {
0091     Q_OBJECT
0092 
0093 public:
0094     UnpackThread(const QUrl &srcUrl, const QUrl &destUrl, const QStringList &fileNames);
0095     ~UnpackThread() override = default;
0096 
0097 protected slots:
0098     void slotStart() override;
0099 
0100 private:
0101     QUrl _sourceUrl;
0102     QUrl _destUrl;
0103     QStringList _fileNames;
0104 };
0105 
0106 #endif // __PACK_JOB_H__