HPositionGenericInfo Class Reference

#include <lbspositioninfo.h>

Link against: lbs.lib

class HPositionGenericInfo : public TPositionInfo
Public Member Functions
IMPORT_C TIntBufferSize()
IMPORT_C voidClearPositionData()
IMPORT_C voidClearRequestedFields()
IMPORT_C TPositionFieldIdFirstRequestedFieldId()
TInt GetValue(TPositionFieldId, TType &)
IMPORT_C TBoolIsFieldAvailable(TPositionFieldId)
IMPORT_C TIntIsRequestedField(TPositionFieldId)
IMPORT_C TIntMaxFields()
IMPORT_C HPositionGenericInfo *New(TInt, TInt)
IMPORT_C HPositionGenericInfo *NewL(TInt, TInt)
IMPORT_C HPositionGenericInfo *NewLC(TInt, TInt)
IMPORT_C TPositionFieldIdNextRequestedFieldId(TPositionFieldId)
IMPORT_C TIntSetRequestedField(TPositionFieldId)
IMPORT_C TIntSetRequestedFields(const TPositionFieldIdList)
TInt SetValue(TPositionFieldId, const TType &)
Inherited Attributes
TPositionClassTypeBase::iPosClassSize
TPositionClassTypeBase::iPosClassType
TPositionInfo::iPosition
TPositionInfoBase::iModuleId
TPositionInfoBase::iPositionMode
TPositionInfoBase::iPositionModeReason
TPositionInfoBase::iUpdateType
Inherited Functions
TPositionClassTypeBase::PositionClassSize()const
TPositionClassTypeBase::PositionClassType()const
TPositionClassTypeBase::TPositionClassTypeBase()
TPositionInfo::GetPosition(TPosition &)const
TPositionInfo::SetPosition(const TPosition &)
TPositionInfo::TPositionInfo()
TPositionInfoBase::ModuleId()const
TPositionInfoBase::PositionMode()const
TPositionInfoBase::PositionModeReason()const
TPositionInfoBase::SetModuleId(TPositionModuleId)
TPositionInfoBase::SetPositionMode(TPositionModuleInfo::TTechnologyType)
TPositionInfoBase::SetPositionModeReason(TPositionModeReason)
TPositionInfoBase::SetUpdateType(TPositionUpdateType)
TPositionInfoBase::TPositionInfoBase()
TPositionInfoBase::UpdateType()const

Detailed 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.

Member Function Documentation

BufferSize ( )

IMPORT_C TIntBufferSize()const

Method returns the size of the buffer set in the constructor

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

ClearPositionData ( )

IMPORT_C voidClearPositionData()

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.

ClearRequestedFields ( )

IMPORT_C voidClearRequestedFields()

Clears all the requested fields.

FirstRequestedFieldId ( )

IMPORT_C TPositionFieldIdFirstRequestedFieldId()const

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

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

GetValue ( TPositionFieldId, TType & )

TInt GetValue(TPositionFieldIdaFieldId,
TType &aValue
)const [inline]

Used to retrieve position information.

Parameters
aFieldIdStandard position field identifier. See _TPositionFieldId
aValueThe parameter aValue can be of the type TInt8, TInt16, TInt32, TInt64, TUint8, TUint16, TUint32, TReal32, TReal64, TTime, TTimeIntervalMicroSeconds, Des8, or Des16. Panics with EPositionGenericInfoMismatchDataType if there is a mismatch in the data type of a field.
Return Value
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 SetValue() .

IsFieldAvailable ( TPositionFieldId )

IMPORT_C TBoolIsFieldAvailable(TPositionFieldIdaFieldId)const

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

Parameters
aFieldIdThis is the field Id that is searched for.
Return Value
If the requested field is available or not. ETrue if the field is available. EFalse if the field is not available.

IsRequestedField ( TPositionFieldId )

IMPORT_C TIntIsRequestedField(TPositionFieldIdaFieldId)const

Returns whether a field has been set as requested.

Parameters
aFieldIdField Id to search for.
Return Value
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.

MaxFields ( )

IMPORT_C TIntMaxFields()const

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

New ( TInt, TInt )

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

Parameters
aBufferSizeSets the size of the buffer that the HPositionGenericInfo will have.
aMaxFieldsSets the maximum number of fields that the HPositionGenericInfo will have.
Return Value
position information in HPositionGenericInfo structure. NULL if heap allocation failed. Pointer to a HPositionGenericInfo instance if alloc was successful.

NewL ( TInt, TInt )

Leaving constructor that allocs a HPositionGenericInfo on the heap.

Parameters
aBufferSizeSets the size of the buffer that the HPositionGenericInfo will have.
aMaxFieldsSets the maximum number of fields that the HPositionGenericInfo will have.
Return Value
Pointer to a HPositionGenericInfo instance.

NewLC ( TInt, TInt )

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

Parameters
aBufferSizeSets the size of the buffer that the HPositionGenericInfo will have.
aMaxFieldsSets the maximum number of fields that the HPositionGenericInfo will have.
Return Value
Pointer to a HPositionGenericInfo instance.

NextRequestedFieldId ( TPositionFieldId )

IMPORT_C TPositionFieldIdNextRequestedFieldId(TPositionFieldIdaFieldId)const

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

Parameters
aFieldIdFunction will return next field Id in the list greater than this Id.
Return Value
Next field Id in the list greater than aFieldId. EPositionFieldNone if there are no field Id's in the list greater than aFieldId

SetRequestedField ( TPositionFieldId )

IMPORT_C TIntSetRequestedField(TPositionFieldIdaFieldId)

Method sets a field as requested.

Parameters
aFieldIdField Id to be set as requested.
Return Value
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 TIntSetRequestedFields(const TPositionFieldIdListaFieldIdList)

Sets multiple TPositionFieldId objects as requested.

Parameters
aFieldIdListList of field Id's to be set as requested. The list is terminated with a EPositionFieldNone entry.
Return Value
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.

SetValue ( TPositionFieldId, const TType & )

TInt SetValue(TPositionFieldIdaFieldId,
const TType &aValue
)[inline]

Used to store position information.

Parameters
aFieldIdStandard position field identifier. See _TPositionFieldId
aValueThe parameter aValue can be of the type TInt8, TInt16, TInt32, TInt64, TUint8, TUint16, TUint32, TReal32, TReal64, TTime, TTimeIntervalMicroSeconds, Des8, or Des16.
Return Value
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.