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 "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: Geographical circular area class definition.
19 #ifndef LBTGEOCIRCLE_H
20 #define LBTGEOCIRCLE_H
22 #include <lbtgeoareabase.h>
23 #include <lbsposition.h>
26 * Geographical circular area.
28 * A geographical circular area is defined by the center of the
29 * circle and the radius. The radius is in meters. The altitude in
30 * the center's coordinate is always ignored. It is optionally also possible
31 * to provide additional geographical area information of CLbtGeoCell
32 * type. Providing additional cell information would enable further
33 * optimization by reducing the number of GPS fixes required to
34 * supervise the trigger, there by, reducing the impact on battery
35 * consumption. Triggers would, initially, be monitored using the cell
36 * information provided. GPS would be used to check the coordinates
37 * only when the mobile terminal reaches the cell / cells specified.
38 * If a particular location is served by multiple cells, then it is
39 * important to mention all available cell information. If not, there
40 * is a possibility of missing triggers even when the mobile terminal
41 * reaches the location specified by the coordinates.
47 class CLbtGeoCircle : public CLbtGeoAreaBase
51 * Allocates and constructs a new geographical circular area object.
52 * In the returned object, the latitude, longitude and altitude
53 * are set to NaN, and the radius is set to NaN.
55 * @return Pointer to the new geographical circular area object.
57 IMPORT_C static CLbtGeoCircle* NewL();
60 * Constructs a new geographical circular area object and pushes
61 * it onto cleanup stack.
62 * In the returned object, the latitude, longitude and altitude
63 * are set to NaN, and the radius is set to NaN.
65 * @return Pointer to the new geographical circular area object.
67 IMPORT_C static CLbtGeoCircle* NewLC();
70 * Allocates and constructs a new geographical circular area object
71 * with specified center coordinate and radius.
73 * @panic ELbtErrArgument If the input radius is negative.
75 * @param[in] aCenter The coordinate of the center.
76 * @param[in] aRadiusInMeters The radius of the circle in meters.
77 * @return Pointer to the new geographical circle area object.
79 IMPORT_C static CLbtGeoCircle* NewL(
80 const TCoordinate& aCenter,
81 TReal aRadiusInMeters );
84 * Allocates and constructs a new geographical circular area object
85 * with specified center coordinate and radius. The constructed
86 * object is pushed onto cleanup stack.
88 * @panic ELbtErrArgument If the input radius is negative.
90 * @param[in] aCenter The coordinate of the center.
91 * @param[in] aRadiusInMeters The radius of the circle in meters.
92 * @return Pointer to the new geographical circle area object.
94 IMPORT_C static CLbtGeoCircle* NewLC(
95 const TCoordinate& aCenter,
96 TReal aRadiusInMeters );
101 IMPORT_C ~CLbtGeoCircle();
104 * Returns the type of geographical area, CLbtGeoAreaBase::ECircle
106 * @return CLbtGeoAreaBase::ECircle.
108 virtual TGeoAreaType Type() const;
111 * Gets the center of the area. If the center has not been set
112 * before, the returned coordinate has latitude, longitude and
113 * altitude set to NaN,
115 * @return The center of the area.
117 virtual TCoordinate Center() const;
120 * Sets the center of the circle.
122 * @param[in] aCenter The coordinate of the center.
124 IMPORT_C void SetCenter(const TCoordinate& aCenter);
127 * Gets the radius of the circle. If the radius has not been
128 * set before, the returned value is NaN.
130 * @return The radius of the circle in meters.
132 IMPORT_C TReal Radius() const;
135 * Sets the radius of the circle.
137 * @panic ELbtErrArgument If the input radius is negative.
139 * @param[in] aRadiusInMeters The radius of the circle in meters.
141 IMPORT_C void SetRadius(TReal aRadiusInMeters);
144 * Gets geographical area information. The following method is currently not
145 * supported. This method will only return empty array when invoked.
147 * @return An array of geographical area instances
149 IMPORT_C RPointerArray< CLbtGeoAreaBase >& GetAdditionalGeoAreaInfo();
152 * Sets additional geographical area information. The geographical
153 * information provided can only be of CLbtGeoCell type. This is optional
154 * and clients may specify this information when available.The following method
155 * is currently not supported.
157 * @panic ELbtErrArgument if argument passed is NULL or if the argument
158 * passed is of any other type other than CLbtGeoCell.
160 * @param[in] aGeoArea A pointer representing a geographical area.
162 IMPORT_C void SetAdditionalGeoAreaInfo(CLbtGeoAreaBase* aGeoArea);
165 * Validates cell information.
167 * @leave KErrArgument if any of the mandatory parameters have not
170 void ValidateCircleInformationL();
175 * Externalize method that subclass must implement.
176 * @param[in] aStream Stream to which the object should be externalized.
178 virtual void DoExternalizeL(RWriteStream& aStream) const ;
181 * Internalize method that subclass must implement.
182 * @param[in] aStream Stream from which the object should be internalized.
184 virtual void DoInternalizeL(RReadStream& aStream) ;
188 * Default constructor
193 * By default, prohibit copy constructor
195 CLbtGeoCircle(const CLbtGeoCircle&);
198 * Prohibit assigment operator
200 CLbtGeoCircle& operator= (const CLbtGeoCircle&);
203 * Symbian 2nd phase constructor
208 * Symbian 2nd phase constructor
210 void ConstructL(TCoordinate aCenter,TReal aRadius);
215 * The center of the circle.
220 * Radius of the circle in meters.
225 * An array of instances representing additional geographical area
228 RPointerArray< CLbtGeoAreaBase > iAdditionalGeoAreaInfo;
231 #endif // LBTGEOCIRCLE_H