summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/oevent.h
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/oevent.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/oevent.h33
1 files changed, 20 insertions, 13 deletions
diff --git a/libopie2/opiepim/oevent.h b/libopie2/opiepim/oevent.h
index 9502efa..dc5e4d6 100644
--- a/libopie2/opiepim/oevent.h
+++ b/libopie2/opiepim/oevent.h
@@ -1,15 +1,15 @@
/*
This file is part of the Opie Project
- Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de)
+ Copyright (C) Stefan Eilers <Eilers.Stefan@epost.de>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
@@ -19,62 +19,66 @@
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
// CONTAINS GPLed code of TT
-#ifndef OPIE_PIM_EVENT_H
-#define OPIE_PIM_EVENT_H
-
-#include <qstring.h>
-#include <qdatetime.h>
-#include <qvaluelist.h>
+#ifndef OEVENT_H
+#define OEVENT_H
+/* OPIE */
+#include <opie2/otimezone.h>
+#include <opie2/opimrecord.h>
#include <qpe/recordfields.h>
#include <qpe/palmtopuidgen.h>
-#include <opie2/otimezone.h>
-#include <opie2/opimrecord.h>
+/* QT */
+#include <qstring.h>
+#include <qdatetime.h>
+#include <qvaluelist.h>
-namespace Opie {
-struct OCalendarHelper {
+namespace Opie
+{
+struct OCalendarHelper
+{
/** calculate the week number of the date */
static int week( const QDate& );
/** calculate the occurence of week days since the start of the month */
static int ocurrence( const QDate& );
// returns the dayOfWeek for the *first* day it finds (ignores
// any further days!). Returns 1 (Monday) if there isn't any day found
static int dayOfWeek( char day );
/** returns the diff of month */
static int monthDiff( const QDate& first, const QDate& second );
};
class OPimNotifyManager;
class ORecur;
/**
* This is the container for all Events. It encapsules all
* available information for a single Event
* @short container for events.
*/
-class OEvent : public OPimRecord {
+class OEvent : public OPimRecord
+{
public:
typedef QValueList<OEvent> ValueList;
/**
* RecordFields contain possible attributes
* used in the Results of toMap()..
*/
enum RecordFields {
FUid = Qtopia::UID_ID,
FCategories = Qtopia::CATEGORY_ID,
FDescription = 0,
FLocation,
FType,
@@ -182,38 +186,41 @@ public:
static int rtti();
bool loadFromStream( QDataStream& );
bool saveToStream( QDataStream& )const;
/* bool operator==( const OEvent& );
bool operator!=( const OEvent& );
bool operator<( const OEvent& );
bool operator<=( const OEvent& );
bool operator>( const OEvent& );
bool operator>=(const OEvent& );
*/
+
private:
inline void changeOrModify();
void deref();
struct Data;
Data* data;
class Private;
Private* priv;
};
/**
* AN Event can span through multiple days. We split up a multiday eve
*/
-class OEffectiveEvent {
+class OEffectiveEvent
+{
+
public:
typedef QValueList<OEffectiveEvent> ValueList;
enum Position { MidWay, Start, End, StartEnd };
// If we calculate the effective event of a multi-day event
// we have to figure out whether we are at the first day,
// at the end, or anywhere else ("middle"). This is important
// for the start/end times (00:00/23:59)
// MidWay: 00:00 -> 23:59, as we are "in the middle" of a multi-
// day event
// Start: start time -> 23:59
// End: 00:00 -> end time
// Start | End == StartEnd: for single-day events (default)