2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * 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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Geographical rectangular area class definition.
22 #include "lbtgeoareabase.h"
25 * Geographical rectangular area.
27 * A geographical rectangular area is defined as a spherical rectangle,
28 * limited by two longitude borders ( WestLongitude and EastLongitude ) and
29 * two latitude borders ( SouthLatitude and NorthLatitude ).
31 * It is required that - 90 =< SouthLatitude =< NorthLatitude =< 90.
32 * WestLongitude must be in the interval [- 180, 180 ), i.e. not including + 180.
33 * EastLongitude must be in the interval [- 180, 180], i.e. including + 180.
34 * It is allowed that EastLongitude < WestLongitude. This defines an area
35 * which crosses the 180 meridian.
37 class CLbtGeoRect : public CLbtGeoAreaBase
41 * Allocates and constructs a new geographical rectangular area object.
42 * In returned object, the border values are set to NaN.
44 * @return Pointer to the new constructed geographical rectangular
47 IMPORT_C static CLbtGeoRect* NewL();
51 * Allocates and constructs a new geographical rectangular area object
52 * and pushes it onto cleanup stack.
53 * In returned object, the border values are set to NaN.
55 * @return Pointer to the new constructed geographical rectangular
58 IMPORT_C static CLbtGeoRect* NewLC();
61 * Allocates and constructs a new geographical rectangular area object.
63 * @param[in] aSouthLatitude The southern latitude border of the area.
64 * @param[in] aNorthLatitude The northern latitude border of the area.
65 * @param[in] aWestLongitude The western longitude border of the area.
66 * @param[in] aEastLongitude The eastern longitude border of the area.
67 * @return Pointer to the new constructed geographical rectangular
70 IMPORT_C static CLbtGeoRect* NewL(
74 TReal aEastLongitude );
77 * Allocates and constructs a new geographical rectangular area object
78 * and pushes it onto cleanup stack.
80 * @param[in] aSouthLatitude The southern latitude border of the area.
81 * @param[in] aNorthLatitude The northern latitude border of the area.
82 * @param[in] aWestLongitude The western longitude border of the area.
83 * @param[in] aEastLongitude The eastern longitude border of the area.
84 * @return Pointer to the new constructed geographical rectangular
87 IMPORT_C static CLbtGeoRect* NewLC(
91 TReal aEastLongitude );
97 IMPORT_C ~CLbtGeoRect();
100 * Returns the type of geographical area, CLbtGeoAreaBase::ERectangular.
102 * @return CLbtGeoAreaBase::ERectangular.
104 virtual TGeoAreaType Type() const;
107 * Gets border values. If the border value has not been set
108 * before, the returned border values are NaN.
110 * @param[out] aSouthLatitude The southern latitude border of the area.
111 * @param[out] aNorthLatitude The northern latitude border of the area.
112 * @param[out] aWestLongitude The western longitude border of the area.
113 * @param[out] aEastLongitude The eastern longitude border of the area.
115 IMPORT_C void GetBorder(
116 TReal& aSouthLatitude,
117 TReal& aNorthLatitude,
118 TReal& aWestLongitude,
119 TReal& aEastLongitude ) const;
122 * Sets the border values.
124 * The input parameters specify the area as described in the
127 * If one of the parameters is out of range, this function fails with
128 * panic with @p KLbtErrArgument. The correct ranges are:
129 * -# - 90 =< aSouthLatitude =< aNorthLatitude =< 90
130 * -# - 180 <= aWestLongitude <= 180
131 * -# - 180 <= aEastLongitude <= 180
133 * @param[in] aSouthLatitude The southern latitude border of the area.
134 * @param[in] aNorthLatitude The northern latitude border of the area.
135 * @param[in] aWestLongitude The western longitude border of the area.
136 * @param[in] aEastLongitude The eastern longitude border of the area.
137 * @panic LocTriggering ELbtErrArgument if the input
138 * parameters are invalid.
140 IMPORT_C void SetBorder(
141 TReal aSouthLatitude,
142 TReal aNorthLatitude,
143 TReal aWestLongitude,
144 TReal aEastLongitude );
148 * Externalize method that subclass must implement.
149 * @param[in] aStream Stream to which the object should be externalized.
151 virtual void DoExternalizeL(RWriteStream& aStream) const ;
154 * Internalize method that subclass must implement.
155 * @param[in] aStream Stream from which the object should be internalized.
157 virtual void DoInternalizeL(RReadStream& aStream) ;
166 * By default, prohibit copy constructor
168 CLbtGeoRect( const CLbtGeoRect& );
171 * Prohibit assigment operator
173 CLbtGeoRect& operator= ( const CLbtGeoRect& );
176 * Symbian 2nd phase constructor
181 * Symbian 2nd phase constructor
183 * @param[in] aSouthLatitude The southern latitude border of the area.
184 * @param[in] aNorthLatitude The northern latitude border of the area.
185 * @param[in] aWestLongitude The western longitude border of the area.
186 * @param[in] aEastLongitude The eastern longitude border of the area.
188 void ConstructL( TReal aSouthLatitude,
189 TReal aNorthLatitude,
190 TReal aWestLongitude,
191 TReal aEastLongitude );
195 * The southern latitude border of the area.
197 TReal iSouthLatitude;
200 * The northern latitude border of the area.
202 TReal iNorthLatitude;
205 * The western longitude border of the area.
207 TReal iWestLongitude;
210 * The eastern longitude border of the area.
212 TReal iEastLongitude;
215 #endif // LBTGEORECT_H