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

akonadi/contact

Akonadi::ContactGroupEditor

Akonadi::ContactGroupEditor Class Reference

An widget to edit contact groups in Akonadi. More...

#include <contactgroupeditor.h>

Inherits QWidget.

List of all members.

Public Types

enum  Mode { CreateMode, EditMode }

Public Slots

void loadContactGroup (const Akonadi::Item &group)
bool saveContactGroup ()

Signals

void contactGroupStored (const Akonadi::Item &group)
void error (const QString &errorMsg)

Public Member Functions

 ContactGroupEditor (Mode mode, QWidget *parent=0)
virtual ~ContactGroupEditor ()
void setContactGroupTemplate (const KABC::ContactGroup &group)
void setDefaultAddressBook (const Akonadi::Collection &addressbook)

Detailed Description

An widget to edit contact groups in Akonadi.

This widget provides a way to create a new contact group or edit an existing contact group in Akonadi.

Example for creating a new contact group:

 using namespace Akonadi;

 ContactGroupEditor *editor = new ContactGroupEditor( Akonadi::ContactGroupEditor::CreateMode, this );

 ...

 if ( !editor->saveContactGroup() ) {
   qDebug() << "Unable to save new contact group to storage";
   return;
 }

Example for editing an existing contact group:

 const Akonadi::Item contactGroup = ...;

 ContactGroupEditor *editor = new ContactGroupEditor( Akonadi::ContactGroupEditor::EditMode, this );
 editor->loadContactGroup( contactGroup );

 ...

 if ( !editor->saveContactGroup() ) {
   qDebug() << "Unable to save changed contact group to storage";
   return;
 }
Author:
Tobias Koenig <tokoe@kde.org>
Since:
4.4

Definition at line 82 of file contactgroupeditor.h.


Member Enumeration Documentation

enum Akonadi::ContactGroupEditor::Mode

Describes the mode of the contact group editor.

Enumerator:
CreateMode 

Creates a new contact group.

EditMode 

Edits an existing contact group.

Definition at line 90 of file contactgroupeditor.h.


Constructor & Destructor Documentation

ContactGroupEditor::ContactGroupEditor ( Mode  mode,
QWidget *  parent = 0 
) [explicit]

Creates a new contact group editor.

Parameters:
mode The mode of the editor.
parent The parent widget of the editor.

Definition at line 229 of file contactgroupeditor.cpp.

ContactGroupEditor::~ContactGroupEditor (  )  [virtual]

Destroys the contact group editor.

Definition at line 252 of file contactgroupeditor.cpp.


Member Function Documentation

void Akonadi::ContactGroupEditor::contactGroupStored ( const Akonadi::Item &  group  )  [signal]

This signal is emitted when the contact group has been saved back to the storage.

void Akonadi::ContactGroupEditor::error ( const QString &  errorMsg  )  [signal]

This signal is emitted when an error occurred during the save.

errorMsg The error message.

void ContactGroupEditor::loadContactGroup ( const Akonadi::Item &  group  )  [slot]

Loads the contact group into the editor.

Definition at line 257 of file contactgroupeditor.cpp.

bool ContactGroupEditor::saveContactGroup (  )  [slot]

Saves the contact group from the editor back to the storage.

Returns:
true if the contact group has been saved successfully, false otherwise.

Definition at line 274 of file contactgroupeditor.cpp.

void ContactGroupEditor::setContactGroupTemplate ( const KABC::ContactGroup &  group  ) 

Sets a contact group that is used as template in create mode.

The fields of the editor will be prefilled with the content of the group.

Definition at line 323 of file contactgroupeditor.cpp.

void ContactGroupEditor::setDefaultAddressBook ( const Akonadi::Collection &  addressbook  ) 

Sets the addressbook which shall be used to store new contact groups.

Definition at line 330 of file contactgroupeditor.cpp.


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

akonadi/contact

Skip menu "akonadi/contact"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

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.6.2-20100208
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