williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
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
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: Geographical rectangular area class definition.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef LBTGEORECT_H
|
williamr@2
|
20 |
#define LBTGEORECT_H
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include "lbtgeoareabase.h"
|
williamr@2
|
23 |
|
williamr@2
|
24 |
/**
|
williamr@2
|
25 |
* Geographical rectangular area.
|
williamr@2
|
26 |
*
|
williamr@2
|
27 |
* A geographical rectangular area is defined as a spherical rectangle,
|
williamr@2
|
28 |
* limited by two longitude borders ( WestLongitude and EastLongitude ) and
|
williamr@2
|
29 |
* two latitude borders ( SouthLatitude and NorthLatitude ).
|
williamr@2
|
30 |
*
|
williamr@2
|
31 |
* It is required that - 90 =< SouthLatitude =< NorthLatitude =< 90.
|
williamr@2
|
32 |
* WestLongitude must be in the interval [- 180, 180 ), i.e. not including + 180.
|
williamr@2
|
33 |
* EastLongitude must be in the interval [- 180, 180], i.e. including + 180.
|
williamr@2
|
34 |
* It is allowed that EastLongitude < WestLongitude. This defines an area
|
williamr@2
|
35 |
* which crosses the 180 meridian.
|
williamr@2
|
36 |
*/
|
williamr@2
|
37 |
class CLbtGeoRect : public CLbtGeoAreaBase
|
williamr@2
|
38 |
{
|
williamr@2
|
39 |
public:
|
williamr@2
|
40 |
/**
|
williamr@2
|
41 |
* Allocates and constructs a new geographical rectangular area object.
|
williamr@2
|
42 |
* In returned object, the border values are set to NaN.
|
williamr@2
|
43 |
*
|
williamr@2
|
44 |
* @return Pointer to the new constructed geographical rectangular
|
williamr@2
|
45 |
* area object.
|
williamr@2
|
46 |
*/
|
williamr@2
|
47 |
IMPORT_C static CLbtGeoRect* NewL();
|
williamr@2
|
48 |
|
williamr@2
|
49 |
|
williamr@2
|
50 |
/**
|
williamr@2
|
51 |
* Allocates and constructs a new geographical rectangular area object
|
williamr@2
|
52 |
* and pushes it onto cleanup stack.
|
williamr@2
|
53 |
* In returned object, the border values are set to NaN.
|
williamr@2
|
54 |
*
|
williamr@2
|
55 |
* @return Pointer to the new constructed geographical rectangular
|
williamr@2
|
56 |
* area object.
|
williamr@2
|
57 |
*/
|
williamr@2
|
58 |
IMPORT_C static CLbtGeoRect* NewLC();
|
williamr@2
|
59 |
|
williamr@2
|
60 |
/**
|
williamr@2
|
61 |
* Allocates and constructs a new geographical rectangular area object.
|
williamr@2
|
62 |
*
|
williamr@2
|
63 |
* @param[in] aSouthLatitude The southern latitude border of the area.
|
williamr@2
|
64 |
* @param[in] aNorthLatitude The northern latitude border of the area.
|
williamr@2
|
65 |
* @param[in] aWestLongitude The western longitude border of the area.
|
williamr@2
|
66 |
* @param[in] aEastLongitude The eastern longitude border of the area.
|
williamr@2
|
67 |
* @return Pointer to the new constructed geographical rectangular
|
williamr@2
|
68 |
* area object.
|
williamr@2
|
69 |
*/
|
williamr@2
|
70 |
IMPORT_C static CLbtGeoRect* NewL(
|
williamr@2
|
71 |
TReal aSouthLatitude,
|
williamr@2
|
72 |
TReal aNorthLatitude,
|
williamr@2
|
73 |
TReal aWestLongitude,
|
williamr@2
|
74 |
TReal aEastLongitude );
|
williamr@2
|
75 |
|
williamr@2
|
76 |
/**
|
williamr@2
|
77 |
* Allocates and constructs a new geographical rectangular area object
|
williamr@2
|
78 |
* and pushes it onto cleanup stack.
|
williamr@2
|
79 |
*
|
williamr@2
|
80 |
* @param[in] aSouthLatitude The southern latitude border of the area.
|
williamr@2
|
81 |
* @param[in] aNorthLatitude The northern latitude border of the area.
|
williamr@2
|
82 |
* @param[in] aWestLongitude The western longitude border of the area.
|
williamr@2
|
83 |
* @param[in] aEastLongitude The eastern longitude border of the area.
|
williamr@2
|
84 |
* @return Pointer to the new constructed geographical rectangular
|
williamr@2
|
85 |
* area object.
|
williamr@2
|
86 |
*/
|
williamr@2
|
87 |
IMPORT_C static CLbtGeoRect* NewLC(
|
williamr@2
|
88 |
TReal aSouthLatitude,
|
williamr@2
|
89 |
TReal aNorthLatitude,
|
williamr@2
|
90 |
TReal aWestLongitude,
|
williamr@2
|
91 |
TReal aEastLongitude );
|
williamr@2
|
92 |
|
williamr@2
|
93 |
|
williamr@2
|
94 |
/**
|
williamr@2
|
95 |
* Destructor
|
williamr@2
|
96 |
*/
|
williamr@2
|
97 |
IMPORT_C ~CLbtGeoRect();
|
williamr@2
|
98 |
|
williamr@2
|
99 |
/**
|
williamr@2
|
100 |
* Returns the type of geographical area, CLbtGeoAreaBase::ERectangular.
|
williamr@2
|
101 |
*
|
williamr@2
|
102 |
* @return CLbtGeoAreaBase::ERectangular.
|
williamr@2
|
103 |
*/
|
williamr@2
|
104 |
virtual TGeoAreaType Type() const;
|
williamr@2
|
105 |
|
williamr@2
|
106 |
/**
|
williamr@2
|
107 |
* Gets border values. If the border value has not been set
|
williamr@2
|
108 |
* before, the returned border values are NaN.
|
williamr@2
|
109 |
*
|
williamr@2
|
110 |
* @param[out] aSouthLatitude The southern latitude border of the area.
|
williamr@2
|
111 |
* @param[out] aNorthLatitude The northern latitude border of the area.
|
williamr@2
|
112 |
* @param[out] aWestLongitude The western longitude border of the area.
|
williamr@2
|
113 |
* @param[out] aEastLongitude The eastern longitude border of the area.
|
williamr@2
|
114 |
*/
|
williamr@2
|
115 |
IMPORT_C void GetBorder(
|
williamr@2
|
116 |
TReal& aSouthLatitude,
|
williamr@2
|
117 |
TReal& aNorthLatitude,
|
williamr@2
|
118 |
TReal& aWestLongitude,
|
williamr@2
|
119 |
TReal& aEastLongitude ) const;
|
williamr@2
|
120 |
|
williamr@2
|
121 |
/**
|
williamr@2
|
122 |
* Sets the border values.
|
williamr@2
|
123 |
*
|
williamr@2
|
124 |
* The input parameters specify the area as described in the
|
williamr@2
|
125 |
* class description.
|
williamr@2
|
126 |
*
|
williamr@2
|
127 |
* If one of the parameters is out of range, this function fails with
|
williamr@2
|
128 |
* panic with @p KLbtErrArgument. The correct ranges are:
|
williamr@2
|
129 |
* -# - 90 =< aSouthLatitude =< aNorthLatitude =< 90
|
williamr@2
|
130 |
* -# - 180 <= aWestLongitude <= 180
|
williamr@2
|
131 |
* -# - 180 <= aEastLongitude <= 180
|
williamr@2
|
132 |
*
|
williamr@2
|
133 |
* @param[in] aSouthLatitude The southern latitude border of the area.
|
williamr@2
|
134 |
* @param[in] aNorthLatitude The northern latitude border of the area.
|
williamr@2
|
135 |
* @param[in] aWestLongitude The western longitude border of the area.
|
williamr@2
|
136 |
* @param[in] aEastLongitude The eastern longitude border of the area.
|
williamr@2
|
137 |
* @panic LocTriggering ELbtErrArgument if the input
|
williamr@2
|
138 |
* parameters are invalid.
|
williamr@2
|
139 |
*/
|
williamr@2
|
140 |
IMPORT_C void SetBorder(
|
williamr@2
|
141 |
TReal aSouthLatitude,
|
williamr@2
|
142 |
TReal aNorthLatitude,
|
williamr@2
|
143 |
TReal aWestLongitude,
|
williamr@2
|
144 |
TReal aEastLongitude );
|
williamr@2
|
145 |
|
williamr@2
|
146 |
protected:
|
williamr@2
|
147 |
/**
|
williamr@2
|
148 |
* Externalize method that subclass must implement.
|
williamr@2
|
149 |
* @param[in] aStream Stream to which the object should be externalized.
|
williamr@2
|
150 |
*/
|
williamr@2
|
151 |
virtual void DoExternalizeL(RWriteStream& aStream) const ;
|
williamr@2
|
152 |
|
williamr@2
|
153 |
/**
|
williamr@2
|
154 |
* Internalize method that subclass must implement.
|
williamr@2
|
155 |
* @param[in] aStream Stream from which the object should be internalized.
|
williamr@2
|
156 |
*/
|
williamr@2
|
157 |
virtual void DoInternalizeL(RReadStream& aStream) ;
|
williamr@2
|
158 |
|
williamr@2
|
159 |
private:
|
williamr@2
|
160 |
/**
|
williamr@2
|
161 |
* Constructor.
|
williamr@2
|
162 |
*/
|
williamr@2
|
163 |
CLbtGeoRect();
|
williamr@2
|
164 |
|
williamr@2
|
165 |
/**
|
williamr@2
|
166 |
* By default, prohibit copy constructor
|
williamr@2
|
167 |
*/
|
williamr@2
|
168 |
CLbtGeoRect( const CLbtGeoRect& );
|
williamr@2
|
169 |
|
williamr@2
|
170 |
/**
|
williamr@2
|
171 |
* Prohibit assigment operator
|
williamr@2
|
172 |
*/
|
williamr@2
|
173 |
CLbtGeoRect& operator= ( const CLbtGeoRect& );
|
williamr@2
|
174 |
|
williamr@2
|
175 |
/**
|
williamr@2
|
176 |
* Symbian 2nd phase constructor
|
williamr@2
|
177 |
*/
|
williamr@2
|
178 |
void ConstructL();
|
williamr@2
|
179 |
|
williamr@2
|
180 |
/**
|
williamr@2
|
181 |
* Symbian 2nd phase constructor
|
williamr@2
|
182 |
*
|
williamr@2
|
183 |
* @param[in] aSouthLatitude The southern latitude border of the area.
|
williamr@2
|
184 |
* @param[in] aNorthLatitude The northern latitude border of the area.
|
williamr@2
|
185 |
* @param[in] aWestLongitude The western longitude border of the area.
|
williamr@2
|
186 |
* @param[in] aEastLongitude The eastern longitude border of the area.
|
williamr@2
|
187 |
*/
|
williamr@2
|
188 |
void ConstructL( TReal aSouthLatitude,
|
williamr@2
|
189 |
TReal aNorthLatitude,
|
williamr@2
|
190 |
TReal aWestLongitude,
|
williamr@2
|
191 |
TReal aEastLongitude );
|
williamr@2
|
192 |
|
williamr@2
|
193 |
private:
|
williamr@2
|
194 |
/**
|
williamr@2
|
195 |
* The southern latitude border of the area.
|
williamr@2
|
196 |
*/
|
williamr@2
|
197 |
TReal iSouthLatitude;
|
williamr@2
|
198 |
|
williamr@2
|
199 |
/**
|
williamr@2
|
200 |
* The northern latitude border of the area.
|
williamr@2
|
201 |
*/
|
williamr@2
|
202 |
TReal iNorthLatitude;
|
williamr@2
|
203 |
|
williamr@2
|
204 |
/**
|
williamr@2
|
205 |
* The western longitude border of the area.
|
williamr@2
|
206 |
*/
|
williamr@2
|
207 |
TReal iWestLongitude;
|
williamr@2
|
208 |
|
williamr@2
|
209 |
/**
|
williamr@2
|
210 |
* The eastern longitude border of the area.
|
williamr@2
|
211 |
*/
|
williamr@2
|
212 |
TReal iEastLongitude;
|
williamr@2
|
213 |
};
|
williamr@2
|
214 |
|
williamr@2
|
215 |
#endif // LBTGEORECT_H
|