Files
Upsilon/escher/include/escher/view_controller.h
Léa Saviot eadf4a018a [escher] New handling of stack view headers in StackViewController.
A boolean in ViewController states if the ViewController wants MaximumSpace (do
not show any stack view headers), or if it does not want to add its own title to
the stack view headers. If the ViewController's title is null, it is not added
to the stack view headers.
By default, ButtonRowControllers do not want to add their title (because they
are only used for now in TabViews, where the title is already displayed in the
tab).

Change-Id: I9e4c64b845262e4d44eb03cf769950f9c9e67a3a
2017-11-17 11:59:50 +01:00

52 lines
1.5 KiB
C++

#ifndef ESCHER_VIEW_CONTROLLER_H
#define ESCHER_VIEW_CONTROLLER_H
#include <kandinsky.h>
#include <escher/i18n.h>
extern "C" {
#include <stdint.h>
}
/* ViewControllers are reponsible for
* - Building the view hierarchy
* - Handling user input
*
* The methods viewWillAppear is called in the following order relatively to
* Responder's methods -didBecomeFirstResponder and didEnterResponderChain:
* - viewWillAppear
* - didEnterResponderChain
* - didBecomeFirstResponder
* The methods viewWillDisappear is called in the following order relatively to
* Responder's methods -willResignFirstResponder and willExitResponderChain:
* - viewWillDisappear
* - willExitResponderChain
* - willResignFirstResponder
* Both methods are always called after setting a view and layouting it
* subviews. */
#include <escher/view.h>
#include <escher/responder.h>
class ViewController : public Responder {
public:
/* DisplayParameter is only used within StackViewController for now. It
* modifies the stack headers display. */
enum class DisplayParameter {
Default,
DoNotShowOwnTitle,
/* With DoNotShowOwnTitle, the title of the ViewController is not added to
* the stack headers. */
WantsMaximumSpace
/* With WantsMaximumSpace, no stack headers are displayed. */
};
ViewController(Responder * parentResponder);
virtual const char * title();
virtual View * view() = 0;
virtual void viewWillAppear();
virtual void viewDidDisappear();
virtual DisplayParameter displayParameter() { return DisplayParameter::Default; }
};
#endif