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

akonadi

  • Akonadi
  • Akonadi::FavoriteCollectionsModel
Public Slots | Public Member Functions

Akonadi::FavoriteCollectionsModel Class Reference

A model that lists a set of favorite collections. More...

#include <favoritecollectionsmodel.h>

Inheritance diagram for Akonadi::FavoriteCollectionsModel:
Inheritance graph
[legend]

List of all members.

Public Slots

void addCollection (const Collection &collection)
void removeCollection (const Collection &collection)
void setCollections (const Collection::List &collections)
void setFavoriteLabel (const Collection &collection, const QString &label)

Public Member Functions

 FavoriteCollectionsModel (QAbstractItemModel *model, const KConfigGroup &group, QObject *parent=0)
virtual ~FavoriteCollectionsModel ()
Collection::List collections () const
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
QString favoriteLabel (const Akonadi::Collection &col)
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const

Detailed Description

A model that lists a set of favorite collections.

In some applications you want to provide fast access to a list of often used collections (e.g. Inboxes from different email accounts in a mail application). Therefor you can use the FavoriteCollectionsModel which stores the list of favorite collections in a given configuration file.

Example:

 using namespace Akonadi;

 EntityTreeModel *sourceModel = new EntityTreeModel( ... );

 const KConfigGroup group = KGlobal::config()->group( "Favorite Collections" );

 FavoriteCollectionsModel *model = new FavoriteCollectionsModel( sourceModel, group, this );

 EntityListView *view = new EntityListView( this );
 view->setModel( model );
Author:
Kevin Ottens <ervin@kde.org>
Since:
4.4

Definition at line 64 of file favoritecollectionsmodel.h.


Constructor & Destructor Documentation

Akonadi::FavoriteCollectionsModel::FavoriteCollectionsModel ( QAbstractItemModel *  model,
const KConfigGroup &  group,
QObject *  parent = 0 
)

Creates a new favorite collections model.

Parameters:
model The source model where the favorite collections come from.
group The config group that shall be used to save the selection of favorite collections.
parent The parent object.
virtual Akonadi::FavoriteCollectionsModel::~FavoriteCollectionsModel (  )  [virtual]

Destroys the favorite collections model.


Member Function Documentation

void Akonadi::FavoriteCollectionsModel::addCollection ( const Collection &  collection  )  [slot]

Adds a collection to the list of favorite collections.

Collection::List Akonadi::FavoriteCollectionsModel::collections (  )  const

Returns the list of favorite collections.

QString Akonadi::FavoriteCollectionsModel::favoriteLabel ( const Akonadi::Collection &  col  ) 

Return associate label for collection.

Definition at line 193 of file favoritecollectionsmodel.cpp.

void Akonadi::FavoriteCollectionsModel::removeCollection ( const Collection &  collection  )  [slot]

Removes a collection from the list of favorite collections.

void Akonadi::FavoriteCollectionsModel::setCollections ( const Collection::List &  collections  )  [slot]

Sets the collections as favorite collections.

void Akonadi::FavoriteCollectionsModel::setFavoriteLabel ( const Collection &  collection,
const QString &  label 
) [slot]

Sets a custom label that will be used when showing the favorite collection.

Definition at line 165 of file favoritecollectionsmodel.cpp.


The documentation for this class was generated from the following files:
  • favoritecollectionsmodel.h
  • favoritecollectionsmodel.cpp

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