summaryrefslogtreecommitdiff
path: root/core/pim/datebook2/managertemplate.h
Side-by-side diff
Diffstat (limited to 'core/pim/datebook2/managertemplate.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook2/managertemplate.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/core/pim/datebook2/managertemplate.h b/core/pim/datebook2/managertemplate.h
new file mode 100644
index 0000000..668fda7
--- a/dev/null
+++ b/core/pim/datebook2/managertemplate.h
@@ -0,0 +1,36 @@
+#ifndef OPIE_DATE_BOOK_MANAGER_TEMPLATE_H
+#define OPIE_DATE_BOOK_MANAGER_TEMPLATE_H
+
+#include <qdialog.h>
+#include <qstring.h>
+
+namespace Datebook {
+ /**
+ * ManagerTemplate is a template which manages
+ * all kind of managers :)
+ */
+ template<class T>
+ class ManagerTemplate {
+ public:
+ ManagerTemplate();
+ ~ManagerTemplate();
+
+ virtual void add( const QString&, const T& t );
+ void remove( const QString& );
+ bool load();
+ bool save();
+
+ QStringList names();
+ T value(const QString&)const;
+
+ protected:
+ QMap<QString, T> m_map;
+
+ private:
+ virtual bool doSave() = 0;
+ virtual bool doLoad() = 0;
+
+ };
+}
+
+#endif