|
1 /* |
|
2 * Copyright (c) 2006 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: MsgEditorCustomDraw declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMSGEDITORCUSTOMDRAW_H |
|
21 #define CMSGEDITORCUSTOMDRAW_H |
|
22 |
|
23 // ========== INCLUDE FILES ================================ |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <frmtlay.h> |
|
27 |
|
28 // ========== CONSTANTS ==================================== |
|
29 |
|
30 // ========== MACROS ======================================= |
|
31 |
|
32 // ========== DATA TYPES =================================== |
|
33 |
|
34 // ========== FUNCTION PROTOTYPES ========================== |
|
35 |
|
36 // ========== FORWARD DECLARATIONS ========================= |
|
37 class CGulIcon; |
|
38 class CEikEdwin; |
|
39 |
|
40 // ========== CLASS DECLARATION ============================ |
|
41 |
|
42 /** |
|
43 * Implementation of MFormCustomDraw |
|
44 * Class is used to draw editor lines to text editor. |
|
45 * |
|
46 * @since 3.1 |
|
47 */ |
|
48 NONSHARABLE_CLASS(CMsgEditorCustomDraw): public CBase, |
|
49 public MFormCustomDraw |
|
50 { |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Static constructor. |
|
55 * |
|
56 * @param aParentCustomDraw IN Parent Custom drawer. |
|
57 * |
|
58 * @return pointer to instance |
|
59 */ |
|
60 static CMsgEditorCustomDraw* NewL( const MFormCustomDraw* aParentCustomDraw, |
|
61 const CEikEdwin* aParentControl,const TInt aControlType ); |
|
62 |
|
63 /** |
|
64 * Destructor |
|
65 */ |
|
66 virtual ~CMsgEditorCustomDraw(); |
|
67 |
|
68 /** |
|
69 * Resolves editor line layout from LAF. |
|
70 */ |
|
71 void ResolveLayouts(); |
|
72 |
|
73 /** |
|
74 * Notifies custom draw that skin has changed. |
|
75 */ |
|
76 void SkinChanged(); |
|
77 |
|
78 public: // Functions from base classes |
|
79 |
|
80 /** |
|
81 * From MFormCustomDraw |
|
82 * See frmtlay.h for more information. |
|
83 */ |
|
84 void DrawBackground( const TParam& aParam, |
|
85 const TRgb& aRgb, |
|
86 TRect& aDrawn ) const; |
|
87 |
|
88 /** |
|
89 * From MFormCustomDraw |
|
90 * See frmtlay.h for more information. |
|
91 */ |
|
92 void DrawText( const TParam& aParam, |
|
93 const TLineInfo& aLineInfo, |
|
94 const TCharFormat& aFormat, |
|
95 const TDesC& aText, |
|
96 const TPoint& aTextOrigin, |
|
97 TInt aExtraPixels ) const; |
|
98 |
|
99 /** |
|
100 * From MFormCustomDraw |
|
101 * See frmtlay.h for more information. |
|
102 */ |
|
103 |
|
104 void DrawText( const TParam& aParam, const TLineInfo& aLineInfo, |
|
105 const TCharFormat& aFormat, const TDesC& aText, const TInt aStart, |
|
106 const TInt aEnd, const TPoint& aTextOrigin, TInt aExtraPixels ) const; |
|
107 |
|
108 /** |
|
109 * From MFormCustomDraw |
|
110 * See frmtlay.h for more information. |
|
111 */ |
|
112 void DrawLineGraphics( const TParam& aParam, |
|
113 const TLineInfo& aLineInfo ) const; |
|
114 |
|
115 /** |
|
116 * From MFormCustomDraw |
|
117 * See frmtlay.h for more information. |
|
118 */ |
|
119 TRgb SystemColor( TUint aColorIndex, |
|
120 TRgb aDefaultColor) const; |
|
121 |
|
122 private: |
|
123 |
|
124 /** |
|
125 * C++ contructor |
|
126 */ |
|
127 CMsgEditorCustomDraw( const MFormCustomDraw* aParentCustomDraw, |
|
128 const CEikEdwin* aParentControl,const TInt aControlType ); |
|
129 |
|
130 /** |
|
131 * 2nd phase constructor |
|
132 */ |
|
133 void ConstructL(); |
|
134 |
|
135 /** |
|
136 * Draws editor lines. |
|
137 */ |
|
138 void DrawEditorLines( const TParam& aParam ) const; |
|
139 |
|
140 private: // data |
|
141 |
|
142 const MFormCustomDraw* iParentCustomDraw; |
|
143 |
|
144 TRect iFirstLineRect; |
|
145 TInt iLineDelta; |
|
146 |
|
147 CGulIcon* iIcon; |
|
148 |
|
149 const CEikEdwin* iParentControl; |
|
150 TInt iControlType; |
|
151 |
|
152 }; |
|
153 |
|
154 |
|
155 #endif // CMSGEDITORCUSTOMDRAW_H |
|
156 |
|
157 // End of File |