lbscriteria.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : LbsCriteria.h
00004 *  Part of     : Location Framework/Location FW
00005 *  Interface   : Location Acquisition API
00006 *  Description : Criteria 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 __LBSCRITERIA_H__
00022 #define __LBSCRITERIA_H__
00023 
00024 #include <LbsCommon.h>
00025 
00032 class TPositionSelectionOrder
00033         {
00034 public:
00038         enum TOrder
00039                 {
00040                 EOrderDontCare   = 0,
00041                 EOrderDefault    = 1,
00042                 EOrderVeryLow    = 25,
00043                 EOrderLow        = 50,
00044                 EOrderFairlyLow  = 75,
00045                 EOrderMedium     = 100,
00046                 EOrderFairlyHigh = 125,
00047                 EOrderHigh       = 150,
00048                 EOrderVeryHigh   = 175
00049                 };
00050 
00054         enum TField
00055                 {
00056                 EFieldTimeToFirstFix,
00057                 EFieldTimeToNextFix,
00058                 EFieldHorizontalAccuracy,
00059                 EFieldVerticalAccuracy,
00060                 EFieldCost,
00061                 EFieldPower,
00062                 EFieldNumFields,       // Do not use this value. Must appear after all other field values.
00063                 EFieldLast = KMaxTInt8 // Do not use this value. Must appear at end.
00064                 };
00065 
00069         IMPORT_C TPositionSelectionOrder();
00070 
00079         IMPORT_C TInt SetOrderTimeToFirstFix(TOrder aOrder);
00080 
00089         IMPORT_C TInt SetOrderTimeToNextFix(TOrder aOrder);
00090 
00099         IMPORT_C TInt SetOrderHorizontalAccuracy(TOrder aOrder);
00100 
00109         IMPORT_C TInt SetOrderVerticalAccuracy(TOrder aOrder);
00110 
00118         IMPORT_C TInt SetOrderCostIndicator(TOrder aOrder);
00119 
00128         IMPORT_C TInt SetOrderPowerConsumption(TOrder aOrder);
00129 
00133         IMPORT_C void ResetSelectionOrder();
00134 
00139         IMPORT_C void ClearSelectionOrder();
00140 
00147         IMPORT_C TUint NumSelectionItems() const;
00148 
00160         IMPORT_C TInt GetSelectionItem(TUint aIndex,
00161                                        TField& aField,
00162                                        TOrder& aOrder) const;
00163 
00164 protected:
00165         struct SItem
00169                 {
00171                 TField iField;
00173                 TOrder iOrder;
00174                 };
00175 
00176 protected:
00177         TInt AddItem(TField aField, TOrder aOrder);
00178 
00179 protected:
00181         TUint iNumItems;
00183         SItem iItems[KPositionMaxSectionFields];
00184         };
00185 
00186 
00187 // If the following line generates an error, too many fields have been added
00188 // to the TPositionSelectionOrder::TOrder enumeration, some must be removed
00189 // to maintain BC.
00190 POSITION_COMPILE_TIME_ASSERT(TPositionSelectionOrder::EFieldNumFields <= KPositionMaxSectionFields);
00191 
00192 
00197 class TPositionCriteriaBase : public TPositionClassTypeBase
00198         {
00199 protected:
00203         IMPORT_C TPositionCriteriaBase();
00210         IMPORT_C TPositionCriteriaBase(TPositionModuleInfo::TCapabilities aCapabilityMask);
00211 
00212 public:
00213 
00220         IMPORT_C void AddRequiredCapabilities(TPositionModuleInfo::TCapabilities aCapabilityMask);
00221 
00226         IMPORT_C void ClearRequiredCapabilities();
00227 
00232         IMPORT_C TPositionModuleInfo::TCapabilities RequiredCapabilities() const;
00233 
00239         IMPORT_C void SetRequiredQuality(const TPositionQuality& aPosQuality);
00240 
00246         IMPORT_C void GetRequiredQuality(TPositionQuality& aPosQuality) const;
00247 
00253         IMPORT_C void SetSelectionOrder(const TPositionSelectionOrder& aSelectionOrder); 
00254 
00260         IMPORT_C void GetSelectionOrder(TPositionSelectionOrder& aSelectionOrder) const;
00261 
00267         IMPORT_C void ResetCriteria();
00268 
00275         IMPORT_C void ClearCriteria();
00276 
00277 protected:
00279         TPositionModuleInfo::TCapabilities iRequiredCaps;
00281         TPositionQuality iRequiredQuality;
00283         TPositionSelectionOrder iSelectionOrder;
00284         };
00285 
00286 
00290 class TPositionCriteria : public TPositionCriteriaBase
00291         {
00292 public:
00293 
00297         IMPORT_C TPositionCriteria();
00298 
00307         IMPORT_C TPositionCriteria(TPositionModuleInfo::TCapabilities aCapabilityMask);
00308 
00309 private:
00311         TUint8 iReserved[4];
00312         };
00313 
00314 // __LBSCRITERIA_H__
00315 #endif

Copyright © Nokia Corporation 2001-2008
Back to top