|
1 /* |
|
2 * Copyright (c) 2005-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: Wrapper class for CEikEdwin |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef _XNTEXTEDITORADAPTER_H |
|
19 #define _XNTEXTEDITORADAPTER_H |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 |
|
24 // User includes |
|
25 #include "xncontroladapter.h" |
|
26 #include "xnuienginepluginif.h" |
|
27 |
|
28 // Forward declarations |
|
29 class CXnNodePluginIf; |
|
30 class CEikEdwin; |
|
31 class CXnTextEditorPublisher; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 class CXnTextEditorAdapter : public CXnControlAdapter |
|
35 { |
|
36 public: |
|
37 // constructor and destructor |
|
38 |
|
39 /** |
|
40 * 2 phase construction. |
|
41 */ |
|
42 static CXnTextEditorAdapter* NewL( |
|
43 CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 ~CXnTextEditorAdapter(); |
|
49 |
|
50 public: |
|
51 // New functions |
|
52 |
|
53 /** |
|
54 * Gets editor |
|
55 * |
|
56 * @since S60 5.0 |
|
57 * @return Editor, ownership is not transfered |
|
58 */ |
|
59 CEikEdwin* Editor() const { return iEditor; }; |
|
60 |
|
61 /** |
|
62 * Set text to the text field |
|
63 * |
|
64 * @since S60 5.0 |
|
65 * @param aText Text to set |
|
66 */ |
|
67 void SetTextL( const TDesC& aText ); |
|
68 |
|
69 /** |
|
70 * Return the text of the text field |
|
71 * |
|
72 * @since S60 5.0 |
|
73 * @return Text, ownership is transfered |
|
74 */ |
|
75 HBufC* Text() const; |
|
76 |
|
77 public: // from base classes |
|
78 |
|
79 /** |
|
80 * See CCoeControl documentation |
|
81 */ |
|
82 TInt CountComponentControls() const; |
|
83 |
|
84 /** |
|
85 * See CCoeControl documentation |
|
86 */ |
|
87 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
88 |
|
89 /** |
|
90 * See CCoeControl documentation |
|
91 */ |
|
92 void SizeChanged(); |
|
93 |
|
94 /** |
|
95 * See CCoeControl documentation |
|
96 */ |
|
97 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
98 |
|
99 /** |
|
100 * See CXnControlAdapter documentation |
|
101 */ |
|
102 TBool RefusesFocusLoss() const; |
|
103 |
|
104 /** |
|
105 * See CCoeControl documentation |
|
106 */ |
|
107 void FocusChanged( TDrawNow aDrawNow ); |
|
108 |
|
109 /** |
|
110 * See CCoeControl documentation |
|
111 */ |
|
112 void Draw( const TRect& aRect ) const; |
|
113 |
|
114 private: |
|
115 // from MCoeControlObserver |
|
116 |
|
117 /** |
|
118 * See MCoeControlObserver documentation |
|
119 */ |
|
120 void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); |
|
121 |
|
122 private: |
|
123 // private constrcutors |
|
124 |
|
125 CXnTextEditorAdapter( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); |
|
126 |
|
127 void ConstructL(); |
|
128 |
|
129 private: |
|
130 // new functions |
|
131 |
|
132 void SetPropertiesL(); |
|
133 |
|
134 private: |
|
135 // data |
|
136 /** Parent control, not owned */ |
|
137 CXnControlAdapter* iParent; |
|
138 /** UI node, not owned */ |
|
139 CXnNodePluginIf& iNode; |
|
140 /** UI engine, not owned */ |
|
141 TXnUiEnginePluginIf* iUiEngine; |
|
142 /** Editor, owned */ |
|
143 CEikEdwin* iEditor; |
|
144 /** CPS publisher wrapper, owned */ |
|
145 CXnTextEditorPublisher* iEditorPublisher; |
|
146 // Font, owned */ |
|
147 CFont* iFont; |
|
148 /** Flag to indicate whether the font needs to be released or not */ |
|
149 TBool iReleaseFont; |
|
150 /** Max line amount */ |
|
151 TInt iMaxLines; |
|
152 /** Flag to indicate whether focus loss is refused */ |
|
153 TBool iRefusesFocusLoss; |
|
154 }; |
|
155 |
|
156 #endif // _XNTEXTEDITORADAPTER_H |
|
157 |
|
158 // End of File |