~aleteoryx/muditaos

ref: 70126e07acf51ca04c936c4c57d6b430001c5fe9 muditaos/module-services/service-time/timeEvents/CalendarTimeEvents.hpp -rw-r--r-- 1.4 KiB
70126e07 — jimmorrisson [EGD-4439] New filesystem handling - module audio. (#1037) 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include <module-db/queries/calendar/QueryEventsEdit.hpp>
#include <stdint.h> // for uint32_t
#include <memory>   // for allocator, unique_ptr
#include <string>   // for string

#include "TimeEvents.hpp"                           // for TimeEvents
#include "EventsRecord.hpp"                         // for EventsRecord
#include "application-calendar/data/dateCommon.hpp" // for TIME_POINT_INVALID, TimePoint

namespace db
{
    class QueryResult;
} // namespace db
namespace sys
{
    class Service;
} // namespace sys

namespace stm
{
    class CalendarTimeEvents : public TimeEvents
    {
      private:
        EventsRecord eventRecord;
        TimePoint startTP = TIME_POINT_INVALID;

      protected:
        const std::string timerName() override
        {
            return "CalendarTimeEvents_timer";
        };
        uint32_t calcToNextEventInterval(std::unique_ptr<db::QueryResult> nextEventQueryResult) override;

        bool sendNextEventQuery() override;
        bool sendEventFiredQuery() override;
        void invokeEvent() override;

      public:
        CalendarTimeEvents() = delete;
        explicit CalendarTimeEvents(sys::Service *service);
        ~CalendarTimeEvents() = default;
    };

} // namespace stm