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

akonadi

  • Akonadi
  • ContactEditor
Public Types | Public Slots | Signals | Public Member Functions | List of all members
Akonadi::ContactEditor Class Reference

#include <contacteditor.h>

Inherits QWidget.

Public Types

enum  DisplayMode { FullMode, VCardMode }
 
enum  Mode { CreateMode, EditMode }
 

Public Slots

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

Signals

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

Public Member Functions

 ContactEditor (Mode mode, QWidget *parent=0)
 
 ContactEditor (Mode mode, AbstractContactEditorWidget *editorWidget, QWidget *parent=0)
 
 ContactEditor (Mode mode, DisplayMode displayMode, QWidget *parent=0)
 
virtual ~ContactEditor ()
 
KABC::Addressee contact ()
 
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 );
...
editor->saveContactInAddressBook();
Author
Tobias Koenig tokoe.nosp@m.@kde.nosp@m..org
Since
4.4

Definition at line 80 of file contacteditor.h.

Member Enumeration Documentation

enum Akonadi::ContactEditor::DisplayMode
Enumerator
FullMode 

Show all pages.

VCardMode 

Show just pages with elements stored in vcard.

Definition at line 93 of file contacteditor.h.

enum Akonadi::ContactEditor::Mode

Describes the mode of the editor.

Enumerator
CreateMode 

Creates a new contact.

EditMode 

Edits an existing contact.

Definition at line 88 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
modeThe mode of the editor.
parentThe parent widget of the editor.

Definition at line 204 of file contacteditor.cpp.

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

Creates a new contact editor with a custom editor widget.

Parameters
modeThe mode of the editor.
editorWidgetThe contact editor widget that shall be used for editing.
parentThe parent widget of the editor.

Definition at line 209 of file contacteditor.cpp.

ContactEditor::ContactEditor ( Mode  mode,
DisplayMode  displayMode,
QWidget *  parent = 0 
)

Creates a new contact editor dialog with a custom editor widget.

Parameters
modeThe mode of the dialog.
displayModemode for displaying the editor
parentThe parent widget of the dialog.
Since
4.10

Definition at line 214 of file contacteditor.cpp.

ContactEditor::~ContactEditor ( )
virtual

Destroys the contact editor.

Definition at line 219 of file contacteditor.cpp.

Member Function Documentation

KABC::Addressee ContactEditor::contact ( )

ContactEditor::contact.

Since
4.10
Returns

Definition at line 241 of file contacteditor.cpp.

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.

Parameters
errorMsgThe error message.
Since
4.11
void Akonadi::ContactEditor::finished ( )
signal

finished

Since
4.11
void ContactEditor::loadContact ( const Akonadi::Item &  contact)
slot

Loads the contact into the editor.

Definition at line 224 of file contacteditor.cpp.

bool ContactEditor::saveContact ( )
slot

Saves the contact from the editor back to the storage.

Deprecated:
use saveContactInAddressBook. We can't get contactStored and error infos. Remove it for KDE SC5

Definition at line 296 of file contacteditor.cpp.

void ContactEditor::saveContactInAddressBook ( )
slot

Save the contact from the editor back to the storage.

And return error. Need to connect to finished() signal, to keep time to emit signal.

Since
4.11

Definition at line 248 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.

Parameters
contactthe contact to use as template content

Definition at line 349 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 354 of file contacteditor.cpp.


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