#include <MAUtil/Moblet.h>
Inheritance diagram for MAUtil::Moblet:
A Moblet manages the application main loop for you. To use Moblet: inherit it, construct an instance and call Moblet::run().
You'll probably want to implement your own keyPressEvent() and keyReleaseEvent().
Code that isn't supposed to be executed in response to an event should be placed in a TimerListener or IdleListener that's registered with the Moblet.
|
Moblet's constructor is protected, forcing you to inherit the class. Causes a panic if another Moblet already exists. There can be only one. |
|
This function is called with a MAK_ code when a key is pressed. Reimplemented from MAUtil::KeyListener. |
|
This function is called with a MAK_ code when a key is released. Reimplemented from MAUtil::KeyListener. |
|
This function is called with a coordinate when a pointer is pressed. Implements MAUtil::PointerListener. |
|
This function is called with a coordinate when a pointer is moved. Implements MAUtil::PointerListener. |
|
This function is called with a coordinate when a pointer is released. Implements MAUtil::PointerListener. |
|
This function is called when the Close event is recieved. The default implementation just calls close(). Implements MAUtil::CloseListener. |
|
This function is called when an event that Moblet doesn't recognize is recieved. |
|
Runs a Moblet. This function only returns if someone sets Moblet::mRun to false. Example: |
|
Shuts down the running application. |
|
Adds the specified listener to the end of the list, unless it is already in the list. |
|
Removes the specified listener from the list, if it's in it. |
|
Queries whether the specified listener is in the list of key listeners. |
|
Adds the specified listener to the end of the list, unless it is already in the list. |
|
Removes the specified listener from the list, if it's in it. |
|
Queries whether the specified listener is in the list of key listeners. |
|
Adds the specified listener to the end of the list, unless it is already in the list. |
|
Removes the specified listener from the list, if it's in it. |
|
Queries whether the specified listener is in the list of key listeners. |
|
Sets the Bluetooth Discovery listener. Causes a panic if there is already a listener set.
|
|
Removes the set Bluetooth Discovery listener. Causes a panic if there is no listener set. |
|
Sets the listener for a connection. Only one listener per connection is allowed, but the same ConnListener can be used with several connections. |
|
Removes the listener for a connection, if any. |
|
Adds a listener for the Close event. Adds the specified listener to the end of the list, unless it is already in the list. |
|
Removes a listener for the Close event. Removes the specified listener from the list, if it's in it. Must not be called from within closeEvent(). |
|
Adds the specified IdleListener to the end of the list, unless it is already in the list. IdleListeners are run again and again while they are registered. Take care, as constant processor usage will drain battery power quickly. |
|
Removes the specified IdleListener from the list, if it's in it. |
|
Adds a timer. This causes the runTimerEvent() function of the specified TimerListener to be called a number of times, at a fixed rate. The timer is then removed automatically. You can only have one timer per listener, so if a timer with the specified listener is already active, it is overwritten.
|
|
Removes the timer associated with the specified listener, if any. |
|
Returns a reference to the Environment. Causes a panic if no Environment exists. |
|
Calls focusGained() of all registered FocusListeners. |
|
Calls focusLost() of all registered FocusListeners. |
|
Calls keyPressEvent() of all registered KeyListeners with the specified keyCode. |
|
Calls keyReleaseEvent() of all registered KeyListeners with the specified keyCode. |
|
Calls pointerPressEvent() of all registered PointerListeners with the specified keyCode. |
|
Calls pointerMoveEvent() of all registered PointerListeners with the specified keyCode. |
|
Calls pointerReleaseEvent() of all registered PointerListeners with the specified keyCode. |
|
Calls the registered BluetoothListener, if any. |
|
Calls the registered ConnListener, if any, for the MAHandle specified by data. |
|
Calls all registered CloseListeners. |
|
Calls all registered IdleListeners once each. |
|
|
|
|
|
Controls the continued execution of the Moblet's event loop. Setting it to 'false' will cause Moblet::run() to return upon completing its current iteration. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|