author | eilers <eilers> | 2002-11-09 14:34:52 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-11-09 14:34:52 (UTC) |
commit | 66b3123dabbad8bdfc75893e0e0c4c4e63301435 (patch) (unidiff) | |
tree | 24098aa7e3de8e2cead0a0dd70d6fb4d07111659 /libopie/pim/ocontactaccessbackend_vcard.h | |
parent | fe6a34ccbccac131c0421a06834ca33de33c0900 (diff) | |
download | opie-66b3123dabbad8bdfc75893e0e0c4c4e63301435.zip opie-66b3123dabbad8bdfc75893e0e0c4c4e63301435.tar.gz opie-66b3123dabbad8bdfc75893e0e0c4c4e63301435.tar.bz2 |
Added VCard Backend.
Diffstat (limited to 'libopie/pim/ocontactaccessbackend_vcard.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/ocontactaccessbackend_vcard.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/libopie/pim/ocontactaccessbackend_vcard.h b/libopie/pim/ocontactaccessbackend_vcard.h new file mode 100644 index 0000000..c1422b0 --- a/dev/null +++ b/libopie/pim/ocontactaccessbackend_vcard.h | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * VCard Backend for the OPIE-Contact Database. | ||
3 | * | ||
4 | * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) | ||
5 | * | ||
6 | * ===================================================================== | ||
7 | *This program is free software; you can redistribute it and/or | ||
8 | *modify it under the terms of the GNU Library General Public | ||
9 | * License as published by the Free Software Foundation; either | ||
10 | * version 2 of the License, or (at your option) any later version. | ||
11 | * ===================================================================== | ||
12 | * ToDo: | ||
13 | * | ||
14 | * ===================================================================== | ||
15 | * Version: $Id$ | ||
16 | * ===================================================================== | ||
17 | * History: | ||
18 | * $Log$ | ||
19 | * Revision 1.1 2002/11/09 14:34:52 eilers | ||
20 | * Added VCard Backend. | ||
21 | * | ||
22 | */ | ||
23 | #ifndef __OCONTACTACCESSBACKEND_VCARD_H_ | ||
24 | #define __OCONTACTACCESSBACKEND_VCARD_H_ | ||
25 | |||
26 | #include <opie/ocontact.h> | ||
27 | |||
28 | #include "ocontactaccessbackend.h" | ||
29 | |||
30 | class VObject; | ||
31 | |||
32 | class OContactAccessBackend_VCard : public OContactAccessBackend { | ||
33 | public: | ||
34 | OContactAccessBackend_VCard ( QString appname, QString filename = 0l ); | ||
35 | |||
36 | bool load (); | ||
37 | bool reload(); | ||
38 | bool save(); | ||
39 | void clear (); | ||
40 | |||
41 | bool add ( const OContact& newcontact ); | ||
42 | bool remove ( int uid ); | ||
43 | bool replace ( const OContact& contact ); | ||
44 | |||
45 | OContact find ( int uid ) const; | ||
46 | QArray<int> allRecords() const; | ||
47 | QArray<int> queryByExample ( const OContact &query, int settings ); | ||
48 | QArray<int> matchRegexp( const QRegExp &r ) const; | ||
49 | |||
50 | const uint querySettings(); | ||
51 | bool hasQuerySettings (uint querySettings) const; | ||
52 | |||
53 | private: | ||
54 | OContact parseVObject( VObject* obj ); | ||
55 | VObject* createVObject( const OContact& c ); | ||
56 | QDate convVCardDateToDate( const QString& datestr ); | ||
57 | VObject *safeAddPropValue( VObject *o, const char* prop, const QString& value ); | ||
58 | VObject *safeAddProp( VObject* o, const char* prop); | ||
59 | |||
60 | bool m_dirty : 1; | ||
61 | QString m_file; | ||
62 | QMap<int, OContact> m_map; | ||
63 | }; | ||
64 | |||
65 | #endif | ||