Blame view

Modif/epsilon-master/poincare/src/preferences.cpp 1.41 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
53
54
55
56
57
58
59
  #include <poincare/preferences.h>
  
  namespace Poincare {
  
  Preferences::Preferences() :
    m_angleUnit(Expression::AngleUnit::Degree),
    m_displayMode(PrintFloat::Mode::Decimal),
    m_editionMode(EditionMode::Edition2D),
    m_complexFormat(Expression::ComplexFormat::Cartesian),
    m_numberOfSignificantDigits(PrintFloat::k_numberOfPrintedSignificantDigits)
  {
  }
  
  Preferences * Preferences::sharedPreferences() {
    static Preferences preferences;
    return &preferences;
  }
  
  Expression::AngleUnit Preferences::angleUnit() const {
    return m_angleUnit;
  }
  
  void Preferences::setAngleUnit(Expression::AngleUnit angleUnit) {
    m_angleUnit = angleUnit;
  }
  
  PrintFloat::Mode Preferences::displayMode() const {
    return m_displayMode;
  }
  
  void Preferences::setDisplayMode(PrintFloat::Mode mode) {
    m_displayMode = mode;
  }
  
  Preferences::EditionMode Preferences::editionMode() const {
    return m_editionMode;
  }
  
  void Preferences::setEditionMode(Preferences::EditionMode editionMode) {
    m_editionMode = editionMode;
  }
  
  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;
  }
  
  }