summaryrefslogtreecommitdiffabout
path: root/libkcal/event.h
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /libkcal/event.h
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'libkcal/event.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/event.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libkcal/event.h b/libkcal/event.h
index 6a58618..da44f81 100644
--- a/libkcal/event.h
+++ b/libkcal/event.h
@@ -1,95 +1,97 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
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 20
21#ifndef EVENT_H 21#ifndef EVENT_H
22#define EVENT_H 22#define EVENT_H
23// 23//
24// Event component, representing a VEVENT object 24// Event component, representing a VEVENT object
25// 25//
26 26
27#include "incidence.h" 27#include "incidence.h"
28//Added by qt3to4:
29#include <Q3CString>
28namespace KCal { 30namespace KCal {
29 31
30/** 32/**
31 This class provides an Event in the sense of RFC2445. 33 This class provides an Event in the sense of RFC2445.
32*/ 34*/
33class Event : public Incidence 35class Event : public Incidence
34{ 36{
35 public: 37 public:
36 enum Transparency { Opaque, Transparent }; 38 enum Transparency { Opaque, Transparent };
37 typedef ListBase<Event> List; 39 typedef ListBase<Event> List;
38 Event(); 40 Event();
39 Event(const Event &); 41 Event(const Event &);
40 ~Event(); 42 ~Event();
41 bool matchTime(QDateTime*startDT, QDateTime* endDT); 43 bool matchTime(QDateTime*startDT, QDateTime* endDT);
42 44
43 QCString type() const { return "Event"; } 45 Q3CString type() const { return "Event"; }
44 IncTypeID typeID() const { return eventID; } 46 IncTypeID typeID() const { return eventID; }
45 47
46 Incidence *clone(); 48 Incidence *clone();
47 QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const; 49 QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
48 50
49 /** for setting an event's ending date/time with a QDateTime. */ 51 /** for setting an event's ending date/time with a QDateTime. */
50 void setDtEnd(const QDateTime &dtEnd); 52 void setDtEnd(const QDateTime &dtEnd);
51 /** Return the event's ending date/time as a QDateTime. */ 53 /** Return the event's ending date/time as a QDateTime. */
52 virtual QDateTime dtEnd() const; 54 virtual QDateTime dtEnd() const;
53 /** returns an event's end time as a string formatted according to the 55 /** returns an event's end time as a string formatted according to the
54 users locale settings */ 56 users locale settings */
55 QString dtEndTimeStr() const; 57 QString dtEndTimeStr() const;
56 /** returns an event's end date as a string formatted according to the 58 /** returns an event's end date as a string formatted according to the
57 users locale settings */ 59 users locale settings */
58 QString dtEndDateStr(bool shortfmt=true) const; 60 QString dtEndDateStr(bool shortfmt=true) const;
59 /** returns an event's end date and time as a string formatted according 61 /** returns an event's end date and time as a string formatted according
60 to the users locale settings */ 62 to the users locale settings */
61 QString dtEndStr(bool shortfmt=true) const; 63 QString dtEndStr(bool shortfmt=true) const;
62 void setHasEndDate(bool); 64 void setHasEndDate(bool);
63 /** Return whether the event has an end date/time. */ 65 /** Return whether the event has an end date/time. */
64 bool hasEndDate() const; 66 bool hasEndDate() const;
65 67
66 /** Return true if the event spans multiple days, otherwise return false. */ 68 /** Return true if the event spans multiple days, otherwise return false. */
67 bool isMultiDay() const; 69 bool isMultiDay() const;
68 70
69 /** set the event's time transparency level. */ 71 /** set the event's time transparency level. */
70 void setTransparency(Transparency transparency); 72 void setTransparency(Transparency transparency);
71 /** get the event's time transparency level. */ 73 /** get the event's time transparency level. */
72 Transparency transparency() const; 74 Transparency transparency() const;
73 75
74 void setDuration(int seconds); 76 void setDuration(int seconds);
75 77
76 bool contains ( Event*); 78 bool contains ( Event*);
77 79
78 bool isOverlapping ( Event*, QDateTime*, QDateTime* ); 80 bool isOverlapping ( Event*, QDateTime*, QDateTime* );
79 QString durationText(); 81 QString durationText();
80 82
81 private: 83 private:
82 bool accept(Visitor &v) { return v.visit(this); } 84 bool accept(Visitor &v) { return v.visit(this); }
83 85
84 QDateTime mDtEnd; 86 QDateTime mDtEnd;
85 bool mHasEndDate; 87 bool mHasEndDate;
86 Transparency mTransparency; 88 Transparency mTransparency;
87}; 89};
88 90
89bool operator==( const Event&, const Event& ); 91bool operator==( const Event&, const Event& );
90 92
91 93
92} 94}
93 95
94 96
95#endif 97#endif