svgtopt/SVG/SVGEngine/inc/SVGFourPointRect.h
changeset 0 d46562c3d99d
equal deleted inserted replaced
-1:000000000000 0:d46562c3d99d
       
     1 /*
       
     2 * Copyright (c) 2003 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:  SVG Engine header file
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SVGFOURPOINTRECT_H
       
    20 #define SVGFOURPOINTRECT_H
       
    21 
       
    22 #if !defined(__E32BASE_H__)
       
    23 #include <e32base.h>
       
    24 #endif
       
    25 
       
    26 #include "SVGEngineInterfaceImpl.h"
       
    27 #include "GfxFloatFixPt.h"
       
    28 #include "GfxRectangle2D.h"
       
    29 
       
    30 /**
       
    31  * This class implements the interface for a MRect object
       
    32  *
       
    33  *  @lib SVGEngine.lib
       
    34  *  @since 1.0
       
    35  */
       
    36 class TSvgFourPointRect: public MRect
       
    37     {
       
    38     public:
       
    39 
       
    40         /**
       
    41          * Construct a rectangle.
       
    42          *
       
    43          * @since 1.0
       
    44          * @return
       
    45          */
       
    46         TSvgFourPointRect();
       
    47 		TSvgFourPointRect(TPoint aPoint1, TPoint aPoint2, TPoint aPoint3, TPoint aPoint4);
       
    48         TSvgFourPointRect( TGfxRectangle2D aRect );
       
    49 		TSvgFourPointRect(TGfxPoint2D aPoint1, TGfxPoint2D aPoint2, TGfxPoint2D aPoint3, TGfxPoint2D aPoint4);
       
    50         TSvgFourPointRect( TFloatFixPt aX, TFloatFixPt aY, TFloatFixPt aWidth, TFloatFixPt aHeight );
       
    51         
       
    52 		void SetRectPoints( TFloatFixPt aX, TFloatFixPt aY, TFloatFixPt aWidth, TFloatFixPt aHeight );
       
    53 		void SetRectPoints(TPoint aPoint1, TPoint aPoint2, TPoint aPoint3, TPoint aPoint4);
       
    54 		void SetRectPoints(TGfxPoint2D aPoint1, TGfxPoint2D aPoint2, TGfxPoint2D aPoint3, TGfxPoint2D aPoint4);
       
    55 		void SetRectPoints( TGfxRectangle2D aRect );
       
    56 		
       
    57 		//IMPLEMENTED FOR MRect
       
    58 		void GetPoints(TPoint& aPoint1, TPoint& aPoint2, TPoint& aPoint3, TPoint& aPoint4) const;
       
    59 		
       
    60         void GetPoints(TGfxPoint2D& aPoint1, TGfxPoint2D& aPoint2, TGfxPoint2D& aPoint3, TGfxPoint2D& aPoint4);
       
    61         void GetTRect(TRect& aRect);
       
    62         void GetTRect(TGfxRectangle2D& aRect);
       
    63         
       
    64         
       
    65         //IMPLEMENTED FOR MRect
       
    66         /**
       
    67          * Determine if the given rectangle intersects with this rectangle.
       
    68          *
       
    69          * @since 1.0
       
    70          * @param aRect : rectangle to check for intersection.
       
    71          * @return true, if intersection occurs.
       
    72          */
       
    73 		TBool  Intersects( const MRect& aRect );
       
    74 		
       
    75 		//IMPLEMENTED FOR MRect
       
    76 		 /**
       
    77          * Determine the center point of this rectangle
       
    78          *
       
    79          * @since 1.0
       
    80          * @param aCenter the center point
       
    81          * @return
       
    82          */
       
    83          
       
    84 		void Center(TPoint& aCenter);
       
    85 		
       
    86         /**
       
    87          * Determine if the given point is contained within this rectangle.
       
    88          *
       
    89          * @since 1.0
       
    90          * @param aRect : rectangle to check for intersection.
       
    91          * @return true, if points is contained within rectangle
       
    92          */
       
    93   //      IMPORT_C TBool  Contains( TGfxPoint2D aPoint );
       
    94 
       
    95         /* Return shape type */
       
    96  //       inline virtual TInt ShapeType () { return ERect; };
       
    97  
       
    98         TGfxPoint2D		  iPoint1;
       
    99         TGfxPoint2D		  iPoint2;
       
   100         TGfxPoint2D		  iPoint3;
       
   101         TGfxPoint2D		  iPoint4;
       
   102     };
       
   103 
       
   104 #endif
       
   105