|
1 /* |
|
2 * Copyright (c) 2009 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: Custom draw component for message editor |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CNCSEDITORCUSTOMDRAW_H |
|
20 #define CNCSEDITORCUSTOMDRAW_H |
|
21 |
|
22 #include <lafmain.h> |
|
23 #include <aknlayoutscalable_apps.cdl.h> |
|
24 #include "ncsconstants.h" |
|
25 |
|
26 class CNcsEditor; |
|
27 |
|
28 /** |
|
29 * Class which handles mail editor row lines to "to" "cc" and "subject" fields. |
|
30 */ |
|
31 class CNcsEditorCustomDraw: public CBase, |
|
32 public MFormCustomDraw |
|
33 { |
|
34 public: // constructor and destructor |
|
35 |
|
36 static CNcsEditorCustomDraw* NewL( const MFormCustomDraw* aParentCustomDraw, |
|
37 const CNcsEditor* aParentControl, |
|
38 TAknTextComponentLayout aLayout ); |
|
39 |
|
40 virtual ~CNcsEditorCustomDraw(); |
|
41 |
|
42 public: // from CLafEdwinCustomDrawBase |
|
43 |
|
44 virtual void DrawBackground( const TParam& aParam, |
|
45 const TRgb& aBackground, |
|
46 TRect& aDrawn) const; |
|
47 |
|
48 virtual void DrawLineGraphics( const TParam& aParam, |
|
49 const TLineInfo& aLineInfo ) const; |
|
50 |
|
51 virtual void DrawText( const TParam& aParam, |
|
52 const TLineInfo& aLineInfo, |
|
53 const TCharFormat& aFormat, |
|
54 const TDesC& aText, |
|
55 const TPoint& aTextOrigin, |
|
56 TInt aExtraPixels) const; |
|
57 |
|
58 virtual TRgb SystemColor( TUint aColorIndex, |
|
59 TRgb aDefaultColor) const; |
|
60 |
|
61 void UpdateLayout( TAknTextComponentLayout aLayout ); |
|
62 |
|
63 private: // methods used internally |
|
64 |
|
65 /** |
|
66 * C++ contructor |
|
67 */ |
|
68 CNcsEditorCustomDraw( const MFormCustomDraw* aParentCustomDraw, |
|
69 const CNcsEditor* aParentControl, |
|
70 const TAknTextComponentLayout aLayout ); |
|
71 |
|
72 /** |
|
73 * 2nd phase constructor |
|
74 */ |
|
75 void ConstructL(); |
|
76 |
|
77 private: |
|
78 /** |
|
79 * default custom drawer. |
|
80 * Not owned. |
|
81 */ |
|
82 const MFormCustomDraw* iCustomDrawer; |
|
83 |
|
84 /** |
|
85 * Parent control. |
|
86 * Not owned. |
|
87 */ |
|
88 const CNcsEditor* iEditor; |
|
89 |
|
90 TAknTextComponentLayout iTextPaneLayout; |
|
91 TInt iLineHeigth; |
|
92 TRgb iLineColor; |
|
93 TInt iLineOffset; |
|
94 TInt iPrevBrX; |
|
95 }; |
|
96 |
|
97 #endif //CNCSEDITORCUSTOMDRAW_H |