libopie PIM API Documentation

OContactAccessBackend_VCard Class Reference

This is the vCard 2.1 implementation of the Contact Storage. More...

#include <ocontactaccessbackend_vcard.h>

Inheritance diagram for OContactAccessBackend_VCard:

Inheritance graph
[legend]
Collaboration diagram for OContactAccessBackend_VCard:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OContactAccessBackend_VCard (const QString &appname, const QString &filename=QString::null)
bool load ()
 load the resource

bool reload ()
 reload the resource

bool save ()
 save the resource and all it's changes

void clear ()
 clear the back end

bool add (const OContact &newcontact)
 add T

bool remove (int uid)
 remove

bool replace (const OContact &contact)
 replace a record with T.uid()

OContact find (int uid) const
 find the OPimRecord with uid

QArray< intallRecords () const
 return an array of all available uids

QArray< intqueryByExample (const OContact &query, int settings, const QDateTime &d=QDateTime())
 queryByExample for T with the given Settings

QArray< intmatchRegexp (const QRegExp &r) const
 return a List of records that match the regex

const uint querySettings ()
 Return all possible settings.

bool hasQuerySettings (uint querySettings) const
 Check whether settings are correct.

QArray< intsorted (bool ascending, int sortOrder, int sortFilter, int cat)
 FIXME!!! Returns a sorted list of records either ascendinf or descending for a giving criteria and category.

bool wasChangedExternally ()
 Return if database was changed externally.


Detailed Description

This is the vCard 2.1 implementation of the Contact Storage.

See also:
OContactAccessBackend_XML

OPimAccessBackend

Definition at line 60 of file ocontactaccessbackend_vcard.h.


Constructor & Destructor Documentation

OContactAccessBackend_VCard::OContactAccessBackend_VCard const QString appname,
const QString filename = QString::null
 

Definition at line 99 of file ocontactaccessbackend_vcard.cpp.

References load().


Member Function Documentation

bool OContactAccessBackend_VCard::load  )  [virtual]
 

load the resource

Implements OPimAccessBackend< OContact >.

Definition at line 107 of file ocontactaccessbackend_vcard.cpp.

References QMap< int, OContact >::clear(), QFile::exists(), QMap< int, OContact >::insert(), QString::latin1(), OContact::setUid(), and Qtopia::Record::uid().

Referenced by OContactAccessBackend_VCard(), and reload().

bool OContactAccessBackend_VCard::reload  )  [virtual]
 

reload the resource

Implements OPimAccessBackend< OContact >.

Definition at line 145 of file ocontactaccessbackend_vcard.cpp.

References load().

bool OContactAccessBackend_VCard::save  )  [virtual]
 

save the resource and all it's changes

Implements OPimAccessBackend< OContact >.

Definition at line 149 of file ocontactaccessbackend_vcard.cpp.

References QMap< int, OContact >::begin(), and QMap< int, OContact >::end().

void OContactAccessBackend_VCard::clear  )  [virtual]
 

clear the back end

Implements OPimAccessBackend< OContact >.

Definition at line 176 of file ocontactaccessbackend_vcard.cpp.

References QMap< int, OContact >::clear().

bool OContactAccessBackend_VCard::add const OContact newcontact  )  [virtual]
 

add T

Implements OPimAccessBackend< OContact >.

Definition at line 182 of file ocontactaccessbackend_vcard.cpp.

References QMap< int, OContact >::insert(), and Qtopia::Record::uid().

bool OContactAccessBackend_VCard::remove int  uid  )  [virtual]
 

remove

Implements OPimAccessBackend< OContact >.

Definition at line 189 of file ocontactaccessbackend_vcard.cpp.

References QMap< int, OContact >::remove().

bool OContactAccessBackend_VCard::replace const OContact contact  )  [virtual]
 

replace a record with T.uid()

Implements OPimAccessBackend< OContact >.

Definition at line 196 of file ocontactaccessbackend_vcard.cpp.

References QMap< int, OContact >::replace(), and Qtopia::Record::uid().

OContact OContactAccessBackend_VCard::find int  uid  )  const [virtual]
 

find the OPimRecord with uid

Parameters:
uid returns T and T.isEmpty() if nothing was found

Implements OPimAccessBackend< OContact >.

Definition at line 203 of file ocontactaccessbackend_vcard.cpp.

QArray< int > OContactAccessBackend_VCard::allRecords  )  const [virtual]
 

return an array of all available uids

Implements OPimAccessBackend< OContact >.

Definition at line 208 of file ocontactaccessbackend_vcard.cpp.

References QMap< int, OContact >::begin(), QMap< int, OContact >::count(), and QMap< int, OContact >::end().

QArray< int > OContactAccessBackend_VCard::queryByExample const OContact query,
int  settings,
const QDateTime d = QDateTime()
[virtual]
 

queryByExample for T with the given Settings

Implements OPimAccessBackend< OContact >.

Definition at line 221 of file ocontactaccessbackend_vcard.cpp.

QArray< int > OContactAccessBackend_VCard::matchRegexp const QRegExp r  )  const [virtual]
 

return a List of records that match the regex

Implements OContactAccessBackend.

Definition at line 228 of file ocontactaccessbackend_vcard.cpp.

const uint OContactAccessBackend_VCard::querySettings  )  [virtual]
 

Return all possible settings.

Returns:
All settings provided by the current backend (i.e.: query_WildCards & query_IgnoreCase)

Implements OContactAccessBackend.

Definition at line 234 of file ocontactaccessbackend_vcard.cpp.

bool OContactAccessBackend_VCard::hasQuerySettings uint  querySettings  )  const [virtual]
 

Check whether settings are correct.

Returns:
true if the given settings are correct and possible.

Implements OContactAccessBackend.

Definition at line 239 of file ocontactaccessbackend_vcard.cpp.

QArray< int > OContactAccessBackend_VCard::sorted bool  ascending,
int  sortOrder,
int  sortFilter,
int  cat
[virtual]
 

FIXME!!! Returns a sorted list of records either ascendinf or descending for a giving criteria and category.

Implements OContactAccessBackend.

Definition at line 250 of file ocontactaccessbackend_vcard.cpp.

bool OContactAccessBackend_VCard::wasChangedExternally  )  [virtual]
 

Return if database was changed externally.

This may just make sense on file based databases like a XML-File. It is used to prevent to overwrite the current database content if the file was already changed by something else ! If this happens, we have to reload before save our data. If we use real databases, this should be handled by the database management system themselve, therefore this function should always return false in this case. It is not our problem to handle this conflict ...

Returns:
true if the database was changed and if save without reload will be dangerous. false if the database was not changed or it is save to write in this situation.

Implements OContactAccessBackend.

Definition at line 244 of file ocontactaccessbackend_vcard.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:26:10 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001