CPosModules Class Reference

class CPosModules : public CBase

The main interface to location settings.

This class is used for accessing positioning plug-ins attributes using GetModuleInfoL() and accessing and managing priority list of PSYs (see methods ModuleIdListL() and SetModulePriorityL() ). A positioning plug-in (or "module") is referenced by its unique TUid value.

All PSYs are ordered into priority list, which is used by Location Server in fallback situations (when used via RPositioner::Open() without parameters). Note however, that modules with visibility attribute set to 0 are not used in these cases and have no priority assigned. Whenever client attempts to get or set priority of such a module, the appropriate methods leave with KErrNotFound. Module must be set visible before its priority can be retrieved or modified, see CPosModuleUpdate::SetUpdateVisibility() .

A client can also listen for changes in location settings by setting an observer via SetObserverL().

Inherits from

Constructor & Destructor Documentation

CPosModules()

CPosModules()[private]

CPosModules(const CPosModules &)

CPosModules(const CPosModules &)[private]

Parameters

const CPosModules &

~CPosModules()

IMPORT_C~CPosModules()[virtual]
Destructor.
panic
LocationSettings EPosLocSetPanicObserverNotStopped If observer is not unset by calling RemoveObserver().
SetObserverL() RemoveObserver()

Member Functions Documentation

ConstructL()

voidConstructL()[private]

Second phase constructor

GetModuleInfoL(TPositionModuleId, TPositionModuleInfoBase &)

IMPORT_C voidGetModuleInfoL(TPositionModuleIdaModuleId,
TPositionModuleInfoBase &aInfo
)

Retrieves the attributes of a module.

If the supplied position module info class is not supported, this method will leave with code KErrNotSupported. Currently only TPositionModuleInfo is supported.

leave
KErrNotSupported Not supported module info class object is is supplied as parameter.
leave
KErrNotFound No module with given ID is installed.

Parameters

TPositionModuleId aModuleId[in] The ID of the module to retrieve information for.
TPositionModuleInfoBase & aInfo[out] On return contains the module information.

IsModuleInstalled(TPositionModuleId)

IMPORT_C TBoolIsModuleInstalled(TPositionModuleIdaModuleId)

Verifies if a module is installed in the system.

Parameters

TPositionModuleId aModuleIdThe ID of the module to check for existence

IsModuleVisibleL(TPositionModuleId)

IMPORT_C TBoolIsModuleVisibleL(TPositionModuleIdaModuleId)

Returns visibility attribute of a module.

leave
KErrNotFound No module with given ID is found in the system.
IsModuleInstalledL()

Parameters

TPositionModuleId aModuleIdThe ID of the module, which visibility attribute is to be checked.

ModuleIdListL()

IMPORT_C CPosModuleIdList *ModuleIdListL()

Retrieves a list of the existing modules in priority order. Client takes ownership of returned object.

Modules marked as invisible are not included in this list.

ModuleIdListLC()

ModuleIdListLC()

IMPORT_C CPosModuleIdList *ModuleIdListLC()

Retrieves a list of the existing modules in priority order and leaves it in cleanup stack. Client takes ownership of returned object.

Modules marked as invisible are not included in this list.

ModuleIdListL()

OpenL()

IMPORT_C CPosModules *OpenL()[static]

Two-phased constructor.

PriorityL(TPositionModuleId)

IMPORT_C TIntPriorityL(TPositionModuleIdaModuleId)

Retrieves the priority of a positioning module. 0 is the highest priority.

Note that modules with visibility attribute set to 0 have no priority.

leave
KErrNotFound No module with specified ID is found in priority list.

Parameters

TPositionModuleId aModuleIdThe ID of the module to retrieve priority for.

RemoveObserver()

IMPORT_C voidRemoveObserver()

Unsets change events observer and stops notifications. SetObserverL()

SetModulePrioritiesL(const CPosModuleIdList &)

IMPORT_C voidSetModulePrioritiesL(const CPosModuleIdList &aModuleIdList)

Changes the priority of modules. The modules priorities will be set to reflect the module order in the list.

leave
KErrLocked Several clients are accessing location settings simultaneously.
leave
KErrArgument Module ID list is missing some module IDs or has module IDs not found in the system.

Parameters

const CPosModuleIdList & aModuleIdList[in] The module list including the new priority order List must have the same set of module IDs as would be returned by ModuleIdListL().

SetModulePriorityL(TPositionModuleId, TInt)

IMPORT_C voidSetModulePriorityL(TPositionModuleIdaModuleId,
TIntaNewPriority
)

Changes the priority of a module. The priority of the other modules will be shifted so that each module has a unique priority between 0 and number of modules - 1. 0 is the highest priority.

Note that modules with visibility attribute set to 0 have no priority.

leave
KErrLocked Several clients are accessing location settings simultaneously.
leave
KErrNotFound No module with specified ID is found in priority list.
leave
KErrArgument Priority value is out of bounds.

Parameters

TPositionModuleId aModuleIdThe ID of the module to set priority for.
TInt aNewPriorityThe new priority for the module. Priority must be a number between 0 and number of modules - 1.

SetModulePriorityL(TInt, TInt)

IMPORT_C voidSetModulePriorityL(TIntaOldPriority,
TIntaNewPriority
)

Changes the priority of a module. The priority of the other modules will be shifted so that each module has a unique priority between 0 and number of modules - 1. 0 is the highest priority.

leave
KErrLocked Several clients are accessing location settings simultaneously.
leave
KErrArgument Priority value is out of bounds.

Parameters

TInt aOldPriorityThe module's old priority. Priority must be a number between 0 and number of modules - 1.
TInt aNewPriorityThe new priority for the module. Priority must be a number between 0 and number of modules - 1.

SetObserverL(MPosModulesObserver &)

IMPORT_C voidSetObserverL(MPosModulesObserver &aObserver)

Sets listener for location settings changes.

Listening can be stopped by calling RemoveObserver() .

leave
KErrNoMemory No memory available to install observer.
panic
LocationSettings EPosLocSetPanicObserverIsAlreadySet If observer is already set.
RemoveObserver()

Parameters

MPosModulesObserver & aObserver[in] The observing object.

UpdateModuleL(TPositionModuleId, const CPosModuleUpdate &)

IMPORT_C voidUpdateModuleL(TPositionModuleIdaModuleId,
const CPosModuleUpdate &aUpdate
)

Updates changeable attributes of a positioning module.

leave
KErrLocked Several clients are accessing location settings simultaneously.
leave
KErrNotFound No module with given ID is installed.

Parameters

TPositionModuleId aModuleId[in] The ID of the module, which attributes are going to be updated.
const CPosModuleUpdate & aUpdate[in] The attributes to update.

operator=(const CPosModules &)

CPosModules &operator=(const CPosModules &)[private]

Parameters

const CPosModules &

Member Data Documentation

CPosModulesEngine * iEngine

CPosModulesEngine *iEngine[private]