epoc32/include/mw/lbtgeorect.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Geographical rectangular area class definition.
    15 *
    16 */
    17 
    18 
    19 #ifndef LBTGEORECT_H
    20 #define LBTGEORECT_H
    21 
    22 #include "lbtgeoareabase.h"
    23 
    24 /**
    25  * Geographical rectangular area.
    26  *
    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 ).
    30  *
    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. 
    36  */
    37 class CLbtGeoRect : public CLbtGeoAreaBase
    38     {
    39 public:
    40     /**
    41      * Allocates and constructs a new geographical rectangular area object.
    42      * In returned object, the border values are set to NaN.
    43      *
    44      * @return Pointer to the new constructed geographical rectangular 
    45      * area object.
    46      */
    47     IMPORT_C static CLbtGeoRect* NewL();
    48 
    49 
    50     /**
    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.
    54      *
    55      * @return Pointer to the new constructed geographical rectangular 
    56      * area object.
    57      */
    58     IMPORT_C static CLbtGeoRect* NewLC();
    59 
    60     /**
    61      * Allocates and constructs a new geographical rectangular area object.
    62      *
    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 
    68      * area object.
    69      */
    70     IMPORT_C static CLbtGeoRect* NewL( 
    71         TReal  aSouthLatitude,
    72         TReal  aNorthLatitude,
    73         TReal  aWestLongitude,
    74         TReal  aEastLongitude );
    75 
    76     /**
    77      * Allocates and constructs a new geographical rectangular area object
    78      * and pushes it onto cleanup stack.
    79      *
    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 
    85      * area object.
    86      */
    87     IMPORT_C static CLbtGeoRect* NewLC( 
    88         TReal  aSouthLatitude,
    89         TReal  aNorthLatitude,
    90         TReal  aWestLongitude,
    91         TReal  aEastLongitude );
    92     
    93     
    94     /**
    95      * Destructor
    96      */
    97     IMPORT_C ~CLbtGeoRect();
    98 
    99     /**
   100      * Returns the type of geographical area, CLbtGeoAreaBase::ERectangular.
   101      *
   102      * @return CLbtGeoAreaBase::ERectangular.
   103      */
   104     virtual TGeoAreaType Type() const;
   105 
   106     /**
   107      * Gets border values. If the border value has not been set
   108      * before, the returned border values are NaN.
   109      *
   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.
   114      */
   115     IMPORT_C void GetBorder( 
   116         TReal&  aSouthLatitude,
   117         TReal&  aNorthLatitude,
   118         TReal&  aWestLongitude,
   119         TReal&  aEastLongitude ) const;
   120     
   121     /**
   122      * Sets the border values.
   123      *
   124      * The input parameters specify the area as described in the
   125      * class description.
   126      *
   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
   132      *
   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.
   139      */
   140     IMPORT_C void SetBorder( 
   141         TReal  aSouthLatitude,
   142         TReal  aNorthLatitude,
   143         TReal  aWestLongitude,
   144         TReal  aEastLongitude );
   145 
   146 protected:
   147     /**
   148      * Externalize method that subclass must implement.
   149      * @param[in] aStream Stream to which the object should be externalized.
   150      */
   151     virtual void DoExternalizeL(RWriteStream& aStream) const ;
   152     
   153     /**
   154      * Internalize method that subclass must implement.
   155      * @param[in] aStream Stream from which the object should be internalized.
   156      */
   157     virtual void DoInternalizeL(RReadStream& aStream)  ;
   158 
   159 private:
   160     /**
   161      * Constructor.
   162      */
   163     CLbtGeoRect();
   164     
   165     /**
   166      * By default, prohibit copy constructor
   167      */
   168     CLbtGeoRect( const CLbtGeoRect& );
   169     
   170     /**
   171      *  Prohibit assigment operator
   172      */
   173     CLbtGeoRect& operator= ( const CLbtGeoRect& );
   174     
   175     /**
   176      * Symbian 2nd phase constructor
   177      */    
   178     void ConstructL();
   179     
   180     /**
   181      * Symbian 2nd phase constructor
   182      *
   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.
   187      */
   188     void ConstructL( TReal  aSouthLatitude,
   189         TReal  aNorthLatitude,
   190         TReal  aWestLongitude,
   191         TReal  aEastLongitude );
   192 
   193 private:
   194     /**
   195      * The southern latitude border of the area.
   196      */
   197     TReal iSouthLatitude;
   198     
   199     /**
   200      * The northern latitude border of the area. 
   201      */
   202     TReal iNorthLatitude;
   203     
   204     /**
   205      * The western longitude border of the area.
   206      */
   207     TReal iWestLongitude;
   208     
   209     /**
   210      * The eastern longitude border of the area.  
   211      */
   212     TReal iEastLongitude;
   213     };
   214 
   215 #endif // LBTGEORECT_H