• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

collectionmodel.h

00001 /*
00002     Copyright (c) 2006 - 2008 Volker Krause <vkrause@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef AKONADI_COLLECTIONMODEL_H
00021 #define AKONADI_COLLECTIONMODEL_H
00022 
00023 #include "akonadi_export.h"
00024 
00025 #include <akonadi/collection.h>
00026 
00027 #include <QtCore/QAbstractItemModel>
00028 
00029 namespace Akonadi {
00030 
00031 class CollectionModelPrivate;
00032 
00053 class AKONADI_EXPORT CollectionModel : public QAbstractItemModel
00054 {
00055   Q_OBJECT
00056 
00057   public:
00061     enum Roles {
00062       CollectionIdRole = Qt::UserRole + 1,  
00063       CollectionRole,                       
00064       UserRole = Qt::UserRole + 42          
00065     };
00066 
00072     explicit CollectionModel( QObject *parent = 0 );
00073 
00077     virtual ~CollectionModel();
00078 
00085     void fetchCollectionStatistics( bool enable );
00086 
00090     void includeUnsubscribed( bool include = true );
00091 
00092     virtual int columnCount( const QModelIndex & parent = QModelIndex() ) const;
00093     virtual QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
00094     virtual QModelIndex index( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
00095     virtual QModelIndex parent( const QModelIndex & index ) const;
00096     virtual int rowCount( const QModelIndex & parent = QModelIndex() ) const;
00097     virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
00098     virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
00099     virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
00100     virtual Qt::DropActions supportedDropActions() const;
00101     virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
00102     virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
00103     virtual QStringList mimeTypes() const;
00104 
00105   protected:
00109     Collection collectionForId( Collection::Id id ) const;
00110 
00111     //@cond PRIVATE
00112     Akonadi::CollectionModelPrivate *d_ptr;
00113     explicit CollectionModel( CollectionModelPrivate *d, QObject *parent = 0 );
00114     //@endcond
00115 
00116   private:
00117     Q_DECLARE_PRIVATE( CollectionModel )
00118 
00119     //@cond PRIVATE
00120     Q_PRIVATE_SLOT( d_func(), void startFirstListJob() )
00121     Q_PRIVATE_SLOT( d_func(), void collectionRemoved( const Akonadi::Collection& ) )
00122     Q_PRIVATE_SLOT( d_func(), void collectionChanged( const Akonadi::Collection& ) )
00123     Q_PRIVATE_SLOT( d_func(), void updateDone( KJob* ) )
00124     Q_PRIVATE_SLOT( d_func(), void collectionStatisticsChanged(
00125                                         Akonadi::Collection::Id,
00126                                         const Akonadi::CollectionStatistics& ) )
00127     Q_PRIVATE_SLOT( d_func(), void listDone( KJob* ) )
00128     Q_PRIVATE_SLOT( d_func(), void editDone( KJob* ) )
00129     Q_PRIVATE_SLOT( d_func(), void dropResult( KJob* ) )
00130     Q_PRIVATE_SLOT( d_func(), void collectionsChanged( const Akonadi::Collection::List& ) )
00131     //@endcond
00132 };
00133 
00134 }
00135 
00136 #endif

akonadi

Skip menu "akonadi"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries 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