Sunrise and sunset events
[wakeup.git] / src / event.h
index 2351aa5..00ea1a1 100644 (file)
@@ -4,12 +4,13 @@
 #include <xml.h>
 #include <date.h>
 
+#include "location.h"
 #include "action.h"
 
 class Event
 {
    String              label;
-   UTC                 start_time;
+   String              start_time;
 
    String              pattern;    // for recurrance
    UTC                 recurrance_interval;
@@ -34,10 +35,20 @@ public:
    void   FromXML(xml_element x);
    String ToXML(void);
 
+   String id()
+   {
+      return label;
+   }
+
+   void  start_at(UTC st)
+   {
+      start_time = st.format();
+   }
+
    void  add_action(String command);
    void  run_sequence();
 
-   UTC   next_occurance(UTC after);
+   UTC   next_occurance(UTC after, Location loc);
 };
 
 std::list<Event> read_alarms(const char *filename);