Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend.h b/libopie2/opiepim/backend/ocontactaccessbackend.h index 8436adc..efb04c7 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend.h | |||
@@ -36,79 +36,73 @@ | |||
36 | * | 36 | * |
37 | */ | 37 | */ |
38 | 38 | ||
39 | #ifndef _OCONTACTACCESSBACKEND_H_ | 39 | #ifndef _OCONTACTACCESSBACKEND_H_ |
40 | #define _OCONTACTACCESSBACKEND_H_ | 40 | #define _OCONTACTACCESSBACKEND_H_ |
41 | 41 | ||
42 | #include <opie2/opimcontact.h> | 42 | #include <opie2/opimcontact.h> |
43 | #include <opie2/opimaccessbackend.h> | 43 | #include <opie2/opimaccessbackend.h> |
44 | 44 | ||
45 | #include <qregexp.h> | 45 | #include <qregexp.h> |
46 | 46 | ||
47 | namespace Opie { | 47 | namespace Opie { |
48 | /** | 48 | /** |
49 | * This class represents the interface of all Contact Backends. | 49 | * This class represents the interface of all Contact Backends. |
50 | * Derivates of this class will be used to access the contacts. | 50 | * Derivates of this class will be used to access the contacts. |
51 | * As implementation currently XML and vCard exist. This class needs to be implemented | 51 | * As implementation currently XML and vCard exist. This class needs to be implemented |
52 | * if you want to provide your own storage. | 52 | * if you want to provide your own storage. |
53 | * In all queries a list of uids is passed on instead of loading the actual record! | 53 | * In all queries a list of uids is passed on instead of loading the actual record! |
54 | * | 54 | * |
55 | * @see OPimContactAccessBackend_VCard | 55 | * @see OPimContactAccessBackend_VCard |
56 | * @see OPimContactAccessBackend_XML | 56 | * @see OPimContactAccessBackend_XML |
57 | */ | 57 | */ |
58 | class OPimContactAccessBackend: public OPimAccessBackend<OPimContact> { | 58 | class OPimContactAccessBackend: public OPimAccessBackend<OPimContact> { |
59 | public: | 59 | public: |
60 | /** | 60 | OPimContactAccessBackend(); |
61 | * @todo make non line in regard to BC guide of KDE | ||
62 | */ | ||
63 | OPimContactAccessBackend() {} | ||
64 | /** | ||
65 | * @todo make non inline in regard to the BC guide of KDE | ||
66 | */ | ||
67 | virtual ~OPimContactAccessBackend() {} | ||
68 | 61 | ||
69 | 62 | ||
70 | /** | 63 | /** |
71 | * Return if database was changed externally. | 64 | * Return if database was changed externally. |
72 | * This may just make sense on file based databases like a XML-File. | 65 | * This may just make sense on file based databases like a XML-File. |
73 | * It is used to prevent to overwrite the current database content | 66 | * It is used to prevent to overwrite the current database content |
74 | * if the file was already changed by something else ! | 67 | * if the file was already changed by something else ! |
75 | * If this happens, we have to reload before save our data. | 68 | * If this happens, we have to reload before save our data. |
76 | * If we use real databases, this should be handled by the database | 69 | * If we use real databases, this should be handled by the database |
77 | * management system themselve, therefore this function should always return false in | 70 | * management system themselve, therefore this function should always return false in |
78 | * this case. It is not our problem to handle this conflict ... | 71 | * this case. It is not our problem to handle this conflict ... |
79 | * @return <i>true</i> if the database was changed and if save without reload will | 72 | * @return <i>true</i> if the database was changed and if save without reload will |
80 | * be dangerous. <i>false</i> if the database was not changed or it is save to write | 73 | * be dangerous. <i>false</i> if the database was not changed or it is save to write |
81 | * in this situation. | 74 | * in this situation. |
82 | */ | 75 | */ |
83 | virtual bool wasChangedExternally() = 0; | 76 | virtual bool wasChangedExternally() = 0; |
84 | 77 | ||
85 | virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0; | ||
86 | |||
87 | /** | 78 | /** |
88 | * Return all possible settings. | 79 | * Return all possible settings. |
89 | * @return All settings provided by the current backend | 80 | * @return All settings provided by the current backend |
90 | * (i.e.: query_WildCards & query_IgnoreCase) | 81 | * (i.e.: query_WildCards & query_IgnoreCase) |
91 | */ | 82 | */ |
92 | virtual const uint querySettings() = 0; | 83 | virtual const uint querySettings() = 0; |
93 | 84 | ||
94 | /** | 85 | /** |
95 | * Check whether settings are correct. | 86 | * Check whether settings are correct. |
96 | * @return <i>true</i> if the given settings are correct and possible. | 87 | * @return <i>true</i> if the given settings are correct and possible. |
97 | */ | 88 | */ |
98 | virtual bool hasQuerySettings (uint querySettings) const = 0; | 89 | virtual bool hasQuerySettings (uint querySettings) const = 0; |
99 | 90 | ||
100 | /** | 91 | /** |
101 | * FIXME!!! | 92 | * Slow and inefficent default implementation |
102 | * Returns a sorted list of records either ascendinf or descending for a giving criteria and category | ||
103 | */ | 93 | */ |
104 | virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0; | 94 | //@{ |
95 | UIDArray queryByExample( const OPimContact&, int settings, const QDateTime& d = QDateTime() )const; | ||
96 | UIDArray sorted( const UIDArray&, bool asc, int, int, const QArray<int>& )const; | ||
97 | OPimBackendOccurrence::List occurrences( const QDate&, const QDate& )const; | ||
98 | //@} | ||
105 | 99 | ||
106 | 100 | ||
107 | private: | 101 | private: |
108 | class Private; | 102 | class Private; |
109 | Private *d; | 103 | Private *d; |
110 | }; | 104 | }; |
111 | 105 | ||
112 | } | 106 | } |
113 | 107 | ||
114 | #endif | 108 | #endif |