CCIMXDesktop
 
Loading...
Searching...
No Matches
BacklightControllerImpl.h
1#ifndef BACKLIGHTCONTROLLERIMPL_H
2#define BACKLIGHTCONTROLLERIMPL_H
3
4#include <QtClassHelperMacros>
5
14public:
15 Q_DISABLE_COPY_MOVE(BacklightControllerImpl)
16
17
21 virtual int MAX_LIGHT_VAL() = 0;
22
27 virtual int MIN_LIGHT_VAL() = 0;
28
33 virtual void setLightLevel(int lightLevel) = 0;
34
39 virtual int lightLevel() = 0;
40
46
50 virtual ~BacklightControllerImpl() = default;
51
52protected:
57};
58
64 static constexpr int MAX = 100;
65 static constexpr int MIN = 0;
66 int current_light = 50;
67
68public:
73
74 Q_DISABLE_COPY_MOVE(PesudoLightController)
75
76
79 ~PesudoLightController() override = default;
80
85 int MAX_LIGHT_VAL() override;
86
91 int MIN_LIGHT_VAL() override;
92
97 void setLightLevel(int lightLevel) override;
98
103 int lightLevel() override;
104};
105#include "desktop_settings.h"
106#ifdef ARM_BUILD
107
108#include <QString>
114class ArmPlatformBacklightController : public BacklightControllerImpl {
115 static constexpr int MIN = 1;
116 int current_light = 50;
117
118 const QString backlight_path = BACKLIGHT_BASE_PATH;
119 const QString brightness_file = backlight_path + "brightness";
120 const QString max_brightness_file = backlight_path + "max_brightness";
121
122public:
127 int MAX_LIGHT_VAL() override;
128
133 int MIN_LIGHT_VAL() override;
134
139 void setLightLevel(int lightLevel) override;
140
145 int lightLevel() override;
146};
147#endif
148
149#endif // BACKLIGHTCONTROLLERIMPL_H
The BacklightControllerImpl class Abstract base class for platform-specific backlight control impleme...
Definition BacklightControllerImpl.h:13
virtual int lightLevel()=0
Gets the current light level.
static BacklightControllerImpl * creator()
Creates a platform-specific implementation of BacklightControllerImpl.
Definition BacklightControllerImpl.cpp:3
virtual int MIN_LIGHT_VAL()=0
Gets the minimum supported light level.
virtual void setLightLevel(int lightLevel)=0
Sets the current light level.
virtual int MAX_LIGHT_VAL()=0
Gets the maximum supported light level.
The PesudoLightController class A dummy light controller used for testing or non-hardware platforms.
Definition BacklightControllerImpl.h:63
~PesudoLightController() override=default
Destructor.
PesudoLightController()=default
Default constructor.