• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • CollectionDialog
Public Types | Public Member Functions | List of all members
Akonadi::CollectionDialog Class Reference

#include <collectiondialog.h>

Inherits KDialog.

Public Types

enum  CollectionDialogOption { None = 0, AllowToCreateNewChildCollection = 1, KeepTreeExpanded = 2 }
 

Public Member Functions

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

Detailed Description

A collection selection dialog.

Provides a dialog that lists collections that are available on the Akonadi storage and allows the selection of one or multiple collections.

The list of shown collections can be filtered by mime type and access rights. Note that mime types are not enabled by default, so setMimeTypeFilter() must be called to enable the desired mime types.

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 kloec.nosp@m.ker@.nosp@m.kde.o.nosp@m.rg
Since
4.3

Definition at line 67 of file collectiondialog.h.

Constructor & Destructor Documentation

CollectionDialog::CollectionDialog ( QWidget *  parent = 0)
explicit

Creates a new collection dialog.

Parameters
parentThe parent widget.

Definition at line 286 of file collectiondialog_desktop.cpp.

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
modelThe custom model to use.
parentThe parent widget.
Since
4.4

Definition at line 292 of file collectiondialog_desktop.cpp.

CollectionDialog::CollectionDialog ( CollectionDialogOptions  options,
QAbstractItemModel *  model = 0,
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
optionsThe collection dialog options.
modelThe custom model to use.
parentThe parent widget.
Since
4.6

Definition at line 298 of file collectiondialog_desktop.cpp.

CollectionDialog::~CollectionDialog ( )

Destroys the collection dialog.

Definition at line 304 of file collectiondialog_desktop.cpp.

Member Function Documentation

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

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

Since
4.4

Definition at line 367 of file collectiondialog_desktop.cpp.

void CollectionDialog::changeCollectionDialogOptions ( CollectionDialogOptions  options)

Change collection dialog options.

Parameters
optionsthe collection dialog options to change
Since
4.6

Definition at line 393 of file collectiondialog_desktop.cpp.

QStringList CollectionDialog::mimeTypeFilter ( ) const

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

Definition at line 354 of file collectiondialog_desktop.cpp.

Akonadi::Collection 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.

Definition at line 309 of file collectiondialog_desktop.cpp.

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

Returns the list of selected collections.

Definition at line 321 of file collectiondialog_desktop.cpp.

QAbstractItemView::SelectionMode CollectionDialog::selectionMode ( ) const

Returns the selection mode.

See also
QAbstractItemView::selectionMode()

Definition at line 388 of file collectiondialog_desktop.cpp.

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

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

Parameters
rightsaccess rights filter values
Since
4.4

Definition at line 359 of file collectiondialog_desktop.cpp.

void CollectionDialog::setContentMimeTypes ( const QStringList &  mimetypes)

Allow to specify collection content mimetype when we create new one.

Since
4.14.6

Definition at line 409 of file collectiondialog_desktop.cpp.

void CollectionDialog::setDefaultCollection ( const Collection &  collection)

Sets the collection that shall be selected by default.

Parameters
collectionthe dialog's pre-selected collection
Since
4.4

Definition at line 378 of file collectiondialog_desktop.cpp.

void CollectionDialog::setDescription ( const QString &  text)

Sets the text that will be shown in the dialog.

Parameters
textthe dialog's description text
Since
4.4

Definition at line 372 of file collectiondialog_desktop.cpp.

void CollectionDialog::setMimeTypeFilter ( const QStringList &  mimeTypes)

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

Note that mime types are not enabled by default.

Parameters
mimeTypesMIME type filter values

Definition at line 338 of file collectiondialog_desktop.cpp.

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

Sets the selection mode.

The initial default mode is QAbstractItemView::SingleSelection.

Parameters
modethe selection mode to use
See also
QAbstractItemView::setSelectionMode()

Definition at line 383 of file collectiondialog_desktop.cpp.

void CollectionDialog::setUseFolderByDefault ( bool  b)
Since
4.13

Definition at line 398 of file collectiondialog_desktop.cpp.

bool CollectionDialog::useFolderByDefault ( ) const
Since
4.13

Definition at line 404 of file collectiondialog_desktop.cpp.


The documentation for this class was generated from the following files:
  • collectiondialog.h
  • collectiondialog_desktop.cpp
  • collectiondialog_mobile.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:04 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

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

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal