~aleteoryx/muditaos

ref: 145178ae2687c1ad5ef978a6f1ecba9940b0b246 muditaos/module-apps/application-notes/ApplicationNotes.hpp -rw-r--r-- 1.8 KiB
145178ae — Przemyslaw Brudny [EGD-6791] Added PhoneUnlock on external MuditaCenter message 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
// 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-apps/application-notes/model/NotesListModel.hpp"
#include "Application.hpp"

namespace gui::name::window
{
    inline constexpr auto note_preview        = "NotePreview";
    inline constexpr auto note_edit           = "NoteEdit";
    inline constexpr auto notes_search        = "NotesSearch";
    inline constexpr auto notes_search_result = "NotesSearchResult";
    inline constexpr auto note_dialog         = "Dialog";
    inline constexpr auto note_confirm_dialog = "ConfirmDialog";
} // namespace gui::name::window

namespace app
{
    inline constexpr auto name_notes = "ApplicationNotes";

    class ApplicationNotes : public Application
    {
      public:
        explicit ApplicationNotes(std::string name                    = name_notes,
                                  std::string parent                  = {},
                                  sys::phone_modes::PhoneMode mode    = sys::phone_modes::PhoneMode::Connected,
                                  StartInBackground startInBackground = {false});

        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;

        void createUserInterface() override;
        void destroyUserInterface() override;
    };

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