|
1 /* |
|
2 * Copyright (c) 2002 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 |
|
20 // INCLUDE FILES |
|
21 #include <e32def.h> |
|
22 #include <bamdesca.h> |
|
23 #include <AknInputLanguageInfo.h> |
|
24 #include "ptiInputLanguageInfo.h" |
|
25 |
|
26 CAknInputLanguageItem* CAknInputLanguageItem::NewL( |
|
27 TLanguage aLanguageCode, |
|
28 const TDesC& aName, |
|
29 TAknInputLanguageCapabilities aCapabilities ) |
|
30 { |
|
31 CAknInputLanguageItem* item = new(ELeave)CAknInputLanguageItem(aLanguageCode); |
|
32 CleanupStack::PushL(item); |
|
33 item->ConstructL( aName, aCapabilities); |
|
34 CleanupStack::Pop(); // item |
|
35 return item; |
|
36 } |
|
37 |
|
38 EXPORT_C CAknInputLanguageItem::~CAknInputLanguageItem() |
|
39 { |
|
40 delete iLanguageName; |
|
41 } |
|
42 |
|
43 CAknInputLanguageItem::CAknInputLanguageItem( TLanguage aLanguageCode ): |
|
44 iLanguageCode ( aLanguageCode ) |
|
45 { |
|
46 } |
|
47 |
|
48 void CAknInputLanguageItem::ConstructL( |
|
49 const TDesC& aName, |
|
50 TAknInputLanguageCapabilities aCapabilities) |
|
51 { |
|
52 iLanguageName = aName.AllocL(); |
|
53 iCapabilities = aCapabilities; |
|
54 } |
|
55 |
|
56 EXPORT_C TLanguage CAknInputLanguageItem::LanguageCode() const |
|
57 { |
|
58 return iLanguageCode; |
|
59 } |
|
60 |
|
61 EXPORT_C TPtrC CAknInputLanguageItem::LanguageName() const |
|
62 { |
|
63 return iLanguageName->Des(); |
|
64 } |
|
65 |
|
66 EXPORT_C TAknInputLanguageCapabilities CAknInputLanguageItem::Capabilities() const |
|
67 { |
|
68 return iCapabilities; |
|
69 } |
|
70 |
|
71 |
|
72 EXPORT_C CAknInputLanguageList::CAknInputLanguageList(TInt aGranularity): |
|
73 CArrayPtrFlat<CAknInputLanguageItem>( aGranularity ) |
|
74 { |
|
75 } |
|
76 |
|
77 EXPORT_C CAknInputLanguageList::~CAknInputLanguageList() |
|
78 { |
|
79 ResetAndDestroy(); |
|
80 } |
|
81 |
|
82 EXPORT_C TInt CAknInputLanguageList::MdcaCount() const |
|
83 { |
|
84 return Count(); |
|
85 } |
|
86 |
|
87 EXPORT_C TPtrC CAknInputLanguageList::MdcaPoint(TInt aIndex) const |
|
88 { |
|
89 return At( aIndex )->LanguageName(); |
|
90 } |
|
91 |
|
92 // End of File |