kabc Library API Documentation

KABC::ResourceFile Class Reference

This resource allows access to a local file. More...

#include <resourcefile.h>

Collaboration diagram for KABC::ResourceFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ResourceFile (const KConfig *cfg)
 ResourceFile (const QString &fileName, const QString &formatName="vcard")
 ~ResourceFile ()
virtual void writeConfig (KConfig *cfg)
virtual bool doOpen ()
virtual void doClose ()
virtual TicketrequestSaveTicket ()
virtual void releaseSaveTicket (Ticket *)
virtual bool load ()
virtual bool asyncLoad ()
virtual bool save (Ticket *ticket)
virtual bool asyncSave (Ticket *ticket)
void setFileName (const QString &)
QString fileName () const
void setFormat (const QString &name)
QString format () const
virtual void removeAddressee (const Addressee &addr)

Protected Slots

void fileChanged ()

Protected Member Functions

void init (const QString &fileName, const QString &format)
bool lock (const QString &fileName)
void unlock (const QString &fileName)

Detailed Description

This resource allows access to a local file.

Definition at line 48 of file resourcefile.h.


Constructor & Destructor Documentation

KABC::ResourceFile::ResourceFile const KConfig cfg  ) 
 

Constructor.

Parameters:
cfg The config object where custom resource settings are stored.

KABC::ResourceFile::ResourceFile const QString fileName,
const QString formatName = "vcard"
 

Construct file resource on file

  • fileName using format
  • formatName.

KABC::ResourceFile::~ResourceFile  ) 
 

Destructor.


Member Function Documentation

virtual void KABC::ResourceFile::writeConfig KConfig cfg  )  [virtual]
 

Writes the config back.

virtual bool KABC::ResourceFile::doOpen  )  [virtual]
 

Tries to open the file and checks for the proper format.

This method should be called before load().

virtual void KABC::ResourceFile::doClose  )  [virtual]
 

Closes the file again.

virtual Ticket* KABC::ResourceFile::requestSaveTicket  )  [virtual]
 

Requests a save ticket, that is used by save().

virtual bool KABC::ResourceFile::load  )  [virtual]
 

Loads all addressees from file to the address book.

Returns true if all addressees could be loaded otherwise false.

virtual bool KABC::ResourceFile::save Ticket ticket  )  [virtual]
 

Saves all addresses from address book to file.

Returns true if all addressees could be saved otherwise false.

Parameters:
ticket The ticket returned by requestSaveTicket()

void KABC::ResourceFile::setFileName const QString  ) 
 

Set name of file to be used for saving.

QString KABC::ResourceFile::fileName  )  const
 

Return name of file used for loading and saving the address book.

void KABC::ResourceFile::setFormat const QString name  ) 
 

Sets a new format by name.

QString KABC::ResourceFile::format  )  const
 

Returns the format name.

virtual void KABC::ResourceFile::removeAddressee const Addressee addr  )  [virtual]
 

Remove a addressee from its source.

This method is mainly called by KABC::AddressBook.


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for kabc Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:31:53 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003