|
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 GFXROUNDRECTANGLE2D_H |
|
20 #define GFXROUNDRECTANGLE2D_H |
|
21 |
|
22 #include <e32std.h> |
|
23 |
|
24 #include "GfxFloatFixPt.h" |
|
25 #include "GfxRectangularShape.h" |
|
26 #include "GfxRectangle2D.h" |
|
27 #include "GfxPoint2D.h" |
|
28 #include "GfxPathIterator.h" |
|
29 #include "GfxAffineTransform.h" |
|
30 |
|
31 |
|
32 |
|
33 /** |
|
34 * Implementation of a rounded-corner rectangle |
|
35 * |
|
36 * @lib Gfx2D.lib |
|
37 * @since 1.0 |
|
38 */ |
|
39 class TGfxRoundRectangle2D : public TGfxRectangularShape |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Constructor. |
|
44 * |
|
45 * @since 1.0 |
|
46 * @return |
|
47 */ |
|
48 TGfxRoundRectangle2D(); |
|
49 |
|
50 /** |
|
51 * Construct a rounded rectangle from top-left, width/height info. |
|
52 * |
|
53 * @since 1.0 |
|
54 * @param aX : x coordinate of top-left corner |
|
55 * @param aY : y coordinate of top-left corner |
|
56 * @param aWidth: width of rectangle |
|
57 * @param aHeight : height of rectangle |
|
58 * @param aArcWidth : rounded corner width |
|
59 * @param aArcHeight : rounded corner height |
|
60 * @return |
|
61 */ |
|
62 TGfxRoundRectangle2D( const TFloatFixPt& aX, |
|
63 const TFloatFixPt& aY, |
|
64 const TFloatFixPt& aW, |
|
65 const TFloatFixPt& aH, |
|
66 const TFloatFixPt& aArcWidth, |
|
67 const TFloatFixPt& aArcHeight ); |
|
68 |
|
69 /** |
|
70 * Get the path iterator for this rounded rectangle. |
|
71 * |
|
72 * @since 1.0 |
|
73 * @param aAt : transform to apply. |
|
74 * @param aPitr : path iterator holder. |
|
75 * @return |
|
76 */ |
|
77 void GetPathIteratorL( TGfxAffineTransform* aAt, |
|
78 CGfxPathIterator*& aPitr ); |
|
79 |
|
80 /** |
|
81 * Get the path iterator for rounded rectangle. |
|
82 * |
|
83 * @since 1.0 |
|
84 * @param aAt : transform to apply. |
|
85 * @param aLimit : maximum of points to define the iterator. |
|
86 * @param aPitr : path iterator holder. |
|
87 * @return |
|
88 */ |
|
89 void GetPathIteratorL( TGfxAffineTransform* aAt, |
|
90 TInt aLimit, |
|
91 CGfxPathIterator*& aPitr ); |
|
92 |
|
93 |
|
94 /* Return shape type */ |
|
95 inline virtual TInt ShapeType () { return ERoundRect; }; |
|
96 |
|
97 |
|
98 public: |
|
99 TFloatFixPt iArcWidth; |
|
100 TFloatFixPt iArcHeight; |
|
101 |
|
102 private: |
|
103 friend class CGfxRoundRectangleIteratorP; |
|
104 |
|
105 }; |
|
106 |
|
107 #endif // GFXROUNDRECTANGLE2D_H |
|
108 |