~aleteoryx/muditaos

ref: d403db410172588d80e7f926cb63d29afc97b966 muditaos/module-apps/application-desktop/windows/DesktopMainWindow.hpp -rw-r--r-- 1.8 KiB
d403db41 — Lefucjusz [MOS-1027] Fix lack of tethering icon on 'Tethering is on' popup 2 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
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <notifications/NotificationsModel.hpp>
#include <application-desktop/models/ActiveNotificationsListPresenter.hpp>

#include <AppWindow.hpp>
#include <ListView.hpp>
#include <widgets/ClockDateWidget.hpp>

namespace app
{
    class ApplicationDesktop;
}

namespace gui
{
    class NotificationsModel;

    class DesktopMainWindow : public AppWindow
    {
      protected:
        gui::ClockDateWidget *clockDate  = nullptr;
        gui::ListView *notificationsList = nullptr;
        std::shared_ptr<gui::ActiveNotificationsListPresenter> notificationsListPresenter;
        std::shared_ptr<gui::NotificationsModel> notificationsModel;

        // method hides or show widgets and sets bars according to provided state
        void setVisibleState();
        void setActiveState();
        bool processLongReleaseEvent(const InputEvent &inputEvent);
        bool processShortReleaseEvent(const InputEvent &inputEvent);
        app::ApplicationDesktop *getAppDesktop() const;

      public:
        explicit DesktopMainWindow(app::ApplicationCommon *app);

        // virtual methods gui::Window
        bool onInput(const InputEvent &inputEvent) override;
        void onBeforeShow(ShowMode mode, SwitchData *data) override;
        // virtual methods gui::AppWindow
        void rebuild() override;
        void buildInterface() override;
        void destroyInterface() override;
        status_bar::Configuration configureStatusBar(status_bar::Configuration appConfiguration) override;

        RefreshModes updateTime() override;

      private:
        bool resolveDialAction(const std::string &number);

        gui::KeyInputMappedTranslation translator;
    };

} /* namespace gui */