From e49230a12104b718c46a34c81b6c0e608c9d40be Mon Sep 17 00:00:00 2001 From: zecke Date: Sun, 22 Sep 2002 22:21:51 +0000 Subject: Add XML resources for todolist and compile fixes for RecordList --- (limited to 'libopie2/opiepim/core/opimaccesstemplate.h') diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h index 36f5a99..31ab516 100644 --- a/libopie2/opiepim/core/opimaccesstemplate.h +++ b/libopie2/opiepim/core/opimaccesstemplate.h @@ -14,7 +14,7 @@ * Library. Either you want to use it's * interface or you want to implement * your own Access lib - * Just create a OPimRecord and inherit from + * Just create a OPimRecord and inherit from * the plugins */ @@ -36,49 +36,49 @@ public: */ OPimAccessTemplate( BackEnd* end); virtual ~OPimAccessTemplate(); - + /** * load from the backend */ - virtual void load(); - + virtual bool load(); + /** * reload from the backend */ - virtual void reload(); - + virtual bool reload(); + /** - * save to the backend + * save to the backend */ - virtual void save(); + virtual bool save(); /** * if the resource was changed externally */ bool wasChangedExternally()const; - + /** * return a List of records * you can iterate over them */ virtual List allRecords()const; - + /** - * queryByExample + * queryByExample */ virtual List queryByExample( const T& t, int sortOrder ); - + /** * find the OPimRecord uid */ - virtual T find( int uid ); + virtual T find( int uid )const; /* invalidate cache here */ /** * clears the backend and invalidates the backend */ virtual void clear() ; - + /** * add T to the backend */ @@ -89,12 +89,12 @@ public: * remove T from the backend */ virtual bool remove( const T& t ); - + /** * remove the OPimRecord with uid */ virtual bool remove( int uid ); - + /** * replace T from backend */ @@ -104,7 +104,8 @@ protected: * invalidate the cache */ void invalidateCache(); - + + void setBackEnd( BackEnd* end ); /** * returns the backend */ @@ -125,16 +126,16 @@ OPimAccessTemplate::~OPimAccessTemplate() { delete m_backEnd; } template -void OPimAccessTemplate::load() { - m_backEnd->load(); +bool OPimAccessTemplate::load() { + return m_backEnd->load(); } template -void OPimAccessTemplate::reload() { - m_backEnd->reload(); +bool OPimAccessTemplate::reload() { + return m_backEnd->reload(); } template -void OPimAccessTemplate::save() { - m_backEnd->save(); +bool OPimAccessTemplate::save() { + return m_backEnd->save(); } template OPimAccessTemplate::List OPimAccessTemplate::allRecords()const { @@ -151,7 +152,7 @@ OPimAccessTemplate::queryByExample( const T& t, int sortOrder ) { return lis; } template -T OPimAccessTemplate::find( int uid ) { +T OPimAccessTemplate::find( int uid ) const{ T t = m_backEnd->find( uid ); return t; } @@ -188,4 +189,8 @@ template bool OPimAccessTemplate::wasChangedExternally()const { return false; } +template +void OPimAccessTemplate::setBackEnd( BackEnd* end ) { + m_backEnd = end; +} #endif -- cgit v0.9.0.2