kabc Library API Documentation

KABC::StdAddressBook Class Reference

Standard KDE address book. More...

#include <stdaddressbook.h>

Inheritance diagram for KABC::StdAddressBook:

KABC::AddressBook QObject List of all members.

Public Methods

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

Static Public Methods

StdAddressBook * self ()
StdAddressBook * self (bool asyncronous)
bool save () KDE_DEPRECATED
void handleCrash () KDE_DEPRECATED
QString fileName ()
QString directoryName ()
void setAutomaticSave (bool state)
void close ()
bool automaticSave ()

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 ) {
      kdDebug() << "UID=" << (*it).uid() << endl;

      // do some other stuff
    }

    KABC::StdAddressBook::save( ticket );
  }

Definition at line 56 of file stdaddressbook.h.


Constructor & Destructor Documentation

StdAddressBook::~StdAddressBook  
 

Destructor.

Definition at line 93 of file stdaddressbook.cpp.

References save().


Member Function Documentation

StdAddressBook * StdAddressBook::self   [static]
 

Returns the standard addressbook object.

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

Definition at line 57 of file stdaddressbook.cpp.

References KStaticDeleter< type >::setObject().

Referenced by save().

StdAddressBook * StdAddressBook::self bool    asyncronous [static]
 

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

Parameters:
asynchronous  When 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 67 of file stdaddressbook.cpp.

References KStaticDeleter< type >::setObject().

bool StdAddressBook::save   [static]
 

Saves the standard address book to disk.

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

Definition at line 139 of file stdaddressbook.cpp.

References KABC::AddressBook::deleteRemovedAddressees(), KABC::AddressBook::error(), KABC::AddressBook::releaseSaveTicket(), KABC::AddressBook::requestSaveTicket(), KABC::AddressBook::resourceManager(), KABC::AddressBook::save(), and self().

Referenced by ~StdAddressBook().

void StdAddressBook::handleCrash   [static]
 

Deprecated:
There is no need to call this function anymore.

Definition at line 53 of file stdaddressbook.cpp.

QString StdAddressBook::fileName   [static]
 

Returns the default file name for vcard-based addressbook.

Definition at line 43 of file stdaddressbook.cpp.

QString StdAddressBook::directoryName   [static]
 

Returns the default directory name for vcard-based addressbook.

Definition at line 48 of file stdaddressbook.cpp.

void StdAddressBook::setAutomaticSave bool    state [static]
 

Sets the automatic save property of the address book.

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

Definition at line 174 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 169 of file stdaddressbook.cpp.

References KStaticDeleter< type >::destructObject().

bool StdAddressBook::automaticSave   [static]
 

Returns whether the address book is saved at destruction time.

See also setAutomaticSave().

Definition at line 179 of file stdaddressbook.cpp.

Addressee StdAddressBook::whoAmI  
 

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 185 of file stdaddressbook.cpp.

References KABC::AddressBook::findByUid().

void StdAddressBook::setWhoAmI const Addressee   addr
 

Sets the users contact.

See whoAmI() for more information.

Parameters:
uid  The uid of the users contact.

Definition at line 193 of file stdaddressbook.cpp.

References KABC::Addressee::uid().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kabc Library Version 3.2.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 4 12:36:46 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003