epoc32/include/mw/epos_cposlmareacriteria.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.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  CPosLmAreaCriteria class
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#ifndef CPOSLMAREACRITERIA_H
williamr@2
    20
#define CPOSLMAREACRITERIA_H
williamr@2
    21
williamr@2
    22
#include <e32base.h>
williamr@2
    23
#include "EPos_CPosLmSearchCriteria.h"
williamr@2
    24
williamr@2
    25
/**
williamr@2
    26
*  Criterion for searching for landmarks which reside in a certain area.
williamr@2
    27
*
williamr@2
    28
*  The search area is defined by providing two latitude and two longitude
williamr@2
    29
*  values which specify the borders of the area. Note that this search
williamr@2
    30
*  does not consider landmark coverage radius, see
williamr@2
    31
*  @p CPosLandmark::GetCoverageRadius.
williamr@2
    32
*
williamr@2
    33
*  The search area is defined as a spherical rectangle, limited by two
williamr@2
    34
*  longitude borders (WestLongitude and EastLongitude) and two latitude
williamr@2
    35
*  borders (SouthLatitude and NorthLatitude).
williamr@2
    36
*
williamr@2
    37
*  It is required that -90 =< SouthLatitude =< NorthLatitude =< 90.
williamr@2
    38
*  WestLongitude must be in the interval [-180, 180), i.e. not including +180.
williamr@2
    39
*  EastLongitude must be in the interval [-180, 180], i.e. including +180.
williamr@2
    40
*  It is allowed that EastLongitude < WestLongitude. This defines an area
williamr@2
    41
*  which crosses the 180 meridian. The area definition is inclusive, i.e.
williamr@2
    42
*  landmarks which lie on the border of the area will be considered as matches.
williamr@2
    43
*  If WestLongitude = EastLongitude and NorthLatitude = SouthLatitude then
williamr@2
    44
*  only landmarks which match the longitude and latitude respectively, are
williamr@2
    45
*  considered to be matches. If WestLongitude = -180 and EastLongitude = +180,
williamr@2
    46
*  all longitudes are included in the search.
williamr@2
    47
*
williamr@2
    48
*  This criterion is only valid when searching for landmarks, i.e. if it
williamr@2
    49
*  is passed to @p CPosLandmarkSearch::StartCategorySearchL, the function
williamr@2
    50
*  will fail with error code @p KErrArgument.
williamr@2
    51
*
williamr@2
    52
*  @lib eposlmsearchlib.lib
williamr@2
    53
*  @since S60 3.0
williamr@2
    54
*/
williamr@2
    55
class CPosLmAreaCriteria : public CPosLmSearchCriteria
williamr@2
    56
    {
williamr@2
    57
    public:
williamr@2
    58
williamr@2
    59
        /**
williamr@2
    60
        * Two-phased constructor.
williamr@2
    61
        *
williamr@2
    62
        * The input parameters specify the area to search as described
williamr@2
    63
        * in the class description.
williamr@2
    64
        *
williamr@2
    65
        * If one of the parameters is out of range, this function fails with
williamr@2
    66
        * error code @p KErrArgument. The correct ranges are:
williamr@2
    67
        *   -# -90 =< aSouthLatitude =< aNorthLatitude =< 90
williamr@2
    68
        *   -# -180 <= aWestLongitude < 180
williamr@2
    69
        *   -# -180 <= aEastLongitude <= 180
williamr@2
    70
        *
williamr@2
    71
        * @param[in] aSouthLatitude The southern latitude border of the search area.
williamr@2
    72
        * @param[in] aNorthLatitude The northern latitude border of the search area.
williamr@2
    73
        * @param[in] aWestLongitude The western longitude border of the search area.
williamr@2
    74
        * @param[in] aEastLongitude The eastern longitude border of the search area.
williamr@2
    75
        * @returns A new instance of this class.
williamr@2
    76
        */
williamr@2
    77
        IMPORT_C static CPosLmAreaCriteria* NewLC(
williamr@2
    78
            const TReal64& aSouthLatitude,
williamr@2
    79
            const TReal64& aNorthLatitude,
williamr@2
    80
            const TReal64& aWestLongitude,
williamr@2
    81
            const TReal64& aEastLongitude
williamr@2
    82
        );
williamr@2
    83
williamr@2
    84
        /**
williamr@2
    85
        * Destructor.
williamr@2
    86
        */
williamr@2
    87
        virtual ~CPosLmAreaCriteria();
williamr@2
    88
williamr@2
    89
    public:
williamr@2
    90
williamr@2
    91
        /**
williamr@2
    92
        * Returns the search area.
williamr@2
    93
        *
williamr@2
    94
        * @param[out] aSouthLatitude The southern latitude border of the search area.
williamr@2
    95
        * @param[out] aNorthLatitude The northern latitude border of the search area.
williamr@2
    96
        * @param[out] aWestLongitude The western longitude border of the search area.
williamr@2
    97
        * @param[out] aEastLongitude The eastern longitude border of the search area.
williamr@2
    98
        */
williamr@2
    99
        IMPORT_C void GetSearchArea(
williamr@2
   100
            TReal64& aSouthLatitude,
williamr@2
   101
            TReal64& aNorthLatitude,
williamr@2
   102
            TReal64& aWestLongitude,
williamr@2
   103
            TReal64& aEastLongitude
williamr@2
   104
        ) const;
williamr@2
   105
williamr@2
   106
        /**
williamr@2
   107
        * Define the search area.
williamr@2
   108
        *
williamr@2
   109
        * The input parameters specify the area to search as described in the
williamr@2
   110
        * class description.
williamr@2
   111
        *
williamr@2
   112
        * If one of the parameters is out of range, this function fails with
williamr@2
   113
        * error code @p KErrArgument. The correct ranges are:
williamr@2
   114
        *   -# -90 =< aSouthLatitude =< aNorthLatitude =< 90
williamr@2
   115
        *   -# -180 <= aWestLongitude < 180
williamr@2
   116
        *   -# -180 <= aEastLongitude <= 180
williamr@2
   117
        *
williamr@2
   118
        * @param[in] aSouthLatitude The southern latitude border of the search area.
williamr@2
   119
        * @param[in] aNorthLatitude The northern latitude border of the search area.
williamr@2
   120
        * @param[in] aWestLongitude The western longitude border of the search area.
williamr@2
   121
        * @param[in] aEastLongitude The eastern longitude border of the search area.
williamr@2
   122
        * @returns @p KErrNone if successful, @p KErrArgument if the input
williamr@2
   123
        *   parameters are invalid, otherwise a system wide error code.
williamr@2
   124
        */
williamr@2
   125
        IMPORT_C TInt SetSearchArea(
williamr@2
   126
            const TReal64& aSouthLatitude,
williamr@2
   127
            const TReal64& aNorthLatitude,
williamr@2
   128
            const TReal64& aWestLongitude,
williamr@2
   129
            const TReal64& aEastLongitude
williamr@2
   130
        );
williamr@2
   131
williamr@2
   132
    private:
williamr@2
   133
williamr@2
   134
        // C++ constructor
williamr@2
   135
        CPosLmAreaCriteria();
williamr@2
   136
williamr@2
   137
        void ConstructL(
williamr@2
   138
            const TReal64&  aSouthLatitude,
williamr@2
   139
            const TReal64&  aNorthLatitude,
williamr@2
   140
            const TReal64&  aWestLongitude,
williamr@2
   141
            const TReal64&  aEastLongitude
williamr@2
   142
        );
williamr@2
   143
williamr@2
   144
        // Prohibit copy constructor
williamr@2
   145
        CPosLmAreaCriteria( const CPosLmAreaCriteria& );
williamr@2
   146
        // Prohibit assigment operator
williamr@2
   147
        CPosLmAreaCriteria& operator= ( const CPosLmAreaCriteria& );
williamr@2
   148
williamr@2
   149
    private:
williamr@2
   150
williamr@2
   151
        TReal64 iSouthLatitude;
williamr@2
   152
        TReal64 iNorthLatitude;
williamr@2
   153
        TReal64 iWestLongitude;
williamr@2
   154
        TReal64 iEastLongitude;
williamr@2
   155
williamr@2
   156
    };
williamr@2
   157
williamr@2
   158
#endif      // CPOSLMAREACRITERIA_H
williamr@2
   159
williamr@2
   160