Akonadi::CollectionComboBox Class Reference

A combobox for selecting an Akonadi collection. More...

#include <collectioncombobox.h>

Inherits KComboBox.

List of all members.

Signals

void currentChanged (const Akonadi::Collection &collection)

Public Member Functions

 CollectionComboBox (QAbstractItemModel *model, QWidget *parent=0)
 CollectionComboBox (QWidget *parent=0)
 ~CollectionComboBox ()
Collection::Rights accessRightsFilter () const
Akonadi::Collection currentCollection () const
QStringList mimeTypeFilter () const
void setAccessRightsFilter (Collection::Rights rights)
void setDefaultCollection (const Collection &collection)
void setMimeTypeFilter (const QStringList &mimetypes)

Detailed Description

A combobox for selecting an Akonadi collection.

This widget provides a combobox to select a collection from the Akonadi storage. The available collections can be filtered by mime type and access rights.

Example:

 using namespace Akonadi;

 QStringList contentMimeTypes;
 contentMimeTypes << KABC::Addressee::mimeType();
 contentMimeTypes << KABC::ContactGroup::mimeType();

 CollectionComboBox *box = new CollectionComboBox( this );
 box->setMimeTypeFilter( contentMimeTypes );
 box->setAccessRightsFilter( Collection::CanCreateItem );
 ...

 const Collection collection = box->currentCollection();
Author:
Tobias Koenig <tokoe@kde.org>
Since:
4.4

Definition at line 62 of file collectioncombobox.h.


Constructor & Destructor Documentation

CollectionComboBox::CollectionComboBox ( QWidget *  parent = 0  )  [explicit]

Creates a new collection combobox.

Parameters:
parent The parent widget.

Definition at line 109 of file collectioncombobox.cpp.

CollectionComboBox::CollectionComboBox ( QAbstractItemModel *  model,
QWidget *  parent = 0 
) [explicit]

Creates a new collection combobox with a custom model.

The filtering by content mime type and access rights is done on top of the custom model.

Parameters:
model The custom model to use.
parent The parent widget.

Definition at line 114 of file collectioncombobox.cpp.

CollectionComboBox::~CollectionComboBox (  ) 

Destroys the collection combobox.

Definition at line 119 of file collectioncombobox.cpp.


Member Function Documentation

Collection::Rights CollectionComboBox::accessRightsFilter (  )  const

Returns the access rights the collections are filtered by.

Definition at line 144 of file collectioncombobox.cpp.

void Akonadi::CollectionComboBox::currentChanged ( const Akonadi::Collection collection  )  [signal]

This signal is emitted whenever the current selection has been changed.

Parameters:
collection The current selection.
Akonadi::Collection CollectionComboBox::currentCollection (  )  const

Returns the current selection.

Definition at line 154 of file collectioncombobox.cpp.

QStringList CollectionComboBox::mimeTypeFilter (  )  const

Returns the content mimetype the collections are filtered by.

Definition at line 134 of file collectioncombobox.cpp.

void CollectionComboBox::setAccessRightsFilter ( Collection::Rights  rights  ) 

Sets the access rights the collections shall be filtered by.

Definition at line 139 of file collectioncombobox.cpp.

void CollectionComboBox::setDefaultCollection ( const Collection collection  ) 

Sets the collection that shall be selected by default.

Definition at line 149 of file collectioncombobox.cpp.

void CollectionComboBox::setMimeTypeFilter ( const QStringList &  mimetypes  ) 

Sets the content mimetypes the collections shall be filtered by.

Definition at line 124 of file collectioncombobox.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys