Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_vcard.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_vcard.h | 18 |
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 | |||
@@ -1,86 +1,96 @@ | |||
1 | /* | 1 | /* |
2 | * VCard Backend for the OPIE-Contact Database. | 2 | * VCard Backend for the OPIE-Contact Database. |
3 | * | 3 | * |
4 | * Copyright (C) 2000 Trolltech AS. All rights reserved. | 4 | * Copyright (C) 2000 Trolltech AS. All rights reserved. |
5 | * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) | 5 | * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) |
6 | * | 6 | * |
7 | * ===================================================================== | 7 | * ===================================================================== |
8 | *This program is free software; you can redistribute it and/or | 8 | *This program is free software; you can redistribute it and/or |
9 | *modify it under the terms of the GNU Library General Public | 9 | *modify it under the terms of the GNU Library General Public |
10 | * License as published by the Free Software Foundation; either | 10 | * License as published by the Free Software Foundation; either |
11 | * version 2 of the License, or (at your option) any later version. | 11 | * version 2 of the License, or (at your option) any later version. |
12 | * ===================================================================== | 12 | * ===================================================================== |
13 | * ToDo: | 13 | * ToDo: |
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 |
26 | * the binaries for today-addressbook. | 31 | * the binaries for today-addressbook. |
27 | * | 32 | * |
28 | * Revision 1.4 2002/12/07 13:26:22 eilers | 33 | * Revision 1.4 2002/12/07 13:26:22 eilers |
29 | * Fixing bug in storing anniversary.. | 34 | * Fixing bug in storing anniversary.. |
30 | * | 35 | * |
31 | * Revision 1.3 2002/11/13 14:14:51 eilers | 36 | * Revision 1.3 2002/11/13 14:14:51 eilers |
32 | * Added sorted for Contacts.. | 37 | * Added sorted for Contacts.. |
33 | * | 38 | * |
34 | * Revision 1.2 2002/11/10 15:41:53 eilers | 39 | * Revision 1.2 2002/11/10 15:41:53 eilers |
35 | * Bugfixes.. | 40 | * Bugfixes.. |
36 | * | 41 | * |
37 | * Revision 1.1 2002/11/09 14:34:52 eilers | 42 | * Revision 1.1 2002/11/09 14:34:52 eilers |
38 | * Added VCard Backend. | 43 | * Added VCard Backend. |
39 | * | 44 | * |
40 | */ | 45 | */ |
41 | #ifndef __OCONTACTACCESSBACKEND_VCARD_H_ | 46 | #ifndef __OCONTACTACCESSBACKEND_VCARD_H_ |
42 | #define __OCONTACTACCESSBACKEND_VCARD_H_ | 47 | #define __OCONTACTACCESSBACKEND_VCARD_H_ |
43 | 48 | ||
44 | #include <opie/ocontact.h> | 49 | #include <opie/ocontact.h> |
45 | 50 | ||
46 | #include "ocontactaccessbackend.h" | 51 | #include "ocontactaccessbackend.h" |
47 | 52 | ||
48 | class VObject; | 53 | class VObject; |
49 | 54 | ||
55 | /** | ||
56 | * This is the vCard 2.1 implementation of the Contact Storage | ||
57 | * @see OContactAccessBackend_XML | ||
58 | * @see OPimAccessBackend | ||
59 | */ | ||
50 | class OContactAccessBackend_VCard : public OContactAccessBackend { | 60 | class 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 | ||
73 | private: | 83 | private: |
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 |