akonadi
collectionpropertiespage.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKONADI_COLLECTIONPROPERTIESPAGE_H
00021 #define AKONADI_COLLECTIONPROPERTIESPAGE_H
00022
00023 #include "akonadi_export.h"
00024
00025 #include <QtGui/QWidget>
00026
00027 namespace Akonadi {
00028
00029 class Collection;
00030
00099 class AKONADI_EXPORT CollectionPropertiesPage : public QWidget
00100 {
00101 Q_OBJECT
00102 public:
00108 explicit CollectionPropertiesPage( QWidget *parent = 0 );
00109
00113 ~CollectionPropertiesPage();
00114
00120 virtual void load( const Collection &collection ) = 0;
00121
00127 virtual void save( Collection &collection ) = 0;
00128
00136 virtual bool canHandle( const Collection &collection ) const;
00137
00143 void setPageTitle( const QString &title );
00144
00148 QString pageTitle() const;
00149
00150 private:
00151
00152 class Private;
00153 Private* const d;
00154
00155 };
00156
00167 class AKONADI_EXPORT CollectionPropertiesPageFactory
00168 {
00169 public:
00173 virtual ~CollectionPropertiesPageFactory();
00174
00180 virtual CollectionPropertiesPage* createWidget( QWidget *parent = 0 ) const = 0;
00181 };
00182
00206 #define AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(factoryName, className) \
00207 class factoryName: public CollectionPropertiesPageFactory \
00208 { \
00209 public: \
00210 inline CollectionPropertiesPage* createWidget( QWidget *parent = 0 ) const \
00211 { \
00212 return new className( parent ); \
00213 } \
00214 };
00215
00216 }
00217
00218 #endif