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

Used to manage several applications on the badge. More...

#include <AppManager.h>

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

Public Member Functions

 AppManager (Dilbert *badge)
 Creates a new application manager. More...
 
void begin ()
 Initialises the application manager.
 
uint8_t addApp (App *app)
 Adds an application to the manager. More...
 
bool activateAppByName (char *name)
 Activates an application given it's name. More...
 
bool activateAppByIdx (uint8_t idx)
 Activates an application given it's index. More...
 
uint8_t appIdx (char *name)
 Gets the index of an app given it's name. More...
 
uint8_t appIdx (App *app) const
 Gets the index of an application. More...
 
Appapp (uint8_t idx)
 Gets an application given it's index. More...
 
size_t numApps () const
 Gets the number of applications in the manager. More...
 
AppactiveApp ()
 Gets the active application. More...
 
void feedBacklight (uint8_t status=BACKLIGHT_STATE_FULL)
 Ensures that the backlight stays on, otherwise it is susceptible to the timeouts set in SystemConfigData.
 
void run ()
 Runs the loop of the active application.
 
void handleUniversalInputEvent (inputtype_t type, IInputDevice *device)
 Handles a state change of an input device. More...
 

Detailed Description

Used to manage several applications on the badge.

Author
Dan Nixon

Constructor & Destructor Documentation

AppManager::AppManager ( Dilbert badge)

Creates a new application manager.

Parameters
badgePointer to badge driver

Member Function Documentation

bool AppManager::activateAppByIdx ( uint8_t  idx)

Activates an application given it's index.

Parameters
idxIndex of the app
Returns
True if the app was successfully activated
bool AppManager::activateAppByName ( char *  name)

Activates an application given it's name.

Parameters
nameName of the app
Returns
True if the app was successfully activated
App* AppManager::activeApp ( )
inline

Gets the active application.

Returns
Pointer to active application
uint8_t AppManager::addApp ( App app)

Adds an application to the manager.

Parameters
appPointer to the application
Returns
Index of the added application (255 on error)

Note that the first application added must be a home page/launcher application. When an application exits application 0 will be launched.

App* AppManager::app ( uint8_t  idx)
inline

Gets an application given it's index.

Parameters
idxApplication index
Returns
Pointer to application
uint8_t AppManager::appIdx ( char *  name)

Gets the index of an app given it's name.

Parameters
nameName of the app
Returns
Index or 255 if not in manager
uint8_t AppManager::appIdx ( App app) const

Gets the index of an application.

Parameters
appPointer to application
Returns
Index or 255 if not in manager
void AppManager::handleUniversalInputEvent ( inputtype_t  type,
IInputDevice *  device 
)

Handles a state change of an input device.

Parameters
typeType of input device (should always be button)
devicePointer to input device
size_t AppManager::numApps ( ) const

Gets the number of applications in the manager.

Returns
NUmber of apps

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