# kabc Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KABC::StdAddressBook Class Reference

Standard KDE address book. More...

`#include <stdaddressbook.h>`

Inheritance diagram for KABC::StdAddressBook:

[legend]
Collaboration diagram for KABC::StdAddressBook:

[legend]
List of all members.

## Static Public Member Functions

AddressBook * | self ()
| Return the standard addressbook object.
AddressBook * | self (bool onlyFastResources)
| This is the same as above, but with specified behaviour of resource loading.
bool | save ()
| Save the standard address book to disk.
void | handleCrash ()
| Call this method in your crash handler to allow the library clean up possible locks.
QString | fileName ()
| Returns the default file name for vcard-based addressbook.
QString | directoryName ()
| Returns the default directory name for vcard-based addressbook.
void | setAutomaticSave (bool enable)
| Set the automatic save property of the address book.
void | close ()
| Closes the address book.
bool | automaticSave ()
| Returns whether the address book is saved at destruction time.

## Protected Member Functions

| StdAddressBook (bool onlyFastResources)
void | init (bool onlyFastResources)

## 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.

Example:

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

      if ( !ab->load() ) {
        // error
      }

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

        // do some other stuff
      }

      KABC::StdAddressBook::save();

Definition at line 56 of file stdaddressbook.h.

## Member Function Documentation

AddressBook * StdAddressBook::self | ( |  | ) | `[static]`

| Return the standard addressbook object. Definition at line 56 of file stdaddressbook.cpp. Referenced by save().

AddressBook * StdAddressBook::self | ( | bool | onlyFastResources | ) | `[static]`

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

Parameters:

  onlyFastResource | Only resources marked as 'fast' should be loaded

Definition at line 66 of file stdaddressbook.cpp.

bool StdAddressBook::save | ( |  | ) | `[static]`

| Save the standard address book to disk. Definition at line 76 of file stdaddressbook.cpp. References QPtrList::at(), QPtrList::count(), KABC::AddressBook::deleteRemovedAddressees(), KABC::AddressBook::error(), KABC::AddressBook::requestSaveTicket(), KABC::AddressBook::resources(), KABC::AddressBook::save(), and self().

void StdAddressBook::handleCrash | ( |  | ) | `[static]`

| Call this method in your crash handler to allow the library clean up possible locks. Definition at line 51 of file stdaddressbook.cpp.

QString StdAddressBook::fileName | ( |  | ) | `[static]`

| Returns the default file name for vcard-based addressbook. Definition at line 41 of file stdaddressbook.cpp. References locateLocal().

QString StdAddressBook::directoryName | ( |  | ) | `[static]`

| Returns the default directory name for vcard-based addressbook. Definition at line 46 of file stdaddressbook.cpp. References locateLocal().

void StdAddressBook::setAutomaticSave | ( | bool | enable | ) | `[static]`

| Set the automatic save property of the address book. If `enable` is TRUE (default) the address book is saved at destruction time otherwise you have to call save() to explicitely save it. Definition at line 181 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 175 of file stdaddressbook.cpp.

bool StdAddressBook::automaticSave | ( |  | ) | `[static]`

| Returns whether the address book is saved at destruction time. See also setAutomaticSave(). Definition at line 186 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 documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:29:51 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001