00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AKONADI_CONTACTGROUPMODEL_P_H
00023 #define AKONADI_CONTACTGROUPMODEL_P_H
00024
00025 #include <QtCore/QAbstractItemModel>
00026
00027 #include <kabc/contactgroup.h>
00028
00029 namespace Akonadi
00030 {
00031
00032 class ContactGroupModel : public QAbstractItemModel
00033 {
00034 Q_OBJECT
00035
00036 public:
00037 enum Role
00038 {
00039 IsReferenceRole = Qt::UserRole,
00040 AllEmailsRole
00041 };
00042
00043 ContactGroupModel( QObject *parent = 0 );
00044 ~ContactGroupModel();
00045
00046 void loadContactGroup( const KABC::ContactGroup &contactGroup );
00047 bool storeContactGroup( KABC::ContactGroup &contactGroup ) const;
00048
00049 QString lastErrorMessage() const;
00050
00051 virtual QModelIndex index( int row, int col, const QModelIndex &parent = QModelIndex() ) const;
00052 virtual QModelIndex parent( const QModelIndex &child ) const;
00053 virtual QVariant data( const QModelIndex &index, int role ) const;
00054 virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
00055 virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
00056 virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
00057 virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
00058 virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
00059
00060 virtual bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
00061
00062 private:
00063 class Private;
00064 Private* const d;
00065
00066 Q_PRIVATE_SLOT( d, void itemFetched( KJob* ) )
00067 };
00068
00069 }
00070
00071 #endif