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) (unidiff)
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 @@
1#ifndef OPIE_PIM_RECORD_H
2#define OPIE_PIM_RECORD_H
3
4#include <qmap.h>
5#include <qstring.h>
6#include <qstringlist.h>
7
8#include <qpe/palmtoprecord.h>
9
10class OPimRecord : public Qtopia::Record {
11public:
12 /**
13 * uid of 0 isEmpty
14 * uid of 1 will be assigned a new one
15 */
16 OPimRecord(int uid = 0);
17 ~OPimRecord();
18
19 /**
20 * copy c'tor
21 */
22 OPimRecord( OPimRecord& rec );
23
24 /**
25 * copy operator
26 */
27 OPimRecord &operator=( const OPimRecord& );
28
29 /**
30 * category names resolved
31 */
32 QStringList categoryNames()const;
33
34 /**
35 * set category names they will be resolved
36 */
37 void setCategoryName( const QStringList& );
38
39 /**
40 * addCategoryName adds a name
41 * to the internal category list
42 */
43 void addCategoryName( const QString& );
44
45 /**
46 * if a Record isEmpty
47 */
48 virtual bool isEmpty()const;
49
50 /**
51 * toRichText summary
52 */
53 virtual QString toRichText()const = 0;
54
55 /**
56 * a small one line summary
57 */
58 virtual QString toShortText()const = 0;
59
60 /**
61 * the name of the Record
62 */
63 virtual QString type()const = 0;
64
65 /**
66 * converts the internal structure to a map
67 */
68 virtual QMap<int, QString> toMap()const = 0;
69
70 /**
71 * key value representation of extra items
72 */
73 virtual QMap<QString, QString> toExtraMap()const = 0;
74
75 /**
76 * the name for a recordField
77 */
78 virtual QString recordField(int)const = 0;
79
80 /**
81 * the related apps names
82 */
83 QStringList relatedApps()const;
84
85 /**
86 * the realtions between an app
87 */
88 QArray<int> relations( const QString& app )const;
89
90 /**
91 *
92 */
93 void clearRelation( const QString& app );
94
95 /**
96 *
97 */
98 void addRelation( const QString& app, int id );
99
100 /**
101 *
102 */
103 void setRelations( const QString&, QArray<int> ids );
104
105protected:
106 QString crossToString()const;
107
108private:
109 class OPimRecordPrivate;
110 OPimRecordPrivate *d;
111 QMap<QString, QArray<int> > m_relations;
112
113};
114
115
116
117#endif