epoc32/include/mw/lbtgeocircle.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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 "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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Geographical circular area class definition.
    15 *
    16 */
    17 
    18 
    19 #ifndef LBTGEOCIRCLE_H
    20 #define LBTGEOCIRCLE_H
    21 
    22 #include <lbtgeoareabase.h>
    23 #include <lbsposition.h>
    24 
    25 /**
    26  * Geographical circular area.
    27  *
    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.
    42  *
    43  * @lib lbt.lib
    44  *
    45  * @since S60 5.1
    46  */
    47 class CLbtGeoCircle : public CLbtGeoAreaBase
    48     {
    49 public:
    50     /**
    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.
    54      *
    55      * @return Pointer to the new geographical circular area object.
    56      */
    57     IMPORT_C static CLbtGeoCircle* NewL();
    58 
    59     /**
    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.
    64      *
    65      * @return Pointer to the new geographical circular area object.
    66      */
    67     IMPORT_C static CLbtGeoCircle* NewLC();
    68 
    69     /**
    70      * Allocates and constructs a new geographical circular area object
    71      * with specified center coordinate and radius.
    72      *
    73      * @panic ELbtErrArgument If the input radius is negative.
    74      *
    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.
    78      */
    79     IMPORT_C static CLbtGeoCircle* NewL( 
    80         const TCoordinate& aCenter,
    81         TReal aRadiusInMeters );
    82 
    83     /**
    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.
    87      *
    88      * @panic ELbtErrArgument If the input radius is negative.
    89      *
    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.
    93      */
    94     IMPORT_C static CLbtGeoCircle* NewLC( 
    95         const TCoordinate& aCenter,
    96         TReal aRadiusInMeters );
    97 
    98     /**
    99      * Destructor.
   100      */
   101     IMPORT_C ~CLbtGeoCircle();
   102 
   103     /**
   104      * Returns the type of geographical area, CLbtGeoAreaBase::ECircle
   105      *
   106      * @return CLbtGeoAreaBase::ECircle.
   107      */
   108     virtual TGeoAreaType Type() const;
   109 
   110     /**
   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, 
   114      *
   115      * @return The center of the area.
   116      */
   117     virtual TCoordinate Center() const;
   118 
   119     /**
   120      * Sets the center of the circle.
   121      *
   122      * @param[in] aCenter The coordinate of the center.
   123      */
   124     IMPORT_C void SetCenter(const TCoordinate& aCenter);
   125 
   126     /**
   127      * Gets the radius of the circle. If the radius has not been
   128      * set before, the returned value is NaN.
   129      *
   130      * @return The radius of the circle in meters.
   131      */
   132     IMPORT_C TReal Radius() const;
   133 
   134     /**
   135      * Sets the radius of the circle.
   136      *
   137      * @panic ELbtErrArgument If the input radius is negative.
   138      *
   139      * @param[in] aRadiusInMeters The radius of the circle in meters.
   140      */
   141     IMPORT_C void SetRadius(TReal aRadiusInMeters);
   142     
   143     /**
   144      * Gets geographical area information. The following method is currently not 
   145      * supported. This method will only return empty array when invoked.
   146      *
   147      * @return An array of geographical area instances
   148      */
   149     IMPORT_C RPointerArray< CLbtGeoAreaBase >& GetAdditionalGeoAreaInfo();
   150     
   151     /**
   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.
   156      *
   157      * @panic ELbtErrArgument if argument passed is NULL or if the argument
   158      * passed is of any other type other than CLbtGeoCell.
   159      *
   160      * @param[in] aGeoArea A pointer representing a geographical area.
   161      */
   162     IMPORT_C void SetAdditionalGeoAreaInfo(CLbtGeoAreaBase* aGeoArea);
   163     
   164     /**
   165      * Validates cell information.
   166      *
   167      * @leave KErrArgument if any of the mandatory parameters have not
   168      * been specified.
   169      */
   170     void ValidateCircleInformationL();  
   171     
   172 protected:
   173     
   174    /**
   175     * Externalize method that subclass must implement.
   176     * @param[in] aStream Stream to which the object should be externalized.
   177     */
   178    virtual void DoExternalizeL(RWriteStream& aStream) const ;
   179    
   180    /**
   181     * Internalize method that subclass must implement.
   182     * @param[in] aStream Stream from which the object should be internalized.
   183     */
   184    virtual void DoInternalizeL(RReadStream& aStream)  ;
   185 
   186 private:
   187     /**
   188      * Default constructor
   189      */
   190     CLbtGeoCircle();
   191 
   192     /**
   193      * By default, prohibit copy constructor
   194      */
   195     CLbtGeoCircle(const CLbtGeoCircle&);
   196    
   197     /**
   198      * Prohibit assigment operator
   199      */
   200     CLbtGeoCircle& operator= (const CLbtGeoCircle&);
   201     
   202     /**
   203      * Symbian 2nd phase constructor
   204      */
   205     void ConstructL();
   206     
   207     /**
   208      * Symbian 2nd phase constructor
   209      */
   210     void ConstructL(TCoordinate aCenter,TReal aRadius);
   211     
   212         
   213 private:
   214     /**
   215      * The center of the circle.
   216      */
   217     TCoordinate iCenter;
   218 
   219     /**
   220      * Radius of the circle in meters.
   221      */
   222     TReal iRadius;
   223     
   224     /**
   225      * An array of instances representing additional geographical area 
   226      * information
   227      */
   228     RPointerArray< CLbtGeoAreaBase > iAdditionalGeoAreaInfo;
   229     };
   230 
   231 #endif // LBTGEOCIRCLE_H