summaryrefslogtreecommitdiff
path: root/libopie/pim/ocontactaccessbackend.h
Unidiff
Diffstat (limited to 'libopie/pim/ocontactaccessbackend.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontactaccessbackend.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/libopie/pim/ocontactaccessbackend.h b/libopie/pim/ocontactaccessbackend.h
index 821f5bf..ebeb42d 100644
--- a/libopie/pim/ocontactaccessbackend.h
+++ b/libopie/pim/ocontactaccessbackend.h
@@ -10,24 +10,29 @@
10 *This program is free software; you can redistribute it and/or 10 *This program is free software; you can redistribute it and/or
11 *modify it under the terms of the GNU Library General Public 11 *modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; 12 * License as published by the Free Software Foundation;
13 * either version 2 of the License, or (at your option) any later 13 * either version 2 of the License, or (at your option) any later
14 * version. 14 * version.
15 * ===================================================================== 15 * =====================================================================
16 * ToDo: Define enum for query settings 16 * ToDo: Define enum for query settings
17 * ===================================================================== 17 * =====================================================================
18 * Version: $Id$ 18 * Version: $Id$
19 * ===================================================================== 19 * =====================================================================
20 * History: 20 * History:
21 * $Log$ 21 * $Log$
22 * Revision 1.5 2003/04/13 18:07:10 zecke
23 * More API doc
24 * QString -> const QString&
25 * QString = 0l -> QString::null
26 *
22 * Revision 1.4 2002/11/13 14:14:51 eilers 27 * Revision 1.4 2002/11/13 14:14:51 eilers
23 * Added sorted for Contacts.. 28 * Added sorted for Contacts..
24 * 29 *
25 * Revision 1.3 2002/11/01 15:10:42 eilers 30 * Revision 1.3 2002/11/01 15:10:42 eilers
26 * Added regExp-search in database for all fields in a contact. 31 * Added regExp-search in database for all fields in a contact.
27 * 32 *
28 * Revision 1.2 2002/10/07 17:34:24 eilers 33 * Revision 1.2 2002/10/07 17:34:24 eilers
29 * added OBackendFactory for advanced backend access 34 * added OBackendFactory for advanced backend access
30 * 35 *
31 * Revision 1.1 2002/09/27 17:11:44 eilers 36 * Revision 1.1 2002/09/27 17:11:44 eilers
32 * Added API for accessing the Contact-Database ! It is compiling, but 37 * Added API for accessing the Contact-Database ! It is compiling, but
33 * please do not expect that anything is working ! 38 * please do not expect that anything is working !
@@ -35,51 +40,68 @@
35 * Please read README_COMPILE for compiling ! 40 * Please read README_COMPILE for compiling !
36 * 41 *
37 * ===================================================================== 42 * =====================================================================
38 * 43 *
39 */ 44 */
40 45
41#ifndef _OCONTACTACCESSBACKEND_H_ 46#ifndef _OCONTACTACCESSBACKEND_H_
42#define _OCONTACTACCESSBACKEND_H_ 47#define _OCONTACTACCESSBACKEND_H_
43 48
44#include "ocontact.h" 49#include "ocontact.h"
45#include "opimaccessbackend.h" 50#include "opimaccessbackend.h"
46 51
47#include "qregexp.h" 52#include <qregexp.h>
48 53
54/**
55 * This class represents the interface of all Contact Backends.
56 * Derivates of this class will be used to access the contacts.
57 * As implementation currently XML and vCard exist. This class needs to be implemented
58 * if you want to provide your own storage.
59 * In all queries a list of uids is passed on instead of loading the actual record!
60 *
61 * @see OContactAccessBackend_VCard
62 * @see OContactAccessBackend_XML
63 */
49class OContactAccessBackend: public OPimAccessBackend<OContact> { 64class OContactAccessBackend: public OPimAccessBackend<OContact> {
50 public: 65 public:
51 OContactAccessBackend() {} 66 OContactAccessBackend() {}
52 virtual ~OContactAccessBackend() {} 67 virtual ~OContactAccessBackend() {}
53 68
54 69
55 /** Return if database was changed externally. 70 /**
71 * Return if database was changed externally.
56 * This may just make sense on file based databases like a XML-File. 72 * This may just make sense on file based databases like a XML-File.
57 * It is used to prevent to overwrite the current database content 73 * It is used to prevent to overwrite the current database content
58 * if the file was already changed by something else ! 74 * if the file was already changed by something else !
59 * If this happens, we have to reload before save our data. 75 * If this happens, we have to reload before save our data.
60 * If we use real databases, this should be handled by the database 76 * If we use real databases, this should be handled by the database
61 * management system themselve, therefore this function should always return false in 77 * management system themselve, therefore this function should always return false in
62 * this case. It is not our problem to handle this conflict ... 78 * this case. It is not our problem to handle this conflict ...
63 * @return <i>true</i> if the database was changed and if save without reload will 79 * @return <i>true</i> if the database was changed and if save without reload will
64 * be dangerous. <i>false</i> if the database was not changed or it is save to write 80 * be dangerous. <i>false</i> if the database was not changed or it is save to write
65 * in this situation. 81 * in this situation.
66 */ 82 */
67 virtual bool wasChangedExternally() = 0; 83 virtual bool wasChangedExternally() = 0;
68 84
69 virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0; 85 virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0;
70 86
71 /** Return all possible settings. 87 /**
88 * Return all possible settings.
72 * @return All settings provided by the current backend 89 * @return All settings provided by the current backend
73 * (i.e.: query_WildCards & query_IgnoreCase) 90 * (i.e.: query_WildCards & query_IgnoreCase)
74 */ 91 */
75 virtual const uint querySettings() = 0; 92 virtual const uint querySettings() = 0;
76 93
77 /** Check whether settings are correct. 94 /**
95 * Check whether settings are correct.
78 * @return <i>true</i> if the given settings are correct and possible. 96 * @return <i>true</i> if the given settings are correct and possible.
79 */ 97 */
80 virtual bool hasQuerySettings (uint querySettings) const = 0; 98 virtual bool hasQuerySettings (uint querySettings) const = 0;
81 99
82 virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0; 100 /**
101 * FIXME!!!
102 * Returns a sorted list of records either ascendinf or descending for a giving criteria and category
103 */
104 virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0;
83 105
84}; 106};
85#endif 107#endif