ark
archive.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 #ifndef KERFUFFLE_ARCHIVE_H
00026 #define KERFUFFLE_ARCHIVE_H
00027
00028 #include "kerfuffle_export.h"
00029
00030 #include <QString>
00031 #include <QStringList>
00032 #include <QHash>
00033
00034 #include <KUrl>
00035
00036 class KJob;
00037
00038 namespace Kerfuffle
00039 {
00040 class ListJob;
00041 class ExtractJob;
00042 class DeleteJob;
00043 class AddJob;
00044
00045 enum EntryMetaDataType { FileName = 0, OriginalFileName = 1, Permissions = 2, Owner = 3,
00046 Group = 4, Size = 5, CompressedSize = 6, Link = 7, Ratio = 8,
00047 CRC = 9, Method = 10, Version = 11, Timestamp = 12, IsDirectory = 13, Comment = 14, Custom = 1048576 };
00048
00049 typedef QHash<int, QVariant> ArchiveEntry;
00050
00051 class KERFUFFLE_EXPORT Archive
00052 {
00053 public:
00054 virtual ~Archive() {}
00055
00056 virtual QString fileName() = 0;
00057 virtual bool isReadOnly() = 0;
00058
00059 virtual KJob* open() = 0;
00060 virtual KJob* create() = 0;
00061 virtual ListJob* list() = 0;
00062 virtual DeleteJob* deleteFiles( const QList<QVariant> & files ) = 0;
00063 virtual AddJob* addFiles( const QStringList & files ) = 0;
00064 virtual ExtractJob* copyFiles( const QList<QVariant> & files, const QString & destinationDir, bool preservePaths = false ) = 0;
00065 };
00066
00067 KERFUFFLE_EXPORT Archive* factory( const QString & filename, const QString & requestedMimeType = QString() );
00068 KERFUFFLE_EXPORT QStringList supportedMimeTypes();
00069 KERFUFFLE_EXPORT QStringList supportedWriteMimeTypes();
00070 }
00071
00072
00073 #endif // KERFUFFLE_ARCHIVE_H