summaryrefslogtreecommitdiff
path: root/plugins/ExternalAPI/m_alarms.h
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-05-19 14:38:45 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-05-19 14:38:45 +0000
commit3bc9ada8ddf588156809662e15236a2a7ce289f7 (patch)
tree0fe3b84bf105b65ce8f734a338b7ea2b0a77a340 /plugins/ExternalAPI/m_alarms.h
parent4392b08fedcfc61eb3ec40a956516637d5abbf38 (diff)
added new header
git-svn-id: http://svn.miranda-ng.org/main/trunk@78 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ExternalAPI/m_alarms.h')
-rw-r--r--plugins/ExternalAPI/m_alarms.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/plugins/ExternalAPI/m_alarms.h b/plugins/ExternalAPI/m_alarms.h
new file mode 100644
index 0000000000..64a77bc2c7
--- /dev/null
+++ b/plugins/ExternalAPI/m_alarms.h
@@ -0,0 +1,50 @@
+#ifndef _ALARMS_H
+#define _ALARMS_H
+
+// flags for alarm action
+#define AAF_POPUP 0x01 // show a popup window (or a popup from popups plugin, if installed and activated via options)
+#define AAF_SOUND 0x02 // play a sound
+#define AAF_COMMAND 0x04 // run a command
+#define AAF_SYSTRAY 0x08 // flash systray icon (not implemented)
+
+typedef enum {
+ OC_ONCE, // all fields in time (see below) are valid
+ OC_DAILY, // only wHour, wMinute, and wSecond are valid
+ OC_WEEKLY, // wHour, wMinute, wSecond, and wDayOfWeek are valid
+ OC_WEEKDAYS, // only wHour, wMinute, and wSecond are valid
+ OC_MONTHLY, // wHour, wMinute, wSecond, and wDay are valid
+ OC_YEARLY // all fields except wYear are valid
+} Occurrence;
+
+// flags
+#define ALF_HIDDEN 0x01 // do not show in GUI (either options or reminder frame)
+#define ALF_NOREMINDER 0x02 // do not show in reminder frame
+#define ALF_SUSPENDED 0x04 // do not trigger next occurence
+#define ALF_NOSTARTUP 0x08 // do not trigger on startup if it was due when miranda was not running
+#define ALF_NOSNOOZE 0x10 // do not allow snoozing of this alarm
+
+typedef struct {
+ char *szTitle;
+ char *szDesc;
+ Occurrence occurrence;
+ BOOL snoozer; // this alarm is a 'once-off', the result of the user pressing the 'snooze' button - the time field no longer contains the original alarm time
+ SYSTEMTIME time; // the time the alarm is triggered at - different fields are valid depending on what the 'occurence' value is set to (see definition of Occurence type above)
+ unsigned short action; // bitwise OR of AAF_* constants above
+ char *szCommand; // passed to ShellExecute (if action & AAF_COMMAND) when the alarm is triggered
+ char *szCommandParams; // passed as parameters for above command
+ BYTE sound_num; // use alarm sound 1, 2, or 3 (if action & AAF_SOUND) (4 == speak, version 0.0.7.0+)
+ int flags; // ALF_* above
+} ALARMINFO;
+
+// set an alarm
+// wparam = 0
+// lparam = (ALARMINFO *)&alarm
+#define MS_ALARMS_ADDALARM "Alarms/AddAlarm"
+
+// event sent when an alarm is triggered
+// wparam=0
+// lparam=(ALARMINFO *)&alarm
+// returning non-zero from your hook will prevent the alarm actions from being carried out
+#define ME_ALARMS_TRIGGERED "Alarms/Triggered"
+
+#endif