Blame view

build2/epsilon-master/apps/solver/app.cpp 1.89 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
60
61
62
63
64
65
66
67
68
69
70
71
  #include "app.h"
  #include "../i18n.h"
  #include "solver_icon.h"
  
  using namespace Shared;
  
  namespace Solver {
  
  I18n::Message App::Descriptor::name() {
    return I18n::Message::SolverApp;
  }
  
  I18n::Message App::Descriptor::upperName() {
    return I18n::Message::SolverAppCapital;
  }
  
  const Image * App::Descriptor::icon() {
    return ImageStore::SolverIcon;
  }
  
  App::Snapshot::Snapshot() :
    m_equationStore()
  {
  }
  
  App * App::Snapshot::unpack(Container * container) {
    return new App(container, this);
  }
  
  App::Descriptor * App::Snapshot::descriptor() {
    static Descriptor descriptor;
    return &descriptor;
  }
  
  void App::Snapshot::reset() {
    // Delete all equations
    m_equationStore.removeAll();
  }
  
  void App::Snapshot::tidy() {
    // Delete all expressions of equations
    m_equationStore.tidy();
  }
  
  App::App(Container * container, Snapshot * snapshot) :
    ExpressionFieldDelegateApp(container, snapshot, &m_inputViewController),
    m_solutionsController(&m_alternateEmptyViewController, snapshot->equationStore()),
    m_intervalController(nullptr, snapshot->equationStore()),
    m_alternateEmptyViewController(nullptr, &m_solutionsController, &m_solutionsController),
    m_listController(&m_listFooter, snapshot->equationStore(), &m_listFooter),
    m_listFooter(&m_stackViewController, &m_listController, &m_listController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey, ButtonRowController::Size::Large),
    m_stackViewController(&m_inputViewController, &m_listFooter),
    m_inputViewController(&m_modalViewController, &m_stackViewController, &m_listController, &m_listController)
  {
  }
  
  void App::willBecomeInactive() {
    if (m_modalViewController.isDisplayingModal()) {
      m_modalViewController.dismissModalViewController();
    }
    if (inputViewController()->isDisplayingModal()) {
      inputViewController()->abortEditionAndDismiss();
    }
    ::App::willBecomeInactive();
  }
  
  const char * App::XNT() {
    return "x";
  }
  
  }