1 /* |
|
2 * Copyright (c) 2001-2010 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 the License "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: Implementation of EAP AKA UI class |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 15 % |
|
20 */ |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include "EapAkaUi.h" |
|
24 #include "EapAkaUiView.h" |
|
25 #include <eapakaui.rsg> |
|
26 #include <bautils.h> |
|
27 #include <coemain.h> |
|
28 #include <aknnotewrappers.h> |
|
29 #include <data_caging_path_literals.hrh> |
|
30 |
|
31 |
|
32 // CONSTANTS |
|
33 _LIT( KDriveZ, "z:" ); // ROM folder |
|
34 _LIT( KResourceFileName, "eapAkaui.rsc" ); |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 class TResourceFileCleanupItem |
|
39 { |
|
40 public: |
|
41 CCoeEnv* iCoeEnv; |
|
42 TInt iResourceFileOffset; |
|
43 }; |
|
44 |
|
45 |
|
46 // ============================= LOCAL FUNCTIONS =============================== |
|
47 |
|
48 // ----------------------------------------------------------------------------- |
|
49 // CleanupResourceFile |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 static void CleanupResourceFile( TAny* aObject ) |
|
53 { |
|
54 TResourceFileCleanupItem* item = |
|
55 REINTERPRET_CAST( TResourceFileCleanupItem*, aObject ); |
|
56 item->iCoeEnv->DeleteResourceFile( item->iResourceFileOffset ); |
|
57 delete item; |
|
58 } |
|
59 |
|
60 |
|
61 // ============================ MEMBER FUNCTIONS =============================== |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CEapAkaUi::CEapAkaUi |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 CEapAkaUi::CEapAkaUi( CEapAkaUiConnection* aConnection ) |
|
68 : iConnection( aConnection ) |
|
69 { |
|
70 } |
|
71 |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // CEapAkaUi::NewL |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 CEapAkaUi* CEapAkaUi::NewL( CEapAkaUiConnection* aConnection ) |
|
78 { |
|
79 CEapAkaUi* self = new ( ELeave ) CEapAkaUi( aConnection ); |
|
80 CleanupStack::PushL( self ); |
|
81 self->ConstructL(); |
|
82 CleanupStack::Pop( self ); |
|
83 return self; |
|
84 } |
|
85 |
|
86 |
|
87 // ----------------------------------------------------------------------------- |
|
88 // CEapAkaUi::ConstructL() |
|
89 // ----------------------------------------------------------------------------- |
|
90 // |
|
91 void CEapAkaUi::ConstructL() |
|
92 { |
|
93 } |
|
94 |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // CEapAkaUi::~CEapAkaUi |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 CEapAkaUi::~CEapAkaUi() |
|
101 { |
|
102 } |
|
103 |
|
104 |
|
105 // ----------------------------------------------------------------------------- |
|
106 // CEapAkaUi::InvokeUiL |
|
107 // ----------------------------------------------------------------------------- |
|
108 // |
|
109 TInt CEapAkaUi::InvokeUiL() |
|
110 { |
|
111 TFileName fileName; |
|
112 |
|
113 fileName.Append( KDriveZ ); |
|
114 fileName.Append( KDC_RESOURCE_FILES_DIR ); |
|
115 fileName.Append( KResourceFileName ); |
|
116 |
|
117 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
118 BaflUtils::NearestLanguageFile( coeEnv->FsSession(), fileName ); |
|
119 |
|
120 TResourceFileCleanupItem* item = new( ELeave ) TResourceFileCleanupItem; |
|
121 |
|
122 item->iCoeEnv = coeEnv; |
|
123 CleanupStack::PushL( TCleanupItem( CleanupResourceFile, item ) ); |
|
124 item->iResourceFileOffset = coeEnv->AddResourceFileL( fileName ); |
|
125 |
|
126 TInt buttonId; |
|
127 CEapAkaUiDialog* settingsDlg = new( ELeave ) CEapAkaUiDialog( iConnection, |
|
128 buttonId ); |
|
129 settingsDlg->ConstructAndRunLD( R_AKA_SETTING_DIALOG ); |
|
130 |
|
131 CleanupStack::PopAndDestroy(); // For resource file |
|
132 |
|
133 return buttonId; |
|
134 } |
|
135 |
|
136 |
|
137 // End of File |
|