CGSPluginLoader Class Reference

class CGSPluginLoader : public CActive

CGSPluginLoader . Mechanism used to load plugins asynchronously. Uses MGSPluginLoadObserver as a callback.

GSFramework.lib
Since
Series60_30.1

Inherits from

Public Member Functions
~CGSPluginLoader ()
IMPORT_C void AbortAsyncLoad ()
IMPORT_C void LoadAsyncL ( TUid , TUid , CArrayPtrFlat < CGSPluginInterface > *)
CGSPluginInterface & LoadSyncL ( TUid , TUid )
IMPORT_C CGSPluginLoader * NewL ( CAknViewAppUi *)
IMPORT_C void RequestPriority ( CActive::TPriority )
IMPORT_C void SetObserver ( MGSPluginLoadObserver *)
IMPORT_C void SortPluginsL ( CArrayPtrFlat < CGSPluginInterface > *)
Private Member Functions
CGSPluginLoader ()
TInt Compare (const CGSPluginInterface &, const CGSPluginInterface &)
TInt CompareCaption (const CGSPluginInterface &, const CGSPluginInterface &)
TInt CompareCategory (const CGSPluginInterface &, const CGSPluginInterface &)
TInt CompareIndex (const CGSPluginInterface &, const CGSPluginInterface &)
void CompleteOwnRequest ()
void ConstructL ( CAknViewAppUi *)
CGSPluginInterface & CreatePluginInstanceL (const CImplementationInformation &)
void DisplayErrorPopupL ( TInt , const CImplementationInformation *)
void DoCancel ()
void InsertPluginInOrderL ( CGSPluginInterface *, CArrayPtrFlat < CGSPluginInterface > *)
void LoadNextPluginL ()
void NotifyFinished ()
void NotifyProgress ()
TInt ParseOrderNumber (const TDesC8 &, TInt &)
TInt ParseToUid (const TDesC8 &, TUid &)
void PrintInfoDebugL (const CImplementationInformation &, TInt , TInt )
void PrintOrderTracesL ( CArrayPtrFlat < CGSPluginInterface > *)
TInt RunError ( TInt )
void RunL ()
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Inherited Enumerations
CActive:TPriority
Private Attributes
CAknViewAppUi * iAppUi
CGSBaseDocument * iDocument
CAknInfoPopupNoteController * iErrorPopup
RImplInfoPtrArray iImplInfoArray
TInt iImplInfoArrayIterator
MGSPluginLoadObserver * iObserver
TUid iParentUid
CArrayPtrFlat < CGSPluginInterface > * iPluginArray
CActive::TPriority iRequestedPriority
TInt iRunLDebugCount
MGSWatchDog * iWatchDog
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CGSPluginLoader()

CGSPluginLoader ( ) [private]

Default C++ contructor

~CGSPluginLoader()

IMPORT_C ~CGSPluginLoader ( )

Destructor

Member Functions Documentation

AbortAsyncLoad()

IMPORT_C void AbortAsyncLoad ( )

Aborts asynchronous loading of the GS plug-ins.

Compare(const CGSPluginInterface &, const CGSPluginInterface &)

TInt Compare ( const CGSPluginInterface & aFirst,
const CGSPluginInterface & aSecond
) [private, static]

Compares plugins according to comparison criterias.

Note: GS internal comparison constants such as KGSComparisonEqual are different from the ones outputted by this function. This is because this function is also usable by RArray sort -functionality but BC cannot be broken in GS.

Parameters

const CGSPluginInterface & aFirst
const CGSPluginInterface & aSecond

CompareCaption(const CGSPluginInterface &, const CGSPluginInterface &)

TInt CompareCaption ( const CGSPluginInterface & aFirst,
const CGSPluginInterface & aSecond
) [private, static]

Parameters

const CGSPluginInterface & aFirst
const CGSPluginInterface & aSecond

CompareCategory(const CGSPluginInterface &, const CGSPluginInterface &)

TInt CompareCategory ( const CGSPluginInterface & aFirst,
const CGSPluginInterface & aSecond
) [private, static]

Precedence is as follows: 1. KGSPluginProviderInternal 2. EGSPluginProviderOEM 3. EGSPluginProviderOperator 4. EGSPluginProvider3rdParty

Parameters

const CGSPluginInterface & aFirst
const CGSPluginInterface & aSecond

CompareIndex(const CGSPluginInterface &, const CGSPluginInterface &)

TInt CompareIndex ( const CGSPluginInterface & aFirst,
const CGSPluginInterface & aSecond
) [private, static]

Parameters

const CGSPluginInterface & aFirst
const CGSPluginInterface & aSecond

CompleteOwnRequest()

void CompleteOwnRequest ( ) [private]

Wait for the next round of CActive execution.

ConstructL(CAknViewAppUi *)

void ConstructL ( CAknViewAppUi * aAppUi ) [private]

Symbian OS default constructor

Parameters

CAknViewAppUi * aAppUi

CreatePluginInstanceL(const CImplementationInformation &)

CGSPluginInterface & CreatePluginInstanceL ( const CImplementationInformation & aImpInfo ) [private]

Creates a plugin instance from given UID. Ownership is transferred.

Parameters

const CImplementationInformation & aImpInfo

DisplayErrorPopupL(TInt, const CImplementationInformation *)

void DisplayErrorPopupL ( TInt aError,
const CImplementationInformation * aInfo
) [private]

Display loading error popup message.

Parameters

TInt aError
const CImplementationInformation * aInfo

DoCancel()

void DoCancel ( ) [private, virtual]

See base class.

InsertPluginInOrderL(CGSPluginInterface *, CArrayPtrFlat< CGSPluginInterface > *)

void InsertPluginInOrderL ( CGSPluginInterface * aPlugin,
CArrayPtrFlat < CGSPluginInterface > * aPlugins
) [private]

Inserts plugin in the correct position in the array using sorting criterias. Assumes aPlugins is ordered.

Parameters

CGSPluginInterface * aPlugin The plugin to be inserted.
CArrayPtrFlat < CGSPluginInterface > * aPlugins Array in which the plugin is inserted into the corresponding location.

LoadAsyncL(TUid, TUid, CArrayPtrFlat< CGSPluginInterface > *)

IMPORT_C void LoadAsyncL ( TUid aInterfaceUid,
TUid aParentUid,
CArrayPtrFlat < CGSPluginInterface > * aPluginArray
)

Starts loading GS plug-ins asynchronously. Will call MGSPluginLoadObserver::HandlePluginLoaded() each time a plug-in is loaded and when all plugins are loaded.

CGSPluginLoader transfers the ownership of each loaded plugin view to CAknViewAppUi . It is client's responsibility to remove the views from CAknViewAppUi and delete the plugins if necessary.

Parameters

TUid aInterfaceUid Uid ofthe interfaces to be loaded.
TUid aParentUid Uid of the parent. Only children of this parent will be loaded.
CArrayPtrFlat < CGSPluginInterface > * aPluginArray An array for the loaded GS plug-ins. CGSPluginLoader does not take the ownership of this array.

LoadNextPluginL()

void LoadNextPluginL ( ) [private]

Starts loading next plugin.

LoadSyncL(TUid, TUid)

CGSPluginInterface & LoadSyncL ( TUid aInterfaceUid,
TUid aImplementationUid
)

Load a specific plugin instance synchronously.

Parameters

TUid aInterfaceUid Uid ofthe interfaces to be loaded.
TUid aImplementationUid Uid of the implementation to load

NewL(CAknViewAppUi *)

IMPORT_C CGSPluginLoader * NewL ( CAknViewAppUi * aAppUi ) [static]

Two-phased constructor.

Parameters

CAknViewAppUi * aAppUi Pointer to application UI. Does not take ownership.

NotifyFinished()

void NotifyFinished ( ) [private]

NotifyProgress()

void NotifyProgress ( ) [private]

ParseOrderNumber(const TDesC8 &, TInt &)

TInt ParseOrderNumber ( const TDesC8 & aSource,
TInt & aOrderNumber
) [private, static]

Parsers plugin's order number

Parameters

const TDesC8 & aSource
TInt & aOrderNumber

ParseToUid(const TDesC8 &, TUid &)

TInt ParseToUid ( const TDesC8 & aSource,
TUid & aTarget
) [private, static]

Parses descriptor to UID.

Parameters

const TDesC8 & aSource
TUid & aTarget

PrintInfoDebugL(const CImplementationInformation &, TInt, TInt)

void PrintInfoDebugL ( const CImplementationInformation & aInfo,
TInt aIterator,
TInt aPluginCount
) [private, static]

Print debug information.

Parameters

const CImplementationInformation & aInfo
TInt aIterator
TInt aPluginCount

PrintOrderTracesL(CArrayPtrFlat< CGSPluginInterface > *)

void PrintOrderTracesL ( CArrayPtrFlat < CGSPluginInterface > * aPlugins ) [private]

Print ordering debug data.

Parameters

CArrayPtrFlat < CGSPluginInterface > * aPlugins

RequestPriority(CActive::TPriority)

IMPORT_C void RequestPriority ( CActive::TPriority aPriority )

Attempts to change CActive priority on next RunL cycle. Use this if needed to change plugin loader priority. Normally when parent plugin view is opened, it is advisable to increase loader priority to get child plugins loaded faster.

Parameters

CActive::TPriority aPriority Desired priority.

RunError(TInt)

TInt RunError ( TInt aError ) [private, virtual]

See base class.

Parameters

TInt aError

RunL()

void RunL ( ) [private, virtual]

See base class.

SetObserver(MGSPluginLoadObserver *)

IMPORT_C void SetObserver ( MGSPluginLoadObserver * aObserver )

Sets observer for this loader. Only one observer per loader in one time is possible.

Parameters

MGSPluginLoadObserver * aObserver

SortPluginsL(CArrayPtrFlat< CGSPluginInterface > *)

IMPORT_C void SortPluginsL ( CArrayPtrFlat < CGSPluginInterface > * aPlugins )

Sorts the plugin array.

Sorting criterias:

1. Order number if provider category is Internal. 2. Provider category. Precedence as follows: 1. KGSPluginProviderInternal 2. EGSPluginProviderOEM 3. EGSPluginProviderOperator 4. EGSPluginProvider3rdParty 3. Alphabetical

Parameters

CArrayPtrFlat < CGSPluginInterface > * aPlugins The array which will be sorted.

Member Data Documentation

CAknViewAppUi * iAppUi

CAknViewAppUi * iAppUi [private]

CGSBaseDocument * iDocument

CGSBaseDocument * iDocument [private]

CAknInfoPopupNoteController * iErrorPopup

CAknInfoPopupNoteController * iErrorPopup [private]

RImplInfoPtrArray iImplInfoArray

RImplInfoPtrArray iImplInfoArray [private]

TInt iImplInfoArrayIterator

TInt iImplInfoArrayIterator [private]

MGSPluginLoadObserver * iObserver

MGSPluginLoadObserver * iObserver [private]

TUid iParentUid

TUid iParentUid [private]

CArrayPtrFlat< CGSPluginInterface > * iPluginArray

CArrayPtrFlat < CGSPluginInterface > * iPluginArray [private]

CActive::TPriority iRequestedPriority

CActive::TPriority iRequestedPriority [private]

TInt iRunLDebugCount

TInt iRunLDebugCount [private]

MGSWatchDog * iWatchDog

MGSWatchDog * iWatchDog [private]