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

kabc

  • KABC
  • StdAddressBook
Public Member Functions | Static Public Member Functions | Protected Member Functions
KABC::StdAddressBook Class Reference

#include <stdaddressbook.h>

Inheritance diagram for KABC::StdAddressBook:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ~StdAddressBook ()
void setWhoAmI (const Addressee &addr)
Addressee whoAmI () const

Static Public Member Functions

static bool automaticSave ()
static void close ()
static QString directoryName ()
static QString fileName ()
static bool save ()
static StdAddressBook * self ()
static StdAddressBook * self (bool asynchronous)
static void setAutomaticSave (bool state)

Protected Member Functions

 StdAddressBook (bool asynchronous)

Detailed Description

Standard KDE address book.

This class provides access to the standard KDE address book shared by all applications.

It's implemented as a singleton. Use self() to get the address book object. On the first self() call the address book also gets loaded.

Example:

  KABC::AddressBook *ab = KABC::StdAddressBook::self();

  AddressBook::Ticket *ticket = ab->requestSaveTicket();

  if ( ticket ) {
    KABC::AddressBook::Iterator it;
    for ( it = ab->begin(); it != ab->end(); ++it ) {
      kDebug(5700) << "UID=" << (*it).uid();

      // do some other stuff
    }

    KABC::StdAddressBook::save( ticket );
  }
Deprecated:
Port to libakonadi-kontact. For instance using Akonadi::ContactSearchJob. See http://techbase.kde.org/Development/AkonadiPorting/AddressBook for details.

Constructor & Destructor Documentation

StdAddressBook::~StdAddressBook ( )

Destructor.

Definition at line 135 of file stdaddressbook.cpp.


Member Function Documentation

bool StdAddressBook::automaticSave ( ) [static]

Returns whether the address book is saved at destruction time.

See also setAutomaticSave().

Definition at line 235 of file stdaddressbook.cpp.

void StdAddressBook::close ( ) [static]

Closes the address book.

Depending on automaticSave() it will save the address book first.

Definition at line 224 of file stdaddressbook.cpp.

QString StdAddressBook::directoryName ( ) [static]

Returns the default directory name for vcard-based addressbook.

Definition at line 69 of file stdaddressbook.cpp.

QString StdAddressBook::fileName ( ) [static]

Returns the default file name for vcard-based addressbook.

Definition at line 64 of file stdaddressbook.cpp.

bool StdAddressBook::save ( ) [static]

Saves the standard address book to disk.

Deprecated:
Use AddressBook::save( Ticket* ) instead

Definition at line 213 of file stdaddressbook.cpp.

StdAddressBook * StdAddressBook::self ( ) [static]

Returns the standard addressbook object.

It also loads all resources of the users standard address book synchronously.

Definition at line 74 of file stdaddressbook.cpp.

StdAddressBook * StdAddressBook::self ( bool  asynchronous) [static]

This is the same as above, but with specified behaviour of resource loading.

Parameters:
asynchronousWhen true, the resources are loaded asynchronous, that means you have the data foremost the addressBookChanged() signal has been emitted. So connect to this signal when using this method!

Definition at line 84 of file stdaddressbook.cpp.

void StdAddressBook::setAutomaticSave ( bool  state) [static]

Sets the automatic save property of the address book.

Parameters:
stateIf true, the address book is saved automatically at destruction time, otherwise you have to call AddressBook::save( Ticket* ).

Definition at line 230 of file stdaddressbook.cpp.

void StdAddressBook::setWhoAmI ( const Addressee &  addr)

Sets the users contact.

See whoAmI() for more information.

Parameters:
addrThe users contact.

Definition at line 248 of file stdaddressbook.cpp.

Addressee StdAddressBook::whoAmI ( ) const

Returns the contact, that is associated with the owner of the address book.

This contact should be used by other programs to access user specific data.

Definition at line 240 of file stdaddressbook.cpp.


The documentation for this class was generated from the following files:
  • stdaddressbook.h
  • stdaddressbook.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 05:09:43 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kabc

Skip menu "kabc"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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