Blame view

build3/poincare/src/preferences.cpp 1.28 KB
6663b6c9   adorian   projet complet av...
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
  #include <poincare/preferences.h>
  #include <poincare/complex.h>
  
  namespace Poincare {
  
  static Preferences s_preferences;
  
  Preferences::Preferences() :
    m_angleUnit(Expression::AngleUnit::Degree),
    m_displayMode(Expression::FloatDisplayMode::Decimal),
    m_complexFormat(Expression::ComplexFormat::Cartesian),
    m_numberOfSignificantDigits(PrintFloat::k_numberOfPrintedSignificantDigits)
  {
  }
  
  Preferences * Preferences::sharedPreferences() {
    return &s_preferences;
  }
  
  Expression::AngleUnit Preferences::angleUnit() const {
    return m_angleUnit;
  }
  
  void Preferences::setAngleUnit(Expression::AngleUnit angleUnit) {
    m_angleUnit = angleUnit;
  }
  
  Expression::FloatDisplayMode Preferences::displayMode() const {
    return m_displayMode;
  }
  
  void Preferences::setDisplayMode(Expression::FloatDisplayMode FloatDisplayMode) {
    m_displayMode = FloatDisplayMode;
  }
  
  Expression::ComplexFormat Preferences::complexFormat() const {
    return m_complexFormat;
  }
  
  void Preferences::setComplexFormat(Expression::ComplexFormat complexFormat) {
    m_complexFormat = complexFormat;
  }
  
  char Preferences::numberOfSignificantDigits() const {
    return m_numberOfSignificantDigits;
  }
  
  void Preferences::setNumberOfSignificantDigits(char numberOfSignificantDigits) {
    m_numberOfSignificantDigits = numberOfSignificantDigits;
  }
  
  }