author | eilers <eilers> | 2005-01-04 14:22:12 (UTC) |
---|---|---|
committer | eilers <eilers> | 2005-01-04 14:22:12 (UTC) |
commit | a63d6d1896bcb6f1ac3b041e3d46edf0ec9e8082 (patch) (unidiff) | |
tree | c5125a96d16685cb49eecb479e761e6b3e9375b3 | |
parent | ff93c49af890b2b03f729a848be36b77a6e2454b (diff) | |
download | opie-a63d6d1896bcb6f1ac3b041e3d46edf0ec9e8082.zip opie-a63d6d1896bcb6f1ac3b041e3d46edf0ec9e8082.tar.gz opie-a63d6d1896bcb6f1ac3b041e3d46edf0ec9e8082.tar.bz2 |
Add section for sorting
-rw-r--r-- | development/pim/pim_howto/pim_howto.lyx | 238 |
1 files changed, 218 insertions, 20 deletions
diff --git a/development/pim/pim_howto/pim_howto.lyx b/development/pim/pim_howto/pim_howto.lyx index 2b08be8..4571996 100644 --- a/development/pim/pim_howto/pim_howto.lyx +++ b/development/pim/pim_howto/pim_howto.lyx | |||
@@ -1,1213 +1,1411 @@ | |||
1 | #LyX 1.3 created this file. For more info see http://www.lyx.org/ | 1 | #LyX 1.3 created this file. For more info see http://www.lyx.org/ |
2 | \lyxformat 221 | 2 | \lyxformat 221 |
3 | \textclass scrbook | 3 | \textclass scrbook |
4 | \begin_preamble | 4 | \begin_preamble |
5 | \fancyhead{} | 5 | \fancyhead{} |
6 | \fancyfoot{} | 6 | \fancyfoot{} |
7 | \fancyhead[LE,RO]{\slshape \leftmark} | 7 | \fancyhead[LE,RO]{\slshape \leftmark} |
8 | \fancyhead[LO,RE]{\slshape \leftmark} | 8 | \fancyhead[LO,RE]{\slshape \leftmark} |
9 | \fancyhead[RE,LO]{\thepage} | 9 | \fancyhead[RE,LO]{\thepage} |
10 | %\fancyhead[LO,RE]{} | 10 | %\fancyhead[LO,RE]{} |
11 | % \usepackage{ae} | 11 | % \usepackage{ae} |
12 | \usepackage[bookmarksopen,colorlinks]{hyperref} | 12 | \usepackage[bookmarksopen,colorlinks]{hyperref} |
13 | % \pdfoutput=1 | 13 | % \pdfoutput=1 |
14 | % \pdfcompresslevel=8 | 14 | % \pdfcompresslevel=8 |
15 | % \pdfinfo{ | 15 | % \pdfinfo{ |
16 | % /Title ClearSim-RealtTime und Andere | 16 | % /Title ClearSim-RealtTime und Andere |
17 | % /Creator (Tex) | 17 | % /Creator (Tex) |
18 | % /Author (Stefan Eilers) | 18 | % /Author (Stefan Eilers) |
19 | % /Subject () | 19 | % /Subject () |
20 | % /Keywords (Simulation,Real-Time,ClearSim,prototype,efsm) | 20 | % /Keywords (Simulation,Real-Time,ClearSim,prototype,efsm) |
21 | % } | 21 | % } |
22 | \renewcommand\familydefault{\sfdefault} | 22 | \renewcommand\familydefault{\sfdefault} |
23 | 23 | ||
24 | \usepackage{multicol} | 24 | \usepackage{multicol} |
25 | \newcommand\NrCol{3} | 25 | \newcommand\NrCol{3} |
26 | \renewenvironment{theindex} | 26 | \renewenvironment{theindex} |
27 | {\columnseprule \z@ | 27 | {\columnseprule \z@ |
28 | \columnsep 35\p@ | 28 | \columnsep 35\p@ |
29 | \section*{\indexname}% | 29 | \section*{\indexname}% |
30 | \@mkboth{\MakeUppercase\indexname}% | 30 | \@mkboth{\MakeUppercase\indexname}% |
31 | {\MakeUppercase\indexname}% | 31 | {\MakeUppercase\indexname}% |
32 | \begin{multicols}{\NrCol}\thispagestyle{plain}\parindent\z@ | 32 | \begin{multicols}{\NrCol}\thispagestyle{plain}\parindent\z@ |
33 | \parskip\z@ \@plus .3\p@\relax | 33 | \parskip\z@ \@plus .3\p@\relax |
34 | \let\item\@idxitem} | 34 | \let\item\@idxitem} |
35 | {\clearpage % | 35 | {\clearpage % |
36 | \end{multicols}} | 36 | \end{multicols}} |
37 | 37 | ||
38 | \renewenvironment{theindex} | 38 | \renewenvironment{theindex} |
39 | {\if@twocolumn | 39 | {\if@twocolumn |
40 | \@restonecolfalse | 40 | \@restonecolfalse |
41 | \else | 41 | \else |
42 | \@restonecoltrue | 42 | \@restonecoltrue |
43 | \fi | 43 | \fi |
44 | \columnseprule \z@ | 44 | \columnseprule \z@ |
45 | \columnsep 35\p@ | 45 | \columnsep 35\p@ |
46 | \twocolumn[\refstepcounter{section}% | 46 | \twocolumn[\refstepcounter{section}% |
47 | \section{\indexname}]% | 47 | \section{\indexname}]% |
48 | \@mkboth{\MakeUppercase\indexname}% | 48 | \@mkboth{\MakeUppercase\indexname}% |
49 | {\MakeUppercase\indexname}% | 49 | {\MakeUppercase\indexname}% |
50 | \thispagestyle{plain}\parindent\z@ | 50 | \thispagestyle{plain}\parindent\z@ |
51 | \parskip\z@ \@plus .3\p@\relax | 51 | \parskip\z@ \@plus .3\p@\relax |
52 | \let\item\@idxitem} | 52 | \let\item\@idxitem} |
53 | {\if@restonecol\onecolumn\else\clearpage\fi} | 53 | {\if@restonecol\onecolumn\else\clearpage\fi} |
54 | \end_preamble | 54 | \end_preamble |
55 | \language german | 55 | \language german |
56 | \inputencoding auto | 56 | \inputencoding auto |
57 | \fontscheme ae | 57 | \fontscheme ae |
58 | \graphics default | 58 | \graphics default |
59 | \float_placement htbp | 59 | \float_placement htbp |
60 | \paperfontsize default | 60 | \paperfontsize default |
61 | \spacing single | 61 | \spacing single |
62 | \papersize a4paper | 62 | \papersize a4paper |
63 | \paperpackage widemarginsa4 | 63 | \paperpackage widemarginsa4 |
64 | \use_geometry 0 | 64 | \use_geometry 0 |
65 | \use_amsmath 0 | 65 | \use_amsmath 0 |
66 | \use_natbib 0 | 66 | \use_natbib 0 |
67 | \use_numerical_citations 0 | 67 | \use_numerical_citations 0 |
68 | \paperorientation portrait | 68 | \paperorientation portrait |
69 | \secnumdepth 3 | 69 | \secnumdepth 3 |
70 | \tocdepth 3 | 70 | \tocdepth 3 |
71 | \paragraph_separation skip | 71 | \paragraph_separation skip |
72 | \defskip medskip | 72 | \defskip medskip |
73 | \quotes_language german | 73 | \quotes_language german |
74 | \quotes_times 2 | 74 | \quotes_times 2 |
75 | \papercolumns 1 | 75 | \papercolumns 1 |
76 | \papersides 2 | 76 | \papersides 2 |
77 | \paperpagestyle fancy | 77 | \paperpagestyle fancy |
78 | 78 | ||
79 | \layout Title | 79 | \layout Title |
80 | 80 | ||
81 | How to use the Opie-Pim API without getting tired! | 81 | How to use the Opie-Pim API without getting tired! |
82 | \newline | 82 | \newline |
83 | (Aka: Hitchhikers Guide Through the Opie-Pim API) | 83 | (Aka: Hitchhikers Guide Through the Opie-Pim API) |
84 | \newline | 84 | \newline |
85 | (Pre V 0.1) | 85 | (Pre V 0.1) |
86 | \layout Author | 86 | \layout Author |
87 | 87 | ||
88 | 88 | ||
89 | \family sans | 89 | \family sans |
90 | Stefan Eilers | 90 | Stefan Eilers |
91 | \layout Section* | 91 | \layout Section* |
92 | 92 | ||
93 | 93 | ||
94 | \family sans | 94 | \family sans |
95 | Abstract | 95 | Abstract |
96 | \layout Standard | 96 | \layout Standard |
97 | 97 | ||
98 | The Opie-Pim API provides a powerfull access interface to the PIM (Personal | 98 | The Opie-Pim API provides a powerfull access interface to the PIM (Personal |
99 | Information Management) data which contains your contact information, the | 99 | Information Management) data which contains your contact information, the |
100 | dates in your calender tool (in this paper called datebook events) and | 100 | dates in your calender tool (in this paper called datebook events) and |
101 | your todo events. | 101 | your todo events. |
102 | Beside providing full featured access to this information, it covers the | 102 | Beside providing full featured access to this information, it covers the |
103 | real management of this informantion - the access of the databases - from | 103 | real management of this informantion - the access of the databases - from |
104 | the user. | 104 | the user. |
105 | 105 | ||
106 | \layout Standard | 106 | \layout Standard |
107 | 107 | ||
108 | While starting to read the automatically generated API-documentation, the | 108 | While starting to read the automatically generated API-documentation, the |
109 | user may be confused by a lot of unneccessary classes and details which | 109 | user may be confused by a lot of unneccessary classes and details which |
110 | makes the quick start not as easy as expected. | 110 | makes the quick start not as easy as possible. |
111 | Due to the fact that a user who just want to access data will not need | 111 | Due to the fact that a user will not need most of the details, this paper |
112 | most of the details, this paper should help to start to be confortable | 112 | should help to start to become confortable with those details he need to |
113 | with the details he need to solve his problems. | 113 | solve his problems. |
114 | \layout Standard | 114 | \layout Standard |
115 | 115 | ||
116 | 116 | ||
117 | \begin_inset LatexCommand \tableofcontents{} | 117 | \begin_inset LatexCommand \tableofcontents{} |
118 | 118 | ||
119 | \end_inset | 119 | \end_inset |
120 | 120 | ||
121 | 121 | ||
122 | \layout Chapter | 122 | \layout Chapter |
123 | 123 | ||
124 | Introduction | 124 | Introduction |
125 | \layout Standard | 125 | \layout Standard |
126 | 126 | ||
127 | Before starting to jump into the work, we should introduce some specialities | 127 | Before starting to jump into the work, we should introduce some specialities |
128 | of the PIM API first. | 128 | of the PIM API, first. |
129 | To know these facts should help to avoid possible irritations and misunderstand | 129 | To know these facts should help to avoid possible irritations and misunderstand |
130 | ings: | 130 | ings: |
131 | \layout Enumerate | 131 | \layout Enumerate |
132 | 132 | ||
133 | The PIM-API heavily uses C++ templates (as known as generic classes), but | 133 | The PIM-API heavily uses C++ templates (as known as generic classes), but |
134 | you don't have to understand very deeple what templates are doing and how | 134 | you don't have to understand very deeple what templates are doing and how |
135 | they work! Most of the API works without even seeing the templates. | 135 | they work! Most of the API works without even seeing the templates. |
136 | In some cases whe have to use them (for instance to use the factory classes) | 136 | In some cases whe have to use them (for instance to use the factory classes), |
137 | but this guide will provide examples which should help to find the path | 137 | but this guide will provide examples which should help to find the path |
138 | through. | 138 | through. |
139 | But it is a good idea to read some short introduction of templates to avoid | 139 | But it is a good idea to read some short introduction of templates to avoid |
140 | unneccessary mistakes. | 140 | unneccessary mistakes. |
141 | \layout Enumerate | 141 | \layout Enumerate |
142 | 142 | ||
143 | The PIM-API is split into two parts: The | 143 | The PIM-API is split into two parts: The |
144 | \emph on | 144 | \emph on |
145 | frontend | 145 | frontend |
146 | \emph default | 146 | \emph default |
147 | and the | 147 | and the |
148 | \emph on | 148 | \emph on |
149 | backend. | 149 | backend. |
150 | 150 | ||
151 | \emph default | 151 | \emph default |
152 | While the frontend provides the API for the user, the backend implements | 152 | While the frontend provides the API for the user, the backend implements |
153 | how to access the databases and what to do with the data. | 153 | how to access the databases and what to do with the data. |
154 | This paper just focusses the frontend as we just want to access data. | 154 | As we just want to access data, this paper just focusses the frontend. |
155 | Thus, you should ignore all classes which contains something like | 155 | Thus, you should ignore all classes which contains something like |
156 | \begin_inset Quotes gld | 156 | \begin_inset Quotes gld |
157 | \end_inset | 157 | \end_inset |
158 | 158 | ||
159 | backend | 159 | backend |
160 | \begin_inset Quotes grd | 160 | \begin_inset Quotes grd |
161 | \end_inset | 161 | \end_inset |
162 | 162 | ||
163 | in its name! Backends are just interessting for people who want to extend | 163 | in its name! Backends are just interessting for people who want to extend |
164 | or implement new possiblities about how to access databases, which will | 164 | or implement new possiblities about how to access databases, which will |
165 | be discussed at the end of this paper. | 165 | be discussed at the end of this paper. |
166 | Currently, you just have to understand that there do exist several backends | 166 | Currently, you just have to understand that there do exist several backends |
167 | for every type of PIM data (Contact, Todo, Datebook) which controls whether | 167 | for every type of PIM data (Contact, Todo, Datebook) which controls whether |
168 | you want to access an XML, SQL (SQLite) or VCard style database. | 168 | you want to access an XML, SQL (SQLite) or VCard style database. |
169 | If you just want to use the default database, you even don't have to think | 169 | If you just want to use the default database, you even don't have to think |
170 | about this! | 170 | about this! |
171 | \layout Standard | 171 | \layout Standard |
172 | 172 | ||
173 | In the next chapter, we will show how to access the default database as | 173 | In the next chapter, we will show how to access the default database as |
174 | easy as possible. | 174 | easy as possible. |
175 | This will be the solution for most of the problems you may face while accessing | 175 | This will be the solution for most of the problems you may face while accessing |
176 | the PIM data. | 176 | the PIM data. |
177 | \layout Chapter | 177 | \layout Chapter |
178 | 178 | ||
179 | Quick Guide to access the Database | 179 | Quick Guide to access the Database |
180 | \layout Standard | 180 | \layout Standard |
181 | 181 | ||
182 | In this chapter we will introduce very quickly how to get access to the | 182 | In this chapter we will introduce very quickly how to get access to the |
183 | database and how to access data. | 183 | database and how to access data. |
184 | It should help to find the right directions. | 184 | It should help to find the right directions. |
185 | If it is too short for you, you should read the next chapter afterwards | 185 | If it is too short for you, you should read the next chapter afterwards |
186 | to find a more complete and detailed view into the system. | 186 | to find a more complete and detailed view into the system. |
187 | \layout Section | 187 | \layout Section |
188 | 188 | ||
189 | Instantiate the access-object | 189 | Instantiate the access-object |
190 | \begin_inset LatexCommand \label{sec:Instantiate-the-Access} | 190 | \begin_inset LatexCommand \label{sec:Instantiate-the-Access} |
191 | 191 | ||
192 | \end_inset | 192 | \end_inset |
193 | 193 | ||
194 | 194 | ||
195 | \layout Standard | 195 | \layout Standard |
196 | 196 | ||
197 | To gain access to the database you need something we will call | 197 | To gain access to the database you need something we will call |
198 | \emph on | 198 | \emph on |
199 | access-object | 199 | access-object |
200 | \emph default | 200 | \emph default |
201 | (an instance of the access-class for the database) which handles the database | 201 | (an instance of the access-class for the database) which handles the database |
202 | access. | 202 | access. |
203 | Requesting such an object is very easy by using the operation | 203 | Requesting such an object is very easy by using the operation |
204 | \emph on | 204 | \emph on |
205 | defaultAccess() | 205 | defaultAccess() |
206 | \emph default | 206 | \emph default |
207 | of the factory class | 207 | of the factory class |
208 | \series bold | 208 | \series bold |
209 | OPimAccessFactory | 209 | OPimAccessFactory |
210 | \series default | 210 | \series default |
211 | (see | 211 | (see |
212 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimAccessFactory.html} | 212 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimAccessFactory.html} |
213 | 213 | ||
214 | \end_inset | 214 | \end_inset |
215 | 215 | ||
216 | ). | 216 | ). |
217 | This operation is defined like this: | 217 | This operation is defined like this: |
218 | \layout LyX-Code | 218 | \layout LyX-Code |
219 | 219 | ||
220 | T* defaultAccess (typename OPimGlobal::PimType type, const QString &appName) | 220 | T* defaultAccess (typename OPimGlobal::PimType type, const QString &appName) |
221 | \layout Standard | 221 | \layout Standard |
222 | 222 | ||
223 | You just have to add the following lines to your source code to use it (this | 223 | You just have to add the following lines to your source code to use it (this |
224 | example is for accessing the contact database): | 224 | example is for accessing the contact database): |
225 | \layout LyX-Code | 225 | \layout LyX-Code |
226 | 226 | ||
227 | #include <opie2/opimaccessfactory.h> | 227 | #include <opie2/opimaccessfactory.h> |
228 | \layout LyX-Code | 228 | \layout LyX-Code |
229 | 229 | ||
230 | use namespace Opie; | 230 | use namespace Opie; |
231 | \layout Standard | 231 | \layout Standard |
232 | 232 | ||
233 | [...] | 233 | [...] |
234 | \layout LyX-Code | 234 | \layout LyX-Code |
235 | 235 | ||
236 | OPimContactAccess* sourceDB = OPimAccessFactory<OPimContactAccess>::defaultAcces | 236 | OPimContactAccess* sourceDB = OPimAccessFactory<OPimContactAccess>::defaultAcces |
237 | s( OPimGlobal::CONTACTLIST, "my-app" ); | 237 | s( OPimGlobal::CONTACTLIST, "my-app" ); |
238 | \layout Standard | 238 | \layout Standard |
239 | 239 | ||
240 | If everything works as expected, you will receive a pointer to the contact | 240 | If everything works as expected, you will receive a pointer to the contact |
241 | access-class which has to be used for accessing the database. | 241 | access-class which has to be used for accessing the database. |
242 | Accessing the datebook database works equally | 242 | Accessing the datebook database works equally |
243 | \begin_inset Foot | 243 | \begin_inset Foot |
244 | collapsed true | 244 | collapsed true |
245 | 245 | ||
246 | \layout Standard | 246 | \layout Standard |
247 | 247 | ||
248 | The API will be changed in the future: ODateBookAccess will be renamed to | 248 | The API will be changed in the future: ODateBookAccess will be renamed to |
249 | OPimEventAccess. | 249 | OPimEventAccess. |
250 | \end_inset | 250 | \end_inset |
251 | 251 | ||
252 | : | 252 | : |
253 | \layout LyX-Code | 253 | \layout LyX-Code |
254 | 254 | ||
255 | ODateBookAccess* sourceDB = OPimAccessFactory<ODatebookAccess>::defaultAccess( | 255 | ODateBookAccess* sourceDB = OPimAccessFactory<ODatebookAccess>::defaultAccess( |
256 | OPimGlobal::DATEBOOK, "my-app" ); | 256 | OPimGlobal::DATEBOOK, "my-app" ); |
257 | \layout Standard | 257 | \layout Standard |
258 | 258 | ||
259 | And the same for todo: | 259 | And the same for todo: |
260 | \layout LyX-Code | 260 | \layout LyX-Code |
261 | 261 | ||
262 | OPimTodoAccess* sourceDB = OPimAccessFactory<OPimTodoAccess>::defaultAccess( | 262 | OPimTodoAccess* sourceDB = OPimAccessFactory<OPimTodoAccess>::defaultAccess( |
263 | OPimGlobal::TODOLIST, "my-app" ); | 263 | OPimGlobal::TODOLIST, "my-app" ); |
264 | \layout Standard | 264 | \layout Standard |
265 | 265 | ||
266 | Using | 266 | Using |
267 | \emph on | 267 | \emph on |
268 | 268 | ||
269 | \begin_inset Quotes gld | 269 | \begin_inset Quotes gld |
270 | \end_inset | 270 | \end_inset |
271 | 271 | ||
272 | defaultAccess() | 272 | defaultAccess() |
273 | \begin_inset Quotes grd | 273 | \begin_inset Quotes grd |
274 | \end_inset | 274 | \end_inset |
275 | 275 | ||
276 | 276 | ||
277 | \emph default | 277 | \emph default |
278 | , the default dabase is accessed automatically | 278 | , the default dabase is accessed automatically |
279 | \begin_inset Foot | 279 | \begin_inset Foot |
280 | collapsed true | 280 | collapsed true |
281 | 281 | ||
282 | \layout Standard | 282 | \layout Standard |
283 | 283 | ||
284 | The configuration file | 284 | The configuration file |
285 | \begin_inset Quotes gld | 285 | \begin_inset Quotes gld |
286 | \end_inset | 286 | \end_inset |
287 | 287 | ||
288 | pimaccess.conf | 288 | pimaccess.conf |
289 | \begin_inset Quotes grd | 289 | \begin_inset Quotes grd |
290 | \end_inset | 290 | \end_inset |
291 | 291 | ||
292 | defines which backend is selected as default! | 292 | defines which backend is selected as default! |
293 | \end_inset | 293 | \end_inset |
294 | 294 | ||
295 | . | 295 | . |
296 | If you want to use anything else, you have to read the next chapter to | 296 | If you want to use anything else, you have to read the next chapter to |
297 | get the information how to do this. | 297 | get the information how to do this. |
298 | 298 | ||
299 | \layout Standard | 299 | \layout Standard |
300 | 300 | ||
301 | The last parameter | 301 | The last parameter |
302 | \begin_inset Quotes gld | 302 | \begin_inset Quotes gld |
303 | \end_inset | 303 | \end_inset |
304 | 304 | ||
305 | my-app | 305 | my-app |
306 | \begin_inset Quotes grd | 306 | \begin_inset Quotes grd |
307 | \end_inset | 307 | \end_inset |
308 | 308 | ||
309 | is very importand and should be equal for every instance of an application. | 309 | is very importand and should be equal for every instance of an application. |
310 | Some database backends (like the XML backend) uses this string as an unique | 310 | Some database backends (like the XML backend) uses this string as an unique |
311 | filename to create a journal file. | 311 | filename to create a journal file. |
312 | If your application should run in several instances independently you will | 312 | If your application should run in several instances independently you will |
313 | need multiple journal files and therefore several name strings! | 313 | need multiple journal files and therefore several name strings! |
314 | \layout Standard | 314 | \layout Standard |
315 | 315 | ||
316 | If the database access-object is is not needed anymore, you have to remove | 316 | If the database access-object is is not needed anymore, you have to remove |
317 | it by calling | 317 | it by calling |
318 | \emph on | 318 | \emph on |
319 | delete | 319 | delete |
320 | \emph default | 320 | \emph default |
321 | : | 321 | : |
322 | \layout LyX-Code | 322 | \layout LyX-Code |
323 | 323 | ||
324 | delete sourceDB; | 324 | delete sourceDB; |
325 | \layout Section | 325 | \layout Section |
326 | 326 | ||
327 | Accessing the access-object | 327 | Accessing the Access-Object |
328 | \begin_inset LatexCommand \label{sec:Accessing-the-access-object} | 328 | \begin_inset LatexCommand \label{sec:Accessing-the-access-object} |
329 | 329 | ||
330 | \end_inset | 330 | \end_inset |
331 | 331 | ||
332 | 332 | ||
333 | \layout Standard | 333 | \layout Standard |
334 | 334 | ||
335 | After receiving the access-object, we just have to use its API which is | 335 | After receiving the access-object, we just have to use its API which is |
336 | mainly defined by the common base class | 336 | mainly defined by the common base class |
337 | \series bold | 337 | \series bold |
338 | OPimAccessTemplate | 338 | OPimAccessTemplate |
339 | \series default | 339 | \series default |
340 | (see | 340 | (see |
341 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimAccessTemplate.html} | 341 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimAccessTemplate.html} |
342 | 342 | ||
343 | \end_inset | 343 | \end_inset |
344 | 344 | ||
345 | ). | 345 | ). |
346 | This API is inherited by all access-classes and therefore common to all | 346 | This API is inherited by all access-classes and therefore common to all |
347 | access-objects. | 347 | access-objects. |
348 | We will show the most important operations of it first (please replace | 348 | We will show the most important operations of it first (please replace |
349 | 349 | ||
350 | \begin_inset Quotes gld | 350 | \begin_inset Quotes gld |
351 | \end_inset | 351 | \end_inset |
352 | 352 | ||
353 | T | 353 | T |
354 | \begin_inset Quotes grd | 354 | \begin_inset Quotes grd |
355 | \end_inset | 355 | \end_inset |
356 | 356 | ||
357 | below with the corresponding | 357 | below with the corresponding |
358 | \emph on | 358 | \emph on |
359 | data-class | 359 | data-class |
360 | \emph default | 360 | \emph default |
361 | for the selected access-class: OPimContact | 361 | for the selected access-class: OPimContact |
362 | \begin_inset Foot | 362 | \begin_inset Foot |
363 | collapsed true | 363 | collapsed true |
364 | 364 | ||
365 | \layout Standard | 365 | \layout Standard |
366 | 366 | ||
367 | see | 367 | see |
368 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimContact.html} | 368 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimContact.html} |
369 | 369 | ||
370 | \end_inset | 370 | \end_inset |
371 | 371 | ||
372 | 372 | ||
373 | \end_inset | 373 | \end_inset |
374 | 374 | ||
375 | for OPimContactAccess, OPimEvent | 375 | for OPimContactAccess, OPimEvent |
376 | \begin_inset Foot | 376 | \begin_inset Foot |
377 | collapsed true | 377 | collapsed true |
378 | 378 | ||
379 | \layout Standard | 379 | \layout Standard |
380 | 380 | ||
381 | see | 381 | see |
382 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimEvent.html} | 382 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimEvent.html} |
383 | 383 | ||
384 | \end_inset | 384 | \end_inset |
385 | 385 | ||
386 | 386 | ||
387 | \end_inset | 387 | \end_inset |
388 | 388 | ||
389 | for ODateBookAccess and OPimTodo | 389 | for ODateBookAccess and OPimTodo |
390 | \begin_inset Foot | 390 | \begin_inset Foot |
391 | collapsed true | 391 | collapsed true |
392 | 392 | ||
393 | \layout Standard | 393 | \layout Standard |
394 | 394 | ||
395 | see | 395 | see |
396 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimTodo.html} | 396 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimTodo.html} |
397 | 397 | ||
398 | \end_inset | 398 | \end_inset |
399 | 399 | ||
400 | 400 | ||
401 | \end_inset | 401 | \end_inset |
402 | 402 | ||
403 | for OPimTodoAccess): | 403 | for OPimTodoAccess): |
404 | \layout LyX-Code | 404 | \layout LyX-Code |
405 | 405 | ||
406 | bool load (); | 406 | bool load (); |
407 | \layout LyX-Code | 407 | \layout LyX-Code |
408 | 408 | ||
409 | bool reload (); | 409 | bool reload (); |
410 | \layout LyX-Code | 410 | \layout LyX-Code |
411 | 411 | ||
412 | bool save (); | 412 | bool save (); |
413 | \layout LyX-Code | 413 | \layout LyX-Code |
414 | 414 | ||
415 | \layout LyX-Code | 415 | \layout LyX-Code |
416 | 416 | ||
417 | bool add (const T& t); | 417 | bool add (const T& t); |
418 | \layout LyX-Code | 418 | \layout LyX-Code |
419 | 419 | ||
420 | bool remove (const T& t); | 420 | bool remove (const T& t); |
421 | \layout LyX-Code | 421 | \layout LyX-Code |
422 | 422 | ||
423 | bool replace (const T& t); | 423 | bool replace (const T& t); |
424 | \layout Standard | 424 | \layout Standard |
425 | 425 | ||
426 | After receiving an access-object, we have to load the existing dataset, | 426 | After receiving an access-object, we have to load the existing dataset into |
427 | which is done by the | 427 | the backend, which is done by the |
428 | \begin_inset Quotes gld | 428 | \begin_inset Quotes gld |
429 | \end_inset | 429 | \end_inset |
430 | 430 | ||
431 | load() | 431 | load() |
432 | \begin_inset Quotes grd | 432 | \begin_inset Quotes grd |
433 | \end_inset | 433 | \end_inset |
434 | 434 | ||
435 | operation. | 435 | operation. |
436 | The | 436 | The |
437 | \begin_inset Quotes gld | 437 | \begin_inset Quotes gld |
438 | \end_inset | 438 | \end_inset |
439 | 439 | ||
440 | save() | 440 | save() |
441 | \begin_inset Quotes grd | 441 | \begin_inset Quotes grd |
442 | \end_inset | 442 | \end_inset |
443 | 443 | ||
444 | operation is important to write back (or | 444 | operation is important to write back (or |
445 | \emph on | 445 | \emph on |
446 | commit | 446 | commit |
447 | \emph default | 447 | \emph default |
448 | ) local changes into the global database. | 448 | ) local changes into the global database. |
449 | After doing this, the changes are globally accessable! The | 449 | After doing this, the changes are globally accessable! The |
450 | \begin_inset Quotes gld | 450 | \begin_inset Quotes gld |
451 | \end_inset | 451 | \end_inset |
452 | 452 | ||
453 | reload() | 453 | reload() |
454 | \begin_inset Quotes grd | 454 | \begin_inset Quotes grd |
455 | \end_inset | 455 | \end_inset |
456 | 456 | ||
457 | operation loads changes of the global database into the local set | 457 | operation loads changes of the global database into the local set |
458 | \series bold | 458 | \series bold |
459 | without | 459 | without |
460 | \series default | 460 | \series default |
461 | removing any local changes | 461 | removing any local changes |
462 | \begin_inset Foot | 462 | \begin_inset Foot |
463 | collapsed true | 463 | collapsed true |
464 | 464 | ||
465 | \layout Standard | 465 | \layout Standard |
466 | 466 | ||
467 | We should check whether all dabases behave like this! (se) | 467 | We should check whether all dabases behave like this! (se) |
468 | \end_inset | 468 | \end_inset |
469 | 469 | ||
470 | . | 470 | . |
471 | This may be done after receiving information about any change by an other | 471 | This may be done after receiving information about any change by an other |
472 | application which is not in scope of this chapter. | 472 | application which is not in scope of this chapter. |
473 | The other operations are self explaining and should work as expected. | 473 | The other operations are self explaining and should work as expected. |
474 | \layout Standard | 474 | \layout Standard |
475 | 475 | ||
476 | If you want to work with the existing dataset, you need to get a list of | 476 | If you want to work with the existing dataset, you need to get a list of |
477 | all available information. | 477 | all available information. |
478 | This list is returned by the call | 478 | This list is returned by the call |
479 | \begin_inset Quotes gld | 479 | \begin_inset Quotes gld |
480 | \end_inset | 480 | \end_inset |
481 | 481 | ||
482 | allRecords() | 482 | allRecords() |
483 | \begin_inset Quotes grd | 483 | \begin_inset Quotes grd |
484 | \end_inset | 484 | \end_inset |
485 | 485 | ||
486 | which returns a list of all available records as an | 486 | which returns a list of all available records as an |
487 | \series bold | 487 | \series bold |
488 | OPimRecordList | 488 | OPimRecordList |
489 | \series default | 489 | \series default |
490 | (see | 490 | (see |
491 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimRecordList.html} | 491 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimRecordList.html} |
492 | 492 | ||
493 | \end_inset | 493 | \end_inset |
494 | 494 | ||
495 | ). | 495 | ). |
496 | 496 | ||
497 | \layout LyX-Code | 497 | \layout LyX-Code |
498 | 498 | ||
499 | List allRecords (); | 499 | List allRecords (); |
500 | \layout Standard | 500 | \layout Standard |
501 | 501 | ||
502 | In fact this | 502 | In fact, this |
503 | \emph on | 503 | \emph on |
504 | List | 504 | List |
505 | \emph default | 505 | \emph default |
506 | just contains a list of uid's to take care of memory space. | 506 | just contains a list of uid's to take care of memory space. |
507 | As every record is identified by an unique identifaction number which is | 507 | As every record is identified by an unique identifaction number which is |
508 | called UID (Unique IDentification), these numbers just exists once in the | 508 | called UID (Unique IDentification), these numbers just exists once in the |
509 | database which is currently on access! To receive the real record, you | 509 | database which is currently on access! To receive the real record, you |
510 | have to use the operation | 510 | have to use the operation |
511 | \begin_inset Quotes gld | 511 | \begin_inset Quotes gld |
512 | \end_inset | 512 | \end_inset |
513 | 513 | ||
514 | find() | 514 | find() |
515 | \begin_inset Quotes grd | 515 | \begin_inset Quotes grd |
516 | \end_inset | 516 | \end_inset |
517 | 517 | ||
518 | with a valid UID as paramter: | 518 | with a valid UID as paramter: |
519 | \layout LyX-Code | 519 | \layout LyX-Code |
520 | 520 | ||
521 | T find (UID uid); | 521 | T find (UID uid); |
522 | \layout Standard | 522 | \layout Standard |
523 | 523 | ||
524 | This is all you need to realize a basic access to the PIM-Databases! The | 524 | This is all you need to realize a basic access to the PIM-Databases! The |
525 | next chapter will guide you into more details of the PIM-API. | 525 | next chapter will guide you into more details of the PIM-API. |
526 | \layout Chapter | 526 | \layout Chapter |
527 | 527 | ||
528 | How to Access PIM-Data: Detailed View | 528 | How to Access PIM-Data: Detailed View |
529 | \layout Standard | 529 | \layout Standard |
530 | 530 | ||
531 | As shown in the previous chapter, all we need to access the PIM-Database | 531 | As shown in the previous chapter, all we need to access the PIM-Database |
532 | is to request an access-object from the OPimAccessFactory and to use it. | 532 | is to request an access-object from the OPimAccessFactory and to use it. |
533 | We will now introduce some special features of this factory (see section | 533 | We will now introduce some special features of this factory (see section |
534 | 534 | ||
535 | \begin_inset LatexCommand \ref{sec:Advanced-Factory-Features} | 535 | \begin_inset LatexCommand \ref{sec:Advanced-Factory-Features} |
536 | 536 | ||
537 | \end_inset | 537 | \end_inset |
538 | 538 | ||
539 | ), followed by some very important features like searching and sorting in | 539 | ), followed by some very important features like searching and sorting in |
540 | section | 540 | section |
541 | \begin_inset LatexCommand \ref{sec:Special-Features:-Searching} | 541 | \begin_inset LatexCommand \ref{sec:Special-Features:-Searching} |
542 | 542 | ||
543 | \end_inset | 543 | \end_inset |
544 | 544 | ||
545 | . | 545 | . |
546 | If you are interested in accessing data without take care about their types, | 546 | If you are interested in accessing data without take care about their types, |
547 | section | 547 | section |
548 | \begin_inset LatexCommand \ref{sec:Generic-Access:-OPimBase} | 548 | \begin_inset LatexCommand \ref{sec:Generic-Access:-OPimBase} |
549 | 549 | ||
550 | \end_inset | 550 | \end_inset |
551 | 551 | ||
552 | will show how to do this, followed by a short introduction about delayed | 552 | will show how to do this, followed by a short introduction about delayed |
553 | loading in section | 553 | loading in section |
554 | \begin_inset LatexCommand \ref{sec:Internal-Signal-Handling:} | 554 | \begin_inset LatexCommand \ref{sec:Internal-Signal-Handling:} |
555 | 555 | ||
556 | \end_inset | 556 | \end_inset |
557 | 557 | ||
558 | . | 558 | . |
559 | \layout Standard | 559 | \layout Standard |
560 | 560 | ||
561 | But first we will start with intoducing some features of the | 561 | But first we will start with intoducing some features of the |
562 | \series bold | 562 | \series bold |
563 | OPimAccessFactory | 563 | OPimAccessFactory |
564 | \series default | 564 | \series default |
565 | . | 565 | . |
566 | \layout Section | 566 | \layout Section |
567 | 567 | ||
568 | Advanced Factory Features | 568 | Advanced Factory Features |
569 | \begin_inset LatexCommand \label{sec:Advanced-Factory-Features} | 569 | \begin_inset LatexCommand \label{sec:Advanced-Factory-Features} |
570 | 570 | ||
571 | \end_inset | 571 | \end_inset |
572 | 572 | ||
573 | 573 | ||
574 | \layout Standard | 574 | \layout Standard |
575 | 575 | ||
576 | In the previous chapter we used the operation | 576 | In the previous chapter we used the operation |
577 | \begin_inset Quotes gld | 577 | \begin_inset Quotes gld |
578 | \end_inset | 578 | \end_inset |
579 | 579 | ||
580 | defaultAccess() | 580 | defaultAccess() |
581 | \begin_inset Quotes grd | 581 | \begin_inset Quotes grd |
582 | \end_inset | 582 | \end_inset |
583 | 583 | ||
584 | to request an access-object to the dafault backend. | 584 | to request an access-object to the dafault backend. |
585 | Whether this default backend will access the XML, VCard or SQLite database | 585 | Whether this default backend will access the XML, VCard or SQLite database |
586 | type, this is defined by the configuration file | 586 | type, is defined by the configuration file |
587 | \begin_inset Quotes gld | 587 | \begin_inset Quotes gld |
588 | \end_inset | 588 | \end_inset |
589 | 589 | ||
590 | pimaccess.conf | 590 | pimaccess.conf |
591 | \begin_inset Quotes grd | 591 | \begin_inset Quotes grd |
592 | \end_inset | 592 | \end_inset |
593 | 593 | ||
594 | which is stored in the directory | 594 | which is stored in the directory |
595 | \begin_inset Quotes gld | 595 | \begin_inset Quotes gld |
596 | \end_inset | 596 | \end_inset |
597 | 597 | ||
598 | Settings | 598 | Settings |
599 | \begin_inset Quotes grd | 599 | \begin_inset Quotes grd |
600 | \end_inset | 600 | \end_inset |
601 | 601 | ||
602 | , stored in the user home directory. | 602 | , stored in the user home directory. |
603 | Changing this setting will take effect to all applications using | 603 | Changing this setting will take effect to all applications using |
604 | \begin_inset Quotes gld | 604 | \begin_inset Quotes gld |
605 | \end_inset | 605 | \end_inset |
606 | 606 | ||
607 | defaultAccess() | 607 | defaultAccess() |
608 | \begin_inset Quotes grd | 608 | \begin_inset Quotes grd |
609 | \end_inset | 609 | \end_inset |
610 | 610 | ||
611 | . | 611 | . |
612 | Therefore it is not a good idea to modify a global setting, if an application | 612 | Therefore it is not a good idea to modify a global setting, if an application |
613 | should access a special database type, for instance to move data from one | 613 | should access a special database type, for instance to move data from one |
614 | database to an other. | 614 | database to an other. |
615 | 615 | ||
616 | \layout Standard | 616 | \layout Standard |
617 | 617 | ||
618 | If the developer wants to select a special database type for sure, he has | 618 | If the developer wants to select a special database type for sure without |
619 | to use the oparation | 619 | unnecessary side effects, he has to use the oparation |
620 | \emph on | 620 | \emph on |
621 | create() | 621 | create() |
622 | \emph default | 622 | \emph default |
623 | which has the following parameters: | 623 | which has the following parameters: |
624 | \layout LyX-Code | 624 | \layout LyX-Code |
625 | 625 | ||
626 | T * create (OPimGlobal::PimType type, OPimGlobal::DatabaseStyle dbStyle, | 626 | T * create (OPimGlobal::PimType type, OPimGlobal::DatabaseStyle dbStyle, |
627 | const QString &appName, const QString &fileName=QString::null) | 627 | const QString &appName, const QString &fileName=QString::null) |
628 | \layout Standard | 628 | \layout Standard |
629 | 629 | ||
630 | Some paramters are already known, like type and appName (see section | 630 | Some paramters are already known, like type and appName (see section |
631 | \begin_inset LatexCommand \ref{sec:Instantiate-the-Access} | 631 | \begin_inset LatexCommand \ref{sec:Instantiate-the-Access} |
632 | 632 | ||
633 | \end_inset | 633 | \end_inset |
634 | 634 | ||
635 | ). | 635 | ). |
636 | The new parameter | 636 | The new parameter |
637 | \begin_inset Quotes gld | 637 | \begin_inset Quotes gld |
638 | \end_inset | 638 | \end_inset |
639 | 639 | ||
640 | dbStyle | 640 | dbStyle |
641 | \begin_inset Quotes grd | 641 | \begin_inset Quotes grd |
642 | \end_inset | 642 | \end_inset |
643 | 643 | ||
644 | defines which database type should be selected. | 644 | defines which database type should be selected. |
645 | Possible values could be found in the enumeration | 645 | Possible values could be found in the enumeration |
646 | \emph on | 646 | \emph on |
647 | DataBaseStyle | 647 | DataBaseStyle |
648 | \emph default | 648 | \emph default |
649 | in the class | 649 | in the class |
650 | \series bold | 650 | \series bold |
651 | OPimGlobal | 651 | OPimGlobal |
652 | \series default | 652 | \series default |
653 | (see | 653 | (see |
654 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1Pim_1_1OPimGlobal.html} | 654 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1Pim_1_1OPimGlobal.html} |
655 | 655 | ||
656 | \end_inset | 656 | \end_inset |
657 | 657 | ||
658 | ). | 658 | ). |
659 | 659 | ||
660 | \begin_inset Quotes gld | 660 | \begin_inset Quotes gld |
661 | \end_inset | 661 | \end_inset |
662 | 662 | ||
663 | DEFAULT | 663 | DEFAULT |
664 | \begin_inset Quotes grd | 664 | \begin_inset Quotes grd |
665 | \end_inset | 665 | \end_inset |
666 | 666 | ||
667 | selects the default database and therefore behaves exactly as the operation | 667 | selects the default database and therefore behaves exactly as the operation |
668 | 668 | ||
669 | \begin_inset Quotes gld | 669 | \begin_inset Quotes gld |
670 | \end_inset | 670 | \end_inset |
671 | 671 | ||
672 | defaultAccess() | 672 | defaultAccess() |
673 | \begin_inset Quotes grd | 673 | \begin_inset Quotes grd |
674 | \end_inset | 674 | \end_inset |
675 | 675 | ||
676 | above. | 676 | above. |
677 | 677 | ||
678 | \begin_inset Quotes gld | 678 | \begin_inset Quotes gld |
679 | \end_inset | 679 | \end_inset |
680 | 680 | ||
681 | UNKOWN | 681 | UNKOWN |
682 | \begin_inset Quotes grd | 682 | \begin_inset Quotes grd |
683 | \end_inset | 683 | \end_inset |
684 | 684 | ||
685 | is just defined for internal reasons and should not be used be the developer. | 685 | is just defined for internal reasons and should not be used be the developer. |
686 | The remaining values ( | 686 | The remaining values ( |
687 | \begin_inset Quotes gld | 687 | \begin_inset Quotes gld |
688 | \end_inset | 688 | \end_inset |
689 | 689 | ||
690 | XML | 690 | XML |
691 | \begin_inset Quotes grd | 691 | \begin_inset Quotes grd |
692 | \end_inset | 692 | \end_inset |
693 | 693 | ||
694 | , | 694 | , |
695 | \begin_inset Quotes gld | 695 | \begin_inset Quotes gld |
696 | \end_inset | 696 | \end_inset |
697 | 697 | ||
698 | SQL | 698 | SQL |
699 | \begin_inset Quotes grd | 699 | \begin_inset Quotes grd |
700 | \end_inset | 700 | \end_inset |
701 | 701 | ||
702 | , | 702 | , |
703 | \begin_inset Quotes gld | 703 | \begin_inset Quotes gld |
704 | \end_inset | 704 | \end_inset |
705 | 705 | ||
706 | VCARD | 706 | VCARD |
707 | \begin_inset Quotes grd | 707 | \begin_inset Quotes grd |
708 | \end_inset | 708 | \end_inset |
709 | 709 | ||
710 | ) should be used to select the desired database backend. | 710 | ) should be used to select the desired database backend. |
711 | The last parameter | 711 | The last parameter |
712 | \begin_inset Quotes gld | 712 | \begin_inset Quotes gld |
713 | \end_inset | 713 | \end_inset |
714 | 714 | ||
715 | fileName | 715 | fileName |
716 | \begin_inset Quotes grd | 716 | \begin_inset Quotes grd |
717 | \end_inset | 717 | \end_inset |
718 | 718 | ||
719 | is used to select a special file name and path to the database file. | 719 | is used to select a special file name and path to the database file. |
720 | Thus, you can use it to access database files which don't reside on the | 720 | Thus, you can use it to access database files which don't reside on the |
721 | default path or have other filenames as it is defined by the platform as | 721 | default path or have other filenames as it is defined by the platform as |
722 | default (in normal cases | 722 | default (in normal cases |
723 | \begin_inset Quotes gld | 723 | \begin_inset Quotes gld |
724 | \end_inset | 724 | \end_inset |
725 | 725 | ||
726 | ~/Applications/<name of application>/ | 726 | ~/Applications/<name of application>/ |
727 | \begin_inset Quotes grd | 727 | \begin_inset Quotes grd |
728 | \end_inset | 728 | \end_inset |
729 | 729 | ||
730 | ). | 730 | ). |
731 | \layout Standard | 731 | \layout Standard |
732 | 732 | ||
733 | In the next section we will discuss how searching and sorting take place | 733 | In the next section we will discuss how searching and sorting take place |
734 | with this API. | 734 | with this API. |
735 | \layout Section | 735 | \layout Section |
736 | 736 | ||
737 | Special Features: Searching and Sorting | 737 | Special Features: Searching and Sorting |
738 | \begin_inset LatexCommand \label{sec:Special-Features:-Searching} | 738 | \begin_inset LatexCommand \label{sec:Special-Features:-Searching} |
739 | 739 | ||
740 | \end_inset | 740 | \end_inset |
741 | 741 | ||
742 | 742 | ||
743 | \layout Standard | 743 | \layout Standard |
744 | 744 | ||
745 | In most cases it is not sufficient to receive just a list of all information | 745 | In most cases it is not sufficient to receive just a list of all information |
746 | in a database. | 746 | in a database. |
747 | It is essential to get a subset of the information available and to be | 747 | It is essential to get a subset of the information available and to be |
748 | able to sort it. | 748 | able to sort it. |
749 | For this kind of excercise we provide some special operations which provide | 749 | For this kind of excercise we provide some special operations which provide |
750 | searching and sorting in an incremental manner | 750 | searching and sorting in an incremental manner |
751 | \begin_inset Foot | 751 | \begin_inset Foot |
752 | collapsed true | 752 | collapsed true |
753 | 753 | ||
754 | \layout Standard | 754 | \layout Standard |
755 | 755 | ||
756 | FIXME: matchRegexp() does take a list of uid's. | 756 | FIXME: matchRegexp() does take a list of uid's. |
757 | Therefore it is currently not possible to use it in an incremental manner! | 757 | Therefore it is currently not possible to use it in an incremental manner! |
758 | (se) | 758 | (se) |
759 | \end_inset | 759 | \end_inset |
760 | 760 | ||
761 | . | 761 | . |
762 | Therfore it is possible to research a | 762 | Therefore it is possible to research a |
763 | \begin_inset Quotes gld | 763 | \begin_inset Quotes gld |
764 | \end_inset | 764 | \end_inset |
765 | 765 | ||
766 | List | 766 | List |
767 | \begin_inset Quotes grd | 767 | \begin_inset Quotes grd |
768 | \end_inset | 768 | \end_inset |
769 | 769 | ||
770 | which was returned by a previous search query and to sort it afterwards. | 770 | which was returned by a previous search query and to sort it afterwards. |
771 | Before we will take a close look into sorting, we will start with searching. | 771 | Before we will take a close look into sorting, we will start with searching. |
772 | There exist two different ways of searching: | 772 | There exist two different ways of searching: |
773 | \layout Enumerate | 773 | \layout Enumerate |
774 | 774 | ||
775 | Search a complete database for a special regular expression, using | 775 | Search a complete database for a special regular expression, using |
776 | \begin_inset Quotes gld | 776 | \begin_inset Quotes gld |
777 | \end_inset | 777 | \end_inset |
778 | 778 | ||
779 | matchRegexp () | 779 | matchRegexp () |
780 | \begin_inset Quotes grd | 780 | \begin_inset Quotes grd |
781 | \end_inset | 781 | \end_inset |
782 | 782 | ||
783 | . | 783 | . |
784 | This search type returns all records which contains the given regular expressio | 784 | This search type returns all records which contains the given regular expressio |
785 | n | 785 | n |
786 | \emph on | 786 | \emph on |
787 | anywhere | 787 | anywhere |
788 | \emph default | 788 | \emph default |
789 | in the dataset. | 789 | in the dataset. |
790 | This search type is used for example by the opie search tool (OSearch) | 790 | This search type is used for example by the opie search tool (OSearch) |
791 | (see | 791 | (see |
792 | \begin_inset LatexCommand \url{http://handhelds.org/cgi-bin/cvsweb.cgi/opie/core/pim/osearch/} | 792 | \begin_inset LatexCommand \url{http://handhelds.org/cgi-bin/cvsweb.cgi/opie/core/pim/osearch/} |
793 | 793 | ||
794 | \end_inset | 794 | \end_inset |
795 | 795 | ||
796 | and | 796 | and |
797 | \begin_inset LatexCommand \url{http://handhelds.org/cgi-bin/cvsweb.cgi/opie/core/pim/osearch/adresssearch.cpp?rev=1.12&content-type=text/x-cvsweb-markup} | 797 | \begin_inset LatexCommand \url{http://handhelds.org/cgi-bin/cvsweb.cgi/opie/core/pim/osearch/adresssearch.cpp?rev=1.12&content-type=text/x-cvsweb-markup} |
798 | 798 | ||
799 | \end_inset | 799 | \end_inset |
800 | 800 | ||
801 | ). | 801 | ). |
802 | \layout Enumerate | 802 | \layout Enumerate |
803 | 803 | ||
804 | Define a so called | 804 | Define a so called |
805 | \begin_inset Quotes gld | 805 | \begin_inset Quotes gld |
806 | \end_inset | 806 | \end_inset |
807 | 807 | ||
808 | Query By Example | 808 | Query By Example |
809 | \begin_inset Quotes grd | 809 | \begin_inset Quotes grd |
810 | \end_inset | 810 | \end_inset |
811 | 811 | ||
812 | search query which allows to define what should be searched and which internal | 812 | search query which allows to define what should be searched and which internal |
813 | data fields should be taken into account. | 813 | data fields should be taken into account. |
814 | This is a very advanced search function which allows to search in a very | 814 | This is a very advanced search function which allows to search in a very |
815 | fine granular manner. | 815 | fine granular manner. |
816 | \layout Standard | 816 | \layout Standard |
817 | 817 | ||
818 | We will start with the first and very simple | 818 | We will start with the first and very simple |
819 | \begin_inset Quotes grd | 819 | \begin_inset Quotes grd |
820 | \end_inset | 820 | \end_inset |
821 | 821 | ||
822 | matchRegexp() | 822 | matchRegexp() |
823 | \begin_inset Quotes grd | 823 | \begin_inset Quotes grd |
824 | \end_inset | 824 | \end_inset |
825 | 825 | ||
826 | , followed by the query by example search query. | 826 | , followed by the query by example search query. |
827 | \layout Subsection | 827 | \layout Subsection |
828 | 828 | ||
829 | Searching with | 829 | Searching with |
830 | \begin_inset Quotes gld | 830 | \begin_inset Quotes gld |
831 | \end_inset | 831 | \end_inset |
832 | 832 | ||
833 | matchRegexp() | 833 | matchRegexp() |
834 | \begin_inset Quotes grd | 834 | \begin_inset Quotes grd |
835 | \end_inset | 835 | \end_inset |
836 | 836 | ||
837 | 837 | ||
838 | \layout Standard | 838 | \layout Standard |
839 | 839 | ||
840 | The function is defined like this: | 840 | The function is defined like this: |
841 | \layout LyX-Code | 841 | \layout LyX-Code |
842 | 842 | ||
843 | List matchRegexp (const QRegExp &r); | 843 | List matchRegexp (const QRegExp &r); |
844 | \layout Standard | 844 | \layout Standard |
845 | 845 | ||
846 | The | 846 | The |
847 | \begin_inset Quotes gld | 847 | \begin_inset Quotes gld |
848 | \end_inset | 848 | \end_inset |
849 | 849 | ||
850 | List | 850 | List |
851 | \begin_inset Quotes grd | 851 | \begin_inset Quotes grd |
852 | \end_inset | 852 | \end_inset |
853 | 853 | ||
854 | is still a OPimRecordList which contains 0 or more uid's of matching records. | 854 | is still a OPimRecordList which contains 0 or more uid's of matching records. |
855 | As already discussed in section | 855 | As already discussed in section |
856 | \begin_inset LatexCommand \ref{sec:Accessing-the-access-object} | 856 | \begin_inset LatexCommand \ref{sec:Accessing-the-access-object} |
857 | 857 | ||
858 | \end_inset | 858 | \end_inset |
859 | 859 | ||
860 | you have to use the | 860 | you have to use the |
861 | \begin_inset Quotes gld | 861 | \begin_inset Quotes gld |
862 | \end_inset | 862 | \end_inset |
863 | 863 | ||
864 | find() | 864 | find() |
865 | \begin_inset Quotes grd | 865 | \begin_inset Quotes grd |
866 | \end_inset | 866 | \end_inset |
867 | 867 | ||
868 | operation to request the real records. | 868 | operation to request the real records. |
869 | \layout Subsection | 869 | \layout Subsection |
870 | 870 | ||
871 | Searching with Query By Example | 871 | Searching with Query By Example |
872 | \layout Standard | 872 | \layout Standard |
873 | 873 | ||
874 | The query by example search style is working is using a data object (for | 874 | The query by example search style is working is using a data object (for |
875 | instance an OPimContact) to store the search query. | 875 | instance an OPimContact) to store the search query. |
876 | For instance, if you want to request all entries which contains the last | 876 | For instance, if you want to request all entries which contains the last |
877 | name | 877 | name |
878 | \begin_inset Quotes gld | 878 | \begin_inset Quotes gld |
879 | \end_inset | 879 | \end_inset |
880 | 880 | ||
881 | Eilers | 881 | Eilers |
882 | \begin_inset Quotes grd | 882 | \begin_inset Quotes grd |
883 | \end_inset | 883 | \end_inset |
884 | 884 | ||
885 | and the home zip number should start with | 885 | and the home zip number should start with |
886 | \begin_inset Quotes gld | 886 | \begin_inset Quotes gld |
887 | \end_inset | 887 | \end_inset |
888 | 888 | ||
889 | 3 | 889 | 3 |
890 | \begin_inset Quotes grd | 890 | \begin_inset Quotes grd |
891 | \end_inset | 891 | \end_inset |
892 | 892 | ||
893 | you have to do the following: | 893 | you have to do the following: |
894 | \layout LyX-Code | 894 | \layout LyX-Code |
895 | 895 | ||
896 | OPimContact searchQuery; | 896 | OPimContact searchQuery; |
897 | \layout LyX-Code | 897 | \layout LyX-Code |
898 | 898 | ||
899 | searchQuery.setLastName( | 899 | searchQuery.setLastName( |
900 | \begin_inset Quotes gld | 900 | \begin_inset Quotes gld |
901 | \end_inset | 901 | \end_inset |
902 | 902 | ||
903 | Eilers | 903 | Eilers |
904 | \begin_inset Quotes grd | 904 | \begin_inset Quotes grd |
905 | \end_inset | 905 | \end_inset |
906 | 906 | ||
907 | ); | 907 | ); |
908 | \layout LyX-Code | 908 | \layout LyX-Code |
909 | 909 | ||
910 | searchQuery.setHomeZip( | 910 | searchQuery.setHomeZip( |
911 | \begin_inset Quotes gld | 911 | \begin_inset Quotes gld |
912 | \end_inset | 912 | \end_inset |
913 | 913 | ||
914 | 3* | 914 | 3* |
915 | \begin_inset Quotes grd | 915 | \begin_inset Quotes grd |
916 | \end_inset | 916 | \end_inset |
917 | 917 | ||
918 | ); | 918 | ); |
919 | \layout Standard | 919 | \layout Standard |
920 | 920 | ||
921 | We use a usual | 921 | We use an usual |
922 | \begin_inset Quotes gld | 922 | \begin_inset Quotes gld |
923 | \end_inset | 923 | \end_inset |
924 | 924 | ||
925 | OPimContact | 925 | OPimContact |
926 | \begin_inset Quotes grd | 926 | \begin_inset Quotes grd |
927 | \end_inset | 927 | \end_inset |
928 | 928 | ||
929 | and fill into two fields the search information. | 929 | and fill into two fields the query information. |
930 | All filled fields are taken for the search operation (using an | ||
931 | \begin_inset Quotes gld | ||
932 | \end_inset | ||
933 | |||
934 | AND | ||
935 | \begin_inset Quotes grd | ||
936 | \end_inset | ||
937 | |||
938 | operation), the unused ones are simply ignored. | ||
930 | As we just want to search for entries which zip number starts with a | 939 | As we just want to search for entries which zip number starts with a |
931 | \begin_inset Quotes gld | 940 | \begin_inset Quotes gld |
932 | \end_inset | 941 | \end_inset |
933 | 942 | ||
934 | 3 | 943 | 3 |
935 | \begin_inset Quotes grd | 944 | \begin_inset Quotes grd |
936 | \end_inset | 945 | \end_inset |
937 | 946 | ||
938 | we use the Wildcard | 947 | we use the Wildcard |
939 | \begin_inset Quotes gld | 948 | \begin_inset Quotes gld |
940 | \end_inset | 949 | \end_inset |
941 | 950 | ||
942 | * | 951 | * |
943 | \begin_inset Quotes grd | 952 | \begin_inset Quotes grd |
944 | \end_inset | 953 | \end_inset |
945 | 954 | ||
946 | as we would do for finding files in a filesystem. | 955 | as we would do to find files in a filesystem. |
947 | \layout Standard | 956 | \layout Standard |
948 | 957 | ||
949 | The next step is to put this query into the operation which is defined like | 958 | The next step is to put this query into the operation which is defined like |
950 | this: | 959 | this: |
951 | \layout LyX-Code | 960 | \layout LyX-Code |
952 | 961 | ||
953 | List queryByExample (const T& query, int querySettings, const QDateTime | 962 | List queryByExample (const T& query, int querySettings, const QDateTime |
954 | &startperiod=QDateTime()) | 963 | &startperiod=QDateTime()) |
955 | \layout Standard | 964 | \layout Standard |
956 | 965 | ||
957 | The first parameter | 966 | The first parameter |
958 | \begin_inset Quotes gld | 967 | \begin_inset Quotes gld |
959 | \end_inset | 968 | \end_inset |
960 | 969 | ||
961 | query | 970 | query |
962 | \begin_inset Quotes grd | 971 | \begin_inset Quotes grd |
963 | \end_inset | 972 | \end_inset |
964 | 973 | ||
965 | should used to set our query, but we have to set the parameter | 974 | should used to set our query, but we have to set the parameter |
966 | \begin_inset Quotes gld | 975 | \begin_inset Quotes gld |
967 | \end_inset | 976 | \end_inset |
968 | 977 | ||
969 | querySettings | 978 | querySettings |
970 | \begin_inset Quotes grd | 979 | \begin_inset Quotes grd |
971 | \end_inset | 980 | \end_inset |
972 | 981 | ||
973 | to configure the search properly. | 982 | to configure the search properly. |
974 | This settings are defined by the enum QuerySettings in the class | 983 | This settings are defined by the enum QuerySettings in the class |
975 | \series bold | 984 | \series bold |
976 | OPimBase | 985 | OPimBase |
977 | \series default | 986 | \series default |
978 | (see | 987 | (see |
979 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/structOpie_1_1OPimBase.html#w19} | 988 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/structOpie_1_1OPimBase.html#w19} |
980 | 989 | ||
981 | \end_inset | 990 | \end_inset |
982 | 991 | ||
983 | ). | 992 | ). |
984 | The meaning of all settings will be discussed later. | 993 | The meaning of all settings will be discussed later. |
985 | For the first turn we will just concentrate on the things we need in this | 994 | For the first turn we will just concentrate on the things we need in this |
986 | case. | 995 | case. |
987 | As we use Wildcards in | 996 | As we use Wildcards in |
988 | \begin_inset Quotes gld | 997 | \begin_inset Quotes gld |
989 | \end_inset | 998 | \end_inset |
990 | 999 | ||
991 | setHomeZip | 1000 | setHomeZip |
992 | \begin_inset Quotes grd | 1001 | \begin_inset Quotes grd |
993 | \end_inset | 1002 | \end_inset |
994 | 1003 | ||
995 | we have to use | 1004 | we have to use |
996 | \begin_inset Quotes gld | 1005 | \begin_inset Quotes gld |
997 | \end_inset | 1006 | \end_inset |
998 | 1007 | ||
999 | WildCards | 1008 | WildCards |
1000 | \begin_inset Quotes grd | 1009 | \begin_inset Quotes grd |
1001 | \end_inset | 1010 | \end_inset |
1002 | 1011 | ||
1003 | . | 1012 | . |
1004 | And we want to be sure to find lower case names, too, which may be mistyped | 1013 | And we want to be sure to find lower case names, too, which may be mistyped |
1005 | (like | 1014 | (like |
1006 | \begin_inset Quotes gld | 1015 | \begin_inset Quotes gld |
1007 | \end_inset | 1016 | \end_inset |
1008 | 1017 | ||
1009 | eilers | 1018 | eilers |
1010 | \begin_inset Quotes grd | 1019 | \begin_inset Quotes grd |
1011 | \end_inset | 1020 | \end_inset |
1012 | 1021 | ||
1013 | , | 1022 | , |
1014 | \begin_inset Quotes gld | 1023 | \begin_inset Quotes gld |
1015 | \end_inset | 1024 | \end_inset |
1016 | 1025 | ||
1017 | eIlers | 1026 | eIlers |
1018 | \begin_inset Quotes grd | 1027 | \begin_inset Quotes grd |
1019 | \end_inset | 1028 | \end_inset |
1020 | 1029 | ||
1021 | , ...). | 1030 | , ...). |
1022 | Thus we have to use the | 1031 | Thus, we have to use the |
1023 | \begin_inset Quotes gld | 1032 | \begin_inset Quotes gld |
1024 | \end_inset | 1033 | \end_inset |
1025 | 1034 | ||
1026 | IgnoreCase | 1035 | IgnoreCase |
1027 | \begin_inset Quotes grd | 1036 | \begin_inset Quotes grd |
1028 | \end_inset | 1037 | \end_inset |
1029 | 1038 | ||
1030 | setting which is to combine with the other using an | 1039 | setting which is to combine with the other using an |
1031 | \begin_inset Quotes gld | 1040 | \begin_inset Quotes gld |
1032 | \end_inset | 1041 | \end_inset |
1033 | 1042 | ||
1034 | or | 1043 | or |
1035 | \begin_inset Quotes grd | 1044 | \begin_inset Quotes grd |
1036 | \end_inset | 1045 | \end_inset |
1037 | 1046 | ||
1038 | operator. | 1047 | operator. |
1039 | The last parameter | 1048 | The last parameter |
1040 | \begin_inset Quotes gld | 1049 | \begin_inset Quotes gld |
1041 | \end_inset | 1050 | \end_inset |
1042 | 1051 | ||
1043 | endperiod | 1052 | endperiod |
1044 | \begin_inset Quotes grd | 1053 | \begin_inset Quotes grd |
1045 | \end_inset | 1054 | \end_inset |
1046 | 1055 | ||
1047 | will be ignored for this case which will look like this: | 1056 | will be ignored for this case which will look like this: |
1048 | \layout LyX-Code | 1057 | \layout LyX-Code |
1049 | 1058 | ||
1050 | use namespace Opie; | 1059 | use namespace Opie; |
1051 | \layout LyX-Code | 1060 | \layout LyX-Code |
1052 | 1061 | ||
1053 | [...] | 1062 | [...] |
1054 | \layout LyX-Code | 1063 | \layout LyX-Code |
1055 | 1064 | ||
1056 | List found_items = queryByExample( searchQuery, OPimBase::WildCards | OpimBase:: | 1065 | List found_items = queryByExample( searchQuery, OPimBase::WildCards | OpimBase:: |
1057 | IgnoreCase ); | 1066 | IgnoreCase ); |
1058 | \layout Standard | 1067 | \layout Standard |
1059 | 1068 | ||
1060 | This operation may return a list of entries which can be accesses as usual, | 1069 | This operation may return a list of entries which can be accessed as above, |
1061 | using the | 1070 | using the |
1062 | \begin_inset Quotes gld | 1071 | \begin_inset Quotes gld |
1063 | \end_inset | 1072 | \end_inset |
1064 | 1073 | ||
1065 | find() | 1074 | find() |
1066 | \begin_inset Quotes grd | 1075 | \begin_inset Quotes grd |
1067 | \end_inset | 1076 | \end_inset |
1068 | 1077 | ||
1069 | operation. | 1078 | operation. |
1070 | \layout Standard | 1079 | \layout Standard |
1071 | 1080 | ||
1072 | It should be clear at this stage, that this query is very powerful and - | 1081 | It should be clear at this stage, that this query is very powerful and - |
1073 | depending to the querySettings - could be very complicated to implement. | 1082 | depending to the querySettings - could be very complicated to implement. |
1074 | Thus, not all backends do support all features defined by querySettings | 1083 | Thus, not all backends do support all features defined by querySettings |
1075 | \begin_inset Foot | 1084 | \begin_inset Foot |
1076 | collapsed true | 1085 | collapsed true |
1077 | 1086 | ||
1078 | \layout Standard | 1087 | \layout Standard |
1079 | 1088 | ||
1080 | At this time, just the contact database for XML and VCard is supporting | 1089 | At this time, just the contact database for XML and VCard is supporting |
1081 | all queries and combination of them. | 1090 | all queries and combination of them. |
1082 | All others just support subsets. | 1091 | All others just support subsets. |
1083 | \end_inset | 1092 | \end_inset |
1084 | 1093 | ||
1085 | . | 1094 | . |
1086 | To check which settings are supported and to be able to react dynamically | 1095 | To check which settings are supported and to be able to react dynamically |
1087 | on missing features (for instance to disable some search features in the | 1096 | on missing features (for instance to disable some search features in the |
1088 | application) we provide the following operations: | 1097 | application) we provide the following operations: |
1089 | \layout LyX-Code | 1098 | \layout LyX-Code |
1090 | 1099 | ||
1091 | bool hasQuerySettings( uint querySettings ); | 1100 | bool hasQuerySettings( uint querySettings ); |
1092 | \layout LyX-Code | 1101 | \layout LyX-Code |
1093 | 1102 | ||
1094 | uint querySettings(); | 1103 | uint querySettings(); |
1095 | \layout Standard | 1104 | \layout Standard |
1096 | 1105 | ||
1097 | The first operation | 1106 | The first operation |
1098 | \begin_inset Quotes gld | 1107 | \begin_inset Quotes gld |
1099 | \end_inset | 1108 | \end_inset |
1100 | 1109 | ||
1101 | hasQuerySettings() | 1110 | hasQuerySettings() |
1102 | \begin_inset Quotes grd | 1111 | \begin_inset Quotes grd |
1103 | \end_inset | 1112 | \end_inset |
1104 | 1113 | ||
1105 | may be used to ask whether the database can handle the given query settings. | 1114 | may be used to ask whether the database can handle the given query settings. |
1106 | In this example a call to | 1115 | In this example a call to |
1107 | \layout LyX-Code | 1116 | \layout LyX-Code |
1108 | 1117 | ||
1109 | hasQuerySettings( OPimBase::WildCards | OpimBase::IgnoreCase ); | 1118 | hasQuerySettings( OPimBase::WildCards | OpimBase::IgnoreCase ); |
1110 | \layout Standard | 1119 | \layout Standard |
1111 | 1120 | ||
1112 | should be answered with | 1121 | should be answered with |
1113 | \begin_inset Quotes gld | 1122 | \begin_inset Quotes gld |
1114 | \end_inset | 1123 | \end_inset |
1115 | 1124 | ||
1116 | true | 1125 | true |
1117 | \begin_inset Quotes grd | 1126 | \begin_inset Quotes grd |
1118 | \end_inset | 1127 | \end_inset |
1119 | 1128 | ||
1120 | . | 1129 | . |
1121 | If you need to ask which kind of queries are supported, the operation | 1130 | If you need to ask which kind of queries are supported, the operation |
1122 | \begin_inset Quotes gld | 1131 | \begin_inset Quotes gld |
1123 | \end_inset | 1132 | \end_inset |
1124 | 1133 | ||
1125 | querySettings() | 1134 | querySettings() |
1126 | \begin_inset Quotes grd | 1135 | \begin_inset Quotes grd |
1127 | \end_inset | 1136 | \end_inset |
1128 | 1137 | ||
1129 | will be your friend. | 1138 | will be your friend. |
1130 | It will return an unsigned integer value where a | 1139 | It will return an unsigned integer value where a |
1131 | \begin_inset Quotes gld | 1140 | \begin_inset Quotes gld |
1132 | \end_inset | 1141 | \end_inset |
1133 | 1142 | ||
1134 | 1 | 1143 | 1 |
1135 | \begin_inset Quotes grd | 1144 | \begin_inset Quotes grd |
1136 | \end_inset | 1145 | \end_inset |
1137 | 1146 | ||
1138 | is set for every available feature. | 1147 | is set for every available feature. |
1139 | \layout Standard | 1148 | \layout Standard |
1140 | 1149 | ||
1141 | The last parameter is called | 1150 | The last parameter is called |
1142 | \begin_inset Quotes gld | 1151 | \begin_inset Quotes gld |
1143 | \end_inset | 1152 | \end_inset |
1144 | 1153 | ||
1145 | startperiod | 1154 | startperiod |
1146 | \begin_inset Quotes grd | 1155 | \begin_inset Quotes grd |
1147 | \end_inset | 1156 | \end_inset |
1148 | 1157 | ||
1149 | which is used to set a time interval: | 1158 | which is used to set a time interval: |
1150 | \layout Standard | 1159 | \layout Standard |
1151 | 1160 | ||
1152 | In some cases, a time interval should be set to find for instance all entries | 1161 | In some cases, a time interval should be set to find for instance all entries |
1153 | between two dates (used for example by the birthday reminder for today | 1162 | between two dates (used for example by the birthday reminder for today |
1154 | (see here: | 1163 | (see here: |
1155 | \begin_inset LatexCommand \url{http://handhelds.org/cgi-bin/cvsweb.cgi/opie/core/pim/today/plugins/addressbook/addresspluginwidget.cpp?rev=1.14&content-type=text/x-cvsweb-markup} | 1164 | \begin_inset LatexCommand \url{http://handhelds.org/cgi-bin/cvsweb.cgi/opie/core/pim/today/plugins/addressbook/addresspluginwidget.cpp?rev=1.14&content-type=text/x-cvsweb-markup} |
1156 | 1165 | ||
1157 | \end_inset | 1166 | \end_inset |
1158 | 1167 | ||
1159 | )) as requested by the setting | 1168 | )) as requested by the setting |
1160 | \begin_inset Quotes gld | 1169 | \begin_inset Quotes gld |
1161 | \end_inset | 1170 | \end_inset |
1162 | 1171 | ||
1163 | OPimBase::DateDiff | 1172 | OPimBase::DateDiff |
1164 | \begin_inset Quotes grd | 1173 | \begin_inset Quotes grd |
1165 | \end_inset | 1174 | \end_inset |
1166 | 1175 | ||
1167 | . | 1176 | . |
1168 | The date and time in the query object is used as the | 1177 | The date and time in the query object is used as the |
1169 | \series bold | 1178 | \series bold |
1170 | end | 1179 | end |
1171 | \series default | 1180 | \series default |
1172 | of the interval. | 1181 | of the interval. |
1173 | The start will be defined by the last parameter (if nothing is set, the | 1182 | The start will be defined by the last parameter (if nothing is set, the |
1174 | current date will be taken!). | 1183 | current date will be taken!). |
1175 | Therefore, it is possible to set a time frame for all searched entries. | 1184 | Therefore, it is possible to set a time frame for all searched entries. |
1185 | \layout Standard | ||
1186 | |||
1187 | If you want to do incremental search operations, you may use the special | ||
1188 | |||
1189 | \begin_inset Quotes gld | ||
1190 | \end_inset | ||
1191 | |||
1192 | queryByExample() | ||
1193 | \begin_inset Quotes grd | ||
1194 | \end_inset | ||
1195 | |||
1196 | which takes a | ||
1197 | \begin_inset Quotes gld | ||
1198 | \end_inset | ||
1199 | |||
1200 | List | ||
1201 | \begin_inset Quotes grd | ||
1202 | \end_inset | ||
1203 | |||
1204 | as the first parameter. | ||
1205 | The search operation will just occure on this set of uid's! | ||
1206 | \layout Subsection | ||
1207 | |||
1208 | Sorting | ||
1209 | \layout Standard | ||
1210 | |||
1211 | To sort a given dataset, you should use the following operation (or one | ||
1212 | of the others which behave slightly differently): | ||
1213 | \layout LyX-Code | ||
1214 | |||
1215 | List sorted (const List& list, bool ascending, int sortOrder, int sortFilter, | ||
1216 | const QArray< UID >& cats); | ||
1217 | \layout Standard | ||
1218 | |||
1219 | This sort operation takes a list of uid's as returned for instance from | ||
1220 | a search query. | ||
1221 | The parameter | ||
1222 | \begin_inset Quotes gld | ||
1223 | \end_inset | ||
1224 | |||
1225 | ascending | ||
1226 | \begin_inset Quotes grd | ||
1227 | \end_inset | ||
1228 | |||
1229 | defines whether the sort should be in an ascending order or not. | ||
1230 | |||
1231 | \begin_inset Quotes gld | ||
1232 | \end_inset | ||
1233 | |||
1234 | sortOrder | ||
1235 | \begin_inset Quotes grd | ||
1236 | \end_inset | ||
1237 | |||
1238 | is defined by the enumerations | ||
1239 | \begin_inset Quotes gld | ||
1240 | \end_inset | ||
1241 | |||
1242 | SortOrder | ||
1243 | \begin_inset Quotes grd | ||
1244 | \end_inset | ||
1245 | |||
1246 | and | ||
1247 | \begin_inset Quotes gld | ||
1248 | \end_inset | ||
1249 | |||
1250 | SortOrderBase | ||
1251 | \begin_inset Quotes grd | ||
1252 | \end_inset | ||
1253 | |||
1254 | and defines which field should be used to sort (see for | ||
1255 | \series bold | ||
1256 | OPimContactAccess | ||
1257 | \series default | ||
1258 | : | ||
1259 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimContactAccess.html} | ||
1260 | |||
1261 | \end_inset | ||
1262 | |||
1263 | , for | ||
1264 | \series bold | ||
1265 | ODateBookAccess | ||
1266 | \series default | ||
1267 | : | ||
1268 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1ODateBookAccess.html} | ||
1269 | |||
1270 | \end_inset | ||
1271 | |||
1272 | and for | ||
1273 | \series bold | ||
1274 | OPimTodoAccess | ||
1275 | \series default | ||
1276 | : | ||
1277 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/classOpie_1_1OPimTodoAccess.html} | ||
1278 | |||
1279 | \end_inset | ||
1280 | |||
1281 | and for common settings | ||
1282 | \begin_inset LatexCommand \url{http://www.sra.uni-hannover.de/~eilers/apidocs/pim2/html/structOpie_1_1OPimBase.html#w21} | ||
1283 | |||
1284 | \end_inset | ||
1285 | |||
1286 | ). | ||
1287 | \layout Standard | ||
1288 | |||
1289 | The | ||
1290 | \begin_inset Quotes gld | ||
1291 | \end_inset | ||
1292 | |||
1293 | sortFilter | ||
1294 | \begin_inset Quotes grd | ||
1295 | \end_inset | ||
1296 | |||
1297 | parameter allows to remove some entries which are not interesting for the | ||
1298 | result and is defined in the same classes as | ||
1299 | \begin_inset Quotes gld | ||
1300 | \end_inset | ||
1301 | |||
1302 | sortOrder | ||
1303 | \begin_inset Quotes grd | ||
1304 | \end_inset | ||
1305 | |||
1306 | by the enumeration | ||
1307 | \begin_inset Quotes gld | ||
1308 | \end_inset | ||
1309 | |||
1310 | SortFilter | ||
1311 | \begin_inset Quotes grd | ||
1312 | \end_inset | ||
1313 | |||
1314 | and | ||
1315 | \begin_inset Quotes gld | ||
1316 | \end_inset | ||
1317 | |||
1318 | SortFilterBase | ||
1319 | \begin_inset Quotes grd | ||
1320 | \end_inset | ||
1321 | |||
1322 | . | ||
1323 | The list of id's in | ||
1324 | \begin_inset Quotes gld | ||
1325 | \end_inset | ||
1326 | |||
1327 | cats | ||
1328 | \begin_inset Quotes grd | ||
1329 | \end_inset | ||
1330 | |||
1331 | allows to remain just these entries which are included in the list of categorie | ||
1332 | s. | ||
1333 | \layout Standard | ||
1334 | |||
1335 | The returned list contains the same uid's as given via | ||
1336 | \begin_inset Quotes gld | ||
1337 | \end_inset | ||
1338 | |||
1339 | list | ||
1340 | \begin_inset Quotes grd | ||
1341 | \end_inset | ||
1342 | |||
1343 | (or a subset of it, as the sortFilter and category list removes some entries) | ||
1344 | with a modified order as | ||
1345 | \begin_inset Quotes gld | ||
1346 | \end_inset | ||
1347 | |||
1348 | sortOrder | ||
1349 | \begin_inset Quotes grd | ||
1350 | \end_inset | ||
1351 | |||
1352 | and | ||
1353 | \begin_inset Quotes gld | ||
1354 | \end_inset | ||
1355 | |||
1356 | ascending | ||
1357 | \begin_inset Quotes grd | ||
1358 | \end_inset | ||
1359 | |||
1360 | dictates. | ||
1361 | \layout Standard | ||
1362 | |||
1363 | Therefore | ||
1364 | \begin_inset Quotes gld | ||
1365 | \end_inset | ||
1366 | |||
1367 | sorted() | ||
1368 | \begin_inset Quotes grd | ||
1369 | \end_inset | ||
1370 | |||
1371 | is more a combination of search and sort, as just a sort command. | ||
1372 | But this combination is exactly what the developer needs in most situations. | ||
1373 | |||
1176 | \layout Section | 1374 | \layout Section |
1177 | 1375 | ||
1178 | Generic Access: OPimBase and OPimRecord | 1376 | Generic Access: OPimBase and OPimRecord |
1179 | \begin_inset LatexCommand \label{sec:Generic-Access:-OPimBase} | 1377 | \begin_inset LatexCommand \label{sec:Generic-Access:-OPimBase} |
1180 | 1378 | ||
1181 | \end_inset | 1379 | \end_inset |
1182 | 1380 | ||
1183 | 1381 | ||
1184 | \layout Section | 1382 | \layout Section |
1185 | 1383 | ||
1186 | Caching | 1384 | Caching |
1187 | \layout Standard | 1385 | \layout Standard |
1188 | 1386 | ||
1189 | Need to be written. | 1387 | Need to be written. |
1190 | Implementation is found at: | 1388 | Implementation is found at: |
1191 | \begin_inset LatexCommand \url{http://handhelds.org/cgi-bin/cvsweb.cgi/opie/noncore/tools/pimconverter/converter.cpp?rev=1.9&content-type=text/x-cvsweb-markup} | 1389 | \begin_inset LatexCommand \url{http://handhelds.org/cgi-bin/cvsweb.cgi/opie/noncore/tools/pimconverter/converter.cpp?rev=1.9&content-type=text/x-cvsweb-markup} |
1192 | 1390 | ||
1193 | \end_inset | 1391 | \end_inset |
1194 | 1392 | ||
1195 | 1393 | ||
1196 | \layout Section | 1394 | \layout Section |
1197 | 1395 | ||
1198 | Internal Signal Handling: Automatic Propagation of Changes | 1396 | Internal Signal Handling: Automatic Propagation of Changes |
1199 | \begin_inset LatexCommand \label{sec:Internal-Signal-Handling:} | 1397 | \begin_inset LatexCommand \label{sec:Internal-Signal-Handling:} |
1200 | 1398 | ||
1201 | \end_inset | 1399 | \end_inset |
1202 | 1400 | ||
1203 | 1401 | ||
1204 | \layout Standard | 1402 | \layout Standard |
1205 | 1403 | ||
1206 | Need to be written and is not implemented completly! | 1404 | Need to be written and is not implemented completly! |
1207 | \layout Chapter | 1405 | \layout Chapter |
1208 | 1406 | ||
1209 | Howto Extend and Write New Backends | 1407 | Howto Extend and Write New Backends |
1210 | \layout Standard | 1408 | \layout Standard |
1211 | 1409 | ||
1212 | Need to be written. | 1410 | Need to be written. |
1213 | \the_end | 1411 | \the_end |