Numworks Epsilon  1.4.1
Graphing Calculator Operating System
global_preferences.cpp
Go to the documentation of this file.
1 #include "global_preferences.h"
2 
4  m_language(I18n::Language::EN),
5  m_examMode(ExamMode::Desactivate),
6  m_showUpdatePopUp(true),
7  m_brightnessLevel(Ion::Backlight::MaxBrightness)
8 {
9 }
10 
12  static GlobalPreferences globalPreferences;
13  return &globalPreferences;
14 }
15 
16 I18n::Language GlobalPreferences::language() const {
17  return m_language;
18 }
19 
20 void GlobalPreferences::setLanguage(I18n::Language language) {
21  if (language != m_language) {
22  m_language = language;
23  }
24 }
25 
27  return m_examMode;
28 }
29 
31  if (examMode != m_examMode) {
32  m_examMode = examMode;
33  }
34 }
35 
37  return m_showUpdatePopUp;
38 }
39 
40 void GlobalPreferences::setShowUpdatePopUp(bool showUpdatePopUp) {
41  if (showUpdatePopUp != m_showUpdatePopUp) {
42  m_showUpdatePopUp = showUpdatePopUp;
43  }
44 }
45 
47  return m_brightnessLevel;
48 }
49 
50 void GlobalPreferences::setBrightnessLevel(int brightnessLevel) {
51  if (m_brightnessLevel != brightnessLevel) {
54  m_brightnessLevel = brightnessLevel;
55  Ion::Backlight::setBrightness(m_brightnessLevel);
56  }
57 }
Definition: i18n.h:6
void Backlight(const char *input)
Definition: backlight.cpp:10
void setExamMode(ExamMode examMode)
bool showUpdatePopUp() const
void setBrightness(uint8_t b)
Definition: backlight.cpp:16
void setShowUpdatePopUp(bool showUpdatePopUp)
void setLanguage(I18n::Language language)
void setBrightnessLevel(int brightnessLevel)
constexpr uint8_t MaxBrightness
Definition: backlight.h:9
I18n::Language language() const
ExamMode examMode() const
Definition: backlight.h:6
#define true
Definition: stdbool.h:8
static GlobalPreferences * sharedGlobalPreferences()