|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __GRAPHICSCONTEXTCHECKER_H__ |
|
17 #define __GRAPHICSCONTEXTCHECKER_H__ |
|
18 |
|
19 #include <graphics/wsgraphicscontext.h> |
|
20 #include <graphics/wscursor.h> |
|
21 #include <graphics/wsgraphicdrawer.h> |
|
22 |
|
23 class CGraphicsContextChecker : public CBase, |
|
24 public MWsGraphicsContext, |
|
25 public MWsTextCursor, |
|
26 public MWsFader, |
|
27 public MWsDrawAnnotationObserver |
|
28 { |
|
29 public: |
|
30 static CGraphicsContextChecker* NewL(MWsGraphicDrawerEnvironment& aEnv); |
|
31 ~CGraphicsContextChecker(); |
|
32 |
|
33 void SetGraphicsContext(MWsGraphicsContext* aGraphicsContext); |
|
34 const MWsGraphicsContext* GraphicsContext() const; |
|
35 void SetTextCursor(MWsTextCursor* aTextCursor); |
|
36 const MWsTextCursor* TextCursor() const; |
|
37 void SetFader(MWsFader* aFader); |
|
38 const MWsFader* Fader() const; |
|
39 |
|
40 public: //MWsObjectProvider |
|
41 TAny* ResolveObjectInterface(TUint aTypeId); |
|
42 public: //MWsGraphicsContext |
|
43 void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap); |
|
44 void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect); |
|
45 void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask); |
|
46 void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, const TPoint& aMaskPos); |
|
47 void ResetClippingRegion(); |
|
48 void Clear(); |
|
49 void Clear(const TRect& aRect); |
|
50 void ResetBrushPattern(); |
|
51 void ResetFont(); |
|
52 void DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd); |
|
53 void DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd); |
|
54 void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap); |
|
55 void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect); |
|
56 void DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask); |
|
57 void DrawRoundRect(const TRect& aRect, const TSize& aEllipse); |
|
58 void DrawPolyLine(const TArray<TPoint>& aPointList); |
|
59 void DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList); |
|
60 void DrawPolygon(const TArray<TPoint>& aPointList, TFillRule aFillRule=EAlternate); |
|
61 void DrawEllipse(const TRect& aRect); |
|
62 void DrawLine(const TPoint& aStart, const TPoint& aEnd); |
|
63 void DrawLineTo(const TPoint& aPoint); |
|
64 void DrawLineBy(const TPoint& aVector); |
|
65 void DrawRect(const TRect& aRect); |
|
66 void DrawText(const TDesC& aText, const TTextParameters* aParam); |
|
67 void DrawText(const TDesC& aText, const TTextParameters* aParam, const TPoint& aPosition); |
|
68 void DrawText(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect); |
|
69 void DrawText(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipFillRect, TInt aBaselineOffset, TTextAlign aHrz=ELeft, TInt aMargin=0); |
|
70 void DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, TBool aUp); |
|
71 void DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TPoint& aPosition, TBool aUp); |
|
72 void DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TBool aUp); |
|
73 void DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TInt aBaselineOffset, TBool aUp, TTextAlign aVert=ELeft, TInt aMargin=0); |
|
74 void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam, const TRect& aClipRect, TInt aBaselineOffset, TInt aTextWidth, TBool aUp, TTextAlign aVert=ELeft, TInt aMargin=0); |
|
75 void MoveTo(const TPoint& aPoint); |
|
76 void MoveBy(const TPoint& aVector); |
|
77 void Plot(const TPoint& aPoint); |
|
78 void Reset(); |
|
79 void SetBrushColor(const TRgb& aColor); |
|
80 void SetBrushOrigin(const TPoint& aOrigin); |
|
81 void SetBrushStyle(TBrushStyle aBrushStyle); |
|
82 void SetClippingRegion(const TRegion& aRegion); |
|
83 void SetDrawMode(TDrawMode aDrawMode); |
|
84 void SetOrigin(const TPoint& aPoint = TPoint(0, 0)); |
|
85 void SetPenColor(const TRgb& aColor); |
|
86 void SetPenStyle(TPenStyle aPenStyle); |
|
87 void SetPenSize(const TSize& aSize); |
|
88 void SetTextShadowColor(const TRgb& aColor); |
|
89 void SetCharJustification(TInt aExcessWidth, TInt aNumChars); |
|
90 void SetWordJustification(TInt aExcessWidth, TInt aNumGaps); |
|
91 void SetUnderlineStyle(TFontUnderline aUnderlineStyle); |
|
92 void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle); |
|
93 void SetBrushPattern(const CFbsBitmap& aBitmap); |
|
94 void SetBrushPattern(TInt aFbsBitmapHandle); |
|
95 void SetFont(const CFont* aFont); |
|
96 void CopyRect(const TPoint& aOffset, const TRect& aRect); |
|
97 void UpdateJustification(const TDesC& aText, const TTextParameters* aParam); |
|
98 void UpdateJustificationVertical(const TDesC& aText, const TTextParameters* aParam, TBool aUp); |
|
99 void SetFontNoDuplicate(const CFont* aFont); |
|
100 TBool HasBrushPattern() const; |
|
101 TBool HasFont() const; |
|
102 TRgb BrushColor() const; |
|
103 TRgb PenColor() const; |
|
104 TRgb TextShadowColor() const; |
|
105 TInt GetError(); |
|
106 TPoint Origin() const; |
|
107 const TRegion& ClippingRegion(); |
|
108 TInt Push(); |
|
109 void Pop(); |
|
110 public: //MWsTextCursor |
|
111 void DrawTextCursor(const TTextCursorInfo& aTextCursorInfo); |
|
112 public: //MWsFader |
|
113 void SetFadingParameters(const TDesC8& aData); |
|
114 void FadeArea(const TRegion& aRegion); |
|
115 public: //MWsDrawAnnotationObserver |
|
116 void WindowRedrawStart(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aRegion); |
|
117 void WindowRedrawEnd(const MWsWindowTreeNode& aWindowTreeNode); |
|
118 void WindowAnimRedrawStart(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aRegion); |
|
119 void WindowAnimRedrawEnd(const MWsWindowTreeNode& aWindowTreeNode); |
|
120 void SpriteRedrawStart(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aRegion); |
|
121 void SpriteRedrawEnd(const MWsWindowTreeNode& aWindowTreeNode); |
|
122 void SpriteFlash(const MWsWindowTreeNode& aWindowTreeNode, TBool aFlashOn); |
|
123 void SegmentRedrawStart(const TRegion& aRegion); |
|
124 void SegmentRedrawEnd(); |
|
125 |
|
126 private: |
|
127 enum TDrawingTarget |
|
128 { |
|
129 ETargetNone, |
|
130 ETargetWindow, |
|
131 ETargetWindowAnim, |
|
132 ETargetWindowSprite, |
|
133 ETargetFloatingSprite, |
|
134 }; |
|
135 private: |
|
136 CGraphicsContextChecker(); |
|
137 private: |
|
138 MWsGraphicsContext* iContext; |
|
139 MWsTextCursor* iTextCursor; |
|
140 MWsFader* iFader; |
|
141 TDrawingTarget iTarget; |
|
142 }; |
|
143 |
|
144 #endif //__GRAPHICSCONTEXTCHECKER_H__ |