47 std::chrono::system_clock::time_point
end_time;
55 auto now = std::chrono::system_clock::now();
64 auto now = std::chrono::system_clock::now();
65 auto window_start =
start_time - std::chrono::minutes(minutes);
66 return now >= window_start && now <
end_time;
74 auto now = std::chrono::system_clock::now();
75 return now < start_time && now >= (
start_time - std::chrono::minutes(minutes));
83 auto now = std::chrono::system_clock::now();
92 auto now = std::chrono::system_clock::now();
93 auto diff = std::chrono::duration_cast<std::chrono::minutes>(
start_time - now);
94 return static_cast<int>(diff.count());
ConnectionState
Connection state for gcalcli.
Represents a Google Calendar event.
bool hasEnded() const
Check if the event has ended.
std::chrono::system_clock::time_point end_time
int minutesUntilStart() const
Get minutes until event starts (negative if already started)
bool isActiveNow() const
Check if the event is currently active (ongoing)
bool willStartWithinMinutes(int minutes) const
Check if the event will start within the next N minutes.
std::string calendar_name
std::chrono::system_clock::time_point start_time
bool hasStartedWithinMinutes(int minutes) const
Check if the event has started within the last N minutes.
Event watch configuration for CpCalendarEventListener.
bool trigger_on_start
Post event when event starts.
bool use_regex
True = regex matching, False = exact string matching.
bool trigger_on_end
Post event when event ends.
bool continuous
Keep watching (true) or one-shot (false)
int minutes_before
Trigger N minutes before event starts (0 = at start time)
std::string pattern
Pattern to match event titles (regex or exact)
Configuration for gcalcli client.
std::chrono::seconds poll_interval
How often to poll for agenda updates.
std::chrono::seconds heartbeat_interval
How often to check connection health (heartbeat)
std::string gcalcli_path
Path to gcalcli executable (default: "gcalcli" from PATH)
std::vector< std::string > calendars
Calendars to monitor (empty = all calendars)
int agenda_days
Number of days ahead to fetch in agenda.
std::optional< std::string > config_folder
Optional config folder for gcalcli (if not using default)
int max_consecutive_failures
Number of consecutive failures before connection is considered lost.