Communicator UI: 1.2 FoamSubApplicationClass: Using a FoamSubApplication Object

Up: GEOS SDK TechDocs | Up | Prev: 1.1 FoamSubApplicationClass Instance Data | Next: 2 ComplexMonikerClass
MSG_FSA_RETURN_TO_LAUNCHER

FoamSubApplication objects do not close like other applications. Because of this, they need to provide their own special "Close" trigger. However, FoamSubApplication objects should not simply "close" when the user presses this trigger. Instead, they should send MSG_FSA_RETURN_TO_LAUNCHER to this FoamSubApplication object.

This message changes the [hardIconBar] entry of the .INI file for the sub-application to be the launcher application (stored in FSAI_ launcherApp ). This allows the sub-application to seemingly close without closing the parent application. It is the responsibility of the application to provide a "Close" trigger that sends this message to the FoamSubApplicationClass object.

The "Close" trigger is declared as a ComplexMonikerClass object of type CMT_CLOSE. The ComplexMoniker is discussed more fully in ComplexMonikerClass .

Code Display 2-2 Using the FoamSubApplicationClass Object

/*
 * Declare the FoamSubApplication object as you would a normal GenApplication 
 * object. This sub-app will be launched from the Extras application.
 */
@start   AppResource
@object FoamSubApplicationClass MyApp = {
    GI_comp = @MyPrimary;
    FSAI_launcherApp = FA_EXTRAS_APP;
    gcnList(MANUFACTURER_ID_GEOWORKS, GAGCNLT_WINDOWS) = @MyPrimary;
    GI_visMoniker = list { @MyTextMoniker };
}
@visMoniker MyTextMoniker = "Nokia UI\rSample App";
@end     AppResource;
/*
 * Somewhere in your sub-app, create a CMT_CLOSE trigger.
 */
@object ComplexMonikerClass CloseTrigger = {
    ComplexMoniker = GenTriggerClass;
    CMI_topText = CMT_CLOSE;
    GTI_actionMsg = MSG_FSA_RETURN_TO_LAUNCHER;
    GTI_destination = @TemplateApp;
    HINT_SEEK_MENU_BAR;
    HINT_SEEK_REPLY_BAR;
    /* 
     * Close Command triggers should always be in the fourth position (3 because 
     * HINT_SEEK_SLOT refers to zero-based slot positions).
     */
    HINT_SEEK_SLOT = 3;
}

Up: GEOS SDK TechDocs | Up | Prev: 1.1 FoamSubApplicationClass Instance Data | Next: 2 ComplexMonikerClass