From 3f194c85b5b9243ff30f1067361ef9fa5bb85a1e Mon Sep 17 00:00:00 2001 From: zecke Date: Sun, 22 Sep 2002 19:25:33 +0000 Subject: Some documentation and addition to OTodoAccess overDue and effectiveTodos --- (limited to 'libopie2/opiepim/core') diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h index e0708e1..36f5a99 100644 --- a/libopie2/opiepim/core/opimaccesstemplate.h +++ b/libopie2/opiepim/core/opimaccesstemplate.h @@ -9,35 +9,105 @@ #include "otemplatebase.h" +/** + * Thats the frontend to our OPIE PIM + * 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 + * the plugins + */ + template class OPimAccessTemplate : public OTemplateBase { public: typedef ORecordList List; typedef OPimAccessBackend BackEnd; + + /** + * our sort order + * should be safe explaining + */ + enum SortOrder { WildCards = 0, IgnoreCase = 1, + RegExp = 2, ExactMatch = 4 }; + + /** + * c'tor BackEnd + */ OPimAccessTemplate( BackEnd* end); virtual ~OPimAccessTemplate(); + + /** + * load from the backend + */ virtual void load(); + + /** + * reload from the backend + */ virtual void reload(); + + /** + * save to the backend + */ virtual void save(); - /* - *do array to Records conversion - * QArray ids + /** + * if the resource was changed externally + */ + bool wasChangedExternally()const; + + /** + * return a List of records + * you can iterate over them */ virtual List allRecords()const; + + /** + * queryByExample + */ virtual List queryByExample( const T& t, int sortOrder ); + + /** + * find the OPimRecord uid + */ virtual T find( int uid ); /* invalidate cache here */ + /** + * clears the backend and invalidates the backend + */ virtual void clear() ; + + /** + * add T to the backend + */ virtual bool add( const T& t ) ; /* only the uid matters */ + /** + * 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 + */ virtual bool replace( const T& t) ; protected: + /** + * invalidate the cache + */ void invalidateCache(); + + /** + * returns the backend + */ BackEnd* backEnd(); BackEnd* m_backEnd; @@ -114,5 +184,8 @@ template OPimAccessTemplate::BackEnd* OPimAccessTemplate::backEnd() { return m_backEnd; } - +template +bool OPimAccessTemplate::wasChangedExternally()const { + return false; +} #endif diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h index e4d33d6..dbb94ed 100644 --- a/libopie2/opiepim/core/opimrecord.h +++ b/libopie2/opiepim/core/opimrecord.h @@ -7,9 +7,16 @@ #include + +/** + * This is the base class for + * all PIM Records + * + */ class OPimRecord : public Qtopia::Record { public: /** + * c'tor * uid of 0 isEmpty * uid of 1 will be assigned a new one */ @@ -44,6 +51,7 @@ public: /** * if a Record isEmpty + * it's empty if it's 0 */ virtual bool isEmpty()const; @@ -88,19 +96,24 @@ public: QArray relations( const QString& app )const; /** - * + * clear the relations for all relations + * with app */ void clearRelation( const QString& app ); /** - * + * add a relation */ void addRelation( const QString& app, int id ); /** - * + * set the relations for an app */ void setRelations( const QString&, QArray ids ); + + /** + * set the uid + */ virtual void setUid( int uid ); protected: diff --git a/libopie2/opiepim/core/otemplatebase.h b/libopie2/opiepim/core/otemplatebase.h index 41cc934..add1de4 100644 --- a/libopie2/opiepim/core/otemplatebase.h +++ b/libopie2/opiepim/core/otemplatebase.h @@ -3,6 +3,9 @@ #include "opimrecord.h" +/** + * internal template base + */ template class OTemplateBase { public: -- cgit v0.9.0.2