Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: Lbs.h
Link against: lbsselflocate.lib

Class RPositioner

class RPositioner : public RPositionerSubSessionBase;

Description

This class is used to create a sub-session with the server for the purpose of obtaining the current position. In addition to actually obtaining position information, this class also provides mechanisms for obtaining the last known position, the general status of the positioning module, changing how often it wishes to receive position updates, as well as identifying itself to the location framework.

Before using the class, a primary connection must have already been established with the server.

Derivation

Members

Defined in RPositioner:
Close(), ConstructL(), Destruct(), ExtendedInterface(), GetLastKnownPosition(), GetUpdateOptions(), NotifyPositionUpdate(), Open(), Open(), Open(), RPositioner(), SetRequestor(), SetRequestor(), SetUpdateOptions()

Inherited from RPositionerSubSessionBase:
CancelRequest()

Inherited from RSubSessionBase:
CloseSubSession(), CreateAutoCloseSubSession(), CreateSubSession(), Send(), SendReceive(), Session(), SubSessionHandle()

See also:


Construction and destruction


RPositioner()

IMPORT_C RPositioner();

Description

Constructor for RPositioner


ConstructL()

protected: virtual IMPORT_C void ConstructL();

Description

Leaving constructor for RPositioner. Just creates the ptr-holder.

[Top]


Member functions


Open()

IMPORT_C TInt Open(RPositionServer &aPosServer);

Description

Creates a sub-session with the positioning server.

Parameters

RPositionServer &aPosServer

is a connected session with the positioning server.

Return value

TInt

Standard Symbian OS error code.


Open()

IMPORT_C TInt Open(RPositionServer &aPosServer, TPositionModuleId aModuleId);

Description

Creates a sub-session with the positioning server.

Parameters

RPositionServer &aPosServer

is a connected session with the positioning server.

TPositionModuleId aModuleId

is the module ID for this sub-session to use to obtain location data.

Return value

TInt

Standard Symbian OS error code.


Open()

IMPORT_C TInt Open(RPositionServer &aPosServer, const TPositionCriteriaBase &aCriteria);

Description

Creates a sub-session with the positioning server.

Parameters

RPositionServer &aPosServer

is a connected session with the positioning server.

const TPositionCriteriaBase &aCriteria

is the criteria that the server must use to choose an appropriate PSY for this sub-session.

Return value

TInt

Standard Symbian OS error code.


Close()

IMPORT_C void Close();

Description

Closes a sub-session with the positioning server.


SetRequestor()

IMPORT_C TInt SetRequestor(CRequestor::TRequestorType aType, CRequestor::TRequestorFormat aFormat, const TDesC &aData);

Description

Sets the requestor of the location information that will be obtained through this sub-session.

Parameters

CRequestor::TRequestorType aType

identifies the type of requestor, a service or a contact.

CRequestor::TRequestorFormat aFormat

determines the type of data held in aData

const TDesC &aData

is requestor data. Can be a telephone number, a URL etc.

Return value

TInt

Standard Symbian OS error code.


SetRequestor()

IMPORT_C TInt SetRequestor(const RRequestorStack &aRequestorStack);

Description

Sets the many requestors of the location information that will be obtained through this sub-session.

Parameters

const RRequestorStack &aRequestorStack

is a collection of CRequestor objects.

Return value

TInt

Standard Symbian OS error code.


SetUpdateOptions()

IMPORT_C TInt SetUpdateOptions(const TPositionUpdateOptionsBase &aPosOption);

Description

This method can be used to modify the behaviour of NotifyPositionUpdate() requests. It enables the client to request an interval time for receiving position updates.

Parameters

const TPositionUpdateOptionsBase &aPosOption

contains the clients requested options for receiving location updates.

Return value

TInt

Standard Symbian OS error code.


GetUpdateOptions()

IMPORT_C TInt GetUpdateOptions(TPositionUpdateOptionsBase &aPosOption) const;

Description

This method retrieves the current update options being used by this RPositioner sub-session.

Parameters

TPositionUpdateOptionsBase &aPosOption

contains, upon successful completion, the set of update options for NotifyPositionUpdate() that are currently in use.

Return value

TInt

Standard Symbian OS error code.


GetLastKnownPosition()

IMPORT_C void GetLastKnownPosition(TPositionInfoBase &aPosInfo, TRequestStatus &aStatus) const;

Description

This method returns cached position information if it is available. This method can be an efficient mechanism - in terms of speed, cost and power consumption - of obtaining the devices' recent position.

Parameters

TPositionInfoBase &aPosInfo

will be set, upon successful completion, to the most recently determined location data.

TRequestStatus &aStatus

returns the result code after the asynchronous call completes


NotifyPositionUpdate()

IMPORT_C void NotifyPositionUpdate(TPositionInfoBase &aPosInfo, TRequestStatus &aStatus) const;

Description

This is an asynchronous method for obtaining position updates. It is possible to pass any class that is derived from TPositionInfoBase. However, the standard data retrieval class is TPositionInfo.

On successful return, aStatus will hold KErrNone. However, if the returned position information does not meet the aplication's quality criteria, aStatus will hold KPositionQualityLoss.

If the application has selected the use of partial updates, aStatus will hold KPositionPartialUpdate when the position information is incomplete or does not meet the required accuracy.

When the request has been completed early via the use of CompleteRequest(), aStatus will contain KPositionEarlyComplete.

aStatus may also return other error codes defined in LBSErrors.h, or other non-Symbian OS defined status codes returned for example, by 3rd party A-GPS or Network Protocol modules

Parameters

TPositionInfoBase &aPosInfo

will hold, on successful completion, information on the devices' current position.

TRequestStatus &aStatus

returns the result code after the asynchronous call completes


Destruct()

protected: virtual IMPORT_C void Destruct();

Description

Destruction method for RPositionServer. Just deletes the ptr-holder.


ExtendedInterface()

protected: virtual IMPORT_C TAny *ExtendedInterface(TInt aFunctionNumber, TAny *aPtr1, TAny *aPtr2);

Description

This method is used to allow polymorphic extensions to the API without breaking BC. See documentation for explanation.

Parameters

TInt aFunctionNumber

contains the Id of the function to be invoked.

TAny *aPtr1

a pointer to any data

TAny *aPtr2

a pointer to any data.

Return value

TAny *

TAny* a pointer to any function