summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/oevent.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/oevent.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/oevent.h38
1 files changed, 24 insertions, 14 deletions
diff --git a/libopie2/opiepim/oevent.h b/libopie2/opiepim/oevent.h
index 30f442e..9218c97 100644
--- a/libopie2/opiepim/oevent.h
+++ b/libopie2/opiepim/oevent.h
@@ -20,82 +20,91 @@ struct OCalendarHelper {
20 static int ocurrence( const QDate& ); 20 static int ocurrence( const QDate& );
21 21
22 // returns the dayOfWeek for the *first* day it finds (ignores 22 // returns the dayOfWeek for the *first* day it finds (ignores
23 // any further days!). Returns 1 (Monday) if there isn't any day found 23 // any further days!). Returns 1 (Monday) if there isn't any day found
24 static int dayOfWeek( char day ); 24 static int dayOfWeek( char day );
25 25
26 /** returns the diff of month */ 26 /** returns the diff of month */
27 static int monthDiff( const QDate& first, const QDate& second ); 27 static int monthDiff( const QDate& first, const QDate& second );
28 28
29}; 29};
30 30
31class OPimNotifyManager; 31class OPimNotifyManager;
32class ORecur; 32class ORecur;
33 33
34/** 34/**
35 * This is the container for all Events. It encapsules all 35 * This is the container for all Events. It encapsules all
36 * available information for a single Event 36 * available information for a single Event
37 * @short container for events. 37 * @short container for events.
38 */ 38 */
39class OEvent : public OPimRecord { 39class OEvent : public OPimRecord {
40public: 40public:
41 typedef QValueList<OEvent> ValueList; 41 typedef QValueList<OEvent> ValueList;
42 /** 42 /**
43 * RecordFields contain possible attributes 43 * RecordFields contain possible attributes
44 * used in the Results of toMap()..
44 */ 45 */
45 enum RecordFields { 46 enum RecordFields {
46 Uid = Qtopia::UID_ID, 47 FUid = Qtopia::UID_ID,
47 Category = Qtopia::CATEGORY_ID, 48 FCategories = Qtopia::CATEGORY_ID,
48 Description, 49 FDescription = 0,
49 Location, 50 FLocation,
50 Alarm, 51 FType,
51 Reminder, 52 FAlarm,
52 Recurrence, 53 FSound,
53 Note, 54 FRType,
54 Created, 55 FRWeekdays,
55 StartDate, 56 FRPosition,
56 EndDate, 57 FRFreq,
57 AllDay, 58 FRHasEndDate,
58 TimeZone 59 FREndDate,
60 FRCreated,
61 FRExceptions,
62 FStart,
63 FEnd,
64 FNote,
65 FTimeZone,
66 FRecParent,
67 FRecChildren,
59 }; 68 };
60 69
61 /** 70 /**
62 * Start with an Empty OEvent. UID == 0 means that it is empty 71 * Start with an Empty OEvent. UID == 0 means that it is empty
63 */ 72 */
64 OEvent(int uid = 0); 73 OEvent(int uid = 0);
65 74
66 /** 75 /**
67 * copy c'tor 76 * copy c'tor
68 */ 77 */
69 OEvent( const OEvent& ); 78 OEvent( const OEvent& );
70 ~OEvent(); 79 ~OEvent();
71 OEvent &operator=( const OEvent& ); 80 OEvent &operator=( const OEvent& );
72 81
73 QString description()const; 82 QString description()const;
74 void setDescription( const QString& description ); 83 void setDescription( const QString& description );
75 84
76 QString location()const; 85 QString location()const;
77 void setLocation( const QString& loc ); 86 void setLocation( const QString& loc );
78 87
79 bool hasNotifiers()const; 88 bool hasNotifiers()const;
80 OPimNotifyManager &notifiers()const; 89 OPimNotifyManager &notifiers()const;
81 90
82 ORecur recurrence()const; 91 ORecur recurrence()const;
83 void setRecurrence( const ORecur& ); 92 void setRecurrence( const ORecur& );
84 bool hasRecurrence()const; 93 bool hasRecurrence()const;
85 94
86 QString note()const; 95 QString note()const;
87 void setNote( const QString& note ); 96 void setNote( const QString& note );
88 97
89 98
90 QDateTime createdDateTime()const; 99 QDateTime createdDateTime()const;
91 void setCreatedDateTime( const QDateTime& dt); 100 void setCreatedDateTime( const QDateTime& dt);
92 101
93 /** set the date to dt. dt is the QDateTime in localtime */ 102 /** set the date to dt. dt is the QDateTime in localtime */
94 void setStartDateTime( const QDateTime& ); 103 void setStartDateTime( const QDateTime& );
95 /** returns the datetime in the local timeZone */ 104 /** returns the datetime in the local timeZone */
96 QDateTime startDateTime()const; 105 QDateTime startDateTime()const;
97 106
98 /** returns the start datetime in the current zone */ 107 /** returns the start datetime in the current zone */
99 QDateTime startDateTimeInZone()const; 108 QDateTime startDateTimeInZone()const;
100 109
101 /** in current timezone */ 110 /** in current timezone */
@@ -111,48 +120,49 @@ public:
111 /* pin this event to a timezone! FIXME */ 120 /* pin this event to a timezone! FIXME */
112 void setTimeZone( const QString& timeZone ); 121 void setTimeZone( const QString& timeZone );
113 QString timeZone()const; 122 QString timeZone()const;
114 123
115 124
116 virtual bool match( const QRegExp& )const; 125 virtual bool match( const QRegExp& )const;
117 126
118 /** For exception to recurrence here is a list of children... */ 127 /** For exception to recurrence here is a list of children... */
119 QArray<int> children()const; 128 QArray<int> children()const;
120 void setChildren( const QArray<int>& ); 129 void setChildren( const QArray<int>& );
121 void addChild( int uid ); 130 void addChild( int uid );
122 void removeChild( int uid ); 131 void removeChild( int uid );
123 132
124 /** return the parent OEvent */ 133 /** return the parent OEvent */
125 int parent()const; 134 int parent()const;
126 void setParent( int uid ); 135 void setParent( int uid );
127 136
128 137
129 /* needed reimp */ 138 /* needed reimp */
130 QString toRichText()const; 139 QString toRichText()const;
131 QString toShortText()const; 140 QString toShortText()const;
132 QString type()const; 141 QString type()const;
133 142
134 QMap<int, QString> toMap()const; 143 QMap<int, QString> toMap()const;
144 void fromMap( const QMap<int, QString>& map );
135 QString recordField(int )const; 145 QString recordField(int )const;
136 146
137 static int rtti(); 147 static int rtti();
138 148
139 bool loadFromStream( QDataStream& ); 149 bool loadFromStream( QDataStream& );
140 bool saveToStream( QDataStream& )const; 150 bool saveToStream( QDataStream& )const;
141 151
142/* bool operator==( const OEvent& ); 152/* bool operator==( const OEvent& );
143 bool operator!=( const OEvent& ); 153 bool operator!=( const OEvent& );
144 bool operator<( const OEvent& ); 154 bool operator<( const OEvent& );
145 bool operator<=( const OEvent& ); 155 bool operator<=( const OEvent& );
146 bool operator>( const OEvent& ); 156 bool operator>( const OEvent& );
147 bool operator>=(const OEvent& ); 157 bool operator>=(const OEvent& );
148*/ 158*/
149private: 159private:
150 inline void changeOrModify(); 160 inline void changeOrModify();
151 void deref(); 161 void deref();
152 struct Data; 162 struct Data;
153 Data* data; 163 Data* data;
154 class Private; 164 class Private;
155 Private* priv; 165 Private* priv;
156 166
157}; 167};
158 168