summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/obackendfactory.h
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/backend/obackendfactory.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/obackendfactory.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/obackendfactory.h b/libopie2/opiepim/backend/obackendfactory.h
index 3a73210..ad6cf5a 100644
--- a/libopie2/opiepim/backend/obackendfactory.h
+++ b/libopie2/opiepim/backend/obackendfactory.h
@@ -13,12 +13,17 @@
* ToDo: Use plugins
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.6 2003/04/13 18:07:10 zecke
+ * More API doc
+ * QString -> const QString&
+ * QString = 0l -> QString::null
+ *
* Revision 1.5 2003/02/21 23:31:52 zecke
* Add XML datebookresource
* -clean up todoaccessxml header
* -implement some more stuff in the oeven tester
* -extend DefaultFactory to not crash and to use datebook
*
@@ -60,25 +65,44 @@
#include "odatebookaccessbackend_xml.h"
#ifdef __USE_SQL
#include "otodoaccesssql.h"
#endif
-
+/**
+ * This class is our factory. It will give us the default implementations
+ * of at least Todolist, Contacts and Datebook. In the future this class will
+ * allow users to switch the backend with ( XML->SQLite ) without the need
+ * to recompile.#
+ * This class as the whole PIM Api is making use of templates
+ *
+ * <pre>
+ * OTodoAccessBackend* backend = OBackEndFactory<OTodoAccessBackend>::Default("todo", QString::null );
+ * backend->load();
+ * </pre>
+ *
+ * @author Stefan Eilers
+ * @version 0.1
+ */
template<class T>
class OBackendFactory
{
public:
OBackendFactory() {};
enum BACKENDS {
TODO,
CONTACT,
DATE
};
+ /**
+ * Returns a backend implementation for backendName
+ * @param backendName the type of the backend
+ * @param appName will be passed on to the backend
+ */
static T* Default( const QString backendName, const QString& appName ){
// __asm__("int3");
Config config( "pimaccess" );
config.setGroup ( backendName );