From c23db0c35b77cc1656ac8822ca948e73c50e8ee6 Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 19 Mar 2002 19:14:32 +0000 Subject: Make multiple backends possible --- (limited to 'include') diff --git a/include/opie/tododb.h b/include/opie/tododb.h index 6478363..945f343 100644 --- a/include/opie/tododb.h +++ b/include/opie/tododb.h @@ -6,11 +6,12 @@ #include +class ToDoResource; class ToDoDB { public: // if no argument is supplied pick the default book - ToDoDB(const QString &fileName = QString::null ); + ToDoDB(const QString &fileName = QString::null, ToDoResource* resource= 0 ); ~ToDoDB(); QValueList effectiveToDos(const QDate &from, const QDate &to, @@ -27,11 +28,14 @@ class ToDoDB void setFileName(const QString & ); QString fileName()const; bool save(); + ToDoResource *resource(); + void setResource(ToDoResource* res); private: class ToDoDBPrivate; ToDoDBPrivate *d; QString m_fileName; + ToDoResource *m_res; QValueList m_todos; void load(); }; diff --git a/include/opie/todoevent.h b/include/opie/todoevent.h index dd8c0c9..79522b2 100644 --- a/include/opie/todoevent.h +++ b/include/opie/todoevent.h @@ -29,6 +29,7 @@ class ToDoEvent { void setDescription(const QString& ); bool isOverdue(); + void setUid(int id) {m_uid = id; }; bool operator<(const ToDoEvent &toDoEvent )const; bool operator<=(const ToDoEvent &toDoEvent )const; bool operator!=(const ToDoEvent &toDoEvent )const { return !(*this == toDoEvent); }; diff --git a/include/opie/todoresource.h b/include/opie/todoresource.h new file mode 100644 index 0000000..34edb04 --- a/dev/null +++ b/include/opie/todoresource.h @@ -0,0 +1,14 @@ + + +#ifndef opietodoresource_h +#define opietodoresource_h + +class ToDoEvent; +class ToDoResource { + public: + ToDoResource( ) {}; + virtual QValueList load(const QString &file ) = 0; + virtual bool save( const QString &file, const QValueList & ) = 0; +}; + +#endif -- cgit v0.9.0.2