epoc32/include/mw/epos_cposlmnearestcriteria.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/epos_cposlmnearestcriteria.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/epos_cposlmnearestcriteria.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,159 @@
     1.4 -epos_cposlmnearestcriteria.h
     1.5 +/*
     1.6 +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  CPosLmNearestCriteria class
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef CPOSLMNEARESTCRITERIA_H
    1.24 +#define CPOSLMNEARESTCRITERIA_H
    1.25 +
    1.26 +#include <e32base.h>
    1.27 +#include <LbsPosition.h>
    1.28 +#include "EPos_CPosLmSearchCriteria.h"
    1.29 +
    1.30 +
    1.31 +/**
    1.32 +*  Criterion for finding the landmarks which are closest to a certain
    1.33 +*  coordinate, called "center coordinate".
    1.34 +*
    1.35 +*  When using @ref CPosLmNearestCriteria, the matches returned in the search
    1.36 +*  are sorted in ascending distance order if the client does not specify
    1.37 +*  other sort preferences.
    1.38 +*
    1.39 +*  By default, this search returns all landmarks in the database, except
    1.40 +*  those which have no coordinates. It is recommended to specify a maximum
    1.41 +*  distance to narrow down the search. This is done by @ref SetMaxDistance.
    1.42 +*
    1.43 +*  The client can specify if the coverage radius should be used.
    1.44 +*  If coverage radius is used, the distance to the landmark coverage area
    1.45 +*  border is used instead of the distance to the landmark coverage area
    1.46 +*  center. If the source coordinate is inside the landmark coverage area,
    1.47 +*  the distance is considered zero. By default, the coverage radius is not
    1.48 +*  used.
    1.49 +*
    1.50 +*  This criterion is only valid when searching for landmarks, i.e. if it
    1.51 +*  is passed to @p CPosLandmarkSearch::StartCategorySearchL, the function
    1.52 +*  will fail with error code @p KErrArgument.
    1.53 +*
    1.54 +*  @lib eposlmsearchlib.lib
    1.55 +*  @since S60 3.0
    1.56 +*/
    1.57 +class CPosLmNearestCriteria : public CPosLmSearchCriteria
    1.58 +    {
    1.59 +    public:
    1.60 +
    1.61 +        /**
    1.62 +        * Two-phased constructor.
    1.63 +        *
    1.64 +        * Latitude and longitude must be set in the coordinate (not NaN).
    1.65 +        * Altitude is ignored.
    1.66 +        *
    1.67 +        * @param[in] aCoordinate The center coordinate of the landmark search.
    1.68 +        * @param[in] aUseCoverageRadius @p ETrue if coverage radius should be
    1.69 +        *   considered in the search.
    1.70 +        *
    1.71 +        * @panic "Landmarks Client"-EPosNaNCoordinate Latitude and/or longitude is NaN.
    1.72 +        */
    1.73 +        IMPORT_C static CPosLmNearestCriteria* NewLC(
    1.74 +            const TCoordinate& aCoordinate,
    1.75 +            TBool aUseCoverageRadius = EFalse
    1.76 +        );
    1.77 +
    1.78 +        /**
    1.79 +        * Destructor.
    1.80 +        */
    1.81 +        virtual ~CPosLmNearestCriteria();
    1.82 +
    1.83 +    public:
    1.84 +
    1.85 +        /**
    1.86 +        * Returns the center coordinate of the search.
    1.87 +        *
    1.88 +        * @param[out] aCoordinate On return, contains the center coordinate.
    1.89 +        */
    1.90 +        IMPORT_C void GetCoordinate( TCoordinate& aCoordinate ) const;
    1.91 +
    1.92 +        /**
    1.93 +        * Set the center coordinate of the search.
    1.94 +        *
    1.95 +        * Latitude and longitude must be set in the coordinate (not NaN).
    1.96 +        * Altitude is ignored.
    1.97 +        *
    1.98 +        * @param[in] aCoordinate The center coordinate of the landmarks search.
    1.99 +        *
   1.100 +        * @panic "Landmarks Client"-EPosNaNCoordinate Latitude and/or longitude is NaN.
   1.101 +        */
   1.102 +        IMPORT_C void SetCoordinate( const TCoordinate& aCoordinate );
   1.103 +
   1.104 +        /**
   1.105 +        * Returns if coverage radius is considered in the search.
   1.106 +        *
   1.107 +        * @return @p ETrue if coverage radius is considered in the search.
   1.108 +        *   @p EFalse otherwise.
   1.109 +        */
   1.110 +        IMPORT_C TBool UseCoverageRadius() const;
   1.111 +
   1.112 +        /**
   1.113 +        * Set if coverage radius should be considered in the search.
   1.114 +        *
   1.115 +        * @param aUseCoverageRadius @p ETrue if coverage radius should be
   1.116 +        *   considered in the search. @p EFalse otherwise.
   1.117 +        */
   1.118 +        IMPORT_C void SetUseCoverageRadius( TBool aUseCoverageRadius );
   1.119 +
   1.120 +        /**
   1.121 +        * Returns whether the search should be limited to landmarks which are
   1.122 +        * closer than a maximum distance.
   1.123 +        *
   1.124 +        * By default the maximum distance is set to NaN which means that the
   1.125 +        * distance is unlimited.
   1.126 +        *
   1.127 +        * @return The maximum distance or NaN if the distance is unlimited.
   1.128 +        */
   1.129 +        IMPORT_C TReal32 MaxDistance() const;
   1.130 +
   1.131 +        /**
   1.132 +        * Set a maximum distance for the search.
   1.133 +        *
   1.134 +        * Only landmarks, which are closer to the center coordinate than the
   1.135 +        * maximum distance are considered matches.
   1.136 +        *
   1.137 +        * @param aMaxDistance The maximum distance or NaN if the distance
   1.138 +        *   should be unlimited.
   1.139 +        */
   1.140 +        IMPORT_C void SetMaxDistance( TReal32 aMaxDistance );
   1.141 +
   1.142 +    private:
   1.143 +
   1.144 +        CPosLmNearestCriteria(TBool aUseCoverageRadius);
   1.145 +
   1.146 +        void ConstructL(const TCoordinate& aCoordinate);
   1.147 +
   1.148 +        // Prohibit copy constructor
   1.149 +        CPosLmNearestCriteria( const CPosLmNearestCriteria& );
   1.150 +        // Prohibit assigment operator
   1.151 +        CPosLmNearestCriteria& operator= ( const CPosLmNearestCriteria& );
   1.152 +
   1.153 +    private:
   1.154 +
   1.155 +        TCoordinate iCenterCoordinate;
   1.156 +        TBool       iUseCoverageRadius;
   1.157 +        TReal32     iMaxDistance;
   1.158 +
   1.159 +    };
   1.160 +
   1.161 +#endif      // CPOSLMNEARESTCRITERIA_H
   1.162 +
   1.163 +