Diffstat (limited to 'noncore/unsupported/libopie/pim/ocontactaccessbackend.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/libopie/pim/ocontactaccessbackend.h | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/noncore/unsupported/libopie/pim/ocontactaccessbackend.h b/noncore/unsupported/libopie/pim/ocontactaccessbackend.h new file mode 100644 index 0000000..cfeeff2 --- a/dev/null +++ b/noncore/unsupported/libopie/pim/ocontactaccessbackend.h | |||
@@ -0,0 +1,131 @@ | |||
1 | /** | ||
2 | * The class responsible for managing a backend. | ||
3 | * The implementation of this abstract class contains | ||
4 | * the complete database handling. | ||
5 | * | ||
6 | * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) | ||
7 | * Copyright (c) 2002 by Holger Freyther (zecke@handhelds.org) | ||
8 | * | ||
9 | * ===================================================================== | ||
10 | *This program is free software; you can redistribute it and/or | ||
11 | *modify it under the terms of the GNU Library General Public | ||
12 | * License as published by the Free Software Foundation; | ||
13 | * either version 2 of the License, or (at your option) any later | ||
14 | * version. | ||
15 | * ===================================================================== | ||
16 | * ToDo: Define enum for query settings | ||
17 | * ===================================================================== | ||
18 | * Version: $Id$ | ||
19 | * ===================================================================== | ||
20 | * History: | ||
21 | * $Log$ | ||
22 | * Revision 1.1 2004/11/16 21:46:07 mickeyl | ||
23 | * libopie1 goes into unsupported | ||
24 | * | ||
25 | * Revision 1.7 2004/02/19 02:05:37 zecke | ||
26 | * Add notes for API fixes and BC stuff | ||
27 | * | ||
28 | * Revision 1.6 2003/08/01 12:30:16 eilers | ||
29 | * Merging changes from BRANCH_1_0 to HEAD | ||
30 | * | ||
31 | * Revision 1.5.4.1 2003/06/30 14:34:19 eilers | ||
32 | * Patches from Zecke: | ||
33 | * Fixing and cleaning up extraMap handling | ||
34 | * Adding d_ptr for binary compatibility in the future | ||
35 | * | ||
36 | * Revision 1.5 2003/04/13 18:07:10 zecke | ||
37 | * More API doc | ||
38 | * QString -> const QString& | ||
39 | * QString = 0l -> QString::null | ||
40 | * | ||
41 | * Revision 1.4 2002/11/13 14:14:51 eilers | ||
42 | * Added sorted for Contacts.. | ||
43 | * | ||
44 | * Revision 1.3 2002/11/01 15:10:42 eilers | ||
45 | * Added regExp-search in database for all fields in a contact. | ||
46 | * | ||
47 | * Revision 1.2 2002/10/07 17:34:24 eilers | ||
48 | * added OBackendFactory for advanced backend access | ||
49 | * | ||
50 | * Revision 1.1 2002/09/27 17:11:44 eilers | ||
51 | * Added API for accessing the Contact-Database ! It is compiling, but | ||
52 | * please do not expect that anything is working ! | ||
53 | * I will debug that stuff in the next time .. | ||
54 | * Please read README_COMPILE for compiling ! | ||
55 | * | ||
56 | * ===================================================================== | ||
57 | * | ||
58 | */ | ||
59 | |||
60 | #ifndef _OCONTACTACCESSBACKEND_H_ | ||
61 | #define _OCONTACTACCESSBACKEND_H_ | ||
62 | |||
63 | #include "ocontact.h" | ||
64 | #include "opimaccessbackend.h" | ||
65 | |||
66 | #include <qregexp.h> | ||
67 | |||
68 | /** | ||
69 | * This class represents the interface of all Contact Backends. | ||
70 | * Derivates of this class will be used to access the contacts. | ||
71 | * As implementation currently XML and vCard exist. This class needs to be implemented | ||
72 | * if you want to provide your own storage. | ||
73 | * In all queries a list of uids is passed on instead of loading the actual record! | ||
74 | * | ||
75 | * @see OContactAccessBackend_VCard | ||
76 | * @see OContactAccessBackend_XML | ||
77 | */ | ||
78 | class OContactAccessBackend: public OPimAccessBackend<OContact> { | ||
79 | public: | ||
80 | /** | ||
81 | * @todo make non line in regard to BC guide of KDE | ||
82 | */ | ||
83 | OContactAccessBackend() {} | ||
84 | /** | ||
85 | * @todo make non inline in regard to the BC guide of KDE | ||
86 | */ | ||
87 | virtual ~OContactAccessBackend() {} | ||
88 | |||
89 | |||
90 | /** | ||
91 | * Return if database was changed externally. | ||
92 | * This may just make sense on file based databases like a XML-File. | ||
93 | * It is used to prevent to overwrite the current database content | ||
94 | * if the file was already changed by something else ! | ||
95 | * If this happens, we have to reload before save our data. | ||
96 | * If we use real databases, this should be handled by the database | ||
97 | * management system themselve, therefore this function should always return false in | ||
98 | * this case. It is not our problem to handle this conflict ... | ||
99 | * @return <i>true</i> if the database was changed and if save without reload will | ||
100 | * be dangerous. <i>false</i> if the database was not changed or it is save to write | ||
101 | * in this situation. | ||
102 | */ | ||
103 | virtual bool wasChangedExternally() = 0; | ||
104 | |||
105 | virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0; | ||
106 | |||
107 | /** | ||
108 | * Return all possible settings. | ||
109 | * @return All settings provided by the current backend | ||
110 | * (i.e.: query_WildCards & query_IgnoreCase) | ||
111 | */ | ||
112 | virtual const uint querySettings() = 0; | ||
113 | |||
114 | /** | ||
115 | * Check whether settings are correct. | ||
116 | * @return <i>true</i> if the given settings are correct and possible. | ||
117 | */ | ||
118 | virtual bool hasQuerySettings (uint querySettings) const = 0; | ||
119 | |||
120 | /** | ||
121 | * FIXME!!! | ||
122 | * Returns a sorted list of records either ascendinf or descending for a giving criteria and category | ||
123 | */ | ||
124 | virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0; | ||
125 | |||
126 | |||
127 | private: | ||
128 | class Private; | ||
129 | Private *d; | ||
130 | }; | ||
131 | #endif | ||