~aleteoryx/muditaos

ref: ef63ee267c78136773ed23156ad85a75e650a7b6 muditaos/module-services/service-appmgr/service-appmgr/Actions.hpp -rw-r--r-- 2.0 KiB
ef63ee26 — Wojtek Rzepecki [EGD-5304] Add new way of system close 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// 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 <module-gui/gui/SwitchData.hpp>

#include <memory>
#include <string>
#include <vector>

namespace app::manager
{
    class ActionRequest; // Forward declaration.

    namespace actions
    {
        using ActionId        = int;
        using ActionFilter    = std::vector<ActionId>;
        using ActionParams    = gui::SwitchData;
        using ActionParamsPtr = std::unique_ptr<ActionParams>;

        enum Action : ActionId
        {
            Home,
            AutoLock,
            Launch,
            Call,
            NotAnEmergencyNotification,
            NoSimNotification,
            Dial,
            EmergencyDial,
            ShowCallLog,
            CreateSms,
            ShowSmsTemplates,
            ShowContacts,
            ShowEmergencyContacts,
            AddContact,
            EditContact,
            ShowContactDetails,
            ShowSpecialInput,
            SelectSimCard,
            ShowAlarm,
            ShowReminder,
            RequestPin,
            RequestPuk,
            RequestPinChange,
            UnlockSim,
            BlockSim,
            ShowMMIResult,
            ShowMMIResponse,
            ShowMMIPush,
            SmsRejectNoSim,
            DisplayCMEError,
            DisplayLowBatteryNotification,
            SystemBrownout,
            RequestScreenPasscode,
            DisplayLogoAtExit,
            UserAction // The last enumerator in the Action enum.
                       // All user-defined actions shall have values greater than UserAction.
                       // All system-wide actions shall have values lesser than UserAction.
        };

        class ConvertibleToAction
        {
          public:
            virtual ~ConvertibleToAction() noexcept = default;

            virtual auto toAction() const -> std::unique_ptr<ActionRequest> = 0;
        };
    } // namespace actions
} // namespace app::manager