2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: CPosLmAreaCriteria class
19 #ifndef CPOSLMAREACRITERIA_H
20 #define CPOSLMAREACRITERIA_H
23 #include "EPos_CPosLmSearchCriteria.h"
26 * Criterion for searching for landmarks which reside in a certain area.
28 * The search area is defined by providing two latitude and two longitude
29 * values which specify the borders of the area. Note that this search
30 * does not consider landmark coverage radius, see
31 * @p CPosLandmark::GetCoverageRadius.
33 * The search area is defined as a spherical rectangle, limited by two
34 * longitude borders (WestLongitude and EastLongitude) and two latitude
35 * borders (SouthLatitude and NorthLatitude).
37 * It is required that -90 =< SouthLatitude =< NorthLatitude =< 90.
38 * WestLongitude must be in the interval [-180, 180), i.e. not including +180.
39 * EastLongitude must be in the interval [-180, 180], i.e. including +180.
40 * It is allowed that EastLongitude < WestLongitude. This defines an area
41 * which crosses the 180 meridian. The area definition is inclusive, i.e.
42 * landmarks which lie on the border of the area will be considered as matches.
43 * If WestLongitude = EastLongitude and NorthLatitude = SouthLatitude then
44 * only landmarks which match the longitude and latitude respectively, are
45 * considered to be matches. If WestLongitude = -180 and EastLongitude = +180,
46 * all longitudes are included in the search.
48 * This criterion is only valid when searching for landmarks, i.e. if it
49 * is passed to @p CPosLandmarkSearch::StartCategorySearchL, the function
50 * will fail with error code @p KErrArgument.
52 * @lib eposlmsearchlib.lib
55 class CPosLmAreaCriteria : public CPosLmSearchCriteria
60 * Two-phased constructor.
62 * The input parameters specify the area to search as described
63 * in the class description.
65 * If one of the parameters is out of range, this function fails with
66 * error code @p KErrArgument. The correct ranges are:
67 * -# -90 =< aSouthLatitude =< aNorthLatitude =< 90
68 * -# -180 <= aWestLongitude < 180
69 * -# -180 <= aEastLongitude <= 180
71 * @param[in] aSouthLatitude The southern latitude border of the search area.
72 * @param[in] aNorthLatitude The northern latitude border of the search area.
73 * @param[in] aWestLongitude The western longitude border of the search area.
74 * @param[in] aEastLongitude The eastern longitude border of the search area.
75 * @returns A new instance of this class.
77 IMPORT_C static CPosLmAreaCriteria* NewLC(
78 const TReal64& aSouthLatitude,
79 const TReal64& aNorthLatitude,
80 const TReal64& aWestLongitude,
81 const TReal64& aEastLongitude
87 virtual ~CPosLmAreaCriteria();
92 * Returns the search area.
94 * @param[out] aSouthLatitude The southern latitude border of the search area.
95 * @param[out] aNorthLatitude The northern latitude border of the search area.
96 * @param[out] aWestLongitude The western longitude border of the search area.
97 * @param[out] aEastLongitude The eastern longitude border of the search area.
99 IMPORT_C void GetSearchArea(
100 TReal64& aSouthLatitude,
101 TReal64& aNorthLatitude,
102 TReal64& aWestLongitude,
103 TReal64& aEastLongitude
107 * Define the search area.
109 * The input parameters specify the area to search as described in the
112 * If one of the parameters is out of range, this function fails with
113 * error code @p KErrArgument. The correct ranges are:
114 * -# -90 =< aSouthLatitude =< aNorthLatitude =< 90
115 * -# -180 <= aWestLongitude < 180
116 * -# -180 <= aEastLongitude <= 180
118 * @param[in] aSouthLatitude The southern latitude border of the search area.
119 * @param[in] aNorthLatitude The northern latitude border of the search area.
120 * @param[in] aWestLongitude The western longitude border of the search area.
121 * @param[in] aEastLongitude The eastern longitude border of the search area.
122 * @returns @p KErrNone if successful, @p KErrArgument if the input
123 * parameters are invalid, otherwise a system wide error code.
125 IMPORT_C TInt SetSearchArea(
126 const TReal64& aSouthLatitude,
127 const TReal64& aNorthLatitude,
128 const TReal64& aWestLongitude,
129 const TReal64& aEastLongitude
135 CPosLmAreaCriteria();
138 const TReal64& aSouthLatitude,
139 const TReal64& aNorthLatitude,
140 const TReal64& aWestLongitude,
141 const TReal64& aEastLongitude
144 // Prohibit copy constructor
145 CPosLmAreaCriteria( const CPosLmAreaCriteria& );
146 // Prohibit assigment operator
147 CPosLmAreaCriteria& operator= ( const CPosLmAreaCriteria& );
151 TReal64 iSouthLatitude;
152 TReal64 iNorthLatitude;
153 TReal64 iWestLongitude;
154 TReal64 iEastLongitude;
158 #endif // CPOSLMAREACRITERIA_H