~aleteoryx/muditaos

ref: d558e60a4d5bc26a982f0ba85f20631d7efac5df muditaos/module-services/service-evtmgr/screen-light-control/ScreenLightControl.hpp -rw-r--r-- 1.2 KiB
d558e60a — Lefucjusz [CP-2013] Add time sync endpoint 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
// 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 "ScreenLightControlParameters.hpp"
#include <memory>
#include <Timers/TimerHandle.hpp>
namespace settings
{
    class Settings;
} // namespace settings

namespace sys
{
    class Service;
} // namespace sys

/// Screen light control algorithm. Automatic/Manual mode of operation.
/// Processing of ambient light sensor input to screen brightness output.
namespace screen_light_control
{
    class ScreenLightController
    {
      public:
        virtual ~ScreenLightController() noexcept = default;

        virtual void processRequest(Action action)                           = 0;
        virtual void processRequest(Action action, const Parameters &params) = 0;
        [[nodiscard]] virtual auto isLightOn() const noexcept -> bool        = 0;
        [[nodiscard]] virtual auto isAutoModeOn() const noexcept -> bool     = 0;
        [[nodiscard]] virtual auto getBrightnessValue() const noexcept
            -> bsp::eink_frontlight::BrightnessPercentage     = 0;
        [[nodiscard]] virtual auto isFadeOutOngoing() -> bool = 0;
    };
} // namespace screen_light_control