• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

kabc

KABC::ResourceFile

KABC::ResourceFile Class Reference

#include <resourcefile.h>

Inherits KABC::Resource.

List of all members.


Detailed Description

This resource allows access to a local file.

Definition at line 45 of file resourcefile.h.


Public Member Functions

 ResourceFile ()
 ResourceFile (const KConfigGroup &group)
 ResourceFile (const QString &fileName, const QString &formatName=QLatin1String("vcard"))
 ~ResourceFile ()
virtual void writeConfig (KConfigGroup &group)
virtual bool doOpen ()
virtual void doClose ()
virtual Ticket * requestSaveTicket ()
virtual void releaseSaveTicket (Ticket *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 (const QString &path)

Protected Member Functions

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

Constructor & Destructor Documentation

ResourceFile::ResourceFile (  ) 

Default constructor.

Definition at line 55 of file resourcefile.cpp.

ResourceFile::ResourceFile ( const KConfigGroup &  group  )  [explicit]

Constructor.

Parameters:
group The configuration group where custom resource settings are stored.

Definition at line 67 of file resourcefile.cpp.

ResourceFile::ResourceFile ( const QString &  fileName,
const QString &  formatName = QLatin1String( "vcard" ) 
) [explicit]

Constructs a file resource on file.

  • fileName using format
  • formatName.
Parameters:
fileName The file to use for this resource
formatName The format of the data in the given file

Definition at line 79 of file resourcefile.cpp.

ResourceFile::~ResourceFile (  ) 

Destructor.

Definition at line 110 of file resourcefile.cpp.


Member Function Documentation

void ResourceFile::writeConfig ( KConfigGroup &  group  )  [virtual]

Writes the config back.

Reimplemented from KRES::Resource.

Definition at line 118 of file resourcefile.cpp.

bool ResourceFile::doOpen (  )  [virtual]

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

This method should be called before load().

Reimplemented from KRES::Resource.

Definition at line 164 of file resourcefile.cpp.

void ResourceFile::doClose (  )  [virtual]

Closes the file again.

Reimplemented from KRES::Resource.

Definition at line 199 of file resourcefile.cpp.

Ticket * ResourceFile::requestSaveTicket (  )  [virtual]

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

Definition at line 131 of file resourcefile.cpp.

bool ResourceFile::load (  )  [virtual]

Loads all addressees from file to the address book.

Returns true if all addressees could be loaded otherwise false.

Definition at line 203 of file resourcefile.cpp.

bool 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()

Definition at line 245 of file resourcefile.cpp.

void ResourceFile::setFileName ( const QString &  fileName  ) 

Set name of file to be used for saving.

Definition at line 383 of file resourcefile.cpp.

QString ResourceFile::fileName (  )  const

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

Definition at line 396 of file resourcefile.cpp.

void ResourceFile::setFormat ( const QString &  name  ) 

Sets a new format by name.

Definition at line 401 of file resourcefile.cpp.

QString ResourceFile::format (  )  const

Returns the format name.

Definition at line 410 of file resourcefile.cpp.

void ResourceFile::removeAddressee ( const Addressee &  addr  )  [virtual]

Remove a addressee from its source.

This method is mainly called by KABC::AddressBook.

Parameters:
addr The addressee to remove
See also:
KABC::AddressBook::removeAddressee()

Definition at line 445 of file resourcefile.cpp.


The documentation for this class was generated from the following files:
  • resourcefile.h
  • resourcefile.cpp

kabc

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal