Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::OPimContactAccessBackend_VCard Class Reference

#include </home/clem/local/src/opie/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h>

Inheritance diagram for Opie::OPimContactAccessBackend_VCard:

Inheritance graph
[legend]
Collaboration diagram for Opie::OPimContactAccessBackend_VCard:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OPimContactAccessBackend_VCard (const QString &appname, const QString &filename=QString::null)
bool load ()
bool reload ()
bool save ()
void clear ()
bool add (const OPimContact &newcontact)
bool remove (int uid)
bool replace (const OPimContact &contact)
OPimContact find (int uid) const
UIDArray allRecords () const
bool wasChangedExternally ()

Private Member Functions

OPimContact parseVObject (VObject *obj)
VObjectcreateVObject (const OPimContact &c)
QString convDateToVCardDate (const QDate &c) const
QDate convVCardDateToDate (const QString &datestr)
VObjectsafeAddPropValue (VObject *o, const char *prop, const QString &value)
VObjectsafeAddProp (VObject *o, const char *prop)

Private Attributes

bool m_dirty: 1
QString m_file
QMap< int, OPimContactm_map
uint version_major
uint version_minor

Detailed Description

This is the vCard 2.1 implementation of the Contact Storage
See also:
OPimContactAccessBackend_XML

OPimAccessBackend

Definition at line 47 of file ocontactaccessbackend_vcard.h.


Constructor & Destructor Documentation

Opie::OPimContactAccessBackend_VCard::OPimContactAccessBackend_VCard const QString appname,
const QString filename = QString::null
 

Definition at line 49 of file ocontactaccessbackend_vcard.cpp.

References load().


Member Function Documentation

bool Opie::OPimContactAccessBackend_VCard::add const OPimContact newcontact  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimContact >.

Definition at line 134 of file ocontactaccessbackend_vcard.cpp.

References QMap< Key, T >::insert(), m_dirty, m_map, and Qtopia::Record::uid().

UIDArray Opie::OPimContactAccessBackend_VCard::allRecords  )  const [virtual]
 

Implements Opie::OPimAccessBackend< OPimContact >.

Definition at line 160 of file ocontactaccessbackend_vcard.cpp.

References QMap< Key, T >::begin(), QMap< Key, T >::count(), QMap< Key, T >::end(), i, and m_map.

void Opie::OPimContactAccessBackend_VCard::clear  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimContact >.

Definition at line 128 of file ocontactaccessbackend_vcard.cpp.

References QMap< Key, T >::clear(), m_dirty, and m_map.

QString Opie::OPimContactAccessBackend_VCard::convDateToVCardDate const QDate c  )  const [private]
 

Definition at line 552 of file ocontactaccessbackend_vcard.cpp.

References QDate::day(), QString::find(), QDate::month(), pos, QString::replace(), and QDate::year().

Referenced by createVObject().

QDate Opie::OPimContactAccessBackend_VCard::convVCardDateToDate const QString datestr  )  [private]
 

Definition at line 566 of file ocontactaccessbackend_vcard.cpp.

References Opie::OPimContactAccessBackend::d, QString::find(), QString::left(), QString::length(), QString::mid(), odebug, oendl, and Opie::MM::y.

Referenced by parseVObject().

VObject * Opie::OPimContactAccessBackend_VCard::createVObject const OPimContact c  )  [private]
 

Definition at line 436 of file ocontactaccessbackend_vcard.cpp.

References Opie::OPimContact::anniversary(), Opie::OPimContact::assistant(), QValueList< T >::begin(), Opie::OPimContact::birthday(), Opie::OPimContact::businessCity(), Opie::OPimContact::businessCountry(), Opie::OPimContact::businessFax(), Opie::OPimContact::businessMobile(), Opie::OPimContact::businessPager(), Opie::OPimContact::businessPhone(), Opie::OPimContact::businessState(), Opie::OPimContact::businessStreet(), Opie::OPimContact::businessWebpage(), Opie::OPimContact::businessZip(), Opie::OPimContact::children(), Opie::OPimContact::company(), convDateToVCardDate(), QDateTime::currentDateTime(), Opie::OPimContact::department(), Opie::OPimContact::emailList(), QValueList< T >::end(), Opie::OPimContact::firstName(), Opie::OPimContact::fullName(), Opie::OPimContact::gender(), Opie::OPimContact::homeCity(), Opie::OPimContact::homeCountry(), Opie::OPimContact::homeFax(), Opie::OPimContact::homeMobile(), Opie::OPimContact::homePhone(), Opie::OPimContact::homeState(), Opie::OPimContact::homeStreet(), Opie::OPimContact::homeWebpage(), Opie::OPimContact::homeZip(), Opie::OPimContact::jobTitle(), Opie::OPimContact::lastName(), Opie::OPimContact::manager(), Opie::OPimContact::middleName(), name, Opie::OPimContact::nickname(), Opie::OPimContact::notes(), QString::number(), Opie::OPimContact::office(), Opie::OPimContact::profession(), safeAddProp(), safeAddPropValue(), Opie::OPimContact::spouse(), Opie::OPimContact::suffix(), title, Opie::OPimContact::title(), TimeConversion::toISO8601(), Qtopia::Record::uid(), VCAdditionalNamesProp, VCAdrProp, VCBirthDateProp, VCCardProp, VCCellularProp, VCCityProp, VCCountryNameProp, VCEmailAddressProp, VCFamilyNameProp, VCFaxProp, VCFullNameProp, VCGivenNameProp, VCHomeProp, VCInternetProp, VCLastRevisedProp, VCNamePrefixesProp, VCNameProp, VCNameSuffixesProp, VCNoteProp, VCOrgNameProp, VCOrgProp, VCOrgUnit2Prop, VCOrgUnitProp, VCPagerProp, VCPostalCodeProp, VCRegionProp, VCStreetAddressProp, VCTelephoneProp, VCTitleProp, VCUniqueStringProp, VCURLProp, VCVersionProp, and VCWorkProp.

Referenced by save().

OPimContact Opie::OPimContactAccessBackend_VCard::find int  uid  )  const
 

Definition at line 155 of file ocontactaccessbackend_vcard.cpp.

References m_map.

bool Opie::OPimContactAccessBackend_VCard::load  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimContact >.

Definition at line 59 of file ocontactaccessbackend_vcard.cpp.

References QMap< Key, T >::clear(), data, QFile::encodeName(), QFile::exists(), QMap< Key, T >::insert(), l, m_dirty, m_file, m_map, odebug, oendl, owarn, parseVObject(), Opie::OPimContact::setUid(), t, and Qtopia::Record::uid().

Referenced by OPimContactAccessBackend_VCard(), and reload().

OPimContact Opie::OPimContactAccessBackend_VCard::parseVObject VObject obj  )  [private]
 

Definition at line 178 of file ocontactaccessbackend_vcard.cpp.

References convVCardDateToDate(), QString::data(), FALSE, QString::fromUtf8(), Opie::OPimContact::insertEmail(), QString::latin1(), QCString::left(), name, o, odebug, oendl, printf, Opie::OPimContact::setAnniversary(), Opie::OPimContact::setAssistant(), Opie::OPimContact::setBirthday(), Opie::OPimContact::setBusinessCity(), Opie::OPimContact::setBusinessCountry(), Opie::OPimContact::setBusinessFax(), Opie::OPimContact::setBusinessMobile(), Opie::OPimContact::setBusinessPager(), Opie::OPimContact::setBusinessPhone(), Opie::OPimContact::setBusinessState(), Opie::OPimContact::setBusinessStreet(), Opie::OPimContact::setBusinessWebpage(), Opie::OPimContact::setBusinessZip(), Opie::OPimContact::setChildren(), Opie::OPimContact::setCompany(), Opie::OPimContact::setDepartment(), Opie::OPimContact::setFileAs(), Opie::OPimContact::setFirstName(), Opie::OPimContact::setGender(), Opie::OPimContact::setHomeCity(), Opie::OPimContact::setHomeCountry(), Opie::OPimContact::setHomeFax(), Opie::OPimContact::setHomeMobile(), Opie::OPimContact::setHomePhone(), Opie::OPimContact::setHomeState(), Opie::OPimContact::setHomeStreet(), Opie::OPimContact::setHomeWebpage(), Opie::OPimContact::setHomeZip(), Opie::OPimContact::setJobTitle(), Opie::OPimContact::setLastName(), Opie::OPimContact::setManager(), Opie::OPimContact::setMiddleName(), Opie::OPimContact::setNickname(), Opie::OPimContact::setNotes(), Opie::OPimContact::setOffice(), Opie::OPimContact::setProfession(), Opie::OPimContact::setSpouse(), Opie::OPimContact::setSuffix(), Opie::OPimContact::setTitle(), QStringList::split(), TRUE, type, VCAdditionalNamesProp, VCAdrProp, VCBirthDateProp, VCCellularProp, VCCityProp, VCCommentProp, VCCountryNameProp, VCEmailAddressProp, VCFamilyNameProp, VCFaxProp, VCGivenNameProp, VCHomeProp, VCInternetProp, VCNamePrefixesProp, VCNameProp, VCNameSuffixesProp, VCOrgNameProp, VCOrgProp, VCOrgUnit2Prop, VCOrgUnitProp, VCPagerProp, VCPostalCodeProp, VCPreferredProp, VCRegionProp, VCStreetAddressProp, VCTelephoneProp, VCTitleProp, VCURLProp, VCVersionProp, VCVoiceProp, VCWorkProp, version, version_major, and version_minor.

Referenced by load().

bool Opie::OPimContactAccessBackend_VCard::reload  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimContact >.

Definition at line 97 of file ocontactaccessbackend_vcard.cpp.

References load().

bool Opie::OPimContactAccessBackend_VCard::remove int  uid  ) 
 

Definition at line 141 of file ocontactaccessbackend_vcard.cpp.

References m_dirty, m_map, and QMap< Key, T >::remove().

bool Opie::OPimContactAccessBackend_VCard::replace const OPimContact contact  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimContact >.

Definition at line 148 of file ocontactaccessbackend_vcard.cpp.

References m_dirty, m_map, and QMap< Key, T >::replace().

VObject * Opie::OPimContactAccessBackend_VCard::safeAddProp VObject o,
const char *  prop
[private]
 

Definition at line 599 of file ocontactaccessbackend_vcard.cpp.

Referenced by createVObject().

VObject * Opie::OPimContactAccessBackend_VCard::safeAddPropValue VObject o,
const char *  prop,
const QString value
[private]
 

Definition at line 591 of file ocontactaccessbackend_vcard.cpp.

References QString::isEmpty(), and QString::utf8().

Referenced by createVObject().

bool Opie::OPimContactAccessBackend_VCard::save  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimContact >.

Definition at line 101 of file ocontactaccessbackend_vcard.cpp.

References QMap< Key, T >::begin(), createVObject(), QMap< Key, T >::end(), QFile::fh, IO_WriteOnly, m_dirty, m_file, m_map, QFile::open(), VCCalProp, VCVersionProp, and writeVObject().

bool Opie::OPimContactAccessBackend_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 Opie::OPimContactAccessBackend.

Definition at line 172 of file ocontactaccessbackend_vcard.cpp.


Member Data Documentation

bool Opie::OPimContactAccessBackend_VCard::m_dirty [private]
 

Definition at line 73 of file ocontactaccessbackend_vcard.h.

Referenced by add(), clear(), load(), remove(), replace(), and save().

QString Opie::OPimContactAccessBackend_VCard::m_file [private]
 

Definition at line 74 of file ocontactaccessbackend_vcard.h.

Referenced by load(), and save().

QMap<int, OPimContact> Opie::OPimContactAccessBackend_VCard::m_map [private]
 

Definition at line 75 of file ocontactaccessbackend_vcard.h.

Referenced by add(), allRecords(), clear(), find(), load(), remove(), replace(), and save().

uint Opie::OPimContactAccessBackend_VCard::version_major [private]
 

Version of parsed VCard

Definition at line 80 of file ocontactaccessbackend_vcard.h.

Referenced by parseVObject().

uint Opie::OPimContactAccessBackend_VCard::version_minor [private]
 

Definition at line 81 of file ocontactaccessbackend_vcard.h.

Referenced by parseVObject().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:59:18 2005 for OPIE by  doxygen 1.4.2