epoc32/include/lbscriteria.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/lbscriteria.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/lbscriteria.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,191 @@
     1.4 -lbscriteria.h
     1.5 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +#ifndef __LBSCRITERIA_H__
    1.21 +#define __LBSCRITERIA_H__
    1.22 +
    1.23 +#include <lbscommon.h>
    1.24 +
    1.25 +
    1.26 +class TPositionSelectionOrder
    1.27 +/**
    1.28 +This class is used as part of the TPositionCriteria class to chose a
    1.29 +positioning module that will provide the desired quality of information.
    1.30 +It allows position-quality-metrics to be given priorities, enabling them
    1.31 +to be given preference in the decision.
    1.32 +
    1.33 +@publishedAll
    1.34 +@released
    1.35 + */
    1.36 +	{
    1.37 +public:
    1.38 +	/**
    1.39 +	 Specifies the priority of selection parameters.
    1.40 +	 */
    1.41 +	enum TOrder
    1.42 +		{
    1.43 +		/** Don't care */
    1.44 +		EOrderDontCare   = 0,
    1.45 +		/** Default */
    1.46 +		EOrderDefault    = 1,
    1.47 +		/** Very low */
    1.48 +		EOrderVeryLow    = 25,
    1.49 +		/** Low */
    1.50 +		EOrderLow        = 50,
    1.51 +		/** Fairly low */
    1.52 +		EOrderFairlyLow  = 75,
    1.53 +		/** Medium */
    1.54 +		EOrderMedium     = 100,
    1.55 +		/** Fairly high */
    1.56 +		EOrderFairlyHigh = 125,
    1.57 +		/** High */
    1.58 +		EOrderHigh       = 150,
    1.59 +		/** Very high */
    1.60 +		EOrderVeryHigh   = 175
    1.61 +		};
    1.62 +
    1.63 +	/**
    1.64 +	 Specifies the quality of position metrics that can be prioritized.
    1.65 +	 */
    1.66 +	enum TField
    1.67 +		{
    1.68 +		/** Time to first fix */
    1.69 +		EFieldTimeToFirstFix,
    1.70 +		/** Time to next fix */
    1.71 +		EFieldTimeToNextFix,
    1.72 +		/** Field Horizontal Accuracy */
    1.73 +		EFieldHorizontalAccuracy,
    1.74 +		/** Field Vertical Accuracy */
    1.75 +		EFieldVerticalAccuracy,
    1.76 +		/** Field cost */
    1.77 +		EFieldCost,
    1.78 +		/** Field power */
    1.79 +		EFieldPower,
    1.80 +		/** Number of fields */
    1.81 +		EFieldNumFields,       // Do not use this value. Must appear after all other field values.
    1.82 +		/** Last field */
    1.83 +		EFieldLast = KMaxTInt8 // Do not use this value. Must appear at end.
    1.84 +		};
    1.85 +
    1.86 +	IMPORT_C TPositionSelectionOrder();
    1.87 +
    1.88 +	IMPORT_C TInt SetOrderTimeToFirstFix(TOrder aOrder);
    1.89 +	IMPORT_C TInt SetOrderTimeToNextFix(TOrder aOrder);
    1.90 +
    1.91 +	IMPORT_C TInt SetOrderHorizontalAccuracy(TOrder aOrder);
    1.92 +	IMPORT_C TInt SetOrderVerticalAccuracy(TOrder aOrder);
    1.93 +
    1.94 +	IMPORT_C TInt SetOrderCostIndicator(TOrder aOrder);
    1.95 +	IMPORT_C TInt SetOrderPowerConsumption(TOrder aOrder);
    1.96 +
    1.97 +	IMPORT_C void ResetSelectionOrder();
    1.98 +	IMPORT_C void ClearSelectionOrder();
    1.99 +
   1.100 +	IMPORT_C TUint NumSelectionItems() const;
   1.101 +	IMPORT_C TInt GetSelectionItem(TUint aIndex,
   1.102 +	                               TField& aField,
   1.103 +	                               TOrder& aOrder) const;
   1.104 +
   1.105 +protected:
   1.106 +	struct SItem
   1.107 +	/**
   1.108 +	 Stores a field / priority pair.
   1.109 +	
   1.110 +	 @publishedAll
   1.111 +	 @released
   1.112 +	 */
   1.113 +		{
   1.114 +		/** A position quality metric identifier. */
   1.115 +		TField iField;
   1.116 +		/** The priority given to the iField position quality metric. */
   1.117 +		TOrder iOrder;
   1.118 +		};
   1.119 +
   1.120 +protected:
   1.121 +	TInt AddItem(TField aField, TOrder aOrder);
   1.122 +
   1.123 +protected:
   1.124 +	/** The number of selection items in the iItems array. */
   1.125 +	TUint iNumItems;
   1.126 +	/** Array of users position quality priorities. */
   1.127 +	SItem iItems[KPositionMaxSectionFields];
   1.128 +	};
   1.129 +
   1.130 +/**
   1.131 +TPositionCriteriaBase derived classes class types
   1.132 +// If the following line generates an error, too many fields have been added
   1.133 +// to the TPositionSelectionOrder::TOrder enumeration, some must be removed
   1.134 +// to maintain BC.
   1.135 +@publishedAll
   1.136 +@released
   1.137 + */
   1.138 +POSITION_COMPILE_TIME_ASSERT(TPositionSelectionOrder::EFieldNumFields <= KPositionMaxSectionFields);
   1.139 +
   1.140 +
   1.141 +class TPositionCriteriaBase : public TPositionClassTypeBase
   1.142 +/**
   1.143 +The base class for classes used to store position module selection
   1.144 +criteria information.
   1.145 +
   1.146 +@publishedAll
   1.147 +@released
   1.148 + */
   1.149 +	{
   1.150 +protected:
   1.151 +	IMPORT_C TPositionCriteriaBase();
   1.152 +	IMPORT_C TPositionCriteriaBase(TPositionModuleInfo::TCapabilities aCapabilityMask);
   1.153 +
   1.154 +public:
   1.155 +	IMPORT_C void AddRequiredCapabilities(TPositionModuleInfo::TCapabilities aCapabilityMask);
   1.156 +	IMPORT_C void ClearRequiredCapabilities();
   1.157 +	IMPORT_C TPositionModuleInfo::TCapabilities RequiredCapabilities() const;
   1.158 +
   1.159 +	IMPORT_C void SetRequiredQuality(const TPositionQuality& aPosQuality);
   1.160 +	IMPORT_C void GetRequiredQuality(TPositionQuality& aPosQuality) const;
   1.161 +
   1.162 +	IMPORT_C void SetSelectionOrder(const TPositionSelectionOrder& aSelectionOrder); 
   1.163 +	IMPORT_C void GetSelectionOrder(TPositionSelectionOrder& aSelectionOrder) const;
   1.164 +
   1.165 +	IMPORT_C void ResetCriteria();
   1.166 +	IMPORT_C void ClearCriteria();
   1.167 +
   1.168 +protected:
   1.169 +	/** The capabilities a positioning module must have. */
   1.170 +	TPositionModuleInfo::TCapabilities iRequiredCaps;
   1.171 +	/** The quality required of a positioning module. */
   1.172 +	TPositionQuality iRequiredQuality;
   1.173 +	/** The priorities assigned to the various quality metrics. */
   1.174 +	TPositionSelectionOrder	iSelectionOrder;
   1.175 +	};
   1.176 +
   1.177 +
   1.178 +class TPositionCriteria : public TPositionCriteriaBase
   1.179 +/**
   1.180 +The standard class criteria class for selecting a positioning module.
   1.181 +
   1.182 +@publishedAll
   1.183 +@released
   1.184 + */
   1.185 +	{
   1.186 +public:
   1.187 +	IMPORT_C TPositionCriteria();
   1.188 +	IMPORT_C TPositionCriteria(TPositionModuleInfo::TCapabilities aCapabilityMask);
   1.189 +
   1.190 +private:
   1.191 +	/** Unused variable for future expansion. */
   1.192 +	TUint8 iReserved[4];
   1.193 +	};
   1.194 +
   1.195 +#endif // __LBSCRITERIA_H__