1 /* |
|
2 * Copyright (c) 2008 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: CLangName class contains language id amd name |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "SisxUILangName.h" // CLangName |
|
20 #include <barsread.h> // TResourceReader |
|
21 |
|
22 |
|
23 // ======== MEMBER FUNCTIONS ======== |
|
24 |
|
25 // --------------------------------------------------------------------------- |
|
26 // CLangName::NewL() |
|
27 // --------------------------------------------------------------------------- |
|
28 // |
|
29 CLangName* CLangName::NewL( TResourceReader& aReader ) |
|
30 { |
|
31 CLangName* self = new (ELeave) CLangName; |
|
32 CleanupStack::PushL( self ); |
|
33 self->ConstructFromResourceL( aReader ); |
|
34 CleanupStack::Pop( self ); |
|
35 return self; |
|
36 } |
|
37 |
|
38 // --------------------------------------------------------------------------- |
|
39 // CLangName::~CLangName() |
|
40 // --------------------------------------------------------------------------- |
|
41 // |
|
42 CLangName::~CLangName() |
|
43 { |
|
44 delete iName; |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // CLangName::Id() |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 TLanguage CLangName::Id() const |
|
52 { |
|
53 return iId; |
|
54 } |
|
55 |
|
56 // --------------------------------------------------------------------------- |
|
57 // CLangName::Name() |
|
58 // --------------------------------------------------------------------------- |
|
59 // |
|
60 TPtrC CLangName::Name() const |
|
61 { |
|
62 return *iName; |
|
63 } |
|
64 |
|
65 // --------------------------------------------------------------------------- |
|
66 // CLangName::CLangName() |
|
67 // --------------------------------------------------------------------------- |
|
68 // |
|
69 CLangName::CLangName() |
|
70 { |
|
71 } |
|
72 |
|
73 // --------------------------------------------------------------------------- |
|
74 // CLangName::ConstructFromResourceL() |
|
75 // --------------------------------------------------------------------------- |
|
76 // |
|
77 void CLangName::ConstructFromResourceL( TResourceReader& aReader ) |
|
78 { |
|
79 iId = static_cast< TLanguage >( aReader.ReadInt16() ); |
|
80 iName = aReader.ReadHBufC16L(); |
|
81 } |
|