svgtopt/gfx2d/inc/GfxRectangularShape.h
changeset 0 d46562c3d99d
equal deleted inserted replaced
-1:000000000000 0:d46562c3d99d
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Graphics Extension Library header file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef GFXRECTANGULARSHAPE_H
       
    20 #define GFXRECTANGULARSHAPE_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32std.h>
       
    24 
       
    25 #include <VG/openvg.h>
       
    26 
       
    27 #include "GfxFloatFixPt.h"
       
    28 #include "GfxShape.h"
       
    29 
       
    30 
       
    31 /**
       
    32  * This class implements the properties of a rectangle.
       
    33  *
       
    34  *  @lib Gfx2D.lib
       
    35  *  @since 1.0
       
    36  */
       
    37 class TGfxRectangularShape : public MGfxShape
       
    38     {
       
    39     public:
       
    40 
       
    41         /**
       
    42          * Constructor.
       
    43          *
       
    44          * @since 1.0
       
    45          * @return
       
    46          */
       
    47                 TGfxRectangularShape();
       
    48 
       
    49         /**
       
    50          * Construct a rectangle from top-left, width/height info.
       
    51          *
       
    52          * @since 1.0
       
    53          * @param aX : x coordinate of top-left corner
       
    54          * @param aY : y coordinate of top-left corner
       
    55          * @param aWidth: width of rectangle
       
    56          * @param aHeight : height of rectangle
       
    57          * @return
       
    58          */
       
    59                 TGfxRectangularShape( const TFloatFixPt& aX,
       
    60                                               const TFloatFixPt& aY,
       
    61                                               const TFloatFixPt& aWidth,
       
    62                                               const TFloatFixPt& aHeight );
       
    63 
       
    64         /**
       
    65          * Get the center x coordinate.
       
    66          *
       
    67          * @since 1.0
       
    68          * @return x coordinate of the center.
       
    69          */
       
    70          TFloatFixPt CenterX();
       
    71 
       
    72         /**
       
    73          * Get the center y coordinate.
       
    74          *
       
    75          * @since 1.0
       
    76          * @return y coordinate of the center.
       
    77          */
       
    78          TFloatFixPt CenterY();
       
    79 
       
    80         /**
       
    81          * Get the minimum x coordinate value.
       
    82          *
       
    83          * @since 1.0
       
    84          * @return minimum x coordinate value.
       
    85          */
       
    86          TFloatFixPt MinX();
       
    87 
       
    88         /**
       
    89          * Get the minimum y coordinate value.
       
    90          *
       
    91          * @since 1.0
       
    92          * @return minimum y coordinate value.
       
    93          */
       
    94          TFloatFixPt MinY();
       
    95 
       
    96         /**
       
    97          * Get the maximum x coordinate value.
       
    98          *
       
    99          * @since 1.0
       
   100          * @return maximum x coordinate value.
       
   101          */
       
   102          TFloatFixPt MaxX();
       
   103 
       
   104         /**
       
   105          * Get the maximum y coordinate value.
       
   106          *
       
   107          * @since 1.0
       
   108          * @return maximum y coordinate value.
       
   109          */
       
   110          TFloatFixPt MaxY();
       
   111 
       
   112         /**
       
   113          * Get the bounding box for this rectangle.
       
   114          *
       
   115          * @since 1.0
       
   116          * @param aAt : transform to apply.
       
   117          * @param aRect : rectangle to store bounding box info.
       
   118          * @return maximum y coordinate value.
       
   119          */
       
   120          void   GetBounds( const TGfxAffineTransform& aAt,
       
   121                                    TGfxRectangle2D& aRect );
       
   122 
       
   123         /**
       
   124          * Get the area.
       
   125          *
       
   126          * @since 1.0
       
   127          * @return area
       
   128          */
       
   129 
       
   130          TFloatFixPt AreaSize();
       
   131 
       
   132 		//
       
   133 		// OpenVG Path accessor methods..
       
   134 		//
       
   135 		//
       
   136 
       
   137     public:
       
   138         TFloatFixPt          iWidth;
       
   139         TFloatFixPt          iHeight;
       
   140         TFloatFixPt          iX;
       
   141         TFloatFixPt          iY;
       
   142     };
       
   143 
       
   144 #endif      // GFXRECTANGULARSHAPE_H