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

akonadi

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

#include <collectionmodel.h>

Inheritance diagram for Akonadi::CollectionModel:
Akonadi::CollectionStatisticsModel Akonadi::SubscriptionModel

Public Types

enum  Roles {
  OldCollectionIdRole = Qt::UserRole + 1 , OldCollectionRole = Qt::UserRole + 2 , CollectionIdRole = Qt::UserRole + 10 , CollectionRole = Qt::UserRole + 11 ,
  UserRole = Qt::UserRole + 42
}
 

Public Member Functions

 CollectionModel (QObject *parent=0)
 
virtual ~CollectionModel ()
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
 
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
void fetchCollectionStatistics (bool enable)
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
void includeUnsubscribed (bool include=true)
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 
virtual QMimeData * mimeData (const QModelIndexList &indexes) const
 
virtual QStringList mimeTypes () const
 
virtual QModelIndex parent (const QModelIndex &index) const
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)
 
virtual Qt::DropActions supportedDropActions () const
 

Protected Member Functions

Collection collectionForId (Collection::Id id) const
 

Detailed Description

A model for collections.

This class provides the interface of QAbstractItemModel for the collection tree of the Akonadi storage.

Akonadi::CollectionModel *model = new Akonadi::CollectionModel( this );
QTreeView *view = new QTreeView( this );
view->setModel( model );
Akonadi::CollectionModel
A model for collections.
Definition: collectionmodel.h:55

If you want to list only collections of a special mime type, use CollectionFilterProxyModel on top of this model.

Author
Volker Krause vkrau.nosp@m.se@k.nosp@m.de.or.nosp@m.g
Deprecated:
Use Akonadi::EntityTreeModel instead

Definition at line 54 of file collectionmodel.h.

Member Enumeration Documentation

◆ Roles

enum Akonadi::CollectionModel::Roles

Describes the roles for collections.

Enumerator
OldCollectionIdRole 

The collection identifier. For binary compatibility to <4.3.

OldCollectionRole 

The actual collection object. For binary compatibility to <4.3.

CollectionIdRole 

The collection identifier.

CollectionRole 

The actual collection object.

UserRole 

Role for user extensions.

Definition at line 62 of file collectionmodel.h.

Constructor & Destructor Documentation

◆ CollectionModel()

CollectionModel::CollectionModel ( QObject *  parent = 0)
explicit

Creates a new collection model.

Parameters
parentThe parent object.

Definition at line 38 of file collectionmodel.cpp.

◆ ~CollectionModel()

CollectionModel::~CollectionModel ( )
virtual

Destroys the collection model.

Definition at line 55 of file collectionmodel.cpp.

Member Function Documentation

◆ collectionForId()

Collection CollectionModel::collectionForId ( Collection::Id  id) const
protected

Returns the collection for a given collection id.

Definition at line 307 of file collectionmodel.cpp.

◆ columnCount()

int CollectionModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

Reimplemented in Akonadi::CollectionStatisticsModel.

Definition at line 67 of file collectionmodel.cpp.

◆ data()

QVariant CollectionModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
virtual

Reimplemented in Akonadi::CollectionStatisticsModel.

Definition at line 75 of file collectionmodel.cpp.

◆ dropMimeData()

bool CollectionModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)
virtual

Definition at line 278 of file collectionmodel.cpp.

◆ fetchCollectionStatistics()

void CollectionModel::fetchCollectionStatistics ( bool  enable)

Sets whether collection statistics information shall be provided by the model.

See also
CollectionStatistics.
Parameters
enablewhether to fetch collecton statistics

Definition at line 313 of file collectionmodel.cpp.

◆ flags()

Qt::ItemFlags CollectionModel::flags ( const QModelIndex &  index) const
virtual

Definition at line 216 of file collectionmodel.cpp.

◆ headerData()

QVariant CollectionModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
virtual

Reimplemented in Akonadi::CollectionStatisticsModel.

Definition at line 177 of file collectionmodel.cpp.

◆ includeUnsubscribed()

void CollectionModel::includeUnsubscribed ( bool  include = true)

Sets whether unsubscribed collections shall be listed in the model.

Definition at line 320 of file collectionmodel.cpp.

◆ index()

QModelIndex CollectionModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
virtual

Definition at line 111 of file collectionmodel.cpp.

◆ mimeData()

QMimeData * CollectionModel::mimeData ( const QModelIndexList &  indexes) const
virtual

Definition at line 262 of file collectionmodel.cpp.

◆ mimeTypes()

QStringList CollectionModel::mimeTypes ( ) const
virtual

Definition at line 257 of file collectionmodel.cpp.

◆ parent()

QModelIndex CollectionModel::parent ( const QModelIndex &  index) const
virtual

Definition at line 137 of file collectionmodel.cpp.

◆ rowCount()

int CollectionModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

Definition at line 164 of file collectionmodel.cpp.

◆ setData()

bool CollectionModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
virtual

Definition at line 199 of file collectionmodel.cpp.

◆ setHeaderData()

bool CollectionModel::setHeaderData ( int  section,
Qt::Orientation  orientation,
const QVariant &  value,
int  role = Qt::EditRole 
)
virtual

Definition at line 187 of file collectionmodel.cpp.

◆ supportedDropActions()

Qt::DropActions CollectionModel::supportedDropActions ( ) const
virtual

Definition at line 252 of file collectionmodel.cpp.


The documentation for this class was generated from the following files:
  • collectionmodel.h
  • collectionmodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 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-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 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
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