Blame view

Giac_maj/epsilon-giac/poincare/src/preferences.cpp 1.07 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
  #include <poincare/preferences.h>
  
  namespace Poincare {
  
  static Preferences s_preferences;
  
  Preferences::Preferences() :
    m_angleUnit(Expression::AngleUnit::Degree),
    m_displayMode(Expression::FloatDisplayMode::Decimal),
    m_complexFormat(Expression::ComplexFormat::Cartesian)
  {
  }
  
  Preferences * Preferences::sharedPreferences() {
    return &s_preferences;
  }
  
  Expression::AngleUnit Preferences::angleUnit() const {
    return m_angleUnit;
  }
  
  void Preferences::setAngleUnit(Expression::AngleUnit angleUnit) {
    if (angleUnit != m_angleUnit) {
      m_angleUnit = angleUnit;
    }
  }
  
  Expression::FloatDisplayMode Preferences::displayMode() const {
    return m_displayMode;
  }
  
  void Preferences::setDisplayMode(Expression::FloatDisplayMode FloatDisplayMode) {
    if (FloatDisplayMode != m_displayMode) {
      m_displayMode = FloatDisplayMode;
    }
  }
  
  Expression::ComplexFormat Preferences::complexFormat() const {
    return m_complexFormat;
  }
  
  void Preferences::setComplexFormat(Expression::ComplexFormat complexFormat) {
    if (complexFormat != m_complexFormat) {
      m_complexFormat = complexFormat;
    }
  }
  
  }