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

akonadi/contact

Akonadi::ContactEditor

Akonadi::ContactEditor Class Reference

An widget to edit contacts in Akonadi. More...

#include <contacteditor.h>

Inherits QWidget.

List of all members.

Public Types

enum  Mode { CreateMode, EditMode }

Public Slots

void loadContact (const Akonadi::Item &contact)
bool saveContact ()

Signals

void contactStored (const Akonadi::Item &contact)
void error (const QString &errorMsg)

Public Member Functions

 ContactEditor (Mode mode, AbstractContactEditorWidget *editorWidget, QWidget *parent=0)
 ContactEditor (Mode mode, QWidget *parent=0)
virtual ~ContactEditor ()
void setContactTemplate (const KABC::Addressee &contact)
void setDefaultAddressBook (const Akonadi::Collection &addressbook)

Detailed Description

An widget to edit contacts in Akonadi.

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

Example for creating a new contact:

 using namespace Akonadi;

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

 ...

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

Example for editing an existing contact:

 const Akonadi::Item contact = ...;

 ContactEditor *editor = new ContactEditor( Akonadi::ContactEditor::EditMode, this );
 editor->loadContact( contact );

 ...

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

Definition at line 83 of file contacteditor.h.


Member Enumeration Documentation

enum Akonadi::ContactEditor::Mode

Describes the mode of the editor.

Enumerator:
CreateMode 

Creates a new contact.

EditMode 

Edits an existing contact.

Definition at line 91 of file contacteditor.h.


Constructor & Destructor Documentation

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

Creates a new contact editor with the standard editor widget.

Parameters:
mode The mode of the editor.
editorWidget The contact editor widget that shall be used for editing.
parent The parent widget of the editor.

Definition at line 190 of file contacteditor.cpp.

ContactEditor::ContactEditor ( Mode  mode,
AbstractContactEditorWidget *  editorWidget,
QWidget *  parent = 0 
)

Creates a new contact editor with a custom editor widget.

Parameters:
mode The mode of the editor.
editorWidget The contact editor widget that shall be used for editing.
parent The parent widget of the editor.

Definition at line 195 of file contacteditor.cpp.

ContactEditor::~ContactEditor (  )  [virtual]

Destroys the contact editor.

Definition at line 200 of file contacteditor.cpp.


Member Function Documentation

void Akonadi::ContactEditor::contactStored ( const Akonadi::Item &  contact  )  [signal]

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

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

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

errorMsg The error message.

void ContactEditor::loadContact ( const Akonadi::Item &  contact  )  [slot]

Loads the contact into the editor.

Definition at line 205 of file contacteditor.cpp.

bool ContactEditor::saveContact (  )  [slot]

Saves the contact from the editor back to the storage.

Definition at line 221 of file contacteditor.cpp.

void ContactEditor::setContactTemplate ( const KABC::Addressee &  contact  ) 

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

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

Definition at line 271 of file contacteditor.cpp.

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

Sets the addressbook which shall be used to store new contacts.

Definition at line 276 of file contacteditor.cpp.


The documentation for this class was generated from the following files:
  • contacteditor.h
  • contacteditor.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.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