locsrv_plat/map_image_api/inc/mnmapimageparams.h
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 2007 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:  TMnMapImageParams class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MNMAPIMAGEPARAMS_H_
       
    20 #define MNMAPIMAGEPARAMS_H_
       
    21 
       
    22 #include <lbsposition.h>
       
    23 
       
    24 /** Container class for map image rendering parameters.
       
    25  *  It stores following parameters:
       
    26  *   - center coordinate of map image,
       
    27  *   - size of the image,
       
    28  *   - image scale
       
    29  *   - image direction
       
    30  *   - type of image 
       
    31  *  @since 5.0 */
       
    32 class TMnMapImageParams
       
    33     {
       
    34     public:
       
    35 
       
    36         /** Types of map images */
       
    37         enum TMapImageType
       
    38             {
       
    39             /** Type is unknown or unspecified */
       
    40             ETypeUnspecified        = 0x00,
       
    41             /** Scalable graphical maps (e.g. street maps) */
       
    42             ETypeVectorMap          = 0x01,
       
    43             /** Image built of satellite photographs of Earth */
       
    44             ETypeSatelliteImage     = 0x02
       
    45             };
       
    46             
       
    47         /** Type for bitmap of image types defined in @ref TMapImageType */
       
    48         typedef TUint32 TMapImageTypes;
       
    49 
       
    50     public:
       
    51         IMPORT_C TMnMapImageParams();
       
    52 
       
    53         /** Sets a world coordinate as a center of desired image.
       
    54          *  @param[in] aCoordinate World location to be center of rendered map.*/
       
    55         inline void SetCenterPoint( const TCoordinate& aCoordinate );
       
    56 
       
    57         /** Returns world location, selected by client as the map center.
       
    58          *  @param aCoordinate Coordinate of map's center. */
       
    59         inline void GetCenterPoint( TCoordinate& aCoordinate ) const;
       
    60 
       
    61         /** Sets the width and heigth of the world area to be covered by the map image.
       
    62          *  These two parameters define an ellipse, covering the world area, 
       
    63          *  which is <i>required</i> to be visible on the map. Actual visible area
       
    64          *  can be larger, if given image size and area have different aspect ratios.
       
    65          *  @param[in] aWidth The length in meters of the line, orthogonal to the image 
       
    66          *      direction and going through center point
       
    67          *  @param[in] aHeight The length in meters of the line, parallel to the image 
       
    68          *      direction and going through center point */
       
    69         inline void SetVisibleArea( TReal32 aWidth, TReal32 aHeight );
       
    70         
       
    71         /** Returns the width and heigth of the world area to be covered by the map image.
       
    72          *  These two parameters define an ellipse, covering the world area, 
       
    73          *  which is <i>required</i> to be visible on the map. Actual visible area
       
    74          *  can be larger, if given image size and area have different aspect ratios.
       
    75          *  @param[out] aWidth The length in meters of the line, orthogonal to the image 
       
    76          *      direction and going through center point
       
    77          *  @param[out] aHeight The length in meters of the line, parallel to the image 
       
    78          *      direction and going through center point */
       
    79         inline void GetVisibleArea( TReal32& aWidth, TReal32& aHeight ) const;
       
    80 
       
    81         /** Sets size of desired map image in pixels.
       
    82          *  @param aImageSize Width and height of the map image. */
       
    83         inline void SetSize( const TSize& aImageSize );
       
    84 
       
    85         /** Returns size of desired map image in pixels.
       
    86          *  @return Width and height of the map image. */
       
    87         inline TSize Size() const;
       
    88 
       
    89         /** Sets required direction of the map.
       
    90          *  Image direction is defined as clockwise angle between two vectors:
       
    91          *  - a.  vector from center point towards true North Pole parallel to center’s longitude.
       
    92          *        If center is positioned at North Pole, then this vector is directed
       
    93          *        towards South Pole parallel to center’s longitude.
       
    94          *  - b.  vector from center point (see @ref SetCenterPoint()) towards center of image’s top side.
       
    95          * 
       
    96          *  This direction parameter can be thought of as "true heading" of the image.
       
    97          *
       
    98          * @param aDirection Direction in degrees. */
       
    99         inline void SetDirection( TReal32 aDirection );
       
   100 
       
   101         /** Returns selected direction of the map. For details of direction definition,
       
   102          *  see @ref SetDirection().
       
   103          *  @return Direction in degrees.*/
       
   104         inline TReal32 Direction() const;
       
   105 
       
   106         /** Sets desired type of map image. If set, then rendering will
       
   107          *  provide (if supported) maps of specified type. Default value is
       
   108          *  ETypeUnspecified, which allows provider to select best suitable image
       
   109          *  for given scale, center etc.*/
       
   110         inline void SetImageType( TMapImageType aImageType );
       
   111 
       
   112         /** Returns type of last rendered map image. (It always matches the value
       
   113          *  specified by client in @ref SetImageType except if ETypeUnspecified
       
   114          *  is given by client.) */
       
   115         inline TMapImageType ImageType() const;
       
   116 
       
   117         /** Sets internal ID of a projection used by renderer.
       
   118          *  It is useful if provider supports several projections.
       
   119          *  Currently must not be used by clients, only for internal purposes
       
   120          *  of provider application.
       
   121          *  @param aProjectionId Renderer'd internal id of used projection */
       
   122         inline void SetProjectionId( TInt aProjectionId );
       
   123 
       
   124         /** Sets internal ID of a projection used by renderer.
       
   125          *  It is meaningful if provider supports several projections.
       
   126          *  Currently must not be used by clients, only for internal purposes
       
   127          *  of provider application.
       
   128          *  @return Renderer'd internal id of used projection. */
       
   129         inline TInt ProjectionId();
       
   130 
       
   131     private:
       
   132         TCoordinate     iCenterPoint;
       
   133         TReal32         iAreaWidth;
       
   134         TReal32         iAreaHeight;
       
   135         TSize           iSize;
       
   136         TReal32         iDirection;
       
   137 
       
   138         TMapImageType   iImageType;
       
   139         TInt            iProjectionId;
       
   140 
       
   141         TInt8           reserved[32];
       
   142     };
       
   143 
       
   144 #include <mnmapimageparams.inl>
       
   145 
       
   146 #endif /*MNMAPIMAGEPARAMS_H_*/