williamr@2: /* williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Geographical rectangular area class definition. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef LBTGEORECT_H williamr@2: #define LBTGEORECT_H williamr@2: williamr@2: #include "lbtgeoareabase.h" williamr@2: williamr@2: /** williamr@2: * Geographical rectangular area. williamr@2: * williamr@2: * A geographical rectangular area is defined as a spherical rectangle, williamr@2: * limited by two longitude borders ( WestLongitude and EastLongitude ) and williamr@2: * two latitude borders ( SouthLatitude and NorthLatitude ). williamr@2: * williamr@2: * It is required that - 90 =< SouthLatitude =< NorthLatitude =< 90. williamr@2: * WestLongitude must be in the interval [- 180, 180 ), i.e. not including + 180. williamr@2: * EastLongitude must be in the interval [- 180, 180], i.e. including + 180. williamr@2: * It is allowed that EastLongitude < WestLongitude. This defines an area williamr@2: * which crosses the 180 meridian. williamr@2: */ williamr@2: class CLbtGeoRect : public CLbtGeoAreaBase williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Allocates and constructs a new geographical rectangular area object. williamr@2: * In returned object, the border values are set to NaN. williamr@2: * williamr@2: * @return Pointer to the new constructed geographical rectangular williamr@2: * area object. williamr@2: */ williamr@2: IMPORT_C static CLbtGeoRect* NewL(); williamr@2: williamr@2: williamr@2: /** williamr@2: * Allocates and constructs a new geographical rectangular area object williamr@2: * and pushes it onto cleanup stack. williamr@2: * In returned object, the border values are set to NaN. williamr@2: * williamr@2: * @return Pointer to the new constructed geographical rectangular williamr@2: * area object. williamr@2: */ williamr@2: IMPORT_C static CLbtGeoRect* NewLC(); williamr@2: williamr@2: /** williamr@2: * Allocates and constructs a new geographical rectangular area object. williamr@2: * williamr@2: * @param[in] aSouthLatitude The southern latitude border of the area. williamr@2: * @param[in] aNorthLatitude The northern latitude border of the area. williamr@2: * @param[in] aWestLongitude The western longitude border of the area. williamr@2: * @param[in] aEastLongitude The eastern longitude border of the area. williamr@2: * @return Pointer to the new constructed geographical rectangular williamr@2: * area object. williamr@2: */ williamr@2: IMPORT_C static CLbtGeoRect* NewL( williamr@2: TReal aSouthLatitude, williamr@2: TReal aNorthLatitude, williamr@2: TReal aWestLongitude, williamr@2: TReal aEastLongitude ); williamr@2: williamr@2: /** williamr@2: * Allocates and constructs a new geographical rectangular area object williamr@2: * and pushes it onto cleanup stack. williamr@2: * williamr@2: * @param[in] aSouthLatitude The southern latitude border of the area. williamr@2: * @param[in] aNorthLatitude The northern latitude border of the area. williamr@2: * @param[in] aWestLongitude The western longitude border of the area. williamr@2: * @param[in] aEastLongitude The eastern longitude border of the area. williamr@2: * @return Pointer to the new constructed geographical rectangular williamr@2: * area object. williamr@2: */ williamr@2: IMPORT_C static CLbtGeoRect* NewLC( williamr@2: TReal aSouthLatitude, williamr@2: TReal aNorthLatitude, williamr@2: TReal aWestLongitude, williamr@2: TReal aEastLongitude ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C ~CLbtGeoRect(); williamr@2: williamr@2: /** williamr@2: * Returns the type of geographical area, CLbtGeoAreaBase::ERectangular. williamr@2: * williamr@2: * @return CLbtGeoAreaBase::ERectangular. williamr@2: */ williamr@2: virtual TGeoAreaType Type() const; williamr@2: williamr@2: /** williamr@2: * Gets border values. If the border value has not been set williamr@2: * before, the returned border values are NaN. williamr@2: * williamr@2: * @param[out] aSouthLatitude The southern latitude border of the area. williamr@2: * @param[out] aNorthLatitude The northern latitude border of the area. williamr@2: * @param[out] aWestLongitude The western longitude border of the area. williamr@2: * @param[out] aEastLongitude The eastern longitude border of the area. williamr@2: */ williamr@2: IMPORT_C void GetBorder( williamr@2: TReal& aSouthLatitude, williamr@2: TReal& aNorthLatitude, williamr@2: TReal& aWestLongitude, williamr@2: TReal& aEastLongitude ) const; williamr@2: williamr@2: /** williamr@2: * Sets the border values. williamr@2: * williamr@2: * The input parameters specify the area as described in the williamr@2: * class description. williamr@2: * williamr@2: * If one of the parameters is out of range, this function fails with williamr@2: * panic with @p KLbtErrArgument. The correct ranges are: williamr@2: * -# - 90 =< aSouthLatitude =< aNorthLatitude =< 90 williamr@2: * -# - 180 <= aWestLongitude <= 180 williamr@2: * -# - 180 <= aEastLongitude <= 180 williamr@2: * williamr@2: * @param[in] aSouthLatitude The southern latitude border of the area. williamr@2: * @param[in] aNorthLatitude The northern latitude border of the area. williamr@2: * @param[in] aWestLongitude The western longitude border of the area. williamr@2: * @param[in] aEastLongitude The eastern longitude border of the area. williamr@2: * @panic LocTriggering ELbtErrArgument if the input williamr@2: * parameters are invalid. williamr@2: */ williamr@2: IMPORT_C void SetBorder( williamr@2: TReal aSouthLatitude, williamr@2: TReal aNorthLatitude, williamr@2: TReal aWestLongitude, williamr@2: TReal aEastLongitude ); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * Externalize method that subclass must implement. williamr@2: * @param[in] aStream Stream to which the object should be externalized. williamr@2: */ williamr@2: virtual void DoExternalizeL(RWriteStream& aStream) const ; williamr@2: williamr@2: /** williamr@2: * Internalize method that subclass must implement. williamr@2: * @param[in] aStream Stream from which the object should be internalized. williamr@2: */ williamr@2: virtual void DoInternalizeL(RReadStream& aStream) ; williamr@2: williamr@2: private: williamr@2: /** williamr@2: * Constructor. williamr@2: */ williamr@2: CLbtGeoRect(); williamr@2: williamr@2: /** williamr@2: * By default, prohibit copy constructor williamr@2: */ williamr@2: CLbtGeoRect( const CLbtGeoRect& ); williamr@2: williamr@2: /** williamr@2: * Prohibit assigment operator williamr@2: */ williamr@2: CLbtGeoRect& operator= ( const CLbtGeoRect& ); williamr@2: williamr@2: /** williamr@2: * Symbian 2nd phase constructor williamr@2: */ williamr@2: void ConstructL(); williamr@2: williamr@2: /** williamr@2: * Symbian 2nd phase constructor williamr@2: * williamr@2: * @param[in] aSouthLatitude The southern latitude border of the area. williamr@2: * @param[in] aNorthLatitude The northern latitude border of the area. williamr@2: * @param[in] aWestLongitude The western longitude border of the area. williamr@2: * @param[in] aEastLongitude The eastern longitude border of the area. williamr@2: */ williamr@2: void ConstructL( TReal aSouthLatitude, williamr@2: TReal aNorthLatitude, williamr@2: TReal aWestLongitude, williamr@2: TReal aEastLongitude ); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * The southern latitude border of the area. williamr@2: */ williamr@2: TReal iSouthLatitude; williamr@2: williamr@2: /** williamr@2: * The northern latitude border of the area. williamr@2: */ williamr@2: TReal iNorthLatitude; williamr@2: williamr@2: /** williamr@2: * The western longitude border of the area. williamr@2: */ williamr@2: TReal iWestLongitude; williamr@2: williamr@2: /** williamr@2: * The eastern longitude border of the area. williamr@2: */ williamr@2: TReal iEastLongitude; williamr@2: }; williamr@2: williamr@2: #endif // LBTGEORECT_H