Index: A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
The ApplicationCache class implements the public API for loading and unloading applications. The code that actually implements the application loading and unloading mechanism lies in a separate MCMApplicationCache object, which runs on the MCM thread. However, the public API will be called from other threads, so it consists of static functions that send messages to the MCM thread to call member functions on the MCMApplicationCache.
#include <shell/appcache.h>
public: | |
static AppCacheError | AllowUnloading(void); |
static AppCacheError | ActiveApplicationClosed(void); |
static AppCacheError | PreventUnloading(void); |
static AppCacheError | GetContextString(const TCHAR *ual, TCHAR **buf); |
static AppCacheError | SetContextString(const TCHAR *ual, const TCHAR *context); |
static AppCacheError | Goto(const TCHAR *ual, const TCHAR *context); |
static AppCacheError | SwitchTo(const TCHAR *ual); |
protected: |
Back to the top of ApplicationCache
Back to the top of ApplicationCache
Back to the top of ApplicationCache
Called to once again allow the current application to be unloaded. If AllowUnloading() is called more times than PreventUnloading(), the call will be ignored.
Return value: ACE_INSUFFICIENT_MEMORY if not enough memory to perform this operation; otherwise ACE_SUCCESS.
See also: PreventUnloading()
Prototype:
static AppCacheError AllowUnloading(void);
Back to the top of ApplicationCache
AppCacheError ActiveApplicationClosed(void);
Invoked when the active application has exited, to allow the AppCachePolicy a chance to bring another application to the foreground.
Return value: ACE_INSUFFICIENT_MEMORY if not enough memory to perform this operation; otherwise ACE_SUCCESS.
Prototype:
static AppCacheError ActiveApplicationClosed(void);
Back to the top of ApplicationCache
AppCacheError PreventUnloading(void);
Invoked to ask the ApplicationCache not to unload the current application. Typically, this is done before a lengthy operation is started. A counter is kept, which means that if PreventUnloading is called twice, AllowUnloading() must also be called twice before the system will think that the application is ready to be unloaded.
Note: The policy for when applications are loaded and unloaded is implemented entirely within the ApplicationCache. PreventUnloading() will let the ApplicationCache know what the application's wishes are, but the ApplicationCache is still free to unload the application.
Return value: ACE_INSUFFICIENT_MEMORY if not enough memory to perform this operation; otherwise ACE_SUCCESS.
See also: AllowUnloading()
Prototype:
static AppCacheError PreventUnloading(void);
Back to the top of ApplicationCache
AppCacheError GetContextString(const TCHAR *ual, TCHAR **buf);
Copies the context string for the application specified by the passed UAL and returns a pointer to the copy.
Parameters:
See also: SetContextString(), Goto()
Prototype:
static AppCacheError GetContextString(const TCHAR *ual, TCHAR **buf);
Back to the top of ApplicationCache
AppCacheError SetContextString(const TCHAR *ual, const TCHAR *context);
Makes a copy of the passed context string and stores it away. It is retrieved by the specified application the next time GetContextString() is invoked (perhaps when the application is next loaded) to restore the application to its previous state.
This is typically invoked on application shutdown by code in the default AppBase::Exit() handler.
Parameters:
See also: GetContextString()
Prototype:
static AppCacheError SetContextString(const TCHAR *ual, const TCHAR *context);
Back to the top of ApplicationCache
AppCacheError Goto(const TCHAR *ual, const TCHAR *context);
Called to deliver a context change to an application. If the application is not loaded, this will load it, but will NOT make it the active application. This is used for dispatching real-time clock events to the application, and may also be used for other simple forms of inter- application communication.
Regardless of whether the application is already loaded, the AppBase object will have AppBase::SetAppContext() invoked, passing the context string that is passed to Goto().
Parameters:
See also: SwitchTo()
Prototype:
static AppCacheError Goto(const TCHAR *ual, const TCHAR *context);
Back to the top of ApplicationCache
AppCacheError SwitchTo(const TCHAR *ual);
Brings up the passed application. If the application referenced by the passed UAL is already loaded, this makes it the active application. Otherwise, the application is loaded, set to the previously saved context (if one exists), and made the active application.
If a context is passed in, the application will be asked to switch to that context.
Parameters:
See also: Goto()
Prototype:
static AppCacheError SwitchTo(const TCHAR *ual);
Back to the top of ApplicationCache