Numworks Epsilon  1.4.1
Graphing Calculator Operating System
modal_view_controller.h
Go to the documentation of this file.
1 #ifndef ESCHER_MODAL_VIEW_CONTROLLER_H
2 #define ESCHER_MODAL_VIEW_CONTROLLER_H
3 
5 #include <escher/stack_view.h>
6 
8 public:
10  View * view() override;
11 
12  bool handleEvent(Ion::Events::Event event) override;
13  void didBecomeFirstResponder() override;
14  void displayModalViewController(ViewController * vc, float verticalAlignment, float horizontalAlignment,
15  KDCoordinate topMargin = 0, KDCoordinate leftMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate rightMargin = 0);
17  bool isDisplayingModal();
18  void viewWillAppear() override;
19  void viewDidDisappear() override;
20 private:
21  class ContentView : public View {
22  public:
23  ContentView();
24  void setMainView(View * regularView);
25  int numberOfSubviews() const override;
26  View * subviewAtIndex(int index) override;
27  void layoutSubviews() override;
28  void presentModalView(View * modalView, float verticalAlignment, float horizontalAlignment,
29  KDCoordinate topMargin, KDCoordinate leftMargin, KDCoordinate bottomMargin, KDCoordinate rightMargin);
30  void dismissModalView();
31  bool isDisplayingModal() const;
32  private:
33  KDRect frame() const;
34  View * m_regularView;
35  View * m_currentModalView;
36  bool m_isDisplayingModal;
37  float m_verticalAlignment;
38  float m_horizontalAlignment;
39  KDCoordinate m_topMargin;
40  KDCoordinate m_leftMargin;
41  KDCoordinate m_bottomMargin;
42  KDCoordinate m_rightMargin;
43  };
44  ContentView m_contentView;
45  Responder * m_previousResponder;
46  ViewController * m_currentModalViewController;
47  ViewController * m_regularViewController;
48 };
49 
50 #endif
bool handleEvent(Ion::Events::Event event) override
int16_t KDCoordinate
Definition: coordinate.h:6
Responder * parentResponder() const
Definition: responder.cpp:12
void viewDidDisappear() override
ModalViewController(Responder *parentResponder, ViewController *child)
void didBecomeFirstResponder() override
Definition: rect.h:26
void displayModalViewController(ViewController *vc, float verticalAlignment, float horizontalAlignment, KDCoordinate topMargin=0, KDCoordinate leftMargin=0, KDCoordinate bottomMargin=0, KDCoordinate rightMargin=0)
Definition: view.h:23