HPositionGenericInfo Class Reference

API published in: S60 2nd Ed FP 2

Link against: lbs.lib

Capability Information

Required Capabilities

None

Exceptions

The capability Location is required in:

TInt RPositionServer::GetDefaultModuleId(TPositionModuleId& aModuleId) const;

TInt RPositionServer::GetNumModules(TUint& aNumModules) const;

TInt RPositionServer::GetModuleInfoByIndex(TInt aModuleIndex, TPositionModuleInfoBase& aModuleInfo) const;

TInt RPositionServer::GetModuleInfoById(TPositionModuleId aModuleId, TPositionModuleInfoBase& aModuleInfo) const;

TInt RPositionServer::GetModuleStatus(TPositionModuleStatusBase& aPosModuleStatus, TPositionModuleId aModuleId) const;

void RPositionServer::NotifyModuleStatusEvent(TPositionModuleStatusEventBase& aStatusEvent,TRequestStatus& aStatus,const TPositionModuleId aModuleId = KPositionNullModuleId) const;

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

TInt RPositioner::SetRequestor(const RRequestorStack& aRequestorStack);

TInt RPositioner::SetUpdateOptions(const TPositionUpdateOptionsBase& aPosOption);

TInt RPositioner::GetUpdateOptions(TPositionUpdateOptionsBase& aPosOption) const;

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

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


#include <lbspositioninfo.h>

Inherits TPositionInfo.


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.


Public Member Functions

IMPORT_C void  ClearRequestedFields ()
  Clears all the requested fields.
IMPORT_C TInt  SetRequestedField (TPositionFieldId aFieldId)
  Method sets a field as requested.
IMPORT_C TInt  SetRequestedFields (const TPositionFieldIdList aFieldIdList)
  Sets multiple TPositionFieldId objects as requested.
IMPORT_C TInt  IsRequestedField (TPositionFieldId aFieldId) const
  Returns whether a field has been set as requested.
IMPORT_C TPositionFieldId  FirstRequestedFieldId () const
  Looks through the list of requested fields for the lowest valued field Id.
IMPORT_C TPositionFieldId  NextRequestedFieldId (TPositionFieldId aFieldId) const
  Looks for the next field Id in the list greater than aFieldId.
IMPORT_C TBool  IsFieldAvailable (TPositionFieldId aFieldId) const
  Looks through the available fields and returns whether aFieldId is in the list.
IMPORT_C void  ClearPositionData ()
  Resets the object to clear all info to that as it was on construction except the requested fields.
IMPORT_C TInt  BufferSize () const
  Method returns the size of the buffer set in the constructor.
IMPORT_C TInt  MaxFields () const
template<class TType>
TInt  SetValue (TPositionFieldId aFieldId, const TType &aValue)
  Used to store position information.
template<class TType>
TInt  GetValue (TPositionFieldId aFieldId, TType &aValue) const
  Used to retrieve position information.

Static Public Member Functions

static IMPORT_C HPositionGenericInfo New (TInt aBufferSize=KPositionGenericInfoDefaultBufferSize, TInt aMaxFields=KPositionGenericInfoDefaultMaxFields)
  Non-leaving constructor that allocs a HPositionGenericInfo on the heap.
static IMPORT_C HPositionGenericInfo NewL (TInt aBufferSize=KPositionGenericInfoDefaultBufferSize, TInt aMaxFields=KPositionGenericInfoDefaultMaxFields)
  Leaving constructor that allocs a HPositionGenericInfo on the heap.
static IMPORT_C HPositionGenericInfo NewLC (TInt aBufferSize=KPositionGenericInfoDefaultBufferSize, TInt aMaxFields=KPositionGenericInfoDefaultMaxFields)
  Leaving constructor that allocs a HPositionGenericInfo on the heap and leaves a pointer to the object on the cleanup stack.

Friends

class  TPositionFieldSetter
class  TPositionFieldGetter

Member Function Documentation

IMPORT_C TInt HPositionGenericInfo::BufferSize  )  const
 

Method returns the size of the buffer set in the constructor.

Returns:
The size of the buffer that was set in the constructor.
IMPORT_C void HPositionGenericInfo::ClearPositionData  ) 
 

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.

IMPORT_C void HPositionGenericInfo::ClearRequestedFields  ) 
 

Clears all the requested fields.

IMPORT_C TPositionFieldId HPositionGenericInfo::FirstRequestedFieldId  )  const
 

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

Returns:
The lowest valued requested field if there are any.

EPositionFieldNone if there are no requested fields.

template<class TType>
TInt HPositionGenericInfo::GetValue TPositionFieldId  aFieldId,
TType &  aValue
const [inline]
 

Used to retrieve position information.

Parameters:
aFieldId  Standard position field identifier. See _TPositionFieldId
[out]  aValue  The 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.
Returns:
a symbian OS error code.

KErrNone on successful operation.

KErrOverflow if the supplied descriptor is too short to contain the requested field.

Note:
This method must use the same data type as that assigned by SetValue().
IMPORT_C TBool HPositionGenericInfo::IsFieldAvailable TPositionFieldId  aFieldId  )  const
 

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

Parameters:
aFieldId  This is the field Id that is searched for.
Returns:
If the requested field is available or not.

ETrue if the field is available.

EFalse if the field is not available.

IMPORT_C TInt HPositionGenericInfo::IsRequestedField TPositionFieldId  aFieldId  )  const
 

Returns whether a field has been set as requested.

Parameters:
aFieldId  Field Id to search for.
Returns:
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.

IMPORT_C TInt HPositionGenericInfo::MaxFields  )  const
 
Returns:
The maximum field that is requestable/returnable that was set in the constructor.
static IMPORT_C HPositionGenericInfo* HPositionGenericInfo::New TInt  aBufferSize = KPositionGenericInfoDefaultBufferSize,
TInt  aMaxFields = KPositionGenericInfoDefaultMaxFields
[static]
 

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

Parameters:
aBufferSize  Sets the size of the buffer that the HPositionGenericInfo will have.
aMaxFields  Sets the maximum number of fields that the HPositionGenericInfo will have.
Returns:
position information in HPositionGenericInfo structure.

NULL if heap allocation failed.

Pointer to a HPositionGenericInfo instance if alloc was successful.

static IMPORT_C HPositionGenericInfo* HPositionGenericInfo::NewL TInt  aBufferSize = KPositionGenericInfoDefaultBufferSize,
TInt  aMaxFields = KPositionGenericInfoDefaultMaxFields
[static]
 

Leaving constructor that allocs a HPositionGenericInfo on the heap.

Parameters:
aBufferSize  Sets the size of the buffer that the HPositionGenericInfo will have.
aMaxFields  Sets the maximum number of fields that the HPositionGenericInfo will have.
Returns:
Pointer to a HPositionGenericInfo instance.
static IMPORT_C HPositionGenericInfo* HPositionGenericInfo::NewLC TInt  aBufferSize = KPositionGenericInfoDefaultBufferSize,
TInt  aMaxFields = KPositionGenericInfoDefaultMaxFields
[static]
 

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

Parameters:
aBufferSize  Sets the size of the buffer that the HPositionGenericInfo will have.
aMaxFields  Sets the maximum number of fields that the HPositionGenericInfo will have.
Returns:
Pointer to a HPositionGenericInfo instance.
IMPORT_C TPositionFieldId HPositionGenericInfo::NextRequestedFieldId TPositionFieldId  aFieldId  )  const
 

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

Parameters:
aFieldId  Function will return next field Id in the list greater than this Id.
Returns:
Next field Id in the list greater than aFieldId.

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

IMPORT_C TInt HPositionGenericInfo::SetRequestedField TPositionFieldId  aFieldId  ) 
 

Method sets a field as requested.

Parameters:
aFieldId  Field Id to be set as requested.
Returns:
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.

IMPORT_C TInt HPositionGenericInfo::SetRequestedFields const TPositionFieldIdList  aFieldIdList  ) 
 

Sets multiple TPositionFieldId objects as requested.

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

template<class TType>
TInt HPositionGenericInfo::SetValue TPositionFieldId  aFieldId,
const TType &  aValue
[inline]
 

Used to store position information.

Parameters:
aFieldId  Standard position field identifier. See _TPositionFieldId
[in]  aValue  The parameter aValue can be of the type TInt8, TInt16, TInt32, TInt64, TUint8, TUint16, TUint32, TReal32, TReal64, TTime, TTimeIntervalMicroSeconds, Des8, or Des16.
Returns:
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.


Friends And Related Function Documentation

friend class TPositionFieldGetter [friend]
 
friend class TPositionFieldSetter [friend]
 

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top