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.

Static Public Methods

AddressBookself ()
 Return the standard addressbook object.

AddressBookself (bool onlyFastResources)
 This is the same as above, but with specified behaviour of resource loading.

bool save ()
 Save the standard address book to disk.

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.


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

bool StdAddressBook::save   [static]
 

Save the standard address book to disk.

Definition at line 105 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().

QString StdAddressBook::fileName   [static]
 

Returns the default file name for vcard-based addressbook.

Definition at line 75 of file stdaddressbook.cpp.

QString StdAddressBook::directoryName   [static]
 

Returns the default directory name for vcard-based addressbook.

Definition at line 80 of file stdaddressbook.cpp.

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

bool StdAddressBook::automaticSave   [static]
 

Returns whether the address book is saved at destruction time.

See also setAutomaticSave().

Definition at line 217 of file stdaddressbook.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:22:10 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001