lbspositioninfo.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : LbsPositionInfo.h
00004 *  Part of     : Location Framework/Location FW
00005 *  Interface   : Location Acquisition API
00006 *  Description : Position Info classes
00007 *  Version     : %version: 3 %
00008 *
00009 *  Copyright (c) 2002-2006 Nokia Corporation.
00010 *  This material, including documentation and any related
00011 *  computer programs, is protected by copyright controlled by
00012 *  Nokia Corporation. All rights are reserved. Copying,
00013 *  including reproducing, storing, adapting or translating, any
00014 *  or all of this material requires the prior written consent of
00015 *  Nokia Corporation. This material also contains confidential
00016 *  information which may not be disclosed to others without the
00017 *  prior written consent of Nokia Corporation.
00018 * ==============================================================================
00019 */
00020 
00021 #ifndef __LBSPOSITIONINFO_H__
00022 #define __LBSPOSITIONINFO_H__
00023 
00024 #include <LbsPosition.h>
00025 #include <LbsCommon.h>
00026 #include <LbsFields.h>
00027 
00037 const TInt KPositionGenericInfoDefaultBufferSize = 1024;
00042 const TInt KPositionGenericInfoDefaultMaxFields = 32;
00046 enum _TPositionUpdateType
00047         {
00048         EPositionUpdateUnknown = 0,
00049         EPositionUpdateGeneral = 0x01
00050         };
00051 
00057 typedef TUint32 TPositionUpdateType;
00058 
00059 
00068 class TPositionInfoBase : public TPositionClassTypeBase
00069         {
00070 public:
00075         IMPORT_C TPositionModuleId ModuleId() const;
00076 
00083         IMPORT_C void SetModuleId(TPositionModuleId aModuleId);
00084 
00089         IMPORT_C TPositionUpdateType UpdateType() const;
00090 
00097         IMPORT_C void SetUpdateType(TPositionUpdateType aUpdateType);
00098 
00099 protected:
00103         IMPORT_C TPositionInfoBase();
00104 
00105 protected:
00107         TPositionModuleId iModuleId;
00109         TUint32 iUpdateType;
00110 
00111 private:
00113         TUint8 iReserved[16];
00114         };
00115 
00116 
00120 class TPositionInfo : public TPositionInfoBase
00121         {
00122 public:
00126         IMPORT_C TPositionInfo();
00127 
00132         IMPORT_C void GetPosition(TPosition& aPosition) const;
00133 
00140         IMPORT_C void SetPosition(const TPosition& aPosition);
00141 
00142 protected:
00144         TPosition iPosition;
00145         };
00146 
00147 
00151 class TPositionCourseInfo : public TPositionInfo
00152         {
00153 public:
00157         IMPORT_C TPositionCourseInfo();
00158 
00163         IMPORT_C void GetCourse(TCourse& aCourse) const;
00164 
00171         IMPORT_C void SetCourse(const TCourse& aCourse);
00172 
00173 protected:
00175         TCourse iCourse;
00176         };
00177 
00178 
00190 class HPositionGenericInfo : public TPositionInfo
00191         {
00192 public:
00193 
00202         IMPORT_C static HPositionGenericInfo* New(TInt aBufferSize = KPositionGenericInfoDefaultBufferSize,
00203                                                                                           TInt aMaxFields = KPositionGenericInfoDefaultMaxFields);
00204 
00211         IMPORT_C static HPositionGenericInfo* NewL(TInt aBufferSize = KPositionGenericInfoDefaultBufferSize,
00212                                                                                            TInt aMaxFields = KPositionGenericInfoDefaultMaxFields);
00213 
00221         IMPORT_C static HPositionGenericInfo* NewLC(TInt aBufferSize = KPositionGenericInfoDefaultBufferSize,
00222                                                                                                 TInt aMaxFields = KPositionGenericInfoDefaultMaxFields);
00223 
00227         IMPORT_C void ClearRequestedFields();
00228 
00237         IMPORT_C TInt SetRequestedField(TPositionFieldId aFieldId);
00238         
00248         IMPORT_C TInt SetRequestedFields(const TPositionFieldIdList aFieldIdList);
00249 
00257         IMPORT_C TInt IsRequestedField(TPositionFieldId aFieldId) const;
00258 
00264         IMPORT_C TPositionFieldId FirstRequestedFieldId() const;
00265 
00272         IMPORT_C TPositionFieldId NextRequestedFieldId(TPositionFieldId aFieldId) const;
00273 
00281         IMPORT_C TBool IsFieldAvailable(TPositionFieldId aFieldId) const;
00282 
00288         IMPORT_C void ClearPositionData();      //Required on server side
00289 
00294         IMPORT_C TInt BufferSize() const;
00295 
00300         IMPORT_C TInt MaxFields() const;
00301 
00313         template <class TType>
00314                 inline TInt SetValue(TPositionFieldId aFieldId, const TType& aValue) 
00315                         {return PositionFieldManager::SetValue(aFieldId, aValue, *this);}
00316 
00330         template <class TType>
00331                 inline TInt GetValue(TPositionFieldId aFieldId, TType& aValue) const 
00332                         {return PositionFieldManager::GetValue(aFieldId, aValue, *this);}
00333 
00334 private:
00338         HPositionGenericInfo(TInt aDataBufferSize, TInt aMaxFields, 
00339                 TUint aFieldIndexStartPoint, TUint aDataStartPoint, TBool aResetRequestedFields);
00343         HPositionGenericInfo& operator=(const HPositionGenericInfo&);
00347         HPositionGenericInfo(const HPositionGenericInfo&);
00348 
00352         TInt FindEmptyRequestedFieldOffset(TInt& aEmptyFieldOffset) const;
00353 
00357         inline TPositionFieldId* RequestedFieldPtr();
00361         inline const TPositionFieldId* RequestedFieldPtr() const;
00365         inline TPositionFieldIndex* FieldIndexPtr();
00369         inline const TPositionFieldIndex* FieldIndexPtr() const;
00370 
00371 private:
00372         friend class TPositionFieldSetter;
00373         friend class TPositionFieldGetter;
00374 
00376         const TInt iMaxFields;
00377 
00379         const TUint iFieldIndexStartPoint;
00380 
00382         const TUint iDataStartPoint;
00383 
00385         const TInt iTotalBufferSize;
00386 
00389         TUint8 iBuffer[1];      //Must be at end of class
00390         };
00391 
00392 //__LBSPOSITIONINFO_H__
00393 #endif

Copyright © Nokia Corporation 2001-2008
Back to top