21
|
1 |
/*
|
|
2 |
* Copyright (c) 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: Provides the CAknFepUiSpellInputPane methods.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
#include <eikgted.h> // for CEikGlobalTextEditor
|
|
30 |
#include <eikedwob.h> // for MEikEdwinObserver
|
|
31 |
#include <eikenv.h> // for CEikonEnv
|
|
32 |
#include <barsread.h> // for TResourceReader
|
|
33 |
#include <eiklabel.h> // for CEikLable
|
|
34 |
#include <AknUtils.h>
|
|
35 |
#include <eikedwin.h>
|
|
36 |
#include <appapaclayout.cdl.h> // for Layout stuff
|
|
37 |
#include <aknlayoutscalable_apps.cdl.h>
|
|
38 |
#include <StringLoader.h>
|
|
39 |
|
|
40 |
#include "aknfepuispellinputpane.h"
|
|
41 |
|
|
42 |
// CONSTANTS
|
|
43 |
const TInt KNumberOfControl = 1;
|
|
44 |
const TInt KSpellMaxLength = 63;
|
|
45 |
const TInt KTouchSpellEditorMaxLine = 1;
|
|
46 |
// Enumarations
|
|
47 |
enum TControls
|
|
48 |
{
|
|
49 |
EInputWin
|
|
50 |
};
|
|
51 |
|
|
52 |
// ================= MEMBER FUNCTIONS ======================
|
|
53 |
|
|
54 |
// ---------------------------------------------------------------------------
|
|
55 |
// CAknFepUiSpellInputPane::CAknFepUiSpellInputPane
|
|
56 |
// (other items were commented in a header)
|
|
57 |
// ---------------------------------------------------------------------------
|
|
58 |
//
|
|
59 |
CAknFepUiSpellInputPane::CAknFepUiSpellInputPane()
|
|
60 |
:iInputWin( NULL )
|
|
61 |
{
|
|
62 |
}
|
|
63 |
|
|
64 |
// ---------------------------------------------------------------------------
|
|
65 |
// CAknFepUiSpellInputPane::CAknFepUiSpellInputPane
|
|
66 |
// (other items were commented in a header)
|
|
67 |
// ---------------------------------------------------------------------------
|
|
68 |
//
|
|
69 |
void CAknFepUiSpellInputPane::ConstructL( CCoeControl* aParent,
|
|
70 |
const TInt aEditorFlag, const TInt aEditorCase,
|
|
71 |
const TInt aEditorSCTResID,
|
|
72 |
const TBool aIsSplitEditor )
|
|
73 |
{
|
|
74 |
// Create as a child window of the specified parent control's window.
|
|
75 |
CreateWindowL( aParent );
|
|
76 |
|
|
77 |
SetMopParent(aParent);
|
|
78 |
|
|
79 |
// Create input editor
|
|
80 |
iInputWin = new ( ELeave ) CEikEdwin;
|
|
81 |
// Initialize the editor
|
|
82 |
iInputWin->SetContainerWindowL( *this );
|
|
83 |
iInputWin->ConstructL(0,0,0,KTouchSpellEditorMaxLine);
|
|
84 |
|
|
85 |
iInputWin->SetAknEditorInputMode(EAknEditorTextInputMode);
|
|
86 |
iInputWin->SetAknEditorSpecialCharacterTable(aEditorSCTResID);
|
|
87 |
if ( aIsSplitEditor )
|
|
88 |
{
|
|
89 |
iInputWin->SetAknEditorFlags( iInputWin->AknEdwinFlags() |
|
|
90 |
aEditorFlag | EAknEditorFlagNoT9 |
|
|
91 |
EAknEditorFlagEnablePartialScreen );
|
|
92 |
}
|
|
93 |
else
|
|
94 |
{
|
|
95 |
iInputWin->SetAknEditorFlags( iInputWin->AknEdwinFlags() |
|
|
96 |
aEditorFlag | EAknEditorFlagNoT9 );
|
|
97 |
}
|
|
98 |
iInputWin->SetAknEditorCase(aEditorCase);
|
|
99 |
iInputWin->SetMaxLength(KSpellMaxLength);
|
|
100 |
iInputWin->SetMopParent(this);
|
|
101 |
iInputWin->SetFocus( EFalse );
|
|
102 |
|
|
103 |
iInputWin->ActivateL();
|
|
104 |
|
|
105 |
ActivateL();
|
|
106 |
}
|
|
107 |
|
|
108 |
// ---------------------------------------------------------------------------
|
|
109 |
// CAknFepUiSpellInputPane::NewL
|
|
110 |
// (other items were commented in a header)
|
|
111 |
// ---------------------------------------------------------------------------
|
|
112 |
//
|
|
113 |
CAknFepUiSpellInputPane* CAknFepUiSpellInputPane::NewL(
|
|
114 |
CCoeControl* aParent, const TInt aEditorFlag,
|
|
115 |
const TInt aEditorCase, const TInt aEditorSCTResID,
|
|
116 |
const TBool aIsSplitEditor )
|
|
117 |
{
|
|
118 |
CAknFepUiSpellInputPane* self = new ( ELeave ) CAknFepUiSpellInputPane;
|
|
119 |
|
|
120 |
CleanupStack::PushL( self );
|
|
121 |
self->ConstructL( aParent, aEditorFlag, aEditorCase, aEditorSCTResID, aIsSplitEditor );
|
|
122 |
CleanupStack::Pop();
|
|
123 |
|
|
124 |
return self;
|
|
125 |
}
|
|
126 |
|
|
127 |
// ---------------------------------------------------------------------------
|
|
128 |
// CAknFepUiSpellInputPane::~CAknFepUiSpellInputPane
|
|
129 |
// (other items were commented in a header)
|
|
130 |
// ---------------------------------------------------------------------------
|
|
131 |
//
|
|
132 |
CAknFepUiSpellInputPane::~CAknFepUiSpellInputPane()
|
|
133 |
{
|
|
134 |
delete iInputWin;
|
|
135 |
iInputWin = NULL;
|
|
136 |
}
|
|
137 |
|
|
138 |
// ---------------------------------------------------------------------------
|
|
139 |
// CAknFepUiSpellInputPane::InputWin
|
|
140 |
// (other items were commented in a header)
|
|
141 |
// ---------------------------------------------------------------------------
|
|
142 |
//
|
|
143 |
CEikEdwin* CAknFepUiSpellInputPane::InputWin() const
|
|
144 |
{
|
|
145 |
return iInputWin;
|
|
146 |
}
|
|
147 |
|
|
148 |
// ---------------------------------------------------------------------------
|
|
149 |
// CAknFepUiSpellInputPane::SetInputWinObserver
|
|
150 |
// (other items were commented in a header)
|
|
151 |
// ---------------------------------------------------------------------------
|
|
152 |
//
|
|
153 |
void CAknFepUiSpellInputPane::SetInputWinObserver( MEikEdwinObserver* aObserver )
|
|
154 |
{
|
|
155 |
iInputWin->SetEdwinObserver( aObserver );
|
|
156 |
}
|
|
157 |
|
|
158 |
|
|
159 |
// ---------------------------------------------------------------------------
|
|
160 |
// CAknFepUiSpellInputPane::SetInputWinTextL
|
|
161 |
// (other items were commented in a header)
|
|
162 |
// ---------------------------------------------------------------------------
|
|
163 |
//
|
|
164 |
void CAknFepUiSpellInputPane::SetInputWinTextL( const TDesC* aDes )
|
|
165 |
{
|
|
166 |
iInputWin->SetTextL( aDes );
|
|
167 |
}
|
|
168 |
|
|
169 |
// ---------------------------------------------------------------------------
|
|
170 |
// CAknFepUiSpellInputPane::SelectAllL
|
|
171 |
// (other items were commented in a header)
|
|
172 |
// ---------------------------------------------------------------------------
|
|
173 |
//
|
|
174 |
void CAknFepUiSpellInputPane::SelectAllL()
|
|
175 |
{
|
|
176 |
iInputWin->SelectAllL();
|
|
177 |
}
|
|
178 |
|
|
179 |
// ---------------------------------------------------------------------------
|
|
180 |
// CAknFepUiSpellInputPane::InputCapabilities
|
|
181 |
// (other items were commented in a header)
|
|
182 |
// ---------------------------------------------------------------------------
|
|
183 |
//
|
|
184 |
TCoeInputCapabilities CAknFepUiSpellInputPane::InputCapabilities() const
|
|
185 |
{
|
|
186 |
if (iInputWin->IsFocused())
|
|
187 |
{
|
|
188 |
return iInputWin->InputCapabilities();
|
|
189 |
}
|
|
190 |
|
|
191 |
return ENone;
|
|
192 |
}
|
|
193 |
|
|
194 |
// ---------------------------------------------------------------------------
|
|
195 |
// CAknFepUiSpellInputPane::OfferKeyEventL
|
|
196 |
// (other items were commented in a header)
|
|
197 |
// ---------------------------------------------------------------------------
|
|
198 |
//
|
|
199 |
TKeyResponse CAknFepUiSpellInputPane::OfferKeyEventL(
|
|
200 |
const TKeyEvent& aKeyEvent, TEventCode aType )
|
|
201 |
{
|
|
202 |
if (iInputWin->IsFocused())
|
|
203 |
{
|
|
204 |
TKeyResponse response = iInputWin->OfferKeyEventL( aKeyEvent, aType );
|
|
205 |
if ( response == EKeyWasNotConsumed )
|
|
206 |
{
|
|
207 |
if ( aType == EEventKeyDown || aType == EEventKeyUp )
|
|
208 |
{
|
|
209 |
response = EKeyWasConsumed;
|
|
210 |
}
|
|
211 |
}
|
|
212 |
return response;
|
|
213 |
}
|
|
214 |
|
|
215 |
return EKeyWasNotConsumed;
|
|
216 |
}
|
|
217 |
|
|
218 |
// ---------------------------------------------------------------------------
|
|
219 |
// CAknFepUiSpellInputPane::CountComponentControls
|
|
220 |
// (other items were commented in a header)
|
|
221 |
// ---------------------------------------------------------------------------
|
|
222 |
//
|
|
223 |
TInt CAknFepUiSpellInputPane::CountComponentControls() const
|
|
224 |
{
|
|
225 |
return KNumberOfControl;
|
|
226 |
}
|
|
227 |
|
|
228 |
// ---------------------------------------------------------------------------
|
|
229 |
// CAknFepUiSpellInputPane::ComponentControl
|
|
230 |
// (other items were commented in a header)
|
|
231 |
// ---------------------------------------------------------------------------
|
|
232 |
//
|
|
233 |
CCoeControl* CAknFepUiSpellInputPane::ComponentControl( TInt aIndex ) const
|
|
234 |
{
|
|
235 |
switch ( aIndex )
|
|
236 |
{
|
|
237 |
case EInputWin:
|
|
238 |
{
|
|
239 |
return iInputWin;
|
|
240 |
}
|
|
241 |
default:
|
|
242 |
{
|
|
243 |
return NULL;
|
|
244 |
}
|
|
245 |
}
|
|
246 |
}
|
|
247 |
|
|
248 |
// ---------------------------------------------------------------------------
|
|
249 |
// CAknFepUiSpellInputPane::Draw
|
|
250 |
// (other items were commented in a header)
|
|
251 |
// ---------------------------------------------------------------------------
|
|
252 |
//
|
|
253 |
void CAknFepUiSpellInputPane::Draw( const TRect& /*aRect*/ ) const
|
|
254 |
{
|
|
255 |
}
|
|
256 |
|
|
257 |
// ---------------------------------------------------------------------------
|
|
258 |
// CAknFepUiSpellInputPane::FocusChanged
|
|
259 |
// (other items were commented in a header)
|
|
260 |
// ---------------------------------------------------------------------------
|
|
261 |
//
|
|
262 |
void CAknFepUiSpellInputPane::FocusChanged( TDrawNow aDrawNow )
|
|
263 |
{
|
|
264 |
iInputWin->SetFocus( IsFocused(), aDrawNow );
|
|
265 |
}
|
|
266 |
|
|
267 |
// ---------------------------------------------------------------------------
|
|
268 |
// CAknFepUiSpellInputPane::SizeChanged
|
|
269 |
// (other items were commented in a header)
|
|
270 |
// ---------------------------------------------------------------------------
|
|
271 |
//
|
|
272 |
void CAknFepUiSpellInputPane::SizeChanged()
|
|
273 |
{
|
|
274 |
}
|
|
275 |
|
|
276 |
// End of File
|