You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
900 B

  1. #pragma once
  2. #include <string>
  3. #include <memory>
  4. #include <vector>
  5. #include <libical/ical.h>
  6. #include <io/debug.h>
  7. namespace ical {
  8. enum class action {
  9. DISPLAY, AUDIO, EMAIL, PROC
  10. };
  11. enum class trigger_type {
  12. ABSOLUTE, RELATIVE
  13. };
  14. class Alarm {
  15. public:
  16. Alarm(icalcomponent* alarm_component, const uint32_t &event_dtstart);
  17. void parse(icalcomponent* alarm_component);
  18. void parse_action(icalcomponent* alarm_component);
  19. void parse_description(icalcomponent* alarm_component);
  20. void parse_trigger(icalcomponent* alarm_component);
  21. std::string get_action() const;
  22. std::string get_trigger_type() const;
  23. std::vector<std::string> get_db_row() const;
  24. std::string print() const;
  25. private:
  26. const uint32_t m_event_dtstart;
  27. action m_action;
  28. trigger_type m_trigger;
  29. uint32_t m_absolute_trigger;
  30. std::string m_description;
  31. };
  32. }