




/* Replace all instances of <Screen Name> with the name of the new screen */
#ifndef __<Screen name>_APP_HPP__
#define __<Screen name>_APP_HPP__
#include <gui/common/OxpeckerApplication.hpp>
class <Screen name>App: public OxpeckerApplication
{
public:
private:
};
#endif
...
#include <gui/common/ZebraApplication.hpp>
#include <gui/common/AppClasses.hpp>
#include <gui/common/ScreenNameApp.hpp> /* Replace apropriately with previously generated file */
...
class <Screen>View :
public <Screen>ViewBase,
public <Screen>App
{
public:
ZEBRA_APPLICATION
...
...
#include <gui/common/KeypadHandler.hpp>
class <screenname>Presenter : public touchgfx::Presenter, public ModelListener, public KeypadHandler
{
public:
...
/**
* Zebra Specific APIs common to all screens
*/
virtual void UpdateAllIcons();
virtual void UpdateIcon(IconID_t IconId, IconStateID_t IconState);
virtual void setCurrentScreen(uint8_t CurrentScreen);
virtual uint8_t getHomeKeyLaunch(void);
<screenname>Presenter::<screenname>Presenter(<screenname>View& v)
: KeypadHandler(model), view(v)
{
...
}
...
void <screenname>Presenter::UpdateAllIcons()
{
/* Signals the model to start a full icon state update */
model->UpdateAllIcons();
}
void <screenname>Presenter::UpdateIcon(IconID_t IconId, IconStateID_t IconState)
{
/* Signal the View to update a specific icon */
/* Note that the actual implementation is specific to the view - for most
screens the icons are located in the Top Status Bar */
view.UpdateIcon(IconId, IconState);
}
void <screenname>Presenter::setCurrentScreen(uint8_t CurrentScreen)
{
model->setCurrentScreen(CurrentScreen);
}
uint8_t <screenname>Presenter::getHomeKeyLaunch(void)
{
return (model->getHomeKeyLaunch());
}
...
#include <gui/common/platform_itf.h>
#include <gui/common/ConfigParam.hpp> /* Optional, to allow configuration parameters for this application */
REGISTER_APPLICATION(
<Screenname>View,
"DemoApp", /* Name of the application, entirely user defined */
TRANSITION_CALLBACK(goto<screenname>ScreenNoTransition), /* is generated automatically because of step 3 */
PRIORITY /* defines the order in the home menu, can be any number between 1 and 255*/
)
…
...
<Screenname>Presenter::<Screenname>Presenter(<Screenname>View& v)
: KeypadHandler(model), view(v)
{
…