~aleteoryx/muditaos

ref: c77a104f3d781b7fb93773be5a2b5af6b97b2a8c muditaos/module-apps/apps-common/popups/presenter/WallpaperPresenter.hpp -rw-r--r-- 1.5 KiB
c77a104f — Maciej Gibowicz [BH-1991] Creating a new application "What`s new" 1 year, 8 months 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
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <ApplicationCommon.hpp>
#include <service-appmgr/messages/GetWallpaperOptionRequest.hpp>
#include <popups/lock-popups/phone-lock-wallpapers/WallpaperClock.hpp>
#include <popups/lock-popups/phone-lock-wallpapers/WallpaperQuote.hpp>
#include <popups/lock-popups/phone-lock-wallpapers/WallpaperLogo.hpp>
#include <notifications/NotificationsModel.hpp>

namespace gui
{
    class WallpaperPresenter : public app::AsyncCallbackReceiver
    {
      public:
        WallpaperPresenter(app::ApplicationCommon *app);
        void setupWallpaper(Item *parent);
        std::shared_ptr<gui::NotificationsModel> getNotificationsModel();
        bool updateWallpaper();
        void forceClockWallpaper();
        /// returns true if actual switch back occured
        bool switchBackWallpaper();

      private:
        void buildWallpapers(Item *parent);
        void switchWallpaper(WallpaperOption option);
        app::ApplicationCommon *application;
        std::shared_ptr<gui::NotificationsModel> notificationsModel;
        std::shared_ptr<WallpaperClock> clockWallpaper = nullptr;
        std::shared_ptr<WallpaperQuote> quoteWallpaper = nullptr;
        std::shared_ptr<WallpaperLogo> logoWallpaper   = nullptr;
        bool clockWallpaperForced                      = false;
        WallpaperOption selectedOption                 = WallpaperOption::Clock;
    };

} // namespace gui