ocontactaccessbackend_vcard.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef __OCONTACTACCESSBACKEND_VCARD_H_
00047 #define __OCONTACTACCESSBACKEND_VCARD_H_
00048
00049 #include <opie/ocontact.h>
00050
00051 #include "ocontactaccessbackend.h"
00052
00053 class VObject;
00054
00060 class OContactAccessBackend_VCard : public OContactAccessBackend {
00061 public:
00062 OContactAccessBackend_VCard ( const QString& appname, const QString& filename = QString::null );
00063
00064 bool load ();
00065 bool reload();
00066 bool save();
00067 void clear ();
00068
00069 bool add ( const OContact& newcontact );
00070 bool remove ( int uid );
00071 bool replace ( const OContact& contact );
00072
00073 OContact find ( int uid ) const;
00074 QArray<int> allRecords() const;
00075 QArray<int> queryByExample ( const OContact &query, int settings, const QDateTime& d = QDateTime() );
00076 QArray<int> matchRegexp( const QRegExp &r ) const;
00077
00078 const uint querySettings();
00079 bool hasQuerySettings (uint querySettings) const;
00080 QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat );
00081 bool wasChangedExternally();
00082
00083 private:
00084 OContact parseVObject( VObject* obj );
00085 VObject* createVObject( const OContact& c );
00086 QString convDateToVCardDate( const QDate& c ) const;
00087 QDate convVCardDateToDate( const QString& datestr );
00088 VObject *safeAddPropValue( VObject *o, const char* prop, const QString& value );
00089 VObject *safeAddProp( VObject* o, const char* prop);
00090
00091 bool m_dirty : 1;
00092 QString m_file;
00093 QMap<int, OContact> m_map;
00094 };
00095
00096 #endif
This file is part of the documentation for OPIE Version 1.1.