~aleteoryx/muditaos

ref: b7bc7cc89fc09f93240473b8aef047f349d2e8c0 muditaos/module-apps/application-calendar/ApplicationCalendar.hpp -rw-r--r-- 2.0 KiB
b7bc7cc8 — Marcin Smoczyński changelog: update for v0.42.1 (#820) 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
49
50
51
52
53
54
55
56
57
58
59
#pragma once

#include "Application.hpp"
#include "Service/Message.hpp"
#include "SystemManager/SystemManager.hpp"
#include "gui/widgets/Label.hpp"
#include <module-apps/application-calendar/data/dateCommon.hpp>
#include "application-calendar/widgets/CalendarStyle.hpp"
#include "NoEvents.hpp"

namespace app
{

    inline const std::string name_calendar = "ApplicationCalendar";

    class ApplicationCalendar : public Application
    {
        time_t applicationStartTime = 0;
        int eventShift                    = 0;
        EquivalentWindow equivalentWindow = EquivalentWindow::EmptyWindow;

      public:
        ApplicationCalendar(std::string name,
                            std::string parent,
                            uint32_t stackDepth           = 4096,
                            sys::ServicePriority priority = sys::ServicePriority::Idle);

        sys::Message_t DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp) override;
        sys::ReturnCodes InitHandler() override;
        sys::ReturnCodes DeinitHandler() override;

        sys::ReturnCodes SwitchPowerModeHandler(const sys::ServicePowerMode mode) override final
        {
            return sys::ReturnCodes::Success;
        }
        time_t getCurrentTimeStamp()
        {
            return applicationStartTime;
        }
        void setEquivalentToEmptyWindow(EquivalentWindow window)
        {
            equivalentWindow = window;
        };
        EquivalentWindow getEquivalentToEmptyWindow() const
        {
            return equivalentWindow;
        };
        int getEventShift()
        {
            return eventShift;
        }
        void createUserInterface() override;
        void destroyUserInterface() override;
        void switchToNoEventsWindow(const std::string &title = "", const TimePoint &dateFilter = TimePoint());

        static const std::map<Reminder, const char *> reminderOptions;
        static const std::map<Repeat, const char *> repeatOptions;
    };
} /* namespace app */