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

ark

archivemodel.h

Go to the documentation of this file.
00001 /*
00002  * ark -- archiver for the KDE project
00003  *
00004  * Copyright (C) 2007 Henrique Pinto <henrique.pinto@kdemail.net>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  *
00020  */
00021 #ifndef ARCHIVEMODEL_H
00022 #define ARCHIVEMODEL_H
00023 
00024 #include <QAbstractItemModel>
00025 #include <kjobtrackerinterface.h>
00026 #include "kerfuffle/archive.h"
00027 
00028 class ArchiveNode;
00029 class ArchiveDirNode;
00030 
00031 using namespace Kerfuffle;
00032 
00033 class ArchiveModel: public QAbstractItemModel
00034 {
00035     Q_OBJECT
00036     public:
00037         ArchiveModel( QObject *parent = 0 );
00038         ~ArchiveModel();
00039 
00040         QVariant data( const QModelIndex &index, int role ) const;
00041         Qt::ItemFlags flags( const QModelIndex &index ) const;
00042         QVariant headerData( int section, Qt::Orientation orientation,
00043                              int role = Qt::DisplayRole ) const;
00044         QModelIndex index( int row, int column,
00045                            const QModelIndex &parent = QModelIndex() ) const;
00046         QModelIndex parent( const QModelIndex &index ) const;
00047         int rowCount( const QModelIndex &parent = QModelIndex() ) const;
00048         int columnCount( const QModelIndex &parent = QModelIndex() ) const;
00049 
00050         void setArchive( Kerfuffle::Archive *archive );
00051         Kerfuffle::Archive *archive() const { return m_archive; }
00052 
00053         ArchiveEntry entryForIndex( const QModelIndex &index );
00054         int childCount( const QModelIndex &index );
00055 
00056         ExtractJob* extractFile( const QVariant& fileName, const QString & destinationDir, bool preservePaths = false );
00057         ExtractJob* extractFiles( const QList<QVariant>& files, const QString & destinationDir, bool preservePaths = false );
00058 
00059         AddJob* addFiles( const QStringList & paths );
00060         DeleteJob* deleteFiles( const QList<QVariant> & files );
00061 
00062         void setJobTracker( KJobTrackerInterface *tracker ) { m_jobTracker = tracker; }
00063 
00064     signals:
00065         void loadingStarted();
00066         void loadingFinished();
00067         void extractionFinished( bool success );
00068         void error( const QString& error, const QString& details );
00069 
00070     private slots:
00071         void slotNewEntry( const ArchiveEntry& entry );
00072         void slotEntryRemoved( const QString & path );
00073 
00074     private:
00075         ArchiveDirNode* parentFor( const ArchiveEntry& entry );
00076         QModelIndex indexForNode( ArchiveNode *node );
00077 
00078         Kerfuffle::Archive *m_archive;
00079         ArchiveDirNode *m_rootNode;
00080         KJobTrackerInterface *m_jobTracker;
00081 };
00082 
00083 #endif // ARCHIVEMODEL_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
  • kdelirc
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • kjots
  • klaptopdaemon
  • kmilo
  • ksim
  • ktimer
  • kwallet
  • superkaramba
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