Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <LbsPositionInfo.h>
Link against: lbs.lib
Link against: lbsselflocate.lib

Class HPositionGenericInfo

class HPositionGenericInfo : public TPositionInfo;

Description

Class for getting arbitrary positioning related information back from the location server. The client can set upto KPositionMaxRequestedFields as the number of requested fields. The definitions of the fields are given in the enum _TPositionFieldId. The client must know what data type will be returned for each of the fields. The server will make a best attempt to fill in the requested fields.

The client needs to allocate a big enough buffer to store the information it is requesting. In order to be sure of getting back all the information the client must know and allocate memory considering the return value for each requested field.

Derivation

Members

Defined in HPositionGenericInfo:

Inherited from TPositionClassTypeBase:

Inherited from TPositionInfo:

Inherited from TPositionInfoBase:


Construction and destruction


NewL(TInt,TInt)

IMPORT_C static HPositionGenericInfo* NewL(TInt aBufferSize=KPositionGenericInfoDefaultBufferSize, TInt aMaxFields=KPositionGenericInfoDefaultMaxFields);

Description

Leaving constructor that allocs a HPositionGenericInfo on the heap.

Parameters

TInt aBufferSize

Sets the size of the buffer that the HPositionGenericInfo will have.

TInt aMaxFields

Sets the maximum number of fields that the HPositionGenericInfo will have.

Return value

HPositionGenericInfo *

Pointer to a HPositionGenericInfo instance.


NewLC(TInt,TInt)

IMPORT_C static HPositionGenericInfo* NewLC(TInt aBufferSize=KPositionGenericInfoDefaultBufferSize, TInt aMaxFields=KPositionGenericInfoDefaultMaxFields);

Description

Leaving constructor that allocs a HPositionGenericInfo on the heap and leaves a pointer to the object on the cleanup stack.

Parameters

TInt aBufferSize

Sets the size of the buffer that the HPositionGenericInfo will have.

TInt aMaxFields

Sets the maximum number of fields that the HPositionGenericInfo will have.

Return value

HPositionGenericInfo *

Pointer to a HPositionGenericInfo instance.

[Top]


Member functions


New(TInt,TInt)

IMPORT_C static HPositionGenericInfo* New(TInt aBufferSize=KPositionGenericInfoDefaultBufferSize, TInt aMaxFields=KPositionGenericInfoDefaultMaxFields);

Description

Non-leaving constructor that allocs a HPositionGenericInfo on the heap.

Parameters

TInt aBufferSize

Sets the size of the buffer that the HPositionGenericInfo will have.

TInt aMaxFields

Sets the maximum number of fields that the HPositionGenericInfo will have.

Return value

HPositionGenericInfo *

position information in HPositionGenericInfo structure. NULL if heap allocation failed. Pointer to a HPositionGenericInfo instance if alloc was successful.


ClearRequestedFields()

IMPORT_C void ClearRequestedFields();

Description

Clears all the requested fields.


SetRequestedField(TPositionFieldId)

IMPORT_C TInt SetRequestedField(TPositionFieldId aFieldId);

Description

Method sets a field as requested.

Parameters

TPositionFieldId aFieldId

Field Id to be set as requested.

Return value

TInt

a symbian OS error code. KErrNone if aFieldId was successfully set as requested. KErrArgument if aFieldId is not strictly between EPositionFieldNone and EPositionFieldIdLast. KErrOverflow if KPositionMaxRequestedFields requested fields have already been set.


SetRequestedFields(const TPositionFieldIdList)

IMPORT_C TInt SetRequestedFields(const TPositionFieldIdList aFieldIdList);

Description

Sets multiple TPositionFieldId objects as requested.

Parameters

const TPositionFieldIdList aFieldIdList

List of field Id's to be set as requested. The list is terminated with a EPositionFieldNone entry.

Return value

TInt

a symbian OS error code. KErrNone if all Field Ids were successfully set as requested. KErrArgument if a filed Id is not strictly between EPositionFieldNone and EPositionFieldIdLast. KErrOverflow if > KPositionMaxRequestedFields requested fields are attempted to be set.


IsRequestedField(TPositionFieldId)const

IMPORT_C TInt IsRequestedField(TPositionFieldId aFieldId) const;

Description

Returns whether a field has been set as requested.

Parameters

TPositionFieldId aFieldId

Field Id to search for.

Return value

TInt

If the requested field has been set or not. ETrue if aFieldId has been set as requested. EFalse if aFieldId has not been set as requested.


FirstRequestedFieldId()const

IMPORT_C TPositionFieldId FirstRequestedFieldId() const;

Description

Looks through the list of requested fields for the lowest valued field Id.

Return value

TPositionFieldId

The lowest valued requested field if there are any. EPositionFieldNone if there are no requested fields.


NextRequestedFieldId(TPositionFieldId)const

IMPORT_C TPositionFieldId NextRequestedFieldId(TPositionFieldId aFieldId) const;

Description

Looks for the next field Id in the list greater than aFieldId.

Parameters

TPositionFieldId aFieldId

Function will return next field Id in the list greater than this Id.

Return value

TPositionFieldId

Next field Id in the list greater than aFieldId. EPositionFieldNone if there are no field Id's in the list greater than aFieldId


IsFieldAvailable(TPositionFieldId)const

IMPORT_C TBool IsFieldAvailable(TPositionFieldId aFieldId) const;

Description

Looks through the available fields and returns whether aFieldId is in the list.

Parameters

TPositionFieldId aFieldId

This is the field Id that is searched for.

Return value

TBool

If the requested field is available or not. ETrue if the field is available. EFalse if the field is not available.


ClearPositionData()

IMPORT_C void ClearPositionData();

Description

Resets the object to clear all info to that as it was on construction except the requested fields. Use in the server to clear the info before putting together a new location fix and passing it back to the client.


BufferSize()const

IMPORT_C TInt BufferSize() const;

Description

Method returns the size of the buffer set in the constructor

Return value

TInt

The size of the buffer that was set in the constructor.


MaxFields()const

IMPORT_C TInt MaxFields() const;

Description

Return value

TInt

The maximum field that is requestable/returnable that was set in the constructor.


SetValue(TPositionFieldId,const TType &)

inline TInt SetValue(TPositionFieldId aFieldId, const TType &aValue);

Description

Used to store position information.

Parameters

TPositionFieldId aFieldId

Standard position field identifier. See _TPositionFieldId

const TType &aValue

Return value

TInt

a symbian OS error code. KErrNone on successful operation. KErrPositionBufferOverflow if the data contained in the parameter aValue cannot be added to the class due to the buffer being too small.


GetValue(TPositionFieldId,TType &)const

inline TInt GetValue(TPositionFieldId aFieldId, TType &aValue) const;

Description

Used to retrieve position information.

Parameters

TPositionFieldId aFieldId

Standard position field identifier. See _TPositionFieldId

TType &aValue

Return value

TInt

a symbian OS error code. KErrNone on successful operation. KErrOverflow if the supplied descriptor is too short to contain the requested field. This method must use the same data type as that assigned by HPositionGenericInfo::SetValue(TPositionFieldId,const TType &) .