~aleteoryx/muditaos

ref: 060a472d479fb012252511e88c1eabd4ff4b5fb9 muditaos/module-services/service-appmgr/service-appmgr/Controller.hpp -rw-r--r-- 2.4 KiB
060a472d — Mateusz Grzegorzek [BH-663] Fix CMake in service-antenna 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
// 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 "Actions.hpp"
#include "messages/Message.hpp"
#include "model/ApplicationManager.hpp"

#include <module-sys/Service/Service.hpp>
#include <SwitchData.hpp>

#include <i18n/i18n.hpp>
#include <time/time_locale.hpp>

#include <memory>
#include <string>

namespace sys
{
    class Service;
} // namespace sys

namespace app::manager
{
    enum class OnSwitchBehaviour
    {
        Close,
        RunInBackground
    };

    class Controller
    {
      public:
        Controller() = delete;

        static auto finish(sys::Service *sender) -> bool;
        static auto applicationInitialised(sys::Service *sender,
                                           StartupStatus status,
                                           StartInBackground startInBackground) -> bool;
        static auto sendAction(sys::Service *sender,
                               actions::ActionId actionId,
                               actions::ActionParamsPtr &&data     = nullptr,
                               OnSwitchBehaviour onSwitchBehaviour = OnSwitchBehaviour::Close) -> bool;
        static auto switchBack(sys::Service *sender, std::unique_ptr<SwitchBackRequest> msg = nullptr) -> bool;
        static auto confirmSwitch(sys::Service *sender) -> bool;
        static auto closeApplication(sys::Service *sender, const ApplicationName &name) -> bool;
        static auto confirmClose(sys::Service *sender) -> bool;
        static auto changeDisplayLanguage(sys::Service *sender, const Language &language) -> bool;
        static auto changeInputLanguage(sys::Service *sender, const Language &language) -> bool;
        static auto changeAutomaticDateAndTimeIsOn(sys::Service *sender, bool isOn) -> bool;
        static auto changeAutomaticTimeZoneIsOn(sys::Service *sender, bool isOn) -> bool;
        static auto changeTimeFormat(sys::Service *sender, utils::time::Locale::TimeFormat timeFormat) -> bool;
        static auto changeDateFormat(sys::Service *sender, utils::time::Locale::DateFormat dateFormat) -> bool;
        static auto changePowerSaveMode(sys::Service *sender) -> bool;
        static auto preventBlockingDevice(sys::Service *sender) -> bool;
        static auto requestNotifications(sys::Service *sender) -> bool;
    };
} // namespace app::manager