• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

  • Akonadi
  • Akonadi::CollectionDialog
Public Member Functions

Akonadi::CollectionDialog Class Reference

A collection selection dialog. More...

#include <collectiondialog.h>

Inherits KDialog.

List of all members.

Public Member Functions

 CollectionDialog (QWidget *parent=0)
 CollectionDialog (QAbstractItemModel *model, QWidget *parent=0)
 ~CollectionDialog ()
Collection::Rights accessRightsFilter () const
QStringList mimeTypeFilter () const
Akonadi::Collection selectedCollection () const
Akonadi::Collection::List selectedCollections () const
QAbstractItemView::SelectionMode selectionMode () const
void setAccessRightsFilter (Collection::Rights rights)
void setDefaultCollection (const Collection &collection)
void setDescription (const QString &text)
void setMimeTypeFilter (const QStringList &mimeTypes)
void setSelectionMode (QAbstractItemView::SelectionMode mode)

Detailed Description

A collection selection dialog.

Provides a dialog that lists collections that are available on the Akonadi storage and allows to select one or multiple collections. The list of shown collections can be filtered by mime type and access rights.

Example:

 using namespace Akonadi;

 // Show the user a dialog to select a writable collection of contacts
 CollectionDialog dlg( this );
 dlg.setMimeTypeFilter( QStringList() << KABC::Addressee::mimeType() );
 dlg.setAccessRightsFilter( Collection::CanCreateItem );
 dlg.setDescription( i18n( "Select an address book for saving:" ) );

 if ( dlg.exec() ) {
   const Collection collection = dlg.selectedCollection();
   ...
 }
Author:
Ingo Klöcker <kloecker@kde.org>
Since:
4.3

Definition at line 64 of file collectiondialog.h.


Constructor & Destructor Documentation

Akonadi::CollectionDialog::CollectionDialog ( QWidget *  parent = 0  )  [explicit]

Creates a new collection dialog.

Parameters:
parent The parent widget.
Akonadi::CollectionDialog::CollectionDialog ( QAbstractItemModel *  model,
QWidget *  parent = 0 
) [explicit]

Creates a new collection dialog 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.
Since:
4.4
Akonadi::CollectionDialog::~CollectionDialog (  ) 

Destroys the collection dialog.


Member Function Documentation

Collection::Rights Akonadi::CollectionDialog::accessRightsFilter (  )  const

Sets the access rights that the listed collections shall match with.

Since:
4.4
QStringList Akonadi::CollectionDialog::mimeTypeFilter (  )  const

Returns the mime types any of which the selected collection(s) shall support.

Akonadi::Collection Akonadi::CollectionDialog::selectedCollection (  )  const

Returns the selected collection if the selection mode is QAbstractItemView::SingleSelection.

If another selection mode was set, or nothing is selected, an invalid collection is returned.

Akonadi::Collection::List Akonadi::CollectionDialog::selectedCollections (  )  const

Returns the list of selected collections.

QAbstractItemView::SelectionMode Akonadi::CollectionDialog::selectionMode (  )  const

Returns the selection mode.

See also:
QAbstractItemView::selectionMode()
void Akonadi::CollectionDialog::setAccessRightsFilter ( Collection::Rights  rights  ) 

Sets the access rights that the listed collections shall match with.

Since:
4.4
void Akonadi::CollectionDialog::setDefaultCollection ( const Collection &  collection  ) 

Sets the collection that shall be selected by default.

Since:
4.4
void Akonadi::CollectionDialog::setDescription ( const QString &  text  ) 

Sets the text that will be shown in the dialog.

Since:
4.4
void Akonadi::CollectionDialog::setMimeTypeFilter ( const QStringList &  mimeTypes  ) 

Sets the mime types any of which the selected collection(s) shall support.

void Akonadi::CollectionDialog::setSelectionMode ( QAbstractItemView::SelectionMode  mode  ) 

Sets the selection mode.

The initial default mode is QAbstractItemView::SingleSelection.

See also:
QAbstractItemView::setSelectionMode()

The documentation for this class was generated from the following file:
  • collectiondialog.h

akonadi

Skip menu "akonadi"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal