~aleteoryx/muditaos

ref: 9098f69e7b9f22e2333d83e2f2503797a1d6b8df muditaos/module-apps/application-calendar/windows/EventReminderWindow.hpp -rw-r--r-- 1.5 KiB
9098f69e — Wojtek Rzepecki [EGD-5814] Fix battery revert 4 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
// 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 "application-calendar/models/EventDetailModel.hpp"
#include "windows/AppWindow.hpp"
#include "Application.hpp"
#include <Style.hpp>
#include <module-db/Interface/EventsRecord.hpp>
#include <Text.hpp>
#include <Label.hpp>
#include <module-sys/Service/Timer.hpp>

namespace gui
{
    class Image;

    class EventReminderWindow : public gui::AppWindow
    {
      private:
        std::unique_ptr<sys::Timer> reminderTimer;

      protected:
        std::shared_ptr<EventsRecord> eventRecord;

        gui::VBox *body         = nullptr;
        Label *dateLabel        = nullptr;
        Label *timeLabel        = nullptr;
        Label *descriptionLabel = nullptr;
        Image *topImage         = nullptr;
        Image *bottomImage      = nullptr;

        void startTimer();
        void destroyTimer();
        void reminderTimerCallback();
        void closeReminder();

      public:
        EventReminderWindow(app::Application *app, std::string name);
        virtual ~EventReminderWindow();

        void onClose() override;
        bool onInput(const gui::InputEvent &inputEvent) override;
        void rebuild() override;
        void buildInterface() override;
        void destroyInterface() override;
        top_bar::Configuration configureTopBar(top_bar::Configuration appConfiguration) override;
        auto handleSwitchData(SwitchData *data) -> bool override;
    };

} /* namespace gui */