alarm.h
00001 /* 00002 This file is part of libkcal. 00003 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 */ 00020 00021 #ifndef KCAL_ALARM_H 00022 #define KCAL_ALARM_H 00023 00024 #include <qstring.h> 00025 00026 #include "duration.h" 00027 00028 namespace KCal { 00029 00030 class Incidence; 00031 00035 class Alarm { 00036 public: 00037 typedef QValueList<Alarm *> List; 00038 00040 Alarm(Incidence *parent); 00042 ~Alarm(); 00043 00045 void setAudioFile(const QString &audioAlarmFile); 00047 QString audioFile() const; 00048 00050 void setProgramFile(const QString &programAlarmFile); 00052 QString programFile() const; 00053 00055 void setMailAddress(const QString &mailAlarmAddress); 00057 void setMailAddresses(const QStringList &mailAlarmAddresses); 00059 void addMailAddress(const QString &mailAlarmAddress); 00061 QStringList mailAddresses() const; 00062 00064 void setMailSubject(const QString &mailAlarmSubject); 00066 QString mailSubject() const; 00067 00069 void setMailAttachment(const QString &mailAttachFile); 00071 void setMailAttachments(const QStringList &mailAttachFiles); 00073 void addMailAttachment(const QString &mailAttachFile); 00075 QStringList mailAttachments() const; 00076 00078 void setText(const QString &alarmText); 00080 QString text() const; 00081 00083 void setTime(const QDateTime &alarmTime); 00085 QDateTime time() const; 00087 bool hasTime() const; 00088 00090 void setOffset( const Duration & ); 00092 Duration offset() const; 00093 00095 void setSnoozeTime(int alarmSnoozeTime); 00097 int snoozeTime() const; 00098 00100 void setRepeatCount(int alarmRepeatCount); 00102 int repeatCount() const; 00103 00106 void toggleAlarm(); 00107 00109 void setEnabled(bool enable); 00111 bool enabled() const; 00112 00114 void setParent( Incidence * ); 00116 Incidence *parent() const { return mParent; } 00117 00118 private: 00119 QString mAudioAlarmFile; // url/filename of sound to play 00120 QString mProgramAlarmFile; // filename of program to run 00121 QStringList mMailAttachFiles; // filenames to attach to email 00122 QStringList mMailAlarmAddresses; // who to mail for reminder 00123 QString mMailAlarmSubject; // subject of email 00124 QString mAlarmText; // text to display/mail for alarm 00125 00126 int mAlarmSnoozeTime; // number of minutes after alarm to 00127 // snooze before ringing again 00128 int mAlarmRepeatCount; // number of times for alarm to repeat 00129 // after the initial time 00130 bool mAlarmEnabled; 00131 00132 QDateTime mAlarmTime; // time at which to display the alarm 00133 bool mHasTime; 00134 Duration mOffset; 00135 00136 Incidence *mParent; 00137 }; 00138 00139 } 00140 00141 #endif