williamr@2: /* williamr@2: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * Name : LbsFields.h williamr@2: * Part of : Mobile Location Framework/Location FW williamr@2: * Interface : Location Acquisition API williamr@2: * Position data Fields manager williamr@2: * Version : williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: #ifndef __LBSFIELDS_H__ williamr@2: #define __LBSFIELDS_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: /* williamr@2: * This header file defines the helper classes used by HPositionGenericInfo williamr@2: * The client should not use this class to access any positioning related information. williamr@2: * Instead the cleitn should use the methods provided by HGenericPositionInfo. williamr@2: */ williamr@2: williamr@2: /** williamr@2: * Standard position field identifiers. It takes one of the enumerated values of _TPositionFieldId williamr@2: * @publishedAll williamr@2: * @released williamr@2: */ williamr@2: typedef TUint16 TPositionFieldId; williamr@2: williamr@2: /** williamr@2: * Array of standard position field identifiers williamr@2: * @publishedAll williamr@2: * @released williamr@2: */ williamr@2: typedef TPositionFieldId TPositionFieldIdList[]; williamr@2: class HPositionGenericInfo; williamr@2: williamr@2: williamr@2: /** williamr@2: * This is an internal class to provide the interface for the williamr@2: * HPositionGenericInfo::GetValue() and HPositionGenericInfo::SetValue() williamr@2: * methods. Methods in this class are not intended to be called directly. williamr@2: * Clients should use HPositionGenericInfo::GetValue() and williamr@2: * HPositionGenericInfo::SetValue() methods. williamr@4: * @publishedAll williamr@2: * @released williamr@2: */ williamr@2: class PositionFieldManager williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Supported data types williamr@2: */ williamr@2: enum TFieldType williamr@2: { williamr@2: /// Undefined data type. This value should not be used. williamr@2: EUndefined, williamr@2: /// TInt8 datatype williamr@2: ETInt8, williamr@2: /// TInt16 datatype williamr@2: ETInt16, williamr@2: /// TInt32 datatype williamr@2: ETInt32, williamr@2: /// TInt64 datatype williamr@2: ETInt64, williamr@2: /// TUint8 datatype williamr@2: ETUint8, williamr@2: /// TUint16 datatype williamr@2: ETUint16, williamr@2: /// TUint32 datatype williamr@2: ETUint32, williamr@2: /// TReal32 datatype williamr@2: ETReal32, williamr@2: /// TReal64 datatype williamr@2: ETReal64, williamr@2: /// TTime datatype williamr@2: ETTime, williamr@2: /// Time specified in microseconds williamr@2: ETTimeIntervalMicroSeconds, williamr@2: /// 8-bit descriptor datatype williamr@2: ETDesC8, williamr@2: /// 16-bit descriptor datatype williamr@2: ETDesC16 williamr@2: }; williamr@2: williamr@2: friend class HPositionGenericInfo; williamr@2: private: williamr@2: /** williamr@2: * Set the value for a location field of data type TInt8 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: TInt8 aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TInt8 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@4: * @param [in] aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TInt8& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TInt16 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: TInt16 aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TInt16 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [in] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TInt16& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TInt32 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: TInt32 aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TInt32 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TInt32& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TInt64 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: const TInt64& aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TInt64 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TInt64& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TUint8 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: TUint8 aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TUint8 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TUint8& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TUint16 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: TUint16 aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TUint16 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TUint16& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TUint32 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: TUint32 aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TUint32 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TUint32& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TReal32 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: TReal32 aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TReal32 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TReal32& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TReal64 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: const TReal64& aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TReal64 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TReal64& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TDesC8 & TDes8 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: const TDesC8& aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TDes8 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TDes8& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TDesC16 & TDes16 in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: const TDesC16& aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TDes16 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TDes16& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TPtrC8 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TPtrC8& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TPtrC16 from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TPtrC16& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TTime in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: const TTime& aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TTime from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TTime& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Set the value for a location field of data type TTimeIntervalMicroSeconds in the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. williamr@2: * @param aValue Value to be copied into the HPositionGenericInfo. williamr@2: * @param aInfo The HPositionGenericInfo object where this field needs to williamr@2: * be added. williamr@2: * @return KErrArgument if aFieldId is EPositionFieldNone. williamr@2: * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo williamr@2: * object. williamr@2: * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the williamr@2: * HPositionGenericInfo object. williamr@2: * @return KErrNone if the SetValue was successful. williamr@2: */ williamr@2: IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, williamr@2: const TTimeIntervalMicroSeconds& aValue, williamr@2: HPositionGenericInfo& aInfo); williamr@2: williamr@2: /** williamr@2: * Get the value for a location field of data type TTimeIntervalMicroSeconds from the williamr@2: * HPositionGenericInfo. williamr@2: * @param aFieldId Id of the field for which the value should be read from williamr@2: * HPositionGenericInfo. williamr@4: * @param [out] aValue The object where the data from the williamr@2: * HPositionGenericInfo is returned. williamr@2: * @param aInfo The HPositionGenericInfo object from where this field needs williamr@2: * to be read. williamr@2: * @return KErrNone is the operation was successful. williamr@2: * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. williamr@2: */ williamr@2: IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, williamr@2: TTimeIntervalMicroSeconds& aValue, williamr@2: const HPositionGenericInfo& aInfo); williamr@2: }; williamr@2: williamr@4: williamr@4: #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS williamr@2: /** williamr@2: * This is an internal class used for indexing entries in HPositionGenericInfo. williamr@2: * Methods in this class are not intended to be called directly. Clients should use williamr@2: * HPositionGenericInfo::GetValue() and HPositionGenericInfo::SetValue() methods. williamr@2: * @internalTechnology williamr@2: * @released williamr@2: */ williamr@2: class TPositionFieldIndex williamr@2: { williamr@2: public: williamr@2: /** Constructor */ williamr@2: inline TPositionFieldIndex(); williamr@2: williamr@2: /** williamr@2: * Get the field ID referred to by this object. williamr@2: * @return The Field Id. The Id is one of the enumerated values of williamr@2: * #_TPositionFieldId. williamr@2: */ williamr@2: inline TPositionFieldId FieldId() const; williamr@2: /** williamr@2: * Get the offset in buffer where this field is contained. williamr@2: * @return The offset in the buffer. williamr@2: */ williamr@2: inline TUint16 FieldStartPos() const; williamr@2: /** williamr@2: * Get the data type of this field. williamr@2: * @return The data type of this field. The data type is one of the williamr@2: * enumerated values of PositionFieldManager::TFieldType. williamr@2: */ williamr@2: inline PositionFieldManager::TFieldType FieldType() const; williamr@2: /** williamr@2: * Set the field ID referred to by this object. williamr@2: * @param aFieldId The Id of the field referred by this object. The Id is williamr@2: * one of the enumerated values of #_TPositionFieldId. williamr@2: */ williamr@2: inline void SetFieldId(TPositionFieldId aFieldId); williamr@2: /** williamr@2: * Set the offset in buffer where this field is contained. williamr@2: * @param aFieldStartPos The offset in the buffer where this field is added. williamr@2: */ williamr@2: inline void SetFieldStartPos(TUint16 aFieldStartPos); williamr@2: /** williamr@2: * Set the data type of this field. williamr@2: * @param aFieldType The data type of this field. The data type is one of williamr@2: * the enumerated values of PositionFieldManager::TFieldType. williamr@2: */ williamr@2: inline void SetFieldType(PositionFieldManager::TFieldType aFieldType); williamr@2: williamr@2: private: williamr@2: /** Id of the field that this index refers to. */ williamr@2: TPositionFieldId iFieldId; williamr@2: /** Offset from HPositionGenericInfo::iBuffer that the object referred to by williamr@2: this index starts at. */ williamr@2: TUint16 iFieldStartPos; williamr@2: /** Type of the data that this index refers to. */ williamr@2: PositionFieldManager::TFieldType iFieldType; williamr@2: }; williamr@4: #endif // SYMBIAN_ENABLE_SPLIT_HEADERS williamr@2: williamr@2: #endif //__LBSFIELDS_H__