epoc32/include/mw/lbtgeocircle.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/lbtgeocircle.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,231 @@
     1.4 +/*
     1.5 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* 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
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  Geographical circular area class definition.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef LBTGEOCIRCLE_H
    1.23 +#define LBTGEOCIRCLE_H
    1.24 +
    1.25 +#include <lbtgeoareabase.h>
    1.26 +#include <lbsposition.h>
    1.27 +
    1.28 +/**
    1.29 + * Geographical circular area.
    1.30 + *
    1.31 + * A geographical circular area is defined by the center of the 
    1.32 + * circle and the radius. The radius is in meters. The altitude in 
    1.33 + * the center's coordinate is always ignored. It is optionally also possible 
    1.34 + * to provide additional geographical area information of CLbtGeoCell 
    1.35 + * type. Providing additional cell information would enable further 
    1.36 + * optimization by reducing the number of GPS fixes required to
    1.37 + * supervise the trigger, there by, reducing the impact on battery
    1.38 + * consumption. Triggers would, initially, be monitored using the cell 
    1.39 + * information provided. GPS would be used to check the coordinates 
    1.40 + * only when the mobile terminal reaches the cell / cells specified. 
    1.41 + * If a particular location is served by multiple cells, then it is 
    1.42 + * important to mention all available cell information. If not, there 
    1.43 + * is a possibility of missing triggers even when the mobile terminal 
    1.44 + * reaches the location specified by the coordinates.
    1.45 + *
    1.46 + * @lib lbt.lib
    1.47 + *
    1.48 + * @since S60 5.1
    1.49 + */
    1.50 +class CLbtGeoCircle : public CLbtGeoAreaBase
    1.51 +    {
    1.52 +public:
    1.53 +    /**
    1.54 +     * Allocates and constructs a new geographical circular area object.
    1.55 +     * In the returned object, the latitude, longitude and altitude 
    1.56 +     * are set to NaN, and the radius is set to NaN.
    1.57 +     *
    1.58 +     * @return Pointer to the new geographical circular area object.
    1.59 +     */
    1.60 +    IMPORT_C static CLbtGeoCircle* NewL();
    1.61 +
    1.62 +    /**
    1.63 +     * Constructs a new geographical circular area object and pushes
    1.64 +     * it onto cleanup stack. 
    1.65 +     * In the returned object, the latitude, longitude and altitude 
    1.66 +     * are set to NaN, and the radius is set to NaN.
    1.67 +     *
    1.68 +     * @return Pointer to the new geographical circular area object.
    1.69 +     */
    1.70 +    IMPORT_C static CLbtGeoCircle* NewLC();
    1.71 +
    1.72 +    /**
    1.73 +     * Allocates and constructs a new geographical circular area object
    1.74 +     * with specified center coordinate and radius.
    1.75 +     *
    1.76 +     * @panic ELbtErrArgument If the input radius is negative.
    1.77 +     *
    1.78 +     * @param[in] aCenter The coordinate of the center.
    1.79 +     * @param[in] aRadiusInMeters The radius of the circle in meters.
    1.80 +     * @return Pointer to the new geographical circle area object.
    1.81 +     */
    1.82 +    IMPORT_C static CLbtGeoCircle* NewL( 
    1.83 +        const TCoordinate& aCenter,
    1.84 +        TReal aRadiusInMeters );
    1.85 +
    1.86 +    /**
    1.87 +     * Allocates and constructs a new geographical circular area object
    1.88 +     * with specified center coordinate and radius. The constructed
    1.89 +     * object is pushed onto cleanup stack.
    1.90 +     *
    1.91 +     * @panic ELbtErrArgument If the input radius is negative.
    1.92 +     *
    1.93 +     * @param[in] aCenter The coordinate of the center.
    1.94 +     * @param[in] aRadiusInMeters The radius of the circle in meters.
    1.95 +     * @return Pointer to the new geographical circle area object.
    1.96 +     */
    1.97 +    IMPORT_C static CLbtGeoCircle* NewLC( 
    1.98 +        const TCoordinate& aCenter,
    1.99 +        TReal aRadiusInMeters );
   1.100 +
   1.101 +    /**
   1.102 +     * Destructor.
   1.103 +     */
   1.104 +    IMPORT_C ~CLbtGeoCircle();
   1.105 +
   1.106 +    /**
   1.107 +     * Returns the type of geographical area, CLbtGeoAreaBase::ECircle
   1.108 +     *
   1.109 +     * @return CLbtGeoAreaBase::ECircle.
   1.110 +     */
   1.111 +    virtual TGeoAreaType Type() const;
   1.112 +
   1.113 +    /**
   1.114 +     * Gets the center of the area. If the center has not been set
   1.115 +     * before, the returned coordinate has latitude, longitude and
   1.116 +     * altitude set to NaN, 
   1.117 +     *
   1.118 +     * @return The center of the area.
   1.119 +     */
   1.120 +    virtual TCoordinate Center() const;
   1.121 +
   1.122 +    /**
   1.123 +     * Sets the center of the circle.
   1.124 +     *
   1.125 +     * @param[in] aCenter The coordinate of the center.
   1.126 +     */
   1.127 +    IMPORT_C void SetCenter(const TCoordinate& aCenter);
   1.128 +
   1.129 +    /**
   1.130 +     * Gets the radius of the circle. If the radius has not been
   1.131 +     * set before, the returned value is NaN.
   1.132 +     *
   1.133 +     * @return The radius of the circle in meters.
   1.134 +     */
   1.135 +    IMPORT_C TReal Radius() const;
   1.136 +
   1.137 +    /**
   1.138 +     * Sets the radius of the circle.
   1.139 +     *
   1.140 +     * @panic ELbtErrArgument If the input radius is negative.
   1.141 +     *
   1.142 +     * @param[in] aRadiusInMeters The radius of the circle in meters.
   1.143 +     */
   1.144 +    IMPORT_C void SetRadius(TReal aRadiusInMeters);
   1.145 +    
   1.146 +    /**
   1.147 +     * Gets geographical area information. The following method is currently not 
   1.148 +     * supported. This method will only return empty array when invoked.
   1.149 +     *
   1.150 +     * @return An array of geographical area instances
   1.151 +     */
   1.152 +    IMPORT_C RPointerArray< CLbtGeoAreaBase >& GetAdditionalGeoAreaInfo();
   1.153 +    
   1.154 +    /**
   1.155 +     * Sets additional geographical area information. The geographical 
   1.156 +     * information provided can only be of CLbtGeoCell type. This is optional
   1.157 +     * and clients may specify this information when available.The following method 
   1.158 +     * is currently not supported.
   1.159 +     *
   1.160 +     * @panic ELbtErrArgument if argument passed is NULL or if the argument
   1.161 +     * passed is of any other type other than CLbtGeoCell.
   1.162 +     *
   1.163 +     * @param[in] aGeoArea A pointer representing a geographical area.
   1.164 +     */
   1.165 +    IMPORT_C void SetAdditionalGeoAreaInfo(CLbtGeoAreaBase* aGeoArea);
   1.166 +    
   1.167 +    /**
   1.168 +     * Validates cell information.
   1.169 +     *
   1.170 +     * @leave KErrArgument if any of the mandatory parameters have not
   1.171 +     * been specified.
   1.172 +     */
   1.173 +    void ValidateCircleInformationL();  
   1.174 +    
   1.175 +protected:
   1.176 +    
   1.177 +   /**
   1.178 +    * Externalize method that subclass must implement.
   1.179 +    * @param[in] aStream Stream to which the object should be externalized.
   1.180 +    */
   1.181 +   virtual void DoExternalizeL(RWriteStream& aStream) const ;
   1.182 +   
   1.183 +   /**
   1.184 +    * Internalize method that subclass must implement.
   1.185 +    * @param[in] aStream Stream from which the object should be internalized.
   1.186 +    */
   1.187 +   virtual void DoInternalizeL(RReadStream& aStream)  ;
   1.188 +
   1.189 +private:
   1.190 +    /**
   1.191 +     * Default constructor
   1.192 +     */
   1.193 +    CLbtGeoCircle();
   1.194 +
   1.195 +    /**
   1.196 +     * By default, prohibit copy constructor
   1.197 +     */
   1.198 +    CLbtGeoCircle(const CLbtGeoCircle&);
   1.199 +   
   1.200 +    /**
   1.201 +     * Prohibit assigment operator
   1.202 +     */
   1.203 +    CLbtGeoCircle& operator= (const CLbtGeoCircle&);
   1.204 +    
   1.205 +    /**
   1.206 +     * Symbian 2nd phase constructor
   1.207 +     */
   1.208 +    void ConstructL();
   1.209 +    
   1.210 +    /**
   1.211 +     * Symbian 2nd phase constructor
   1.212 +     */
   1.213 +    void ConstructL(TCoordinate aCenter,TReal aRadius);
   1.214 +    
   1.215 +        
   1.216 +private:
   1.217 +    /**
   1.218 +     * The center of the circle.
   1.219 +     */
   1.220 +    TCoordinate iCenter;
   1.221 +
   1.222 +    /**
   1.223 +     * Radius of the circle in meters.
   1.224 +     */
   1.225 +    TReal iRadius;
   1.226 +    
   1.227 +    /**
   1.228 +     * An array of instances representing additional geographical area 
   1.229 +     * information
   1.230 +     */
   1.231 +    RPointerArray< CLbtGeoAreaBase > iAdditionalGeoAreaInfo;
   1.232 +    };
   1.233 +
   1.234 +#endif // LBTGEOCIRCLE_H