libkcal
alarm.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KCAL_ALARM_H
00023 #define KCAL_ALARM_H
00024
00025 #include <qstring.h>
00026 #include <qstringlist.h>
00027 #include <qvaluelist.h>
00028
00029 #include "customproperties.h"
00030 #include "duration.h"
00031 #include "person.h"
00032 #include "listbase.h"
00033 #include "libkcal_export.h"
00034
00035 #include <kdepimmacros.h>
00036
00037 namespace KCal {
00038
00039 class Incidence;
00040
00044 class LIBKCAL_EXPORT Alarm : public CustomProperties
00045 {
00046 public:
00047 enum Type { Invalid, Display, Procedure, Email, Audio };
00048
00049 typedef ListBase<Alarm> List;
00050
00054 explicit Alarm( Incidence *parent );
00058 ~Alarm();
00059
00063 bool operator==( const Alarm & ) const;
00064 bool operator!=( const Alarm &a ) const { return !operator==( a ); }
00065
00073 void setType( Type type );
00077 Type type() const;
00078
00084 void setDisplayAlarm( const QString &text = QString::null );
00089 void setText( const QString &text );
00093 QString text() const;
00094
00100 void setAudioAlarm( const QString &audioFile = QString::null );
00105 void setAudioFile( const QString &audioFile );
00111 QString audioFile() const;
00112
00119 void setProcedureAlarm( const QString &programFile,
00120 const QString &arguments = QString::null );
00125 void setProgramFile( const QString &programFile );
00131 QString programFile() const;
00136 void setProgramArguments( const QString &arguments );
00142 QString programArguments() const;
00143
00152 void setEmailAlarm( const QString &subject, const QString &text,
00153 const QValueList<Person> &addressees,
00154 const QStringList &attachments = QStringList() );
00155
00160 void setMailAddress( const Person &mailAlarmAddress );
00165 void setMailAddresses( const QValueList<Person> &mailAlarmAddresses );
00170 void addMailAddress( const Person &mailAlarmAddress );
00174 QValueList<Person> mailAddresses() const;
00175
00180 void setMailSubject( const QString &mailAlarmSubject );
00184 QString mailSubject() const;
00185
00190 void setMailAttachment( const QString &mailAttachFile );
00195 void setMailAttachments( const QStringList &mailAttachFiles );
00200 void addMailAttachment( const QString &mailAttachFile );
00204 QStringList mailAttachments() const;
00205
00210 void setMailText( const QString &text );
00216 QString mailText() const;
00217
00221 void setTime( const QDateTime &alarmTime );
00225 QDateTime time() const;
00230 QDateTime endTime() const;
00234 bool hasTime() const;
00235
00239 void setStartOffset( const Duration & );
00245 Duration startOffset() const;
00250 bool hasStartOffset() const;
00251
00255 void setEndOffset( const Duration & );
00261 Duration endOffset() const;
00266 bool hasEndOffset() const;
00267
00273 void setSnoozeTime( int alarmSnoozeTime );
00274
00280 int snoozeTime() const;
00281
00286 void setRepeatCount( int alarmRepeatCount );
00290 int repeatCount() const;
00298 QDateTime nextRepetition(const QDateTime& preTime) const;
00306 QDateTime previousRepetition(const QDateTime& afterTime) const;
00311 int duration() const;
00312
00317 void toggleAlarm();
00318
00322 void setEnabled(bool enable);
00326 bool enabled() const;
00327
00331 void setParent( Incidence * );
00335 Incidence *parent() const { return mParent; }
00336
00337 protected:
00342 virtual void customPropertyUpdated();
00343
00344 private:
00345 Incidence *mParent;
00346 Type mType;
00347 QString mDescription;
00348 QString mFile;
00349 QStringList mMailAttachFiles;
00350 QValueList<Person> mMailAddresses;
00351 QString mMailSubject;
00352
00353 int mAlarmSnoozeTime;
00354
00355 int mAlarmRepeatCount;
00356
00357
00358 QDateTime mAlarmTime;
00359 Duration mOffset;
00360 bool mEndOffset;
00361 bool mHasTime;
00362 bool mAlarmEnabled;
00363
00364 class Private;
00365 Private *d;
00366 };
00367
00368 }
00369
00370 #endif
|