#include <PalmApp.hpp>
Public Types | |
enum | EConst { eTimeout = 100 } |
enum | EErrorCode { eOk = 0, eUnknownCode = appErrorClass|0x0001, eInitInstanceCode, eExitInstanceCode, eResetCode, eLaunchCodeCode, eNoGlobalVarsCode } |
Public Methods | |
PalmApp () | |
Constructor - don't make PlamOS calls here. | |
virtual | ~PalmApp () |
Destructor - don't make PlamOS calls here. | |
uint16 | GetLaunchCode () const |
void | SetLaunchCode (uint16) |
uint16 | GetFlags () const |
void | SetFlags (uint16) |
uint32 | GetExitCode () const |
void | SetExitCode (uint32) |
const void * | GetCommandPBP () const |
void | SetCommandPBP (const void *) |
const EventType & | GetCurrEvent () const |
int32 | GetTimeout () const |
void | SetTimeout (int32) |
uint32 | PilotMain (uint16, void *, uint16) |
Static Public Methods | |
void | Quit () |
Protected Methods | |
virtual void | InitInstance () |
Intialization routine. More... | |
virtual void | ExitInstance () |
Cleanup routine. More... | |
virtual bool | Idle (int32) |
virtual bool | PretranslateI () |
Called before a sys handler. | |
virtual bool | PretranslateII () |
Called before a menu handler. | |
virtual bool | AppHandleEvent () |
Called before a form handler (the last opportunity :). | |
Friends | |
class | XPalmApp |
Typical code in the PalmApp constructor is intialization of other forms objects, global objects or resources that are not PalmOS related.
The PalmApp object serves as a container for the application forms.
In order to link the application to the PalmOS and define the entry point use a set of macros. These macros define the entry point, an event handler and the exit code. A PalmApp object is instantiated in the macros and is used to start the application:
BEGIN_ENTRY_POINT(PalmOsApp)
DEFAULT_C_STUB()
END_ENTRY_POINT(PalmOsApp)
The PalmOsApp class:
////////////////////////////////////////////////////////////////////////////////////////
// class PalmOsApp
// ----- ---------
class PalmOsApp : public ail::PalmApp
{
private:
MSExplorer Explorer;
MSForm MainForm;
protected:
void InitInstance();
void ExitInstance();
public:
// ctor/dtor
PalmOsApp();
~PalmOsApp();
};
Definition at line 76 of file PalmApp.hpp.
|
This method is executed before existing the application. Cleanup code that uses PalmOS services should be placed here and not in the destructor. Definition at line 38 of file PalmApp.cpp. |
|
Called when the application is first loaded. This is the place to put the initialization code for the app. This is a good place to verify the version of the Palm OS, or the type of the HW in order to tune the application.
Example for initialization code: Definition at line 34 of file PalmApp.cpp. |