• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

ark

archive.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2007 Henrique Pinto <henrique.pinto@kdemail.net>
00003  *
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions
00006  * are met:
00007  *
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  *
00014  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00015  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00016  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00017  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00018  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
00019  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00020  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
00021  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00022  * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
00023  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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, InternalID = 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, IsPasswordProtected = 15, Custom = 1048576 };
00048 
00049     typedef QHash<int, QVariant> ArchiveEntry;
00050 
00056     typedef QHash<QString, QVariant> CompressionOptions;
00057 
00058     class KERFUFFLE_EXPORT Archive
00059     {
00060         public:
00061 
00062             enum CopyFlag {
00063                 PreservePaths = 0x1,
00064                 TruncateCommonBase = 0x2
00065             };
00066             Q_DECLARE_FLAGS(CopyFlags, CopyFlag)
00067 
00068             virtual ~Archive() {}
00069 
00070             virtual QString fileName() = 0;
00071             virtual bool isReadOnly() = 0;
00072             
00073             virtual KJob*       open() = 0;
00074             virtual KJob*       create() = 0;
00075             virtual ListJob*    list() = 0;
00076             virtual DeleteJob*  deleteFiles( const QList<QVariant> & files ) = 0;
00077 
00090             virtual AddJob*     addFiles( const QStringList & files, const CompressionOptions& options = CompressionOptions()) = 0;
00091 
00092             virtual ExtractJob* copyFiles( const QList<QVariant> & files, const QString & destinationDir, Archive::CopyFlags flags) = 0;
00093 
00094             virtual bool isSingleFolderArchive() = 0;
00095             virtual QString subfolderName() = 0;
00096             virtual bool isPasswordProtected() = 0;
00097 
00098             virtual void setPassword(QString password) = 0;
00099 
00100     };
00101 
00102     Q_DECLARE_OPERATORS_FOR_FLAGS(Archive::CopyFlags)
00103 
00104     KERFUFFLE_EXPORT Archive* factory( const QString & filename, const QString & requestedMimeType = QString() );
00105     KERFUFFLE_EXPORT QStringList supportedMimeTypes();
00106     KERFUFFLE_EXPORT QStringList supportedWriteMimeTypes();
00107 } // namespace Kerfuffle
00108 
00109 
00110 #endif // KERFUFFLE_ARCHIVE_H

ark

Skip menu "ark"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • okteta
  • printer-applet
  • superkaramba
  • sweeper
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal