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

ark

jobs.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 JOBS_H
00026 #define JOBS_H
00027 
00028 #include "kerfuffle_export.h"
00029 #include "archiveinterface.h"
00030 #include "archive.h"
00031 #include "queries.h"
00032 
00033 #include <KJob>
00034 #include <QList>
00035 #include <QVariant>
00036 #include <QString>
00037 
00038 namespace ThreadWeaver
00039 {
00040     class Job;
00041 } // namespace ThreadWeaver
00042 
00043 namespace Kerfuffle
00044 {
00045     class KERFUFFLE_EXPORT ListJob: public KJob
00046     {
00047         Q_OBJECT
00048         public:
00049             explicit ListJob( ReadOnlyArchiveInterface *interface, QObject *parent = 0 );
00050 
00051             void start();
00052             bool isSingleFolderArchive() { return m_isSingleFolderArchive; }
00053             bool isPasswordProtected() { return m_isPasswordProtected; }
00054             QString subfolderName() { return m_subfolderName; }
00055             qlonglong extractedFilesSize() { return m_extractedFilesSize; }
00056 
00057         signals:
00058             void newEntry( const ArchiveEntry & );
00059             void error( const QString& errorMessage, const QString& details );
00060 
00061         private slots:
00062             void done( ThreadWeaver::Job* );
00063             void progress( double );
00064             void onNewEntry(const ArchiveEntry&);
00065             void onError(const QString& errorMessage, const QString& details);
00066 
00067         private:
00068             ReadOnlyArchiveInterface *m_archive;
00069             bool m_isSingleFolderArchive;
00070             bool m_isPasswordProtected;
00071             QString m_subfolderName;
00072             QString m_previousEntry;
00073             qlonglong m_extractedFilesSize;
00074     };
00075 
00076     class KERFUFFLE_EXPORT ExtractJob: public KJob
00077     {
00078         Q_OBJECT
00079         public:
00080             ExtractJob( const QList<QVariant> & files, const QString& destinationDir, Archive::CopyFlags flags, ReadOnlyArchiveInterface *interface, QObject *parent = 0 );
00081 
00082             void start();
00083 
00084         signals:
00085             void userQuery( Query* );
00086 
00087         private slots:
00088             void done( ThreadWeaver::Job * );
00089             void progress( double );
00090             void error( const QString&, const QString& );
00091 
00092         private:
00093             QList<QVariant>           m_files;
00094             QString                   m_destinationDir;
00095             Archive::CopyFlags m_flags;
00096             ReadOnlyArchiveInterface *m_archive;
00097     };
00098 
00099     class KERFUFFLE_EXPORT AddJob: public KJob
00100     {
00101         Q_OBJECT
00102         public:
00103             AddJob(const QString& path, const QStringList & files, ReadWriteArchiveInterface *interface, QObject *parent = 0 );
00104 
00105             void start();
00106 
00107         signals:
00108             void newEntry( const ArchiveEntry & );
00109             void userQuery( Query* );
00110 
00111         private slots:
00112             void done( ThreadWeaver::Job * );
00113             void progress( double );
00114             void error( const QString&, const QString& );
00115 
00116         private:
00117             QStringList                m_files;
00118             QString                 m_path;
00119             ReadWriteArchiveInterface *m_archive;
00120 
00121     };
00122 
00123     class KERFUFFLE_EXPORT DeleteJob: public KJob
00124     {
00125         Q_OBJECT
00126         public:
00127             DeleteJob( const QList<QVariant>& files, ReadWriteArchiveInterface *interface, QObject *parent = 0 );
00128 
00129             void start();
00130 
00131         signals:
00132             void entryRemoved( const QString & entry );
00133             void error( const QString& errorMessage, const QString& details );
00134             void userQuery( Query* );
00135 
00136         private slots:
00137             void done( ThreadWeaver::Job * );
00138             void progress( double );
00139 
00140         private:
00141             QList<QVariant>            m_files;
00142             ReadWriteArchiveInterface *m_archive;
00143     };
00144 } // namespace Kerfuffle
00145 
00146 #endif // JOBS_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