21
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2005 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: drop-down list control
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <AknFepGlobalEnums.h>
|
|
20 |
#include <peninputsplititutnew.rsg>
|
|
21 |
#include <e32keys.h>
|
|
22 |
#include <peninputlayout.h>
|
|
23 |
#include <peninputcommonbutton.h>
|
|
24 |
#include <peninputrawkeybutton.h>
|
|
25 |
|
|
26 |
#include "peninputsplititutwesternuistatenonpredict.h"
|
|
27 |
#include "peninputsplititutuimgrbase.h"
|
|
28 |
#include "peninputsplititutdatamgr.h"
|
|
29 |
#include "peninputsplititutlayoutcontext.h"
|
|
30 |
#include "peninputsplititutwindowmanager.h"
|
|
31 |
|
|
32 |
|
|
33 |
// ============================ MEMBER FUNCTIONS =============================
|
|
34 |
|
|
35 |
// ---------------------------------------------------------------------------
|
|
36 |
// CWesternSplitItutUiStateNonPredict::NewL
|
|
37 |
// ---------------------------------------------------------------------------
|
|
38 |
//
|
|
39 |
CWesternSplitItutUiStateNonPredict* CWesternSplitItutUiStateNonPredict::NewL(CSplitItutUiMgrBase* aOwner)
|
|
40 |
{
|
|
41 |
CWesternSplitItutUiStateNonPredict* self = new (ELeave) CWesternSplitItutUiStateNonPredict(aOwner);
|
|
42 |
CleanupStack::PushL(self);
|
|
43 |
self->ConstructL();
|
|
44 |
CleanupStack::Pop(self);
|
|
45 |
return self;
|
|
46 |
}
|
|
47 |
|
|
48 |
// ---------------------------------------------------------------------------
|
|
49 |
// CWesternSplitItutUiStateNonPredict::~CWesternSplitItutUiStateNonPredict
|
|
50 |
// ---------------------------------------------------------------------------
|
|
51 |
//
|
|
52 |
CWesternSplitItutUiStateNonPredict::~CWesternSplitItutUiStateNonPredict()
|
|
53 |
{
|
|
54 |
}
|
|
55 |
|
|
56 |
// ---------------------------------------------------------------------------
|
|
57 |
// CWesternSplitItutUiStateNonPredict::CWesternSplitItutUiStateNonPredict
|
|
58 |
// ---------------------------------------------------------------------------
|
|
59 |
//
|
|
60 |
CWesternSplitItutUiStateNonPredict::CWesternSplitItutUiStateNonPredict(CSplitItutUiMgrBase* aOwner)
|
|
61 |
:CSplitItutUiStateBase(aOwner),
|
|
62 |
iConsumeLastKeyDown(EFalse)
|
|
63 |
{
|
|
64 |
}
|
|
65 |
|
|
66 |
// ---------------------------------------------------------------------------
|
|
67 |
// CWesternSplitItutUiStateNonPredict::OnEntryL
|
|
68 |
// ---------------------------------------------------------------------------
|
|
69 |
//
|
|
70 |
void CWesternSplitItutUiStateNonPredict::OnEntryL()
|
|
71 |
{
|
|
72 |
TInt keypadResId = KInvalidResId;
|
|
73 |
switch (iOwner->DataMgr()->InputMode())
|
|
74 |
{
|
|
75 |
case ENumber:
|
|
76 |
if( iOwner->DataMgr()->IsExistPlusChar() )
|
|
77 |
{
|
|
78 |
keypadResId = R_FINGER_INPUT_KEYPAD_NUMBER_WITH_PLUS;
|
|
79 |
}
|
|
80 |
else
|
|
81 |
{
|
|
82 |
keypadResId = R_FINGER_INPUT_KEYPAD_NUMBER;
|
|
83 |
}
|
|
84 |
break;
|
|
85 |
case ELatin:
|
|
86 |
keypadResId = iOwner->DataMgr()->KeypadResourceId();
|
|
87 |
break;
|
|
88 |
default:
|
|
89 |
break;
|
|
90 |
}
|
|
91 |
|
|
92 |
// update resource id of keypad, candidate drop list
|
|
93 |
iOwner->DataMgr()->NotifyChangeControlLayout(
|
|
94 |
MItutPropertySubscriber::EItutPropertyKeypadResourceId, keypadResId);
|
|
95 |
|
|
96 |
// for secret editor, there is no need to show navigation buttons
|
|
97 |
{
|
|
98 |
if (iOwner->DataMgr()->IsChinese())
|
|
99 |
{
|
|
100 |
iOwner->LayoutContext()->ShowArrowBtn(EBtnArrowLeft | EBtnArrowRight
|
|
101 |
| EBtnArrowUp| EBtnArrowDown);
|
|
102 |
if(iOwner->LayoutContext()->IsSecretEdtior())
|
|
103 |
{
|
|
104 |
CAknFepCtrlRawKeyButton * leftbtn;
|
|
105 |
CAknFepCtrlRawKeyButton * rightbtn;
|
|
106 |
CAknFepCtrlRawKeyButton * upbtn;
|
|
107 |
CAknFepCtrlRawKeyButton * downbtn;
|
|
108 |
leftbtn = static_cast<CAknFepCtrlRawKeyButton *>
|
|
109 |
(iOwner->LayoutContext()->Control(ECtrlIdArrowLeft));
|
|
110 |
rightbtn = static_cast<CAknFepCtrlRawKeyButton *>
|
|
111 |
(iOwner->LayoutContext()->Control(ECtrlIdArrowRight));
|
|
112 |
upbtn = static_cast<CAknFepCtrlRawKeyButton *>
|
|
113 |
(iOwner->LayoutContext()->Control(ECtrlIdArrowUp));
|
|
114 |
downbtn = static_cast<CAknFepCtrlRawKeyButton *>
|
|
115 |
(iOwner->LayoutContext()->Control(ECtrlIdArrowDown));
|
|
116 |
leftbtn->SetDimmed(ETrue);
|
|
117 |
rightbtn->SetDimmed(ETrue);
|
|
118 |
upbtn->SetDimmed(ETrue);
|
|
119 |
downbtn->SetDimmed(ETrue);
|
|
120 |
}
|
|
121 |
}
|
|
122 |
else
|
|
123 |
{
|
|
124 |
iOwner->LayoutContext()->ShowArrowBtn(EBtnArrowLeft | EBtnArrowRight);
|
|
125 |
iOwner->LayoutContext()->Control(ECtrlIdOptions)->Hide(EFalse);
|
|
126 |
iOwner->LayoutContext()->Control(ECtrlIdClose)->Hide(EFalse);
|
|
127 |
|
|
128 |
if(iOwner->LayoutContext()->IsSecretEdtior())
|
|
129 |
{
|
|
130 |
CAknFepCtrlRawKeyButton * leftbtn;
|
|
131 |
CAknFepCtrlRawKeyButton * rightbtn;
|
|
132 |
leftbtn = static_cast<CAknFepCtrlRawKeyButton *>
|
|
133 |
(iOwner->LayoutContext()->Control(ECtrlIdArrowLeft));
|
|
134 |
rightbtn = static_cast<CAknFepCtrlRawKeyButton *>
|
|
135 |
(iOwner->LayoutContext()->Control(ECtrlIdArrowRight));
|
|
136 |
leftbtn->SetDimmed(ETrue);
|
|
137 |
rightbtn->SetDimmed(ETrue);
|
|
138 |
}
|
|
139 |
}
|
|
140 |
}
|
|
141 |
}
|
|
142 |
|
|
143 |
// ---------------------------------------------------------------------------
|
|
144 |
// CWesternSplitItutUiStateNonPredict::OnExit
|
|
145 |
// ---------------------------------------------------------------------------
|
|
146 |
//
|
|
147 |
void CWesternSplitItutUiStateNonPredict::OnExit()
|
|
148 |
{
|
|
149 |
iOwner->LayoutContext()->ShowArrowBtn(0);
|
|
150 |
}
|
|
151 |
|
|
152 |
// ---------------------------------------------------------------------------
|
|
153 |
// CWesternSplitItutUiStateNonPredict::StateType
|
|
154 |
// ---------------------------------------------------------------------------
|
|
155 |
//
|
|
156 |
CSplitItutUiMgrBase::TUiState CWesternSplitItutUiStateNonPredict::StateType()
|
|
157 |
{
|
|
158 |
return CSplitItutUiMgrBase::EStateWesternStandby;
|
|
159 |
}
|
|
160 |
|
|
161 |
// ---------------------------------------------------------------------------
|
|
162 |
// CWesternSplitItutUiStateNonPredict::HandleCommandL
|
|
163 |
// ---------------------------------------------------------------------------
|
|
164 |
//
|
|
165 |
TInt CWesternSplitItutUiStateNonPredict::HandleCommandL(TInt aCmd, TUint8* /*aData*/)
|
|
166 |
{
|
|
167 |
switch (aCmd)
|
|
168 |
{
|
|
169 |
case ECmdPenInputFingerMatchList:
|
|
170 |
{
|
|
171 |
iOwner->LayoutContext()->UiLayout()->SignalOwner(ESignalEnterSpellMode);
|
|
172 |
return KErrNone;
|
|
173 |
}
|
|
174 |
|
|
175 |
case ECmdPenInputIsSecretText:
|
|
176 |
{
|
|
177 |
//TUint* data = (TUint*) aData;
|
|
178 |
{
|
|
179 |
if (iOwner->DataMgr()->IsChinese())
|
|
180 |
{
|
|
181 |
iOwner->LayoutContext()->ShowArrowBtn(EBtnArrowLeft | EBtnArrowRight
|
|
182 |
| EBtnArrowUp| EBtnArrowDown);
|
|
183 |
/*CAknFepCtrlRawKeyButton * leftbtn;
|
|
184 |
CAknFepCtrlRawKeyButton * rightbtn;
|
|
185 |
CAknFepCtrlRawKeyButton * upbtn;
|
|
186 |
CAknFepCtrlRawKeyButton * downbtn;
|
|
187 |
leftbtn = static_cast<CAknFepCtrlRawKeyButton *>(iOwner->LayoutContext()->Control(ECtrlIdArrowLeft));
|
|
188 |
rightbtn = static_cast<CAknFepCtrlRawKeyButton *>(iOwner->LayoutContext()->Control(ECtrlIdArrowRight));
|
|
189 |
upbtn = static_cast<CAknFepCtrlRawKeyButton *>(iOwner->LayoutContext()->Control(ECtrlIdArrowUp));
|
|
190 |
downbtn = static_cast<CAknFepCtrlRawKeyButton *>(iOwner->LayoutContext()->Control(ECtrlIdArrowDown));
|
|
191 |
if(*data > 0)
|
|
192 |
{
|
|
193 |
leftbtn->SetDimmed(ETrue);
|
|
194 |
rightbtn->SetDimmed(ETrue);
|
|
195 |
upbtn->SetDimmed(ETrue);
|
|
196 |
downbtn->SetDimmed(ETrue);
|
|
197 |
}
|
|
198 |
else
|
|
199 |
{
|
|
200 |
leftbtn->SetDimmed(EFalse);
|
|
201 |
rightbtn->SetDimmed(EFalse);
|
|
202 |
upbtn->SetDimmed(EFalse);
|
|
203 |
downbtn->SetDimmed(EFalse);
|
|
204 |
}*/
|
|
205 |
}
|
|
206 |
else
|
|
207 |
{
|
|
208 |
iOwner->LayoutContext()->ShowArrowBtn(EBtnArrowLeft | EBtnArrowRight);
|
|
209 |
/*CAknFepCtrlRawKeyButton * leftbtn;
|
|
210 |
CAknFepCtrlRawKeyButton * rightbtn;
|
|
211 |
leftbtn = static_cast<CAknFepCtrlRawKeyButton *>(iOwner->LayoutContext()->Control(ECtrlIdArrowLeft));
|
|
212 |
rightbtn = static_cast<CAknFepCtrlRawKeyButton *>(iOwner->LayoutContext()->Control(ECtrlIdArrowRight));
|
|
213 |
if(*data > 0)
|
|
214 |
{
|
|
215 |
leftbtn->SetDimmed(ETrue);
|
|
216 |
rightbtn->SetDimmed(ETrue);
|
|
217 |
}
|
|
218 |
else
|
|
219 |
{
|
|
220 |
leftbtn->SetDimmed(EFalse);
|
|
221 |
rightbtn->SetDimmed(EFalse);
|
|
222 |
}*/
|
|
223 |
}
|
|
224 |
}
|
|
225 |
|
|
226 |
return KErrNone;
|
|
227 |
}
|
|
228 |
default:
|
|
229 |
break;
|
|
230 |
}
|
|
231 |
|
|
232 |
return KErrNotSupported;
|
|
233 |
}
|
|
234 |
|
|
235 |
// ---------------------------------------------------------------------------
|
|
236 |
// CWesternSplitItutUiStateNonPredict::HandleCtrlEventL
|
|
237 |
// ---------------------------------------------------------------------------
|
|
238 |
//
|
|
239 |
TBool CWesternSplitItutUiStateNonPredict::HandleCtrlEventL(
|
|
240 |
TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData)
|
|
241 |
{
|
|
242 |
switch (aEventType)
|
|
243 |
{
|
|
244 |
case EEventRawKeyDownEvent:
|
|
245 |
{
|
|
246 |
const TKeyEvent *key = reinterpret_cast<const TKeyEvent*>(aEventData.Ptr());
|
|
247 |
|
|
248 |
iConsumeLastKeyDown = EFalse;
|
|
249 |
/*
|
|
250 |
if (key->iScanCode == EStdKeyNkpAsterisk)
|
|
251 |
{
|
|
252 |
iConsumeLastKeyDown = ETrue;
|
|
253 |
iOwner->UiManager()->SetLastRawKeyDown(key->iScanCode, ETrue, aCtrl);
|
|
254 |
return ETrue;
|
|
255 |
}
|
|
256 |
*/
|
|
257 |
return EFalse;
|
|
258 |
}
|
|
259 |
case EEventRawKeyUpEvent:
|
|
260 |
{
|
|
261 |
const TKeyEvent *key = reinterpret_cast<const TKeyEvent*>(aEventData.Ptr());
|
|
262 |
/*
|
|
263 |
if (key->iScanCode == EStdKeyNkpAsterisk)
|
|
264 |
{
|
|
265 |
if (iConsumeLastKeyDown)
|
|
266 |
{
|
|
267 |
iOwner->LayoutContext()->UiLayout()->SignalOwner(ESignalEnterSpellMode);
|
|
268 |
iOwner->UiManager()->SetLastRawKeyDown(key->iScanCode, EFalse, aCtrl);
|
|
269 |
return ETrue;
|
|
270 |
}
|
|
271 |
}
|
|
272 |
*/
|
|
273 |
return EFalse;
|
|
274 |
}
|
|
275 |
case EEventPointerDownOnNomatch:
|
|
276 |
{
|
|
277 |
iOwner->LayoutContext()->UiLayout()->SignalOwner(ESignalEnterSpellMode);
|
|
278 |
return ETrue;
|
|
279 |
}
|
|
280 |
default:
|
|
281 |
break;
|
|
282 |
}
|
|
283 |
|
|
284 |
return EFalse;
|
|
285 |
}
|
|
286 |
|
|
287 |
// End Of File
|