00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __CALARM__H_
00025 #define __CALARM__H_
00026
00027
00028 #include <vector>
00029 #include <string>
00030 #include "CAlarmIface.h"
00031 #include "time.h"
00032
00033
00034
00035 enum dataAlarm {
00036 E_AM_NONE = 0,
00037 E_AM_ETIME,
00038 E_AM_5MIN,
00039 E_AM_15MIN,
00040 E_AM_30MIN,
00041 E_AM_1HR,
00042 E_AM_3HR,
00043 E_AM_DAYBEFORE,
00044 E_AM_EXACTDATETIME,
00045 };
00046
00047
00048 using namespace std;
00049 using std::vector;
00050
00056 class CAlarm : public CAlarmIface{
00057
00058 public:
00059
00064 CAlarm();
00065
00069 CAlarm(CAlarm & ref);
00070
00074 ~CAlarm();
00075
00079 const CAlarm & operator=(const CAlarm & right);
00080
00091 CAlarm(int iTrigger, int iRepeat, int iDuration, int iAction, string szAttach);
00092
00093 CAlarm(int iTrigger, int iDuration);
00094
00100 bool setTrigger(int);
00101
00107 int getTrigger();
00108
00115 bool setRepeat(int iRepeat);
00122 int getRepeat();
00129 bool setDuration(int iDuration);
00136 int getDuration();
00143 bool setTimeBefore(int iSecondsBeforeEvent);
00150 int getTimeBefore();
00157 bool setAction(int iAction);
00164 int getAction();
00171 bool setAttach(string szAttach);
00172
00178 string getAttach();
00179
00187 vector < long > getCookie();
00195 bool setCookie(vector < long > icookie);
00196
00197
00215 long addAlarmEvent(time_t event_time, string message,
00216 string location, time_t dateStart,
00217 time_t dateEnd, string compId, int iCalendarId,
00218 string szDescription,int iType,bool allday,
00219 string szZone,int& pErrorCode);
00220
00230 long registerAlarmForAutoDeletion (time_t alarm_time,int& pErrorCode);
00231
00241 int deleteAlarmEvent(long cookie,int& pErrorCode);
00242
00260 long modifyAlarmEvent(long oldcookie, time_t modify_time,
00261 string message, string location, time_t dateStart,
00262 time_t dateEnd, string sCompId, int iCalendarId,
00263 string szDescription,int iType,bool allday, string szZone,int& pErrorCode);
00267 string toString();
00268
00274 static int getDefaultTimeBefore(dataAlarm alarmType);
00275
00280 static int purgeAlarms();
00281 private:
00282
00283
00284
00285 int iTrigger;
00287 int iRepeat;
00289 int iDuration;
00292 int iAction;
00294 vector < long > vcookie;
00296 string szAttach;
00297 };
00298
00299 #endif