akonadi
favoritecollectionsmodel.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKONADI_FAVORITECOLLECTIONSMODEL_H
00021 #define AKONADI_FAVORITECOLLECTIONSMODEL_H
00022
00023 #include "akonadi_export.h"
00024
00025 #include <akonadi/selectionproxymodel.h>
00026
00027 #include <akonadi/collection.h>
00028
00029 class KConfigGroup;
00030
00031 namespace Akonadi {
00032
00033 class EntityTreeModel;
00034
00064 class AKONADI_EXPORT FavoriteCollectionsModel : public Akonadi::SelectionProxyModel
00065 {
00066 Q_OBJECT
00067
00068 public:
00078 FavoriteCollectionsModel( QAbstractItemModel *model, const KConfigGroup &group, QObject *parent = 0 );
00079
00083 virtual ~FavoriteCollectionsModel();
00084
00088 Collection::List collections() const;
00089
00093 QString favoriteLabel( const Akonadi::Collection & col );
00094
00095 virtual QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
00096 virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
00097
00098 public Q_SLOTS:
00102 void setCollections( const Collection::List &collections );
00103
00107 void addCollection( const Collection &collection );
00108
00112 void removeCollection( const Collection &collection );
00113
00118 void setFavoriteLabel( const Collection &collection, const QString &label );
00119
00120 private:
00121
00122 using KSelectionProxyModel::setSourceModel;
00123
00124 class Private;
00125 Private* const d;
00126
00127 Q_PRIVATE_SLOT( d, void clearAndUpdateSelection() )
00128 Q_PRIVATE_SLOT( d, void updateSelection() )
00129
00130 };
00131
00132 }
00133
00134 #endif