|
1 /* |
|
2 * Copyright (c) 2002-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <PtiEngine.h> |
|
20 #include <centralrepository.h> |
|
21 |
|
22 #include <osshangulinputcontext.h> |
|
23 |
|
24 #include "PtiKoreanQwertyCoreDebug.h" |
|
25 #include "PtiKoreanQwertyCore.h" // CPtiKoreanQwertyCore |
|
26 #include "PtiKoreanQwertyCore.pan" // panic codes |
|
27 #include "PtiKoreanQwertyCoreCRDefs.h" |
|
28 |
|
29 #include <e32std.h> |
|
30 |
|
31 const static TOssCombinationItem sDefaulTOssCombinationItem[] = |
|
32 { |
|
33 {0x1169,0x1161,0x116a}, /* jungseong o + a = wa */ |
|
34 {0x1169,0x1162,0x116b}, /* jungseong o + ae = wae */ |
|
35 {0x1169,0x1175,0x116c}, /* jungseong o + i = oe */ |
|
36 {0x116e,0x1165,0x116f}, /* jungseong u + eo = weo */ |
|
37 {0x116e,0x1166,0x1170}, /* jungseong u + e = we */ |
|
38 {0x116e,0x1175,0x1171}, /* jungseong u + i = wi */ |
|
39 {0x1173,0x1175,0x1174}, /* jungseong eu + i = yi */ |
|
40 {0x11a8,0x11ba,0x11aa}, /* jongseong kiyeok + sios = kiyeok-sois */ |
|
41 {0x11ab,0x11bd,0x11ac}, /* jongseong nieun + cieuc = nieun-cieuc */ |
|
42 {0x11ab,0x11c2,0x11ad}, /* jongseong nieun + hieuh = nieun-hieuh */ |
|
43 {0x11af,0x11a8,0x11b0}, /* jongseong rieul + kiyeok = rieul-kiyeok */ |
|
44 {0x11af,0x11b7,0x11b1}, /* jongseong rieul + mieum = rieul-mieum */ |
|
45 {0x11af,0x11b8,0x11b2}, /* jongseong rieul + pieup = rieul-pieup */ |
|
46 {0x11af,0x11ba,0x11b3}, /* jongseong rieul + sios = rieul-sios */ |
|
47 {0x11af,0x11c0,0x11b4}, /* jongseong rieul + thieuth = rieul-thieuth */ |
|
48 {0x11af,0x11c1,0x11b5}, /* jongseong rieul + phieuph = rieul-phieuph */ |
|
49 {0x11af,0x11c2,0x11b6}, /* jongseong rieul + hieuh = rieul-hieuh */ |
|
50 {0x11b8,0x11ba,0x11b9}, /* jongseong pieup + sios = pieup-sios */ |
|
51 }; |
|
52 |
|
53 const TInt KSizeOfDefaulTOssCombinationItem=sizeof(sDefaulTOssCombinationItem)/sizeof(TOssCombinationItem); |
|
54 |
|
55 const static TOssCombinationItem KCombiSsangKiyeokCho={0x1100,0x1100,0x1101}; /* choseong kiyeok + kiyeok = ssangkiyeok */ |
|
56 const static TOssCombinationItem KCombiSsangKiyeokJong={0x11a8,0x11a8,0x11a9}; /* jongseong kiyeok + kiyeok = ssangekiyeok */ |
|
57 const static TOssCombinationItem KCombiSsangTikeut={0x1103,0x1103,0x1104}; /* choseong tikeut + tikeut = ssangtikeut */ |
|
58 const static TOssCombinationItem KCombiSsangPieup={0x1107,0x1107,0x1108}; /* choseong pieup + pieup = ssangpieup */ |
|
59 const static TOssCombinationItem KCombiSsangSiosCho={0x1109,0x1109,0x110a}; /* choseong sios + sios = ssangsios */ |
|
60 const static TOssCombinationItem KCombiSsangSiosJong={0x11ba,0x11ba,0x11bb}; /* jongseong sios + sios = ssangsios */ |
|
61 const static TOssCombinationItem KCombiSsangCieuc={0x110c,0x110c,0x110d}; /* choseong cieuc + cieuc = ssangcieuc */ |
|
62 const static TOssCombinationItem KCombiYaPlusI={0x1163,0x1175,0x1164}; /* jungseong ya-o = ya + o */ |
|
63 const static TOssCombinationItem KCombiYuPlusI={0x1167,0x1175,0x1168}; /* jungseong yu-i = yu + i */ |
|
64 |
|
65 class CActiveCallback : public CActive |
|
66 { |
|
67 public: |
|
68 CActiveCallback(CRepository& aRepository) |
|
69 : CActive(EPriorityNormal), |
|
70 iRepository(aRepository) |
|
71 { |
|
72 CActiveScheduler::Add(this); |
|
73 } |
|
74 |
|
75 void Start(const TCallBack& aCallBack) |
|
76 { |
|
77 iCallBack=aCallBack; |
|
78 iRepository.NotifyRequest(EDblConsonentOnSetting,iStatus); |
|
79 SetActive(); |
|
80 } |
|
81 |
|
82 void RunL() |
|
83 { |
|
84 iCallBack.CallBack(); |
|
85 } |
|
86 |
|
87 void DoCancel() |
|
88 { |
|
89 iRepository.NotifyCancel(EDblConsonentOnSetting); |
|
90 } |
|
91 |
|
92 CRepository& iRepository; |
|
93 |
|
94 TCallBack iCallBack; |
|
95 |
|
96 }; |
|
97 |
|
98 /* |
|
99 ============================================================================ |
|
100 Constructors & Destructiors |
|
101 ============================================================================ |
|
102 */ |
|
103 |
|
104 CPtiKoreanQwertyCore* CPtiKoreanQwertyCore::NewLC( |
|
105 CPtiEngine* aOwner, |
|
106 TDes* aTextBuffer) |
|
107 { |
|
108 CPtiKoreanQwertyCore* self = |
|
109 new (ELeave) CPtiKoreanQwertyCore(aOwner,aTextBuffer); |
|
110 CleanupStack::PushL(self); |
|
111 self->ConstructL(); |
|
112 return self; |
|
113 } |
|
114 |
|
115 CPtiKoreanQwertyCore* CPtiKoreanQwertyCore::NewL( |
|
116 CPtiEngine* aOwner, |
|
117 TDes* aTextBuffer) |
|
118 { |
|
119 CPtiKoreanQwertyCore* self = |
|
120 CPtiKoreanQwertyCore::NewLC(aOwner,aTextBuffer); |
|
121 CleanupStack::Pop(self); |
|
122 return self; |
|
123 } |
|
124 |
|
125 CPtiKoreanQwertyCore::CPtiKoreanQwertyCore( |
|
126 CPtiEngine* aOwner, |
|
127 TDes* aTextBuffer) |
|
128 : iOwner(aOwner), |
|
129 iTextBuffer(aTextBuffer), |
|
130 iKoreanLanOpen(EFalse), |
|
131 iLowerCase(ETrue) |
|
132 { |
|
133 } |
|
134 |
|
135 void CPtiKoreanQwertyCore::ConstructL() |
|
136 { |
|
137 _LIT8(KKeyboard,"2"); |
|
138 iHic=COssHangulInputContext::NewL(KKeyboard); |
|
139 iCombination=COssCombination::NewL(); |
|
140 for (TInt i=0;i<KSizeOfDefaulTOssCombinationItem;i++) |
|
141 { |
|
142 iCombination->AddCombinationL(sDefaulTOssCombinationItem[i]); |
|
143 } |
|
144 iRepository=CRepository::NewL(KCRUidPtiKoreanQwertyCore); |
|
145 UpdateFromRepositoryL(); |
|
146 iCRNotifier=new (ELeave) CActiveCallback(*iRepository); |
|
147 iCRNotifier->Start(TCallBack(CPtiKoreanQwertyCore::CBSettingChanged,this)); |
|
148 } |
|
149 |
|
150 CPtiKoreanQwertyCore::~CPtiKoreanQwertyCore() |
|
151 { |
|
152 |
|
153 if ( iCRNotifier ) |
|
154 { |
|
155 iCRNotifier->Cancel(); |
|
156 } |
|
157 |
|
158 delete iCRNotifier; |
|
159 delete iRepository; |
|
160 delete iCombination; |
|
161 delete iHic; |
|
162 |
|
163 } |
|
164 |
|
165 /* |
|
166 ============================================================================ |
|
167 From CPtiCore |
|
168 ============================================================================ |
|
169 */ |
|
170 |
|
171 void CPtiKoreanQwertyCore::InitializeL( |
|
172 CPtiEngine* aOwner, |
|
173 TDes* aTextBuffer, |
|
174 CArrayPtrFlat<CPtiCoreLanguage>* /*aLanguageList*/, |
|
175 TBool aUseDefautUserDictionary) |
|
176 { |
|
177 LOG1("CPtiKoreanQwertyCore::InitializeL %d",aUseDefautUserDictionary); |
|
178 iOwner=aOwner; |
|
179 iTextBuffer=aTextBuffer; |
|
180 |
|
181 CPtiCoreLanguage* lang; |
|
182 lang = static_cast<CPtiCoreLanguage*>(iOwner->GetLanguage(ELangKorean)); |
|
183 if (lang) |
|
184 { |
|
185 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
186 lang->SetCore(this, EPtiEngineQwertyKorean); |
|
187 #else |
|
188 lang->SetCore(this, EPtiEngineQwerty); |
|
189 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
190 } |
|
191 } |
|
192 |
|
193 void CPtiKoreanQwertyCore::DropLanguages(CArrayPtrFlat<CPtiCoreLanguage>* /*aLanguageList*/) |
|
194 { |
|
195 LOG_ASSERT("CPtiKoreanQwertyCore::DropLanguages"); |
|
196 } |
|
197 |
|
198 TInt CPtiKoreanQwertyCore::OpenLanguageL(CPtiCoreLanguage *aLanguage) |
|
199 { |
|
200 LOG1("CPtiKoreanQwertyCore::OpenLanguageL id=%d",aLanguage->LanguageCode()); |
|
201 TInt ret(KErrNotSupported); |
|
202 if (aLanguage->LanguageCode()==ELangKorean) |
|
203 { |
|
204 ret=KErrNone; |
|
205 iKoreanLanOpen=ETrue; |
|
206 } |
|
207 return ret; |
|
208 } |
|
209 |
|
210 TInt CPtiKoreanQwertyCore::CloseLanguageL() |
|
211 { |
|
212 LOG1("CPtiKoreanQwertyCore::CloseLanguageL opened=%d",iKoreanLanOpen); |
|
213 __ASSERT_ALWAYS(iKoreanLanOpen,User::Panic(_L("PtiKoreanQwertyCore"),__LINE__)); |
|
214 iKoreanLanOpen=EFalse; |
|
215 return KErrNone; |
|
216 } |
|
217 |
|
218 TPtrC CPtiKoreanQwertyCore::GetCurrentWord() const |
|
219 { |
|
220 LOG_ASSERT("CPtiKoreanQwertyCore::GetCurrentWord"); |
|
221 TPtrC ret; |
|
222 return ret; |
|
223 } |
|
224 |
|
225 TInt CPtiKoreanQwertyCore::CommitCurrentWord() |
|
226 { |
|
227 LOG("CPtiKoreanQwertyCore::CommitCurrentWord"); |
|
228 iTextBuffer->Copy(iHic->GetCommitString()); |
|
229 return KErrNone; |
|
230 } |
|
231 |
|
232 MPtiCoreInfo* CPtiKoreanQwertyCore::GetCoreInfo() |
|
233 { |
|
234 LOG_ASSERT("CPtiKoreanQwertyCore::GetCoreInfo"); |
|
235 return NULL; |
|
236 } |
|
237 |
|
238 TInt CPtiKoreanQwertyCore::SetReordering(TBool /*aStatus*/) |
|
239 { |
|
240 LOG_ASSERT("CPtiKoreanQwertyCore::SetReordering"); |
|
241 |
|
242 return KErrNotSupported; |
|
243 } |
|
244 |
|
245 void CPtiKoreanQwertyCore::AppendKeyPress(TPtiKey aKey) |
|
246 { |
|
247 TInt key=aKey; |
|
248 if (iLowerCase && ('A'<=key && key <= 'Z')) |
|
249 { |
|
250 key=key-'A'+'a'; |
|
251 } |
|
252 LOG1("CPtiKoreanQwertyCore::AppendKeyPress %c",key); |
|
253 TBool preEditOngoing(iHic->GetPreeditString().Length()>0); |
|
254 if (iHic->Process(key)) |
|
255 { |
|
256 if (preEditOngoing&&iTextBuffer->Length()) |
|
257 { |
|
258 iTextBuffer->SetLength(iTextBuffer->Length()-1); |
|
259 } |
|
260 if (iHic->GetCommitString().Length()) |
|
261 { |
|
262 LOG1("CPtiKoreanQwertyCore::AppendKeyPress len cmt %d",iHic->GetCommitString().Length()); |
|
263 iTextBuffer->Append(iHic->GetCommitString()); |
|
264 } |
|
265 iTextBuffer->Append(iHic->GetPreeditString()); |
|
266 LOG1("CPtiKoreanQwertyCore::AppendKeyPress len pre %d",iTextBuffer->Length()); |
|
267 } |
|
268 } |
|
269 |
|
270 void CPtiKoreanQwertyCore::DeleteKeyPress() |
|
271 { |
|
272 LOG("CPtiKoreanQwertyCore::DeleteKeyPress"); |
|
273 TInt lenPrevText(iTextBuffer->Length()); |
|
274 TInt lenPrevPreEdit(iHic->GetPreeditString().Length()); |
|
275 if (lenPrevPreEdit) |
|
276 { |
|
277 TInt lenToDelete=lenPrevText>=lenPrevPreEdit?lenPrevPreEdit:lenPrevText; |
|
278 iTextBuffer->SetLength(iTextBuffer->Length()-lenToDelete); |
|
279 } |
|
280 else if (lenPrevText) |
|
281 { |
|
282 iTextBuffer->SetLength(iTextBuffer->Length()-1); |
|
283 } |
|
284 iHic->BackSpace(); |
|
285 if (iHic->GetPreeditString().Length()) |
|
286 { |
|
287 iTextBuffer->Append(iHic->GetPreeditString()); |
|
288 } |
|
289 } |
|
290 |
|
291 void CPtiKoreanQwertyCore::ClearBuffer() |
|
292 { |
|
293 LOG("CPtiKoreanQwertyCore::ClearBuffer"); |
|
294 iHic->Reset(); |
|
295 } |
|
296 |
|
297 TInt CPtiKoreanQwertyCore::SetCurrentInputSequence(TPtrC8 /*aInput*/) |
|
298 { |
|
299 LOG_ASSERT("CPtiKoreanQwertyCore::SetCurrentInputSequence"); |
|
300 |
|
301 return KErrNotSupported; |
|
302 } |
|
303 |
|
304 TInt CPtiKoreanQwertyCore::Convert( |
|
305 TPtiCharConversion /*aType*/, |
|
306 TAny* /*aInput*/, |
|
307 TInt /*aInputLength*/, |
|
308 TAny* /*aOutput*/) |
|
309 { |
|
310 LOG_ASSERT("CPtiKoreanQwertyCore::Convert"); |
|
311 |
|
312 return KErrNotSupported; |
|
313 } |
|
314 |
|
315 TInt CPtiKoreanQwertyCore::SetExternalKeyMapL( |
|
316 TPtiEngineInputMode /*aMode*/, |
|
317 TPtiKey /*aKey*/, |
|
318 TDesC& /*aKeyMap*/, |
|
319 TPtiTextCase /*aCase*/) |
|
320 { |
|
321 LOG_ASSERT("CPtiKoreanQwertyCore::SetExternalKeyMapL"); |
|
322 |
|
323 return KErrNotSupported; |
|
324 } |
|
325 |
|
326 TInt CPtiKoreanQwertyCore::GetSpelling( |
|
327 TUint16 /*aInput*/, |
|
328 TDes& /*aOutput*/, |
|
329 TPtiSpelling /*aType*/) |
|
330 { |
|
331 LOG_ASSERT("CPtiKoreanQwertyCore::GetSpelling"); |
|
332 |
|
333 return KErrNotSupported; |
|
334 } |
|
335 |
|
336 TInt CPtiKoreanQwertyCore::CancelTimerActivity() |
|
337 { |
|
338 LOG("CPtiKoreanQwertyCore::CancelTimerActivity"); |
|
339 return KErrNone; |
|
340 } |
|
341 |
|
342 TInt CPtiKoreanQwertyCore::HandleCommandL(TPtiEngineCommand aCommand, TAny* /*aParams*/) |
|
343 { |
|
344 LOG1("CPtiKoreanQwertyCore::HandleCommandL %d",aCommand); |
|
345 TInt ret(KErrNone); |
|
346 switch (aCommand) |
|
347 { |
|
348 case EPtiCommandVowelSeqFlag: |
|
349 case EPtiCommandDoubleWideEntry: |
|
350 case EPtiCommandPollQwertyDeadKeyRootFlag: |
|
351 case EPtiCommandGetAndClearLastVietnameseChar: |
|
352 case EPtiCommandClearVowelSeq: |
|
353 case EPtiCommandGetAndClearDeadKeyRootChar: |
|
354 ret=KErrNotSupported; |
|
355 break; |
|
356 case EPtiCommandUseLatinCaseUpperOnlyKeyMap: |
|
357 iLowerCase=EFalse; |
|
358 break; |
|
359 case EPtiCommandUseLatinCaseLowerOnlyKeyMap: |
|
360 iLowerCase=ETrue; |
|
361 break; |
|
362 case EPtiCommandGetAutoCompletionTailLength: |
|
363 //To do: |
|
364 break; |
|
365 case EPtiCommandGetSecondaryCandidate: |
|
366 //To do: |
|
367 break; |
|
368 case EPtiCommandSetCorrectionLevel: |
|
369 // To do |
|
370 break; |
|
371 default: |
|
372 LOG_ASSERT("CPtiKoreanQwertyCore::HandleCommandL"); |
|
373 break; |
|
374 } |
|
375 |
|
376 return ret; |
|
377 } |
|
378 |
|
379 /* |
|
380 ============================================================================ |
|
381 From CPtiCore Predictive latin API |
|
382 ============================================================================ |
|
383 */ |
|
384 |
|
385 TInt CPtiKoreanQwertyCore::NumberOfCandidates() |
|
386 { |
|
387 LOG_ASSERT("CPtiKoreanQwertyCore::NumberOfCandidates"); |
|
388 |
|
389 return KErrNotSupported; |
|
390 } |
|
391 |
|
392 TInt CPtiKoreanQwertyCore::GetCandidateListL(CDesCArray& /*aList*/) |
|
393 { |
|
394 LOG_ASSERT("CPtiKoreanQwertyCore::GetCandidateListL"); |
|
395 |
|
396 return KErrNotSupported; |
|
397 } |
|
398 |
|
399 TInt CPtiKoreanQwertyCore::GetNextWordCandidateListL(CDesCArray& /*aList*/) |
|
400 { |
|
401 LOG_ASSERT("CPtiKoreanQwertyCore::GetNextWordCandidateListL"); |
|
402 |
|
403 return KErrNotSupported; |
|
404 } |
|
405 |
|
406 TInt CPtiKoreanQwertyCore::GetFirstCandidate(TDes& /*aResult*/) |
|
407 { |
|
408 LOG_ASSERT("CPtiKoreanQwertyCore::GetFirstCandidate"); |
|
409 |
|
410 return KErrNotSupported; |
|
411 } |
|
412 |
|
413 TInt CPtiKoreanQwertyCore::GetNextCandidate(TDes& /*aResult*/) |
|
414 { |
|
415 LOG_ASSERT("CPtiKoreanQwertyCore::GetNextCandidate"); |
|
416 |
|
417 return KErrNotSupported; |
|
418 } |
|
419 |
|
420 TInt CPtiKoreanQwertyCore::GetPreviousCandidate(TDes& /*aResult*/) |
|
421 { |
|
422 LOG_ASSERT("CPtiKoreanQwertyCore::GetPreviousCandidate"); |
|
423 |
|
424 return KErrNotSupported; |
|
425 } |
|
426 |
|
427 /* |
|
428 ============================================================================ |
|
429 From CPtiCore User dictionary API |
|
430 ============================================================================ |
|
431 */ |
|
432 |
|
433 TInt CPtiKoreanQwertyCore::AddUserDictionaryEntry( |
|
434 MPtiUserDictionaryEntry& /*aEntry*/, |
|
435 CPtiUserDictionary* /*aDict*/) |
|
436 { |
|
437 LOG_ASSERT("CPtiKoreanQwertyCore::AddUserDictionaryEntry"); |
|
438 |
|
439 return KErrNotSupported; |
|
440 } |
|
441 |
|
442 TInt CPtiKoreanQwertyCore::RemoveUserDictionaryEntry( |
|
443 MPtiUserDictionaryEntry& /*aEntry*/, |
|
444 CPtiUserDictionary* /*aDict*/) |
|
445 { |
|
446 LOG_ASSERT("CPtiKoreanQwertyCore::RemoveUserDictionaryEntry"); |
|
447 |
|
448 return KErrNotSupported; |
|
449 } |
|
450 |
|
451 TInt CPtiKoreanQwertyCore::NumberOfEntriesInUserDictionary( |
|
452 CPtiUserDictionary* /*aDict*/) |
|
453 { |
|
454 LOG_ASSERT("CPtiKoreanQwertyCore::NumberOfEntriesInUserDictionary"); |
|
455 |
|
456 return KErrNotSupported; |
|
457 } |
|
458 |
|
459 TInt CPtiKoreanQwertyCore::GetUserDictionaryEntry( |
|
460 TInt /*aIndex*/, |
|
461 MPtiUserDictionaryEntry& /*aResult*/, |
|
462 CPtiUserDictionary* /*aDict*/) |
|
463 { |
|
464 LOG_ASSERT("CPtiKoreanQwertyCore::GetUserDictionaryEntry"); |
|
465 |
|
466 return KErrNotSupported; |
|
467 } |
|
468 |
|
469 CPtiUserDictionary* CPtiKoreanQwertyCore::CreateEmptyUserDictionaryL(TInt /*aMaxSize*/) |
|
470 { |
|
471 LOG_ASSERT("CPtiKoreanQwertyCore::CreateEmptyUserDictionaryL"); |
|
472 |
|
473 return NULL; |
|
474 } |
|
475 |
|
476 TInt CPtiKoreanQwertyCore::AttachUserDictionary(CPtiUserDictionary* /*aDict*/) |
|
477 { |
|
478 LOG_ASSERT("CPtiKoreanQwertyCore::AttachUserDictionary"); |
|
479 |
|
480 return KErrNotSupported; |
|
481 } |
|
482 |
|
483 TBool CPtiKoreanQwertyCore::DetachUserDictionary(CPtiUserDictionary* /*aDict*/) |
|
484 { |
|
485 LOG_ASSERT("CPtiKoreanQwertyCore::DetachUserDictionary"); |
|
486 |
|
487 return EFalse; |
|
488 } |
|
489 |
|
490 /* |
|
491 ============================================================================ |
|
492 From CPtiCore Chinese API |
|
493 ============================================================================ |
|
494 */ |
|
495 |
|
496 TPtrC CPtiKoreanQwertyCore::GetCandidatePage() |
|
497 { |
|
498 LOG_ASSERT("CPtiKoreanQwertyCore::GetCandidatePage"); |
|
499 |
|
500 return KNullDesC(); |
|
501 } |
|
502 |
|
503 TBool CPtiKoreanQwertyCore::NextCandidatePage() |
|
504 { |
|
505 LOG_ASSERT("CPtiKoreanQwertyCore::NextCandidatePage"); |
|
506 |
|
507 return EFalse; |
|
508 } |
|
509 |
|
510 TBool CPtiKoreanQwertyCore::PreviousCandidatePage() |
|
511 { |
|
512 LOG_ASSERT("CPtiKoreanQwertyCore::PreviousCandidatePage"); |
|
513 |
|
514 return EFalse; |
|
515 } |
|
516 |
|
517 TBool CPtiKoreanQwertyCore::MoreCandidatePages() |
|
518 { |
|
519 LOG_ASSERT("CPtiKoreanQwertyCore::MoreCandidatePages"); |
|
520 |
|
521 return EFalse; |
|
522 } |
|
523 |
|
524 void CPtiKoreanQwertyCore::SetCandidatePageLength(TInt /*aLength*/) |
|
525 { |
|
526 LOG_ASSERT("CPtiKoreanQwertyCore::SetCandidatePageLength"); |
|
527 |
|
528 } |
|
529 |
|
530 TPtrC CPtiKoreanQwertyCore::GetPhoneticSpelling(TInt /*aIndex*/) const |
|
531 { |
|
532 LOG_ASSERT("CPtiKoreanQwertyCore::GetPhoneticSpelling"); |
|
533 return KNullDesC(); |
|
534 } |
|
535 |
|
536 TInt CPtiKoreanQwertyCore::PhoneticSpellingCount() const |
|
537 { |
|
538 LOG_ASSERT("CPtiKoreanQwertyCore::PhoneticSpellingCount"); |
|
539 |
|
540 return KErrNotSupported; |
|
541 } |
|
542 |
|
543 TBool CPtiKoreanQwertyCore::SelectPhoneticSpelling(TInt /*aIndex*/) |
|
544 { |
|
545 LOG_ASSERT("CPtiKoreanQwertyCore::SelectPhoneticSpelling"); |
|
546 |
|
547 return EFalse; |
|
548 } |
|
549 |
|
550 TInt CPtiKoreanQwertyCore::SelectedPhoneticSpelling() const |
|
551 { |
|
552 LOG_ASSERT("CPtiKoreanQwertyCore::SelectedPhoneticSpelling"); |
|
553 |
|
554 return KErrNotSupported; |
|
555 } |
|
556 |
|
557 TBool CPtiKoreanQwertyCore::ToneMark(TText& /*aToneMark*/) const |
|
558 { |
|
559 LOG_ASSERT("CPtiKoreanQwertyCore::ToneMark"); |
|
560 |
|
561 return EFalse; |
|
562 } |
|
563 |
|
564 TBool CPtiKoreanQwertyCore::IsToneMarkValidForSpelling() |
|
565 { |
|
566 LOG_ASSERT("CPtiKoreanQwertyCore::IsToneMarkValidForSpelling"); |
|
567 |
|
568 return EFalse; |
|
569 } |
|
570 |
|
571 TBool CPtiKoreanQwertyCore::SetPredictiveChineseChar(const TDesC& /*aChar*/) |
|
572 { |
|
573 LOG_ASSERT("CPtiKoreanQwertyCore::SetPredictiveChineseChar"); |
|
574 |
|
575 return EFalse; |
|
576 } |
|
577 |
|
578 TBool CPtiKoreanQwertyCore::SetToneMark(TInt /*aToneMark*/) |
|
579 { |
|
580 LOG_ASSERT("CPtiKoreanQwertyCore::SetToneMark"); |
|
581 |
|
582 return EFalse; |
|
583 } |
|
584 |
|
585 |
|
586 /* |
|
587 ============================================================================ |
|
588 From CPtiCore Japanese API |
|
589 ============================================================================ |
|
590 */ |
|
591 |
|
592 TPtrC CPtiKoreanQwertyCore::ReadingTextL() |
|
593 { |
|
594 LOG_ASSERT("CPtiKoreanQwertyCore::ReadingTextL"); |
|
595 |
|
596 return KNullDesC(); |
|
597 } |
|
598 |
|
599 MPtiEngineCompositionDataInterface* CPtiKoreanQwertyCore::CompositionData() |
|
600 { |
|
601 LOG_ASSERT("CPtiKoreanQwertyCore::CompositionData"); |
|
602 |
|
603 return NULL; |
|
604 } |
|
605 |
|
606 /* |
|
607 ============================================================================ |
|
608 From CPtiCore Chinese API |
|
609 ============================================================================ |
|
610 */ |
|
611 |
|
612 HBufC* CPtiKoreanQwertyCore::GetCandidatesByInputString( |
|
613 const TDesC& /*aInputString*/, |
|
614 RPointerArray<HBufC>& /*aList*/, |
|
615 const TBool /*aIsPredictive*/) |
|
616 { |
|
617 LOG_ASSERT("CPtiKoreanQwertyCore::GetCandidatesByInputString"); |
|
618 |
|
619 return NULL; |
|
620 } |
|
621 |
|
622 void CPtiKoreanQwertyCore::UpdateFromRepositoryL() |
|
623 { |
|
624 UpdateDblConsonentL(EDblConsonentSsangKiyeok,KCombiSsangKiyeokCho); |
|
625 UpdateDblConsonentL(EDblConsonentSsangKiyeok,KCombiSsangKiyeokJong); |
|
626 UpdateDblConsonentL(EDblConsonentSsangTikeut,KCombiSsangTikeut); |
|
627 UpdateDblConsonentL(EDblConsonentSsangPieup,KCombiSsangPieup); |
|
628 UpdateDblConsonentL(EDblConsonentSsangSios,KCombiSsangSiosCho); |
|
629 UpdateDblConsonentL(EDblConsonentSsangSios,KCombiSsangSiosJong); |
|
630 UpdateDblConsonentL(EDblConsonentSsangCieuc,KCombiSsangCieuc); |
|
631 UpdateDblConsonentL(EDblConsonentYaPlusI,KCombiYaPlusI); |
|
632 UpdateDblConsonentL(EDblConsonentYuPlusI,KCombiYuPlusI); |
|
633 iHic->SetCombinationL(*iCombination); |
|
634 } |
|
635 |
|
636 void CPtiKoreanQwertyCore::UpdateDblConsonentL( |
|
637 const TInt& aCenRepId, |
|
638 const TOssCombinationItem& aCombination) |
|
639 { |
|
640 TInt value; |
|
641 if (KErrNone==iRepository->Get(aCenRepId,value)) |
|
642 { |
|
643 if (value) |
|
644 { |
|
645 iCombination->AddCombinationL(aCombination); |
|
646 } |
|
647 else |
|
648 { |
|
649 iCombination->RemoveCombination(aCombination); |
|
650 } |
|
651 } |
|
652 } |
|
653 |
|
654 TInt CPtiKoreanQwertyCore::CBSettingChanged(void* aSelf) |
|
655 { |
|
656 CPtiKoreanQwertyCore* self=(CPtiKoreanQwertyCore*)aSelf; |
|
657 TInt settingOnGoing(EFalse); |
|
658 TInt ret(KErrNone); |
|
659 if (KErrNone==self->iRepository->Get(EDblConsonentOnSetting,settingOnGoing)) |
|
660 { |
|
661 if (!settingOnGoing) |
|
662 { |
|
663 TRAP(ret,self->UpdateFromRepositoryL()); |
|
664 } |
|
665 } |
|
666 if (ret==KErrNone) |
|
667 { |
|
668 self->iCRNotifier->Start( |
|
669 TCallBack(CPtiKoreanQwertyCore::CBSettingChanged,self)); |
|
670 } |
|
671 return ret; |
|
672 } |