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 voidAbortAsyncLoad()
IMPORT_C voidLoadAsyncL(TUid, TUid, CArrayPtrFlat< CGSPluginInterface > *)
CGSPluginInterface &LoadSyncL(TUid, TUid)
IMPORT_C CGSPluginLoader *NewL(CAknViewAppUi *)
IMPORT_C voidRequestPriority(CActive::TPriority)
IMPORT_C voidSetObserver(MGSPluginLoadObserver *)
IMPORT_C voidSortPluginsL(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 &)
voidCompleteOwnRequest()
voidConstructL(CAknViewAppUi *)
CGSPluginInterface &CreatePluginInstanceL(const CImplementationInformation &)
voidDisplayErrorPopupL(TInt, const CImplementationInformation *)
voidDoCancel()
voidInsertPluginInOrderL(CGSPluginInterface *, CArrayPtrFlat< CGSPluginInterface > *)
voidLoadNextPluginL()
voidNotifyFinished()
voidNotifyProgress()
TInt ParseOrderNumber(const TDesC8 &, TInt &)
TInt ParseToUid(const TDesC8 &, TUid &)
voidPrintInfoDebugL(const CImplementationInformation &, TInt, TInt)
voidPrintOrderTracesL(CArrayPtrFlat< CGSPluginInterface > *)
TInt RunError(TInt)
voidRunL()
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 voidAbortAsyncLoad()

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()

voidCompleteOwnRequest()[private]

Wait for the next round of CActive execution.

ConstructL(CAknViewAppUi *)

voidConstructL(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 *)

voidDisplayErrorPopupL(TIntaError,
const CImplementationInformation *aInfo
)[private]

Display loading error popup message.

Parameters

TInt aError
const CImplementationInformation * aInfo

DoCancel()

voidDoCancel()[private, virtual]

See base class.

InsertPluginInOrderL(CGSPluginInterface *, CArrayPtrFlat< CGSPluginInterface > *)

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

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

Parameters

CGSPluginInterface * aPluginThe plugin to be inserted.
CArrayPtrFlat< CGSPluginInterface > * aPluginsArray in which the plugin is inserted into the corresponding location.

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

IMPORT_C voidLoadAsyncL(TUidaInterfaceUid,
TUidaParentUid,
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 aInterfaceUidUid ofthe interfaces to be loaded.
TUid aParentUidUid of the parent. Only children of this parent will be loaded.
CArrayPtrFlat< CGSPluginInterface > * aPluginArrayAn array for the loaded GS plug-ins. CGSPluginLoader does not take the ownership of this array.

LoadNextPluginL()

voidLoadNextPluginL()[private]

Starts loading next plugin.

LoadSyncL(TUid, TUid)

CGSPluginInterface &LoadSyncL(TUidaInterfaceUid,
TUidaImplementationUid
)

Load a specific plugin instance synchronously.

Parameters

TUid aInterfaceUidUid ofthe interfaces to be loaded.
TUid aImplementationUidUid of the implementation to load

NewL(CAknViewAppUi *)

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

Two-phased constructor.

Parameters

CAknViewAppUi * aAppUiPointer to application UI. Does not take ownership.

NotifyFinished()

voidNotifyFinished()[private]

NotifyProgress()

voidNotifyProgress()[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)

voidPrintInfoDebugL(const CImplementationInformation &aInfo,
TIntaIterator,
TIntaPluginCount
)[private, static]

Print debug information.

Parameters

const CImplementationInformation & aInfo
TInt aIterator
TInt aPluginCount

PrintOrderTracesL(CArrayPtrFlat< CGSPluginInterface > *)

voidPrintOrderTracesL(CArrayPtrFlat< CGSPluginInterface > *aPlugins)[private]

Print ordering debug data.

Parameters

CArrayPtrFlat< CGSPluginInterface > * aPlugins

RequestPriority(CActive::TPriority)

IMPORT_C voidRequestPriority(CActive::TPriorityaPriority)

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 aPriorityDesired priority.

RunError(TInt)

TInt RunError(TIntaError)[private, virtual]

See base class.

Parameters

TInt aError

RunL()

voidRunL()[private, virtual]

See base class.

SetObserver(MGSPluginLoadObserver *)

IMPORT_C voidSetObserver(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 voidSortPluginsL(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 > * aPluginsThe 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]