summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimrecord.h
authorzecke <zecke>2002-09-20 12:59:29 (UTC)
committer zecke <zecke>2002-09-20 12:59:29 (UTC)
commita05c10c9744020be31c3038b2de3401b5cc673fb (patch) (side-by-side diff)
tree20d059bf00fc1199c34a60a8be4cb842ebfe4d14 /libopie2/opiepim/core/opimrecord.h
parent7099778ab711f78cfd86dadad1b8af993e008f38 (diff)
downloadopie-a05c10c9744020be31c3038b2de3401b5cc673fb.zip
opie-a05c10c9744020be31c3038b2de3401b5cc673fb.tar.gz
opie-a05c10c9744020be31c3038b2de3401b5cc673fb.tar.bz2
Our new common template based start for Accessing and Manipulating
the Records The CROSS_REFERENCE branch will get ported to it. We use templates for several reasons They allow us to share code and to be easily extended I've to make them not inline to save memory... I've to port all DBs and Record related classes
Diffstat (limited to 'libopie2/opiepim/core/opimrecord.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimrecord.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h
new file mode 100644
index 0000000..a0e0413
--- a/dev/null
+++ b/libopie2/opiepim/core/opimrecord.h
@@ -0,0 +1,117 @@
+#ifndef OPIE_PIM_RECORD_H
+#define OPIE_PIM_RECORD_H
+
+#include <qmap.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include <qpe/palmtoprecord.h>
+
+class OPimRecord : public Qtopia::Record {
+public:
+ /**
+ * uid of 0 isEmpty
+ * uid of 1 will be assigned a new one
+ */
+ OPimRecord(int uid = 0);
+ ~OPimRecord();
+
+ /**
+ * copy c'tor
+ */
+ OPimRecord( OPimRecord& rec );
+
+ /**
+ * copy operator
+ */
+ OPimRecord &operator=( const OPimRecord& );
+
+ /**
+ * category names resolved
+ */
+ QStringList categoryNames()const;
+
+ /**
+ * set category names they will be resolved
+ */
+ void setCategoryName( const QStringList& );
+
+ /**
+ * addCategoryName adds a name
+ * to the internal category list
+ */
+ void addCategoryName( const QString& );
+
+ /**
+ * if a Record isEmpty
+ */
+ virtual bool isEmpty()const;
+
+ /**
+ * toRichText summary
+ */
+ virtual QString toRichText()const = 0;
+
+ /**
+ * a small one line summary
+ */
+ virtual QString toShortText()const = 0;
+
+ /**
+ * the name of the Record
+ */
+ virtual QString type()const = 0;
+
+ /**
+ * converts the internal structure to a map
+ */
+ virtual QMap<int, QString> toMap()const = 0;
+
+ /**
+ * key value representation of extra items
+ */
+ virtual QMap<QString, QString> toExtraMap()const = 0;
+
+ /**
+ * the name for a recordField
+ */
+ virtual QString recordField(int)const = 0;
+
+ /**
+ * the related apps names
+ */
+ QStringList relatedApps()const;
+
+ /**
+ * the realtions between an app
+ */
+ QArray<int> relations( const QString& app )const;
+
+ /**
+ *
+ */
+ void clearRelation( const QString& app );
+
+ /**
+ *
+ */
+ void addRelation( const QString& app, int id );
+
+ /**
+ *
+ */
+ void setRelations( const QString&, QArray<int> ids );
+
+protected:
+ QString crossToString()const;
+
+private:
+ class OPimRecordPrivate;
+ OPimRecordPrivate *d;
+ QMap<QString, QArray<int> > m_relations;
+
+};
+
+
+
+#endif