~aleteoryx/muditaos

ref: 5c2032ae929d48b62c2bcd9c0a27a38970350bfb muditaos/module-apps/apps-common/popups/data/AlarmPopupRequestParams.hpp -rw-r--r-- 1.5 KiB
5c2032ae — Maciej-Mudita [MOS-836] Fix for selecting SIM during onboarding 3 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
// 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 "PopupRequestParams.hpp"
#include <AlarmEventRecord.hpp>

namespace gui
{

    enum class AlarmPopupType
    {
        AlarmRing,
        SnoozeCheck
    };

    class AlarmPopupRequestParams : public PopupRequestParams
    {
      public:
        explicit AlarmPopupRequestParams(AlarmPopupType type, std::unique_ptr<AlarmEventRecord> r)
            : PopupRequestParams{popup::ID::Alarm}, type{type}, record(std::move(r))
        {}

        explicit AlarmPopupRequestParams(AlarmPopupType type, std::vector<SingleEventRecord> snoozed)
            : PopupRequestParams{popup::ID::Alarm}, type{type}, snoozedAlarms(std::move(snoozed))
        {}

        explicit AlarmPopupRequestParams(AlarmPopupRequestParams *p)
            : PopupRequestParams{p->getPopupId()}, type(p->type), record(std::move(p->record)),
              snoozedAlarms(p->snoozedAlarms)
        {}

        [[nodiscard]] AlarmPopupType getPopupType() const
        {
            return type;
        }

        [[nodiscard]] std::unique_ptr<AlarmEventRecord> popRecord()
        {
            return std::move(record);
        }

        [[nodiscard]] const std::vector<SingleEventRecord> popSnoozed()
        {
            return std::move(snoozedAlarms);
        }

      private:
        const AlarmPopupType type;
        std::unique_ptr<AlarmEventRecord> record;
        const std::vector<SingleEventRecord> snoozedAlarms;
    };
} // namespace gui