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

kget

chunkdownloadmodel.h

Go to the documentation of this file.
00001 
00003 /***************************************************************************
00004  *   Copyright (C) 2007 by Joris Guisson and Ivan Vasic                    *
00005  *   joris.guisson@gmail.com                                               *
00006  *   ivasic@gmail.com                                                      *
00007  *                                                                         *
00008  *   This program is free software; you can redistribute it and/or modify  *
00009  *   it under the terms of the GNU General Public License as published by  *
00010  *   the Free Software Foundation; either version 2 of the License, or     *
00011  *   (at your option) any later version.                                   *
00012  *                                                                         *
00013  *   This program is distributed in the hope that it will be useful,       *
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00016  *   GNU General Public License for more details.                          *
00017  *                                                                         *
00018  *   You should have received a copy of the GNU General Public License     *
00019  *   along with this program; if not, write to the                         *
00020  *   Free Software Foundation, Inc.,                                       *
00021  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
00022  ***************************************************************************/
00023 #ifndef KTCHUNKDOWNLOADMODEL_H
00024 #define KTCHUNKDOWNLOADMODEL_H
00025 
00026 #include <QAbstractTableModel>
00027 #include <interfaces/chunkdownloadinterface.h>
00028 
00029 
00030 namespace bt
00031 {
00032     class TorrentInterface;
00033 }
00034 
00035 namespace kt
00036 {
00037 
00041     class ChunkDownloadModel : public QAbstractTableModel
00042     {           
00043         Q_OBJECT
00044     public:
00045         ChunkDownloadModel(QObject* parent);
00046         virtual ~ChunkDownloadModel();
00047 
00049         void downloadAdded(bt::ChunkDownloadInterface* cd);
00050 
00052         void downloadRemoved(bt::ChunkDownloadInterface* cd);
00053         
00055         void changeTC(bt::TorrentInterface* tc);
00056         
00057         void update();
00058         
00059         void clear();
00060 
00061         virtual int rowCount(const QModelIndex & parent) const;
00062         virtual int columnCount(const QModelIndex & parent) const;
00063         virtual QVariant headerData(int section, Qt::Orientation orientation,int role) const;
00064         virtual QVariant data(const QModelIndex & index,int role) const;
00065         virtual bool removeRows(int row,int count,const QModelIndex & parent);
00066         virtual bool insertRows(int row,int count,const QModelIndex & parent);
00067     private:
00068         struct Item
00069         {
00070             mutable bt::ChunkDownloadInterface::Stats stats;
00071             bt::ChunkDownloadInterface* cd;
00072             QString files;
00073             
00074             Item(bt::ChunkDownloadInterface* cd,const QString & files);
00075             
00076             bool changed() const;
00077             QVariant data(int col) const;
00078             QVariant dataForSorting(int col) const;
00079         };
00080         
00081         QList<Item> items;
00082         bt::TorrentInterface* tc;
00083     };
00084 
00085 }
00086 
00087 #endif

kget

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

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork 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