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

akonadi

  • Akonadi
  • CollectionPropertiesPage
Public Member Functions | List of all members
Akonadi::CollectionPropertiesPage Class Referenceabstract

#include <collectionpropertiespage.h>

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

Public Member Functions

 CollectionPropertiesPage (QWidget *parent=0)
 
 ~CollectionPropertiesPage ()
 
virtual bool canHandle (const Collection &collection) const
 
virtual void load (const Collection &collection)=0
 
QString pageTitle () const
 
virtual void save (Collection &collection)=0
 
void setPageTitle (const QString &title)
 

Detailed Description

A single page in a collection properties dialog.

The collection properties dialog can be extended by custom collection properties pages, which provide gui elements for viewing and changing collection attributes.

The following example shows how to create a simple collection properties page for the secrecy attribute from the Akonadi::Attribute example.

class SecrecyPage : public CollectionPropertiesPage
{
public:
SecrecyPage( QWidget *parent = 0 )
: CollectionPropertiesPage( parent )
{
QVBoxLayout *layout = new QVBoxLayout( this );
mSecrecy = new QComboBox( this );
mSecrecy->addItem( "Public" );
mSecrecy->addItem( "Private" );
mSecrecy->addItem( "Confidential" );
layout->addWidget( new QLabel( "Secrecy:" ) );
layout->addWidget( mSecrecy );
setPageTitle( i18n( "Secrecy" ) );
}
void load( const Collection &collection )
{
SecrecyAttribute *attr = collection.attribute( "secrecy" );
switch ( attr->secrecy() ) {
case SecrecyAttribute::Public: mSecrecy->setCurrentIndex( 0 ); break;
case SecrecyAttribute::Private: mSecrecy->setCurrentIndex( 1 ); break;
case SecrecyAttribute::Confidential: mSecrecy->setCurrentIndex( 2 ); break;
}
}
void save( Collection &collection )
{
SecrecyAttribute *attr = collection.attribute( "secrecy" );
switch ( mSecrecy->currentIndex() ) {
case 0: attr->setSecrecy( SecrecyAttribute::Public ); break;
case 1: attr->setSecrecy( SecrecyAttribute::Private ); break;
case 2: attr->setSecrecy( SecrecyAttribute::Confidential ); break;
}
}
bool canHandle( const Collection &collection ) const
{
return collection.hasAttribute( "secrecy" );
}
};
AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY( SecrecyPageFactory, SecrecyPage )
See also
Akonadi::CollectionPropertiesDialog, Akonadi::CollectionPropertiesPageFactory
Author
Volker Krause vkrau.nosp@m.se@k.nosp@m.de.or.nosp@m.g

Definition at line 99 of file collectionpropertiespage.h.

Constructor & Destructor Documentation

Akonadi::CollectionPropertiesPage::CollectionPropertiesPage ( QWidget *  parent = 0)
explicit

Creates a new collection properties page.

Parameters
parentThe parent widget.
Akonadi::CollectionPropertiesPage::~CollectionPropertiesPage ( )

Destroys the collection properties page.

Member Function Documentation

virtual bool Akonadi::CollectionPropertiesPage::canHandle ( const Collection &  collection) const
virtual

Checks if this page can actually handle the given collection.

Returns true if the collection can be handled, false otherwise The default implementation returns always true. When false is returned this page is not shown in the properties dialog.

Parameters
collectionThe collection to check.

Reimplemented in Akonadi::CachePolicyPage.

virtual void Akonadi::CollectionPropertiesPage::load ( const Collection &  collection)
pure virtual

Loads the page content from the given collection.

Parameters
collectionThe collection to load.

Implemented in Akonadi::CachePolicyPage.

QString Akonadi::CollectionPropertiesPage::pageTitle ( ) const

Returns the page title.

virtual void Akonadi::CollectionPropertiesPage::save ( Collection &  collection)
pure virtual

Saves page content to the given collection.

Parameters
collectionReference to the collection to save to.

Implemented in Akonadi::CachePolicyPage.

void Akonadi::CollectionPropertiesPage::setPageTitle ( const QString &  title)

Sets the page title.

Parameters
titleTranslated, preferbly short tab title.

The documentation for this class was generated from the following file:
  • collectionpropertiespage.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:28 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
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

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