author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /libkcal/incidencebase.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | libkcal/incidencebase.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index 3edc03b..d97f524 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h | |||
@@ -12,59 +12,61 @@ | |||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | #ifndef KCAL_INCIDENCEBASE_H | 20 | #ifndef KCAL_INCIDENCEBASE_H |
21 | #define KCAL_INCIDENCEBASE_H | 21 | #define KCAL_INCIDENCEBASE_H |
22 | // | 22 | // |
23 | // Incidence - base class of calendaring components | 23 | // Incidence - base class of calendaring components |
24 | // | 24 | // |
25 | 25 | ||
26 | #include <qdatetime.h> | 26 | #include <qdatetime.h> |
27 | #include <qstringlist.h> | 27 | #include <qstringlist.h> |
28 | #include <qvaluelist.h> | 28 | #include <q3valuelist.h> |
29 | #include <qptrlist.h> | 29 | #include <q3ptrlist.h> |
30 | //Added by qt3to4: | ||
31 | #include <Q3CString> | ||
30 | 32 | ||
31 | #include "customproperties.h" | 33 | #include "customproperties.h" |
32 | #include "attendee.h" | 34 | #include "attendee.h" |
33 | 35 | ||
34 | namespace KCal { | 36 | namespace KCal { |
35 | 37 | ||
36 | typedef QValueList<QDate> DateList; | 38 | typedef Q3ValueList<QDate> DateList; |
37 | enum IncTypeID { eventID,todoID,journalID,freebusyID }; | 39 | enum IncTypeID { eventID,todoID,journalID,freebusyID }; |
38 | 40 | ||
39 | /** | 41 | /** |
40 | This class provides the base class common to all calendar components. | 42 | This class provides the base class common to all calendar components. |
41 | */ | 43 | */ |
42 | class IncidenceBase : public CustomProperties | 44 | class IncidenceBase : public CustomProperties |
43 | { | 45 | { |
44 | public: | 46 | public: |
45 | class Observer { | 47 | class Observer { |
46 | public: | 48 | public: |
47 | virtual void incidenceUpdated( IncidenceBase * ) = 0; | 49 | virtual void incidenceUpdated( IncidenceBase * ) = 0; |
48 | }; | 50 | }; |
49 | 51 | ||
50 | IncidenceBase(); | 52 | IncidenceBase(); |
51 | IncidenceBase(const IncidenceBase &); | 53 | IncidenceBase(const IncidenceBase &); |
52 | virtual ~IncidenceBase(); | 54 | virtual ~IncidenceBase(); |
53 | 55 | ||
54 | virtual QCString type() const = 0; | 56 | virtual Q3CString type() const = 0; |
55 | virtual IncTypeID typeID() const = 0; | 57 | virtual IncTypeID typeID() const = 0; |
56 | 58 | ||
57 | /** Set the unique id for the event */ | 59 | /** Set the unique id for the event */ |
58 | void setUid(const QString &); | 60 | void setUid(const QString &); |
59 | /** Return the unique id for the event */ | 61 | /** Return the unique id for the event */ |
60 | QString uid() const; | 62 | QString uid() const; |
61 | 63 | ||
62 | /** Sets the time the incidence was last modified. */ | 64 | /** Sets the time the incidence was last modified. */ |
63 | void setLastModified(const QDateTime &lm); | 65 | void setLastModified(const QDateTime &lm); |
64 | /** Return the time the incidence was last modified. */ | 66 | /** Return the time the incidence was last modified. */ |
65 | QDateTime lastModified() const; | 67 | QDateTime lastModified() const; |
66 | QString lastModifiedSortKey() const; | 68 | QString lastModifiedSortKey() const; |
67 | 69 | ||
68 | /** sets the organizer for the event */ | 70 | /** sets the organizer for the event */ |
69 | void setOrganizer(const QString &o); | 71 | void setOrganizer(const QString &o); |
70 | QString organizer() const; | 72 | QString organizer() const; |
@@ -96,33 +98,33 @@ class IncidenceBase : public CustomProperties | |||
96 | /** Return true or false depending on whether the incidence "floats," | 98 | /** Return true or false depending on whether the incidence "floats," |
97 | * i.e. has a date but no time attached to it. */ | 99 | * i.e. has a date but no time attached to it. */ |
98 | bool doesFloat() const; | 100 | bool doesFloat() const; |
99 | /** Set whether the incidence floats, i.e. has a date but no time attached to it. */ | 101 | /** Set whether the incidence floats, i.e. has a date but no time attached to it. */ |
100 | void setFloats(bool f); | 102 | void setFloats(bool f); |
101 | 103 | ||
102 | /** | 104 | /** |
103 | Add Attendee to this incidence. IncidenceBase takes ownership of the | 105 | Add Attendee to this incidence. IncidenceBase takes ownership of the |
104 | Attendee object. | 106 | Attendee object. |
105 | */ | 107 | */ |
106 | bool addAttendee(Attendee *a, bool doupdate=true ); | 108 | bool addAttendee(Attendee *a, bool doupdate=true ); |
107 | // void removeAttendee(Attendee *a); | 109 | // void removeAttendee(Attendee *a); |
108 | // void removeAttendee(const char *n); | 110 | // void removeAttendee(const char *n); |
109 | /** Remove all Attendees. */ | 111 | /** Remove all Attendees. */ |
110 | void clearAttendees(); | 112 | void clearAttendees(); |
111 | /** Return list of attendees. */ | 113 | /** Return list of attendees. */ |
112 | QPtrList<Attendee> attendees() const { return mAttendees; }; | 114 | Q3PtrList<Attendee> attendees() const { return mAttendees; }; |
113 | /** Return number of attendees. */ | 115 | /** Return number of attendees. */ |
114 | int attendeeCount() const { return mAttendees.count(); }; | 116 | int attendeeCount() const { return mAttendees.count(); }; |
115 | /** Return the Attendee with this email */ | 117 | /** Return the Attendee with this email */ |
116 | Attendee* attendeeByMail(const QString &); | 118 | Attendee* attendeeByMail(const QString &); |
117 | /** Return first Attendee with one of this emails */ | 119 | /** Return first Attendee with one of this emails */ |
118 | Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null); | 120 | Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null); |
119 | 121 | ||
120 | /** pilot syncronization states */ | 122 | /** pilot syncronization states */ |
121 | enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 }; | 123 | enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 }; |
122 | /** Set synchronisation satus. */ | 124 | /** Set synchronisation satus. */ |
123 | void setSyncStatus(int stat); | 125 | void setSyncStatus(int stat); |
124 | /** Return synchronisation status. */ | 126 | /** Return synchronisation status. */ |
125 | int syncStatus() const; | 127 | int syncStatus() const; |
126 | 128 | ||
127 | /** Set Pilot Id. */ | 129 | /** Set Pilot Id. */ |
128 | void setPilotId(int id); | 130 | void setPilotId(int id); |
@@ -155,36 +157,36 @@ class IncidenceBase : public CustomProperties | |||
155 | protected: | 157 | protected: |
156 | bool blockLastModified; | 158 | bool blockLastModified; |
157 | bool mIsTagged; | 159 | bool mIsTagged; |
158 | QDateTime mDtStart; | 160 | QDateTime mDtStart; |
159 | bool mReadOnly; | 161 | bool mReadOnly; |
160 | QDateTime getEvenTime( QDateTime ); | 162 | QDateTime getEvenTime( QDateTime ); |
161 | 163 | ||
162 | private: | 164 | private: |
163 | // base components | 165 | // base components |
164 | QString mOrganizer; | 166 | QString mOrganizer; |
165 | QString mLastModifiedKey; | 167 | QString mLastModifiedKey; |
166 | QString mUid; | 168 | QString mUid; |
167 | int mCalID; | 169 | int mCalID; |
168 | bool mCalEnabled; | 170 | bool mCalEnabled; |
169 | bool mAlarmEnabled; | 171 | bool mAlarmEnabled; |
170 | QDateTime mLastModified; | 172 | QDateTime mLastModified; |
171 | QPtrList<Attendee> mAttendees; | 173 | Q3PtrList<Attendee> mAttendees; |
172 | 174 | ||
173 | bool mFloats; | 175 | bool mFloats; |
174 | 176 | ||
175 | int mDuration; | 177 | int mDuration; |
176 | bool mHasDuration; | 178 | bool mHasDuration; |
177 | QString mExternalId; | 179 | QString mExternalId; |
178 | int mTempSyncStat; | 180 | int mTempSyncStat; |
179 | 181 | ||
180 | // PILOT SYNCHRONIZATION STUFF | 182 | // PILOT SYNCHRONIZATION STUFF |
181 | int mPilotId; // unique id for pilot sync | 183 | int mPilotId; // unique id for pilot sync |
182 | int mSyncStatus; // status (for sync) | 184 | int mSyncStatus; // status (for sync) |
183 | 185 | ||
184 | QPtrList<Observer> mObservers; | 186 | Q3PtrList<Observer> mObservers; |
185 | }; | 187 | }; |
186 | 188 | ||
187 | bool operator==( const IncidenceBase&, const IncidenceBase& ); | 189 | bool operator==( const IncidenceBase&, const IncidenceBase& ); |
188 | } | 190 | } |
189 | 191 | ||
190 | #endif | 192 | #endif |