~aleteoryx/muditaos

ref: fe8671698432b6877da6b8e911b8df77fc439922 muditaos/module-apps/application-settings/ApplicationSettings.hpp -rw-r--r-- 1.7 KiB
fe867169 — Piotr Tanski [EGD-4153] Use actions instead explicit applications switch. (#1032) 5 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
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#ifndef MODULE_APPS_APPLICATION_SETTINGS_APPLICATIONSETTINGS_HPP_
#define MODULE_APPS_APPLICATION_SETTINGS_APPLICATIONSETTINGS_HPP_

#include "Application.hpp"

#include "bsp/common.hpp"

namespace app
{

    inline constexpr auto name_settings  = "ApplicationSettings";
    inline constexpr auto sim_select     = "SimSelect";
    inline constexpr auto change_setting = "ChangeSetting";

    class ApplicationSettings : public app::Application
    {
      public:
        ApplicationSettings(std::string name                    = name_settings,
                            std::string parent                  = {},
                            StartInBackground startInBackground = {false});
        virtual ~ApplicationSettings();
        sys::MessagePointer DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp) override;
        sys::ReturnCodes InitHandler() override;
        sys::ReturnCodes DeinitHandler() override;

        sys::ReturnCodes SwitchPowerModeHandler(const sys::ServicePowerMode mode) override final
        {
            return sys::ReturnCodes::Success;
        }

        void createUserInterface() override;
        void destroyUserInterface() override;
        bsp::Board board = bsp::Board::none;
    };

    template <> struct ManifestTraits<ApplicationSettings>
    {
        static auto GetManifest() -> manager::ApplicationManifest
        {
            return {{manager::actions::Launch, manager::actions::SelectSimCard}};
        }
    };
} /* namespace app */

#endif /* MODULE_APPS_APPLICATION_SETTINGS_APPLICATIONSETTINGS_HPP_ */