00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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,
00063 EFieldLast = KMaxTInt8
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
00188
00189
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
00315 #endif