summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimrecord.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimrecord.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimrecord.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h
index ec99a13..665530f 100644
--- a/libopie2/opiepim/core/opimrecord.h
+++ b/libopie2/opiepim/core/opimrecord.h
@@ -1,122 +1,134 @@
1#ifndef OPIE_PIM_RECORD_H 1#ifndef OPIE_PIM_RECORD_H
2#define OPIE_PIM_RECORD_H 2#define OPIE_PIM_RECORD_H
3 3
4#include <qdatastream.h>
4#include <qmap.h> 5#include <qmap.h>
5#include <qstring.h> 6#include <qstring.h>
6#include <qstringlist.h> 7#include <qstringlist.h>
7 8
8#include <qpe/palmtoprecord.h> 9#include <qpe/palmtoprecord.h>
9 10
10#include <opie/opimxrefmanager.h> 11#include <opie/opimxrefmanager.h>
11 12
12/** 13/**
13 * This is the base class for 14 * This is the base class for
14 * all PIM Records 15 * all PIM Records
15 * 16 *
16 */ 17 */
17class OPimRecord : public Qtopia::Record { 18class OPimRecord : public Qtopia::Record {
18public: 19public:
19 /** 20 /**
20 * c'tor 21 * c'tor
21 * uid of 0 isEmpty 22 * uid of 0 isEmpty
22 * uid of 1 will be assigned a new one 23 * uid of 1 will be assigned a new one
23 */ 24 */
24 OPimRecord(int uid = 0); 25 OPimRecord(int uid = 0);
25 ~OPimRecord(); 26 ~OPimRecord();
26 27
27 /** 28 /**
28 * copy c'tor 29 * copy c'tor
29 */ 30 */
30 OPimRecord( const OPimRecord& rec ); 31 OPimRecord( const OPimRecord& rec );
31 32
32 /** 33 /**
33 * copy operator 34 * copy operator
34 */ 35 */
35 OPimRecord &operator=( const OPimRecord& ); 36 OPimRecord &operator=( const OPimRecord& );
36 37
37 /** 38 /**
38 * category names resolved 39 * category names resolved
39 */ 40 */
40 QStringList categoryNames()const; 41 QStringList categoryNames()const;
41 42
42 /** 43 /**
43 * set category names they will be resolved 44 * set category names they will be resolved
44 */ 45 */
45 void setCategoryNames( const QStringList& ); 46 void setCategoryNames( const QStringList& );
46 47
47 /** 48 /**
48 * addCategoryName adds a name 49 * addCategoryName adds a name
49 * to the internal category list 50 * to the internal category list
50 */ 51 */
51 void addCategoryName( const QString& ); 52 void addCategoryName( const QString& );
52 53
53 /** 54 /**
54 * if a Record isEmpty 55 * if a Record isEmpty
55 * it's empty if it's 0 56 * it's empty if it's 0
56 */ 57 */
57 virtual bool isEmpty()const; 58 virtual bool isEmpty()const;
58 59
59 /** 60 /**
60 * toRichText summary 61 * toRichText summary
61 */ 62 */
62 virtual QString toRichText()const = 0; 63 virtual QString toRichText()const = 0;
63 64
64 /** 65 /**
65 * a small one line summary 66 * a small one line summary
66 */ 67 */
67 virtual QString toShortText()const = 0; 68 virtual QString toShortText()const = 0;
68 69
69 /** 70 /**
70 * the name of the Record 71 * the name of the Record
71 */ 72 */
72 virtual QString type()const = 0; 73 virtual QString type()const = 0;
73 74
74 /** 75 /**
75 * converts the internal structure to a map 76 * converts the internal structure to a map
76 */ 77 */
77 virtual QMap<int, QString> toMap()const = 0; 78 virtual QMap<int, QString> toMap()const = 0;
78 79
79 /** 80 /**
80 * key value representation of extra items 81 * key value representation of extra items
81 */ 82 */
82 virtual QMap<QString, QString> toExtraMap()const = 0; 83 virtual QMap<QString, QString> toExtraMap()const = 0;
83 84
84 /** 85 /**
85 * the name for a recordField 86 * the name for a recordField
86 */ 87 */
87 virtual QString recordField(int)const = 0; 88 virtual QString recordField(int)const = 0;
88 89
89 /** 90 /**
90 * returns a reference of the 91 * returns a reference of the
91 * Cross Reference Manager 92 * Cross Reference Manager
92 * Partner 'One' is THIS PIM RECORD! 93 * Partner 'One' is THIS PIM RECORD!
93 * 'Two' is the Partner where we link to 94 * 'Two' is the Partner where we link to
94 */ 95 */
95 OPimXRefManager& xrefmanager(); 96 OPimXRefManager& xrefmanager();
96 97
97 /** 98 /**
98 * set the uid 99 * set the uid
99 */ 100 */
100 virtual void setUid( int uid ); 101 virtual void setUid( int uid );
101 102
102 /* 103 /*
103 * used inside the Templates for casting 104 * used inside the Templates for casting
104 * REIMPLEMENT in your .... 105 * REIMPLEMENT in your ....
105 */ 106 */
106 static int rtti(); 107 static int rtti();
107 108
109 /**
110 * some marshalling and de marshalling code
111 * saves the OPimRecord
112 * to and from a DataStream
113 */
114 virtual bool loadFromStream(QDataStream& );
115 virtual bool saveToStream( QDataStream& stream )const;
116
108protected: 117protected:
109 Qtopia::UidGen &uidGen(); 118 Qtopia::UidGen &uidGen();
110// QString crossToString()const; 119// QString crossToString()const;
111 120
112private: 121private:
113 class OPimRecordPrivate; 122 class OPimRecordPrivate;
114 OPimRecordPrivate *d; 123 OPimRecordPrivate *d;
115 OPimXRefManager m_xrefman; 124 OPimXRefManager m_xrefman;
116 static Qtopia::UidGen m_uidGen; 125 static Qtopia::UidGen m_uidGen;
117 126
127private:
128 void flush( const OPimXRefPartner&, QDataStream& stream )const;
129 OPimXRefPartner partner( QDataStream& );
118}; 130};
119 131
120 132
121 133
122#endif 134#endif