00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AKONADI_COLLECTIONDIALOG_H
00022 #define AKONADI_COLLECTIONDIALOG_H
00023
00024 #include "akonadi_export.h"
00025
00026 #include <kdialog.h>
00027
00028 #include <akonadi/collection.h>
00029
00030 #include <QtGui/QAbstractItemView>
00031
00032 namespace Akonadi {
00033
00067 class AKONADI_EXPORT CollectionDialog : public KDialog
00068 {
00069 Q_OBJECT
00070 Q_DISABLE_COPY( CollectionDialog )
00071
00072 public:
00073
00074
00075 enum CollectionDialogOption
00076 {
00077 None = 0,
00078 AllowToCreateNewChildCollection = 1
00079 };
00080
00081 Q_DECLARE_FLAGS( CollectionDialogOptions, CollectionDialogOption )
00082
00083
00084
00089 explicit CollectionDialog( QWidget *parent = 0 );
00090
00102 explicit CollectionDialog( QAbstractItemModel *model, QWidget *parent = 0 );
00103
00117 explicit CollectionDialog( CollectionDialogOptions options, QAbstractItemModel *model = 0, QWidget *parent = 0 );
00118
00122 ~CollectionDialog();
00123
00128 void setMimeTypeFilter( const QStringList &mimeTypes );
00129
00133 QStringList mimeTypeFilter() const;
00134
00140 void setAccessRightsFilter( Collection::Rights rights );
00141
00147 Collection::Rights accessRightsFilter() const;
00148
00154 void setDescription( const QString &text );
00155
00161 void setDefaultCollection( const Collection &collection );
00162
00168 void setSelectionMode( QAbstractItemView::SelectionMode mode );
00169
00174 QAbstractItemView::SelectionMode selectionMode() const;
00175
00181 Akonadi::Collection selectedCollection() const;
00182
00186 Akonadi::Collection::List selectedCollections() const;
00187
00192 void changeCollectionDialogOptions( CollectionDialogOptions options );
00193
00194 private:
00195
00196 class Private;
00197 Private * const d;
00198
00199 Q_PRIVATE_SLOT( d, void slotCollectionAvailable( const QModelIndex& ) )
00200 Q_PRIVATE_SLOT( d, void slotSelectionChanged() )
00201 Q_PRIVATE_SLOT( d, void slotAddChildCollection() )
00202 Q_PRIVATE_SLOT( d, void slotCollectionCreationResult(KJob* job) )
00203
00204 };
00205
00206 }
00207
00208 #endif // AKONADI_COLLECTIONDIALOG_H