2
2
* Copyright (c) 2007 Henrique Pinto <henrique.pinto@kdemail.net>
3
3
* Copyright (c) 2008 Harald Hvaal <haraldhv@stud.ntnu.no>
4
* Copyright (c) 2011 Raphael Kubo da Costa <rakuco@FreeBSD.org>
5
6
* Redistribution and use in source and binary forms, with or without
6
7
* modification, are permitted provided that the following conditions
92
virtual QString fileName() const = 0;
93
virtual bool isReadOnly() const = 0;
95
virtual KJob* open() = 0;
96
virtual KJob* create() = 0;
97
virtual ListJob* list() = 0;
98
virtual DeleteJob* deleteFiles(const QList<QVariant> & files) = 0;
93
static Archive *create(const QString &fileName, QObject *parent = 0);
94
static Archive *create(const QString &fileName, const QString &fixedMimeType, QObject *parent = 0);
97
QString fileName() const;
98
bool isReadOnly() const;
103
DeleteJob* deleteFiles(const QList<QVariant> & files);
101
106
* Compression options that should be handled by all interfaces:
109
114
* archive root where the files will be added under
112
virtual AddJob* addFiles(const QStringList & files, const CompressionOptions& options = CompressionOptions()) = 0;
114
virtual ExtractJob* copyFiles(const QList<QVariant> & files, const QString & destinationDir, ExtractionOptions options = ExtractionOptions()) = 0;
116
virtual bool isSingleFolderArchive() = 0;
117
virtual QString subfolderName() = 0;
118
virtual bool isPasswordProtected() = 0;
120
virtual void setPassword(QString password) = 0;
117
AddJob* addFiles(const QStringList & files, const CompressionOptions& options = CompressionOptions());
119
ExtractJob* copyFiles(const QList<QVariant> & files, const QString & destinationDir, ExtractionOptions options = ExtractionOptions());
121
bool isSingleFolderArchive();
122
QString subfolderName();
123
bool isPasswordProtected();
125
void setPassword(const QString &password);
128
void onListFinished(KJob*);
129
void onAddFinished(KJob*);
130
void onUserQuery(Kerfuffle::Query*);
133
Archive(ReadOnlyArchiveInterface *archiveInterface, QObject *parent = 0);
135
void listIfNotListed();
136
ReadOnlyArchiveInterface *m_iface;
137
bool m_hasBeenListed;
138
bool m_isPasswordProtected;
139
bool m_isSingleFolderArchive;
140
QString m_subfolderName;
141
qlonglong m_extractedFilesSize;
124
KERFUFFLE_EXPORT Archive* factory(const QString & filename, const QString & fixedMimeType = QString());
125
144
KERFUFFLE_EXPORT QStringList supportedMimeTypes();
126
145
KERFUFFLE_EXPORT QStringList supportedWriteMimeTypes();
127
146
} // namespace Kerfuffle