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