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 00054 class AKONADI_EXPORT_DEPRECATED CollectionModel : public QAbstractItemModel 00055 { 00056 Q_OBJECT 00057 00058 public: 00062 enum Roles { 00063 OldCollectionIdRole = Qt::UserRole + 1, 00064 OldCollectionRole = Qt::UserRole + 2, 00065 CollectionIdRole = Qt::UserRole + 10, 00066 CollectionRole = Qt::UserRole + 11, 00067 UserRole = Qt::UserRole + 42 00068 }; 00069 00075 explicit CollectionModel( QObject *parent = 0 ); 00076 00080 virtual ~CollectionModel(); 00081 00088 void fetchCollectionStatistics( bool enable ); 00089 00093 void includeUnsubscribed( bool include = true ); 00094 00095 virtual int columnCount( const QModelIndex & parent = QModelIndex() ) const; 00096 virtual QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const; 00097 virtual QModelIndex index( int row, int column, const QModelIndex & parent = QModelIndex() ) const; 00098 virtual QModelIndex parent( const QModelIndex & index ) const; 00099 virtual int rowCount( const QModelIndex & parent = QModelIndex() ) const; 00100 virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; 00101 virtual bool setHeaderData( int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole ); 00102 virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole ); 00103 virtual Qt::ItemFlags flags( const QModelIndex &index ) const; 00104 virtual Qt::DropActions supportedDropActions() const; 00105 virtual QMimeData *mimeData( const QModelIndexList &indexes ) const; 00106 virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ); 00107 virtual QStringList mimeTypes() const; 00108 00109 protected: 00113 Collection collectionForId( Collection::Id id ) const; 00114 00115 //@cond PRIVATE 00116 Akonadi::CollectionModelPrivate *d_ptr; 00117 explicit CollectionModel( CollectionModelPrivate *d, QObject *parent = 0 ); 00118 //@endcond 00119 00120 private: 00121 Q_DECLARE_PRIVATE( CollectionModel ) 00122 00123 //@cond PRIVATE 00124 Q_PRIVATE_SLOT( d_func(), void startFirstListJob() ) 00125 Q_PRIVATE_SLOT( d_func(), void collectionRemoved( const Akonadi::Collection& ) ) 00126 Q_PRIVATE_SLOT( d_func(), void collectionChanged( const Akonadi::Collection& ) ) 00127 Q_PRIVATE_SLOT( d_func(), void updateDone( KJob* ) ) 00128 Q_PRIVATE_SLOT( d_func(), void collectionStatisticsChanged( 00129 Akonadi::Collection::Id, 00130 const Akonadi::CollectionStatistics& ) ) 00131 Q_PRIVATE_SLOT( d_func(), void listDone( KJob* ) ) 00132 Q_PRIVATE_SLOT( d_func(), void editDone( KJob* ) ) 00133 Q_PRIVATE_SLOT( d_func(), void dropResult( KJob* ) ) 00134 Q_PRIVATE_SLOT( d_func(), void collectionsChanged( const Akonadi::Collection::List& ) ) 00135 //@endcond 00136 }; 00137 00138 } 00139 00140 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue May 8 2012 00:00:40 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue May 8 2012 00:00:40 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.