1 /* |
1 /* |
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
13 * |
13 * |
14 * Description: Application UI class |
14 * Description: Application UI class |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
|
19 // INCLUDE FILES |
18 // INCLUDE FILES |
20 #include "UssdAppUi.h" |
|
21 #include "UssdContainer.h" |
|
22 #include "UssdComms.h" |
|
23 #include <ussd.rsg> |
19 #include <ussd.rsg> |
24 #include <avkon.rsg> |
20 #include <avkon.rsg> |
25 #include "ussd.hrh" |
|
26 #include <eikmenub.h> |
21 #include <eikmenub.h> |
27 #include <eikedwin.h> |
22 #include <eikedwin.h> |
28 #include <avkon.hrh> |
23 #include <avkon.hrh> |
29 #include <bldvariant.hrh> |
24 #include <bldvariant.hrh> |
30 #include <featmgr.h> |
25 #include <featmgr.h> |
31 |
|
32 #include <AknDef.h> |
26 #include <AknDef.h> |
33 #include <hlplch.h> // For HlpLauncher |
27 #include <hlplch.h> // For HlpLauncher |
34 |
28 |
35 |
29 #include "UssdAppUi.h" |
|
30 #include "UssdContainer.h" |
|
31 #include "UssdComms.h" |
|
32 #include "ussd.hrh" |
|
33 #include "UssdLogger.h" |
36 // ============================ MEMBER FUNCTIONS =============================== |
34 // ============================ MEMBER FUNCTIONS =============================== |
37 |
35 |
38 // ----------------------------------------------------------------------------- |
36 // ----------------------------------------------------------------------------- |
39 // CUssdAppUi::ConstructL |
37 // CUssdAppUi::ConstructL |
40 // Creates all members |
38 // Creates all members |
41 // ----------------------------------------------------------------------------- |
39 // ----------------------------------------------------------------------------- |
42 void CUssdAppUi::ConstructL() |
40 void CUssdAppUi::ConstructL() |
43 { |
41 { |
|
42 _LOGSTRING( "CUssdAppUi::ConstructL =>" ) |
44 // Sets up TLS, must be done before FeatureManager is used in USSD. |
43 // Sets up TLS, must be done before FeatureManager is used in USSD. |
45 FeatureManager::InitializeLibL(); |
44 FeatureManager::InitializeLibL(); |
46 |
45 |
47 BaseConstructL( |
46 BaseConstructL( |
48 EAknEnableSkin | EAknEnableMSK |
47 EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible |
49 ); |
48 ); |
50 |
49 |
51 // Softkeys at start: |
50 // Softkeys at start: |
52 // With HELP: Options-Exit (defined in the resource file, default) |
51 // With HELP: Options-Exit (defined in the resource file, default) |
53 // Without HELP: <empty>-Exit |
52 // Without HELP: <empty>-Exit |
64 iAppContainer = new( ELeave ) CUssdContainer( *this ); |
63 iAppContainer = new( ELeave ) CUssdContainer( *this ); |
65 iAppContainer->SetMopParent( this ); |
64 iAppContainer->SetMopParent( this ); |
66 iAppContainer->ConstructL( ClientRect() ); |
65 iAppContainer->ConstructL( ClientRect() ); |
67 AddToStackL( iAppContainer ); |
66 AddToStackL( iAppContainer ); |
68 iIsAddedToStack = ETrue; |
67 iIsAddedToStack = ETrue; |
69 } |
68 _LOGSTRING( "CUssdAppUi::ConstructL <=" ) |
70 |
69 } |
71 |
70 |
72 // ----------------------------------------------------------------------------- |
71 // ----------------------------------------------------------------------------- |
73 // CUssdAppUi::~CUssdAppUi |
72 // CUssdAppUi::~CUssdAppUi |
74 // Destructor |
73 // Destructor |
75 // Frees reserved resources |
74 // Frees reserved resources |
76 // ----------------------------------------------------------------------------- |
75 // ----------------------------------------------------------------------------- |
77 CUssdAppUi::~CUssdAppUi() |
76 CUssdAppUi::~CUssdAppUi() |
78 { |
77 { |
|
78 _LOGSTRING( "CUssdAppUi::~CUssdAppUi =>" ) |
79 if ( iIsAddedToStack ) |
79 if ( iIsAddedToStack ) |
80 { |
80 { |
81 RemoveFromStack( iAppContainer ); |
81 RemoveFromStack( iAppContainer ); |
82 } |
82 } |
83 |
83 |
84 delete iAppContainer; |
84 delete iAppContainer; |
85 iAppContainer = NULL; |
|
86 |
85 |
87 delete iComms; |
86 delete iComms; |
88 iComms = NULL; |
|
89 |
87 |
90 // Frees the TLS! Must be done after FeatureManager is used. |
88 // Frees the TLS! Must be done after FeatureManager is used. |
91 FeatureManager::UnInitializeLib(); |
89 FeatureManager::UnInitializeLib(); |
92 } |
90 _LOGSTRING( "CUssdAppUi::~CUssdAppUi <=" ) |
93 |
91 } |
94 |
92 |
95 // ----------------------------------------------------------------------------- |
93 // ----------------------------------------------------------------------------- |
96 // CUssdAppUi::HandleCommandL |
94 // CUssdAppUi::HandleCommandL |
97 // Handle commands from the user. |
95 // Handle commands from the user. |
98 // ----------------------------------------------------------------------------- |
96 // ----------------------------------------------------------------------------- |
99 void CUssdAppUi::HandleCommandL( TInt aCommand ) |
97 void CUssdAppUi::HandleCommandL( TInt aCommand ) |
100 { |
98 { |
|
99 _LOGSTRING2( "CUssdAppUi::HandleCommandL =>, aCommand=%d", |
|
100 aCommand ) |
101 switch ( aCommand ) |
101 switch ( aCommand ) |
102 { |
102 { |
103 case EAknCmdExit: |
103 case EAknCmdExit: |
104 case EEikCmdExit: |
104 case EEikCmdExit: |
105 case EAknSoftkeyExit: |
105 case EAknSoftkeyExit: |
143 } |
143 } |
144 |
144 |
145 default: |
145 default: |
146 break; |
146 break; |
147 } |
147 } |
148 } |
148 _LOGSTRING( "CUssdAppUi::HandleCommandL <=" ) |
149 |
149 } |
150 |
150 |
151 // ----------------------------------------------------------------------------- |
151 // ----------------------------------------------------------------------------- |
152 // CUssdAppUi::HandleResourceChangeL |
152 // CUssdAppUi::HandleResourceChangeL |
153 // ----------------------------------------------------------------------------- |
153 // ----------------------------------------------------------------------------- |
154 void CUssdAppUi::HandleResourceChangeL( TInt aType ) |
154 void CUssdAppUi::HandleResourceChangeL( TInt aType ) |
165 // CUssdAppUi::HandleForegroundEventL |
165 // CUssdAppUi::HandleForegroundEventL |
166 // Handle foreground event. |
166 // Handle foreground event. |
167 // ----------------------------------------------------------------------------- |
167 // ----------------------------------------------------------------------------- |
168 void CUssdAppUi::HandleForegroundEventL( TBool aForeground ) |
168 void CUssdAppUi::HandleForegroundEventL( TBool aForeground ) |
169 { |
169 { |
|
170 _LOGSTRING2( "CUssdAppUi::HandleForegroundEventL =>, aForeground=%d", |
|
171 aForeground ) |
170 if ( iComms ) |
172 if ( iComms ) |
171 { |
173 { |
172 if ( aForeground ) |
174 if ( aForeground ) |
173 { |
175 { |
174 // If app comes to foreground, we must know is the |
176 // If app comes to foreground, we must know is the |
200 { |
202 { |
201 iAppContainer->UpdateNavipaneMsgLengthL(); |
203 iAppContainer->UpdateNavipaneMsgLengthL(); |
202 } |
204 } |
203 |
205 |
204 CAknAppUi::HandleForegroundEventL( aForeground ); |
206 CAknAppUi::HandleForegroundEventL( aForeground ); |
205 } |
207 _LOGSTRING( "CUssdAppUi::HandleForegroundEventL <=" ) |
206 |
208 } |
207 |
209 |
208 // ----------------------------------------------------------------------------- |
210 // ----------------------------------------------------------------------------- |
209 // CUssdAppUi::DynInitMenuPaneL |
211 // CUssdAppUi::DynInitMenuPaneL |
210 // Set's Send option visible. |
212 // Set's Send option visible. |
211 // |
213 // |
234 } |
236 } |
235 |
237 |
236 // If help not defined, do nothing |
238 // If help not defined, do nothing |
237 } |
239 } |
238 |
240 |
239 |
|
240 // ----------------------------------------------------------------------------- |
241 // ----------------------------------------------------------------------------- |
241 // CUssdAppUi::SetSofkeySendVisibleL |
242 // CUssdAppUi::SetSofkeySendVisibleL |
242 // Sets Send softkey (in)visible. |
243 // Sets Send softkey (in)visible. |
243 // ----------------------------------------------------------------------------- |
244 // ----------------------------------------------------------------------------- |
244 void CUssdAppUi::SetSoftkeySendVisibleL( |
245 void CUssdAppUi::SetSoftkeySendVisibleL( |