-rw-r--r-- | libopie/pim/ocontactaccess.h | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/libopie/pim/ocontactaccess.h b/libopie/pim/ocontactaccess.h index adc66cf..da9c942 100644 --- a/libopie/pim/ocontactaccess.h +++ b/libopie/pim/ocontactaccess.h | |||
@@ -8,24 +8,27 @@ | |||
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; | 10 | * License as published by the Free Software Foundation; |
11 | * either version 2 of the License, or (at your option) any later | 11 | * either version 2 of the License, or (at your option) any later |
12 | * version. | 12 | * version. |
13 | * ===================================================================== | 13 | * ===================================================================== |
14 | * ToDo: Define enum for query settings | 14 | * ToDo: Define enum for query settings |
15 | * ===================================================================== | 15 | * ===================================================================== |
16 | * Version: $Id$ | 16 | * Version: $Id$ |
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.3 2002/10/16 10:52:40 eilers | ||
21 | * Added some docu to the interface and now using the cache infrastucture by zecke.. :) | ||
22 | * | ||
20 | * Revision 1.2 2002/10/14 16:21:54 eilers | 23 | * Revision 1.2 2002/10/14 16:21:54 eilers |
21 | * Some minor interface updates | 24 | * Some minor interface updates |
22 | * | 25 | * |
23 | * Revision 1.1 2002/09/27 17:11:44 eilers | 26 | * Revision 1.1 2002/09/27 17:11:44 eilers |
24 | * Added API for accessing the Contact-Database ! It is compiling, but | 27 | * Added API for accessing the Contact-Database ! It is compiling, but |
25 | * please do not expect that anything is working ! | 28 | * please do not expect that anything is working ! |
26 | * I will debug that stuff in the next time .. | 29 | * I will debug that stuff in the next time .. |
27 | * Please read README_COMPILE for compiling ! | 30 | * Please read README_COMPILE for compiling ! |
28 | * | 31 | * |
29 | * ===================================================================== | 32 | * ===================================================================== |
30 | */ | 33 | */ |
31 | #ifndef _OCONTACTACCESS_H | 34 | #ifndef _OCONTACTACCESS_H |
@@ -82,87 +85,47 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact> | |||
82 | 85 | ||
83 | /** Return all possible settings. | 86 | /** Return all possible settings. |
84 | * @return All settings provided by the current backend | 87 | * @return All settings provided by the current backend |
85 | * (i.e.: query_WildCards & query_IgnoreCase) | 88 | * (i.e.: query_WildCards & query_IgnoreCase) |
86 | */ | 89 | */ |
87 | const uint querySettings(); | 90 | const uint querySettings(); |
88 | 91 | ||
89 | /** Check whether settings are correct. | 92 | /** Check whether settings are correct. |
90 | * @return <i>true</i> if the given settings are correct and possible. | 93 | * @return <i>true</i> if the given settings are correct and possible. |
91 | */ | 94 | */ |
92 | bool hasQuerySettings ( int querySettings ) const; | 95 | bool hasQuerySettings ( int querySettings ) const; |
93 | 96 | ||
94 | /** Add Contact to database. | ||
95 | * @param newcontact The contact to add. | ||
96 | * @return <i>true</i> if added successfully. | ||
97 | */ | ||
98 | bool add (const OContact& newcontact); | ||
99 | |||
100 | /** Replace contact. | ||
101 | * Replaces given contact with contact with the user id <i>uid</i>. | ||
102 | * @param uid The user ID | ||
103 | * @param contact The new contact | ||
104 | * @return <i>true</i> if successful. | ||
105 | */ | ||
106 | bool replace ( const OContact& contact ); | ||
107 | |||
108 | /** Remove contact. | ||
109 | * Removes contact with the user id <i>uid</i>. | ||
110 | * @param The contact to remove | ||
111 | * @return <i>true</i> if successful. | ||
112 | */ | ||
113 | bool remove ( const OContact& t ); | ||
114 | |||
115 | /** Remove contact. | ||
116 | * Removes contact with the user id <i>uid</i>. | ||
117 | * @param The user id of the contact to remove | ||
118 | * @return <i>true</i> if successful. | ||
119 | */ | ||
120 | bool remove ( int uid ); | ||
121 | |||
122 | /** Load Database * | ||
123 | */ | ||
124 | bool load(); | ||
125 | |||
126 | /** | 97 | /** |
127 | * if the resource was changed externally. | 98 | * if the resource was changed externally. |
128 | * You should use the signal instead of polling possible changes ! | 99 | * You should use the signal instead of polling possible changes ! |
129 | */ | 100 | */ |
130 | bool wasChangedExternally()const; | 101 | bool wasChangedExternally()const; |
131 | 102 | ||
132 | /** Reload database. | ||
133 | * You should execute this function if the external database | ||
134 | * was changed. | ||
135 | * This function will load the external database and afterwards | ||
136 | * rejoin the local changes. Therefore the local database will be set consistent. | ||
137 | */ | ||
138 | bool reload(); | ||
139 | 103 | ||
140 | /** Save contacts database. | 104 | /** Save contacts database. |
141 | * Save is more a "commit". After calling this function, all changes are public available. | 105 | * Save is more a "commit". After calling this function, all changes are public available. |
142 | * @return true if successful | 106 | * @return true if successful |
143 | */ | 107 | */ |
144 | bool save(); | 108 | bool save(); |
145 | 109 | ||
146 | signals: | 110 | signals: |
147 | /* Signal is emitted if the database was changed. Therefore | 111 | /* Signal is emitted if the database was changed. Therefore |
148 | * we may need to reload to stay consistent. | 112 | * we may need to reload to stay consistent. |
149 | * @param which Pointer to the database who created this event. This pointer | 113 | * @param which Pointer to the database who created this event. This pointer |
150 | * is useful if an application has to handle multiple databases at the same time. | 114 | * is useful if an application has to handle multiple databases at the same time. |
151 | * @see reload() | 115 | * @see reload() |
152 | */ | 116 | */ |
153 | void signalChanged ( const OContactAccess *which ); | 117 | void signalChanged ( const OContactAccess *which ); |
154 | 118 | ||
155 | 119 | ||
156 | private: | 120 | private: |
157 | // class OContactAccessPrivate; | 121 | // class OContactAccessPrivate; |
158 | // OContactAccessPrivate* d; | 122 | // OContactAccessPrivate* d; |
159 | OContactAccessBackend *m_backEnd; | 123 | OContactAccessBackend *m_backEnd; |
160 | bool m_loading:1; | 124 | bool m_loading:1; |
161 | bool m_changed; | ||
162 | 125 | ||
163 | private slots: | 126 | private slots: |
164 | void copMessage( const QCString &msg, const QByteArray &data ); | 127 | void copMessage( const QCString &msg, const QByteArray &data ); |
165 | 128 | ||
166 | 129 | ||
167 | }; | 130 | }; |
168 | #endif | 131 | #endif |