API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also

The functions in the IAppHistory interface allow the caller to interact with the application history list. This list consists of the visible and suspended applications. The APIs allow the caller to:
- Navigate through entries in the history list
- Obtain the class ID of a history entry
- Set or retrieve data stored by the system when the application is suspended
- Close the application history entry
- Insert a new entry into the history

This interface is obtained by calling ISHELL_CreateInstance. A new instance of IAppHistory is initialized pointing to the top-most history entry (that of the currently top-visible application), unless the history list is empty.
Every application that is either top-visible or is suspended has an associated history entry. There is no history entry created for background and windowed applications.
Rules on creating history entry for an app: When there is an attempt to start an app and make it top-visible (i.e. when ISHELL_StartApplet() or one of the macros based on this function) is invoked, BREW will associate an apphistory entry with this app. If the app does not already have a history entry with it (i.e if it is not already in the list of suspended apps), a new history entry will be created for this app. If this app is already in the history list, the following rules will be used to decide whether to create a new entry for this app OR to move the already existing history entry to the top of the list: a. If the app has set resume data previously (when it got suspended) by invoking IAppHistory_SetResumeData(), then a new history entry will be created for the app when ISHELL_StartApplet() is invoked on it again b. If the app has not set resume data previously by calling IAppHistory_SetResumeData(), then a new history entry will not be created for this app when it is started again. Instead, the already existing history entry will be moved to the top of the list (to make this app top-visible).
Rules for removing a history entry: Other than using IAPPHISTORY APIs to move a history entry, when ISHELL_CloseApplet() is called, it will remove the history entry (if one exists) for the caller. Calling IAppletCtl_Stop() will not remove a history entry unless it is the top-visible app.
Registering for notifications: Following is skeletal code indicating how to register for IAppHistory notifications
ISHELL_CreateInstance(pShell, AEECLSID_APPHISTORY, (void**)&pAppHist); IAPPHISTORY_QueryInterface(pAppHist, AEEIID_MODEL, (void**)&pAHModel); LISTENER_Init(pListener, pfn, pcd); IMODEL_AddListener(pAHModel, pListener);