ark
archivebase.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ARCHIVEBASE_H
00027 #define ARCHIVEBASE_H
00028
00029 #include "archive.h"
00030 #include "archiveinterface.h"
00031 #include "jobs.h"
00032 #include "kerfuffle_export.h"
00033
00034 namespace ThreadWeaver
00035 {
00036 class Job;
00037 }
00038
00039 namespace Kerfuffle
00040 {
00041 class KERFUFFLE_EXPORT ArchiveBase: public QObject, public Archive
00042 {
00043 Q_OBJECT
00044 public:
00045
00046
00047
00048
00049
00050 ArchiveBase( ReadOnlyArchiveInterface *archive );
00051 virtual ~ArchiveBase();
00052
00053 virtual KJob* open();
00054 virtual KJob* create();
00055 virtual ListJob* list();
00056 virtual DeleteJob* deleteFiles( const QList<QVariant> & files );
00057 virtual AddJob* addFiles( const QStringList & files, const CompressionOptions& options = CompressionOptions() );
00058 virtual ExtractJob* copyFiles( const QList<QVariant> & files, const QString & destinationDir, Archive::CopyFlags flags );
00059
00060 virtual bool isReadOnly();
00061 virtual QString fileName();
00062
00063 virtual bool isSingleFolderArchive();
00064 virtual QString subfolderName();
00065 virtual bool isPasswordProtected();
00066
00067 virtual void setPassword(QString password);
00068
00069 private slots:
00070 void onListFinished(KJob*);
00071
00072 private:
00073 void listIfNotListed();
00074 ReadOnlyArchiveInterface *m_iface;
00075 bool m_hasBeenListed;
00076 bool m_isSingleFolderArchive;
00077 bool m_isPasswordProtected;
00078 QString m_subfolderName;
00079 qlonglong m_extractedFilesSize;
00080
00081 };
00082 }
00083
00084 #endif // ARCHIVEBASE_H