Dilbert
Firmware for the Dilbert interactive badge.
 All Classes Files Functions Variables Enumerations Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
App Class Reference

Used to encapsulate an individual application. More...

#include <App.h>

Inheritance diagram for App:
Inheritance graph
[legend]
Collaboration diagram for App:
Collaboration graph
[legend]

Public Member Functions

 App (char *name)
 Creates a new instance of a badge application. More...
 
char * name ()
 Gets the name of the application. More...
 
void setBackgroundColour (uint16_t colour)
 Sets the background fill colour of the display for this application. More...
 
virtual void create ()
 Creates the application. More...
 
virtual void onEntry ()
 Called when the application is entered. More...
 
virtual void run ()
 Called in a loop while the application is active. More...
 
virtual void exit ()
 Exits the application.
 
virtual void onExit ()
 Called when the application exits. More...
 
virtual void destroy ()
 Destroys the application. More...
 

Protected Member Functions

virtual bool handleButton (IButton *button)
 Handle button presses. More...
 

Protected Attributes

Dilbertm_badge
 Pointer to badge driver.
 
AppManagerm_manager
 Pointer to application manager.
 
char * m_name
 Name of application.
 
bool m_ready
 If the application has been created.
 
uint16_t m_backgroundColour
 Background colour.
 

Friends

class AppManager
 

Detailed Description

Used to encapsulate an individual application.

Author
Dan Nixon

Constructor & Destructor Documentation

App::App ( char *  name)
inline

Creates a new instance of a badge application.

Parameters
nameName of the application

Member Function Documentation

virtual void App::create ( )
inlinevirtual

Creates the application.

Memory allocations should be performed here.

Reimplemented in NeoTestApp, SystemSettingsApp, and MenuApp.

virtual void App::destroy ( )
inlinevirtual

Destroys the application.

Memory deallocation should be performed here.

Reimplemented in NeoTestApp.

virtual bool App::handleButton ( IButton *  button)
inlineprotectedvirtual

Handle button presses.

Parameters
buttonButton that has changed
Returns
True if the button was handled in this function

Reimplemented in Conways, StarsApp, NeoTestApp, ButtonTestApp, SystemSettingsApp, MenuApp, and StaticDisplayApp.

char* App::name ( )
inline

Gets the name of the application.

Returns
Pointer to name
virtual void App::onEntry ( )
inlinevirtual

Called when the application is entered.

Initial state should be set here, particularly for the display.

Reimplemented in Conways, NeoTestApp, StarsApp, ButtonTestApp, DilbertApp, SystemSettingsApp, MenuApp, and StaticDisplayApp.

virtual void App::onExit ( )
inlinevirtual

Called when the application exits.

Perform any state cleanup here.

Reimplemented in NeoTestApp, and StaticDisplayApp.

virtual void App::run ( )
inlinevirtual

Called in a loop while the application is active.

Equivalent to loop() in Arduino.

Reimplemented in Conways, NeoTestApp, StarsApp, and ProfileApp.

void App::setBackgroundColour ( uint16_t  colour)
inline

Sets the background fill colour of the display for this application.

Parameters
colourBackground colour

The documentation for this class was generated from the following file: