~aleteoryx/muditaos

ref: a912db548997bf89d875be3494c8d130a5a48f12 muditaos/module-apps/application-bell-main/windows/BellMainWindow.hpp -rw-r--r-- 1.0 KiB
a912db54 — Pawel.Paprocki [BH-677] Add widget AlarmSetSpinner 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <data/BellAlarmData.hpp>
#include <AppWindow.hpp>
#include <gui/widgets/Spinner.hpp>
#include <widgets/TimeSetSpinner.hpp>
#include <widgets/AlarmSetSpinner.hpp>
#include <BoxLayout.hpp>

namespace gui
{
    class BellMainWindow : public AppWindow
    {
      public:
        explicit BellMainWindow(app::Application *app);

        void buildInterface() override;
        bool onInput(const InputEvent &inputEvent) override;
        bool updateTime() override;

        gui::Label *time        = nullptr;
        gui::Label *temperature = nullptr;
        AlarmSetSpinner *alarmSetSpinner = nullptr;

      private:
        auto handleEnterKey(const InputEvent &inputEvent) -> bool;
        auto handleEditModeEntry() -> void;
        bool alarmEditMode            = false;
        BellAlarm::Status alarmStatus = BellAlarm::Status::DEACTIVATED;
    };
} // namespace gui