summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_vcard.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_vcard.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h
index 93e2da3..712d769 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h
@@ -14,12 +14,17 @@
14 * 14 *
15 * ===================================================================== 15 * =====================================================================
16 * Version: $Id$ 16 * Version: $Id$
17 * ===================================================================== 17 * =====================================================================
18 * History: 18 * History:
19 * $Log$ 19 * $Log$
20 * Revision 1.6 2003/04/13 18:07:10 zecke
21 * More API doc
22 * QString -> const QString&
23 * QString = 0l -> QString::null
24 *
20 * Revision 1.5 2003/03/21 10:33:09 eilers 25 * Revision 1.5 2003/03/21 10:33:09 eilers
21 * Merged speed optimized xml backend for contacts to main. 26 * Merged speed optimized xml backend for contacts to main.
22 * Added QDateTime to querybyexample. For instance, it is now possible to get 27 * Added QDateTime to querybyexample. For instance, it is now possible to get
23 * all Birthdays/Anniversaries between two dates. This should be used 28 * all Birthdays/Anniversaries between two dates. This should be used
24 * to show all birthdays in the datebook.. 29 * to show all birthdays in the datebook..
25 * This change is sourcecode backward compatible but you have to upgrade 30 * This change is sourcecode backward compatible but you have to upgrade
@@ -44,43 +49,48 @@
44#include <opie/ocontact.h> 49#include <opie/ocontact.h>
45 50
46#include "ocontactaccessbackend.h" 51#include "ocontactaccessbackend.h"
47 52
48class VObject; 53class VObject;
49 54
55/**
56 * This is the vCard 2.1 implementation of the Contact Storage
57 * @see OContactAccessBackend_XML
58 * @see OPimAccessBackend
59 */
50class OContactAccessBackend_VCard : public OContactAccessBackend { 60class OContactAccessBackend_VCard : public OContactAccessBackend {
51 public: 61 public:
52 OContactAccessBackend_VCard ( QString appname, QString filename = 0l ); 62 OContactAccessBackend_VCard ( const QString& appname, const QString& filename = QString::null );
53 63
54 bool load (); 64 bool load ();
55 bool reload(); 65 bool reload();
56 bool save(); 66 bool save();
57 void clear (); 67 void clear ();
58 68
59 bool add ( const OContact& newcontact ); 69 bool add ( const OContact& newcontact );
60 bool remove ( int uid ); 70 bool remove ( int uid );
61 bool replace ( const OContact& contact ); 71 bool replace ( const OContact& contact );
62 72
63 OContact find ( int uid ) const; 73 OContact find ( int uid ) const;
64 QArray<int> allRecords() const; 74 QArray<int> allRecords() const;
65 QArray<int> queryByExample ( const OContact &query, int settings, const QDateTime& d = QDateTime() ); 75 QArray<int> queryByExample ( const OContact &query, int settings, const QDateTime& d = QDateTime() );
66 QArray<int> matchRegexp( const QRegExp &r ) const; 76 QArray<int> matchRegexp( const QRegExp &r ) const;
67 77
68 const uint querySettings(); 78 const uint querySettings();
69 bool hasQuerySettings (uint querySettings) const; 79 bool hasQuerySettings (uint querySettings) const;
70 QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ); 80 QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat );
71 bool wasChangedExternally(); 81 bool wasChangedExternally();
72 82
73private: 83private:
74 OContact parseVObject( VObject* obj ); 84 OContact parseVObject( VObject* obj );
75 VObject* createVObject( const OContact& c ); 85 VObject* createVObject( const OContact& c );
76 QString convDateToVCardDate( const QDate& c ) const; 86 QString convDateToVCardDate( const QDate& c ) const;
77 QDate convVCardDateToDate( const QString& datestr ); 87 QDate convVCardDateToDate( const QString& datestr );
78 VObject *safeAddPropValue( VObject *o, const char* prop, const QString& value ); 88 VObject *safeAddPropValue( VObject *o, const char* prop, const QString& value );
79 VObject *safeAddProp( VObject* o, const char* prop); 89 VObject *safeAddProp( VObject* o, const char* prop);
80 90
81 bool m_dirty : 1; 91 bool m_dirty : 1;
82 QString m_file; 92 QString m_file;
83 QMap<int, OContact> m_map; 93 QMap<int, OContact> m_map;
84}; 94};
85 95
86#endif 96#endif