SMACC2
Loading...
Searching...
No Matches
cb_detect_calendar_event.hpp
Go to the documentation of this file.
1// Copyright 2024 RobosoftAI Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <string>
18
20
23#include <cl_gcalcli/types.hpp>
24
25namespace cl_gcalcli
26{
27
44{
45public:
53 const std::string & pattern, bool use_regex = false, int minutes_before = 0);
54
55 virtual ~CbDetectCalendarEvent() = default;
56
57 void onEntry() override;
58 void onExit() override;
59
63 std::optional<CalendarEvent> getDetectedEvent() const { return detected_event_; }
64
65private:
69 void onEventStarted(const CalendarEvent & event);
70
71 std::string pattern_;
74
77
78 std::optional<CalendarEvent> detected_event_;
80};
81
82} // namespace cl_gcalcli
Async behavior that waits for a calendar event's start time to arrive.
CbDetectCalendarEvent(const std::string &pattern, bool use_regex=false, int minutes_before=0)
Construct with pattern configuration.
void onEventStarted(const CalendarEvent &event)
Callback when an event starts.
virtual ~CbDetectCalendarEvent()=default
std::optional< CalendarEvent > detected_event_
std::optional< CalendarEvent > getDetectedEvent() const
Get the detected event (if any)
SMACC2 Client for Google Calendar integration via gcalcli.
Component that listens for calendar events and triggers notifications.
Represents a Google Calendar event.
Definition types.hpp:40