Diffstat (limited to 'libopie2/opiepim/backend/obackendfactory.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/obackendfactory.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/obackendfactory.h b/libopie2/opiepim/backend/obackendfactory.h index ad6cf5a..f3c339d 100644 --- a/libopie2/opiepim/backend/obackendfactory.h +++ b/libopie2/opiepim/backend/obackendfactory.h | |||
@@ -7,24 +7,32 @@ | |||
7 | *This program is free software; you can redistribute it and/or | 7 | *This program is free software; you can redistribute it and/or |
8 | *modify it under the terms of the GNU Library General Public | 8 | *modify it under the terms of the GNU Library General Public |
9 | * License as published by the Free Software Foundation; | 9 | * License as published by the Free Software Foundation; |
10 | * either version 2 of the License, or (at your option) any later | 10 | * either version 2 of the License, or (at your option) any later |
11 | * version. | 11 | * version. |
12 | * ===================================================================== | 12 | * ===================================================================== |
13 | * ToDo: Use plugins | 13 | * ToDo: Use plugins |
14 | * ===================================================================== | 14 | * ===================================================================== |
15 | * Version: $Id$ | 15 | * Version: $Id$ |
16 | * ===================================================================== | 16 | * ===================================================================== |
17 | * History: | 17 | * History: |
18 | * $Log$ | 18 | * $Log$ |
19 | * Revision 1.7 2003/08/01 12:30:16 eilers | ||
20 | * Merging changes from BRANCH_1_0 to HEAD | ||
21 | * | ||
22 | * Revision 1.6.4.1 2003/06/30 14:34:19 eilers | ||
23 | * Patches from Zecke: | ||
24 | * Fixing and cleaning up extraMap handling | ||
25 | * Adding d_ptr for binary compatibility in the future | ||
26 | * | ||
19 | * Revision 1.6 2003/04/13 18:07:10 zecke | 27 | * Revision 1.6 2003/04/13 18:07:10 zecke |
20 | * More API doc | 28 | * More API doc |
21 | * QString -> const QString& | 29 | * QString -> const QString& |
22 | * QString = 0l -> QString::null | 30 | * QString = 0l -> QString::null |
23 | * | 31 | * |
24 | * Revision 1.5 2003/02/21 23:31:52 zecke | 32 | * Revision 1.5 2003/02/21 23:31:52 zecke |
25 | * Add XML datebookresource | 33 | * Add XML datebookresource |
26 | * -clean up todoaccessxml header | 34 | * -clean up todoaccessxml header |
27 | * -implement some more stuff in the oeven tester | 35 | * -implement some more stuff in the oeven tester |
28 | * -extend DefaultFactory to not crash and to use datebook | 36 | * -extend DefaultFactory to not crash and to use datebook |
29 | * | 37 | * |
30 | * -reading of OEvents is working nicely.. saving will be added | 38 | * -reading of OEvents is working nicely.. saving will be added |
@@ -59,24 +67,26 @@ | |||
59 | #include <qstring.h> | 67 | #include <qstring.h> |
60 | #include <qasciidict.h> | 68 | #include <qasciidict.h> |
61 | #include <qpe/config.h> | 69 | #include <qpe/config.h> |
62 | 70 | ||
63 | #include "otodoaccessxml.h" | 71 | #include "otodoaccessxml.h" |
64 | #include "ocontactaccessbackend_xml.h" | 72 | #include "ocontactaccessbackend_xml.h" |
65 | #include "odatebookaccessbackend_xml.h" | 73 | #include "odatebookaccessbackend_xml.h" |
66 | 74 | ||
67 | #ifdef __USE_SQL | 75 | #ifdef __USE_SQL |
68 | #include "otodoaccesssql.h" | 76 | #include "otodoaccesssql.h" |
69 | #endif | 77 | #endif |
70 | 78 | ||
79 | class OBackendPrivate; | ||
80 | |||
71 | /** | 81 | /** |
72 | * This class is our factory. It will give us the default implementations | 82 | * This class is our factory. It will give us the default implementations |
73 | * of at least Todolist, Contacts and Datebook. In the future this class will | 83 | * of at least Todolist, Contacts and Datebook. In the future this class will |
74 | * allow users to switch the backend with ( XML->SQLite ) without the need | 84 | * allow users to switch the backend with ( XML->SQLite ) without the need |
75 | * to recompile.# | 85 | * to recompile.# |
76 | * This class as the whole PIM Api is making use of templates | 86 | * This class as the whole PIM Api is making use of templates |
77 | * | 87 | * |
78 | * <pre> | 88 | * <pre> |
79 | * OTodoAccessBackend* backend = OBackEndFactory<OTodoAccessBackend>::Default("todo", QString::null ); | 89 | * OTodoAccessBackend* backend = OBackEndFactory<OTodoAccessBackend>::Default("todo", QString::null ); |
80 | * backend->load(); | 90 | * backend->load(); |
81 | * </pre> | 91 | * </pre> |
82 | * | 92 | * |
@@ -139,16 +149,18 @@ class OBackendFactory | |||
139 | return (T*) new OContactAccessBackend_XML( appName ); | 149 | return (T*) new OContactAccessBackend_XML( appName ); |
140 | case DATE: | 150 | case DATE: |
141 | if ( backend == "sql" ) | 151 | if ( backend == "sql" ) |
142 | qWarning("OBackendFactory:: sql Backend not implemented! Using XML instead!"); | 152 | qWarning("OBackendFactory:: sql Backend not implemented! Using XML instead!"); |
143 | 153 | ||
144 | return (T*) new ODateBookAccessBackend_XML( appName ); | 154 | return (T*) new ODateBookAccessBackend_XML( appName ); |
145 | default: | 155 | default: |
146 | return NULL; | 156 | return NULL; |
147 | } | 157 | } |
148 | 158 | ||
149 | 159 | ||
150 | } | 160 | } |
161 | private: | ||
162 | OBackendPrivate* d; | ||
151 | }; | 163 | }; |
152 | 164 | ||
153 | 165 | ||
154 | #endif | 166 | #endif |