CGSPluginAndViewIdCache Class Reference

class CGSPluginAndViewIdCache : public CBase
CGSPluginAndViewIdCache application class.
  • Creates/Loads a list of CGSShimmedViews from a cache file on GS start-up.

  • Inserts CGSShimmedViews into view-framework view list.

Problem/rationale: Launching GS plugin view outside GS application when GS application is not already running may fail. This was caused by application inter working combined with GS application's asynchronized plugin loading. High level functionality for external view launching goes: 1. Application framework starts desired application 2. Application framework calls view-activation on the desired application view. 3. Desired view handles the activation call-back by drawing itself on screen or whatever required.

Starting from phase 2, things can go wrong: when GS start-up call returns, GS has not yet loaded all the plugins and the views owned by plugins are not added yet to the view-framework view list. Calling non-existing view will naturally fail.

Solution: When GS start-up is called, populate view-frameworks view list with all the views provided by GS application before function return. Kind of: This would ruin GS's asynchronous plugin loading and would cause devastating freeze-up times on GS start-up. Hence, on GS start-up we're not actually loading the plugins nor the real views. We use light-weight dummy views (aka CGSShimmedView ) wich we add into view-framework view list immedieately on start-up. If it happens so, that the view framework-decides to call view activation on one of these dummy views, dummy view will load manually the real plugin view and switch it with the dummy view. Dummy views are created by CGSPluginAndViewIdCache on GS-application start-up.

Different use scenarios:

1. First GS-application start on a new device, create cache & save as file.

2. Launch GS-application second time. Always populate CCoeAppUi with CGSShimmedView instances created from cache file (cache maps view uid to ecom plugin implementation uid).
  • When pluginloader loads plugin, it replaces dummy view (shim) with the real view from the plugin. The shim is then destroyed.

3. GS plugin view is activated externally when GS is not running:
  • Uses normal application framework to launch GS application.

  • Same functionality as in scenario 2 but if shimmed view is requested before actual view is created, load actual plugin manually and synchronously.

  • CGSPlaceholderView : View-FW will only switch between two different view uids. This is why we need to switch between 3 different views. -> Will result in 3x fold different view activation.

  • Used view activations are: 1. Shimmed view DoActivate for view uid <view_uid>. 2. Shimmed view calls Placeholder::DoActivate with a dummy "uid DEADBED". 3. Placeholder view calls actual plugin::DoActivate with actual view uid <view_uid>.

NOTE: Requirements:
  • Cache: GS has to be launched once successfully for the cache to work. -> otherwise error if launching from external application.

  • Views which need to be used externally (external view launch) must be implemented as a GS-plugin. Those cannot be implemented as a local view.

Since
Series60_3.1

Inherits from

Nested Classes and Structures

Constructor & Destructor Documentation

CGSPluginAndViewIdCache(CEikAppUi &)

CGSPluginAndViewIdCache ( CEikAppUi & aAppUi ) [private]

C++ constructor

Parameters

CEikAppUi & aAppUi

~CGSPluginAndViewIdCache()

~CGSPluginAndViewIdCache ( )

Destructor.

Member Functions Documentation

ActivatePlaceholderViewL()

void ActivatePlaceholderViewL ( )

ConstructL()

void ConstructL ( ) [private]

Second phase constructor

DestroyShims()

void DestroyShims ( ) [private]

GetCacheFileNameL(TDes &)

void GetCacheFileNameL ( TDes & aFileName ) [private]

Parameters

TDes & aFileName

GetCachePathL(TDes &)

void GetCachePathL ( TDes & aPath ) [private]

Parameters

TDes & aPath

HandleShimDestruction(TUid)

void HandleShimDestruction ( TUid aViewId )

Parameters

TUid aViewId

HashFunction(const TUid &)

TUint32 HashFunction ( const TUid & aViewId ) [private, static]

Parameters

const TUid & aViewId

HashIdentityRelation(const TUid &, const TUid &)

TBool HashIdentityRelation ( const TUid & aLeft,
const TUid & aRight
) [private, static]

Parameters

const TUid & aLeft
const TUid & aRight

IsPluginLoaded(TUid)

TBool IsPluginLoaded ( TUid aViewId ) const

Parameters

TUid aViewId

NewL(CEikAppUi &)

CGSPluginAndViewIdCache * NewL ( CEikAppUi & aAppUi ) [static]

Parameters

CEikAppUi & aAppUi

PluginImplementationUidForView(TUid)

TUid PluginImplementationUidForView ( TUid aViewId ) const

Parameters

TUid aViewId

PluginInstance(TUid)

CGSPluginInterface * PluginInstance ( TUid aViewId ) const

Parameters

TUid aViewId

PrepareForUIDestruction()

void PrepareForUIDestruction ( )

PrepareToRegisterPluginInstanceLC(TUid)

void PrepareToRegisterPluginInstanceLC ( TUid aViewId )

Parameters

TUid aViewId

PriorToPlaceholderActiveViewId()

const TVwsViewId & PriorToPlaceholderActiveViewId ( ) const

ReRegisterShimWithUi(TAny *)

void ReRegisterShimWithUi ( TAny * aSelf ) [private, static]

Parameters

TAny * aSelf

RegisterPluginInstanceL(TUid, CGSPluginInterface &)

void RegisterPluginInstanceL ( TUid aViewId,
CGSPluginInterface & aPluginInstance
)

Parameters

TUid aViewId
CGSPluginInterface & aPluginInstance

RegisterViewAndImplementationAssociationL(TUid, TUid)

void RegisterViewAndImplementationAssociationL ( TUid aViewId,
TUid aImplementationUid
)

Parameters

TUid aViewId
TUid aImplementationUid

RegisterViewAndImplementationAssociationL(TUid, TUid, TBool)

void RegisterViewAndImplementationAssociationL ( TUid aViewId,
TUid aImplementationUid,
TBool aCreateShim
)

Parameters

TUid aViewId
TUid aImplementationUid
TBool aCreateShim

RestoreL()

void RestoreL ( ) [private]

SetPriorToPlaceholderActiveViewId(const TVwsViewId &)

void SetPriorToPlaceholderActiveViewId ( const TVwsViewId & aViewId )

Parameters

const TVwsViewId & aViewId

StoreL()

void StoreL ( ) [private]

Member Data Documentation

CEikAppUi & iAppUi

CEikAppUi & iAppUi [private]

RFs & iFsSession

RFs & iFsSession [private]

RHashMap< TUid, TCacheEntry > iLookupTable

RHashMap < TUid , TCacheEntry > iLookupTable [private]

CGSPlaceholderView * iPlaceholderView

CGSPlaceholderView * iPlaceholderView [private]

TUid iTransientCleanupViewUid

TUid iTransientCleanupViewUid [private]