author | zecke <zecke> | 2002-11-30 11:28:47 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-11-30 11:28:47 (UTC) |
commit | 9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d (patch) (side-by-side diff) | |
tree | 896dd858dc2ec2f0b7e1b265cae66ccceecc82da /libopie/pim/opimnotify.h | |
parent | 599c58c6ab2ab936890cbbfa4e6299493c141f8a (diff) | |
download | opie-9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d.zip opie-9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d.tar.gz opie-9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d.tar.bz2 |
More infrastructure
ORecur has now the nextOccurence function
exceptions
We've now Notifers like Alarms and DatebookEntries
we may add to execute applications...
AppName replaced with service cause it is a service
Add rtti to OPimRecord as a static function
This is used inside the BackEnd classes to static_cast...
added removeAllCompleted to the todobackends...
add a common Opie PIM mainwindow which takes care of some simple
scripting enchangements..
much more
-rw-r--r-- | libopie/pim/opimnotify.h | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/libopie/pim/opimnotify.h b/libopie/pim/opimnotify.h new file mode 100644 index 0000000..3501948 --- a/dev/null +++ b/libopie/pim/opimnotify.h @@ -0,0 +1,142 @@ +#ifndef OPIE_PIM_NOTIFY_H +#define OPIE_PIM_NOTIFY_H + +#include <qdatetime.h> +#include <qvaluelist.h> + +/** + * This is the base class of Notifiers. Possible + * notifiers would be Alarms, Reminders + * What they share is that they have + * A DateTime, Type, Duration + * This is what this base class takes care of + * on top of that it's shared + */ +/* + * TALK to eilers: have a class OPimDuration which sets the Duration + * given on the Due/Start Date? -zecke + * discuss: do we need a uid for the notify? -zecke + */ +class OPimNotify { +public: + typedef QValueList<OPimNotify> ValueList; + OPimNotify( const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 ); + OPimNotify( const OPimNotify& ); + virtual ~OPimNotify(); + + OPimNotify &operator=(const OPimNotify& ); + bool operator==( const OPimNotify& ); + + virtual QString type()const = 0; + + /** start date */ + QDateTime dateTime()const; + QString service()const; + + /** + * RETURN the parent uid + */ + int parent()const; + + /** + * in Seconds + */ + int duration()const; + + /** + * Start Time + Duration + */ + QDateTime endTime()const; + + void setDateTime( const QDateTime& ); + void setDuration( int dur ); + void setParent(int uid ); + void setService( const QString& ); + + +private: + inline void copyIntern(); + void deref(); + struct Data; + Data* data; + + /* d-pointer */ + class NotifyPrivate; + NotifyPrivate* d; + +}; +/** + * An alarm is a sound/mail/buzzer played/send + * at a given time to inform about + * an Event + */ +class OPimAlarm : public OPimNotify { +public: + enum Sound{Loud=0, Silent, Custom }; + OPimAlarm( int sound = Silent, const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 ); + OPimAlarm( const OPimAlarm& ); + ~OPimAlarm(); + + OPimAlarm &operator=( const OPimAlarm& ); + bool operator==( const OPimAlarm& ); + QString type()const; + + int sound()const; + QString file()const; + + void setSound( int ); + /* only when sound is custom... */ + void setFile( const QString& sound ); + +private: + void deref(); + void copyIntern(); + struct Data; + Data * data; + + class Private; + Private* d; + +}; + +/** + * A Reminder will be put into the + * datebook + */ +class OPimReminder : public OPimNotify { +public: + + /** + * c'tor of a reminder + * @param uid The uid of the Record inside the Datebook + * @param start the StartDate invalid for all day... + * @param duration The duration of the event ( -1 for all day ) + * @param parent The 'parent' record of this reminder + */ + OPimReminder( int uid = 0, const QDateTime& start = QDateTime(), + int duration = 0, int parent = 0 ); + OPimReminder( const OPimReminder& ); + OPimReminder &operator=(const OPimReminder& ); + + QString type()const; + + bool operator==( const OPimReminder& ); + + /** + * the uid of the alarm + * inside the 'datebook' application + */ + int recordUid()const; + void setRecordUid( int uid ); + +private: + void deref(); + void copyIntern(); + + struct Data; + Data* data; + class Private; + Private *d; +}; + +#endif |