Numworks Epsilon  1.4.1
Graphing Calculator Operating System
view_controller.h
Go to the documentation of this file.
1 #ifndef ESCHER_VIEW_CONTROLLER_H
2 #define ESCHER_VIEW_CONTROLLER_H
3 
4 #include <kandinsky.h>
5 #include <escher/i18n.h>
6 extern "C" {
7 #include <stdint.h>
8 }
9 
10 /* ViewControllers are reponsible for
11  * - Building the view hierarchy
12  * - Handling user input
13  *
14  * The methods viewWillAppear is called in the following order relatively to
15  * Responder's methods -didBecomeFirstResponder and didEnterResponderChain:
16  * - viewWillAppear
17  * - didEnterResponderChain
18  * - didBecomeFirstResponder
19  * The methods viewWillDisappear is called in the following order relatively to
20  * Responder's methods -willResignFirstResponder and willExitResponderChain:
21  * - viewWillDisappear
22  * - willExitResponderChain
23  * - willResignFirstResponder
24  * Both methods are always called after setting a view and layouting it
25  * subviews. */
26 
27 #include <escher/view.h>
28 #include <escher/responder.h>
29 
30 class ViewController : public Responder {
31 public:
32  /* DisplayParameter is only used within StackViewController for now. It
33  * modifies the stack headers display. */
34  enum class DisplayParameter {
35  Default,
37  /* With DoNotShowOwnTitle, the title of the ViewController is not added to
38  * the stack headers. */
40  /* With WantsMaximumSpace, no stack headers are displayed. */
41  };
42 
44  virtual const char * title();
45  virtual View * view() = 0;
46  virtual void viewWillAppear();
47  virtual void viewDidDisappear();
49 };
50 
51 #endif
Responder * parentResponder() const
Definition: responder.cpp:12
virtual View * view()=0
ViewController(Responder *parentResponder)
virtual void viewWillAppear()
virtual const char * title()
Definition: view.h:23
virtual void viewDidDisappear()
virtual DisplayParameter displayParameter()