1
/* $Id: symbian_ua_guiAppUi.cpp 3550 2011-05-05 05:33:27Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
// [[[ begin generated region: do not modify [Generated System Includes]
21
#include <akncontext.h>
23
#include <symbian_ua_gui.rsg>
24
// ]]] end generated region [Generated System Includes]
26
// [[[ begin generated region: do not modify [Generated User Includes]
27
#include "symbian_ua_guiAppUi.h"
28
#include "symbian_ua_gui.hrh"
29
#include "symbian_ua_guiContainer.hrh"
30
#include "symbian_ua_guiSettingItemList.hrh"
31
#include "symbian_ua_guiContainerView.h"
32
#include "symbian_ua_guiSettingItemListView.h"
33
// ]]] end generated region [Generated User Includes]
35
// [[[ begin generated region: do not modify [Generated Constants]
36
// ]]] end generated region [Generated Constants]
38
#include "symbian_ua.h"
41
* Construct the Csymbian_ua_guiAppUi instance
43
Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer(0)
45
// [[[ begin generated region: do not modify [Generated Contents]
46
// ]]] end generated region [Generated Contents]
51
* The appui's destructor removes the container from the control
52
* stack and destroys it.
54
Csymbian_ua_guiAppUi::~Csymbian_ua_guiAppUi()
56
// [[[ begin generated region: do not modify [Generated Contents]
57
TRAPD( err_Dlg_wait_init, RemoveDlg_wait_initL() );
58
// ]]] end generated region [Generated Contents]
61
// [[[ begin generated function: do not modify
62
void Csymbian_ua_guiAppUi::InitializeContainersL()
64
iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL();
65
AddViewL( iSymbian_ua_guiContainerView );
66
iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL();
67
AddViewL( iSymbian_ua_guiSettingItemListView );
68
SetDefaultViewL( *iSymbian_ua_guiSettingItemListView );
70
// ]]] end generated function
73
* Handle a command for this appui (override)
74
* @param aCommand command id to be handled
76
void Csymbian_ua_guiAppUi::HandleCommandL( TInt aCommand )
78
// [[[ begin generated region: do not modify [Generated Code]
79
TBool commandHandled = EFalse;
81
{ // code to dispatch to the AppUi's menu and CBA commands is generated here
87
if ( !commandHandled )
89
if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit )
95
// ]]] end generated region [Generated Code]
100
* Override of the HandleResourceChangeL virtual function
102
void Csymbian_ua_guiAppUi::HandleResourceChangeL( TInt aType )
104
CAknViewAppUi::HandleResourceChangeL( aType );
105
// [[[ begin generated region: do not modify [Generated Code]
106
// ]]] end generated region [Generated Code]
111
* Override of the HandleKeyEventL virtual function
112
* @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not
116
TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL(
117
const TKeyEvent& aKeyEvent,
120
// The inherited HandleKeyEventL is private and cannot be called
121
// [[[ begin generated region: do not modify [Generated Contents]
122
// ]]] end generated region [Generated Contents]
124
return EKeyWasNotConsumed;
128
* Override of the HandleViewDeactivation virtual function
130
* @param aViewIdToBeDeactivated
131
* @param aNewlyActivatedViewId
133
void Csymbian_ua_guiAppUi::HandleViewDeactivation(
134
const TVwsViewId& aViewIdToBeDeactivated,
135
const TVwsViewId& aNewlyActivatedViewId )
137
CAknViewAppUi::HandleViewDeactivation(
138
aViewIdToBeDeactivated,
139
aNewlyActivatedViewId );
140
// [[[ begin generated region: do not modify [Generated Contents]
141
// ]]] end generated region [Generated Contents]
146
* @brief Completes the second phase of Symbian object construction.
147
* Put initialization code that could leave here.
149
void Csymbian_ua_guiAppUi::ConstructL()
151
// [[[ begin generated region: do not modify [Generated Contents]
152
BaseConstructL( EAknEnableSkin );
153
InitializeContainersL();
154
// ]]] end generated region [Generated Contents]
156
// Create private folder
160
path.Copy( process.FileName().Left(2) );
162
if(path.Compare(_L("c")) || path.Compare(_L("C")))
163
CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC);
164
else if(path.Compare(_L("e")) || path.Compare(_L("E")))
165
CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE);
168
if (symbian_ua_init() != 0) {
169
symbian_ua_destroy();
173
ExecuteDlg_wait_initLD();
175
CTimer::ConstructL();
176
CActiveScheduler::Add( this );
181
* Override of the HandleApplicationSpecificEventL virtual function
183
void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL(
185
const TWsEvent& anEvent )
187
CAknViewAppUi::HandleApplicationSpecificEventL( aType, anEvent );
188
// [[[ begin generated region: do not modify [Generated Code]
189
// ]]] end generated region [Generated Code]
194
* Handle the applicationSpecificEvent event.
196
void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL(
198
const TWsEvent& /* anEvent */ )
200
// TODO: implement applicationSpecificEvent event handler
203
// [[[ begin generated function: do not modify
205
* Execute the wait dialog for dlg_wait_init. This routine returns
206
* while the dialog is showing. It will be closed and destroyed when
207
* RemoveDlg_wait_initL() or the user selects the Cancel soft key.
208
* @param aOverrideText optional override text. When null the text configured
209
* in the UI Designer is used.
211
void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD( const TDesC* aOverrideText )
213
iDlg_wait_init = new ( ELeave ) CAknWaitDialog(
214
reinterpret_cast< CEikDialog** >( &iDlg_wait_init ), EFalse );
215
if ( aOverrideText != NULL )
217
iDlg_wait_init->SetTextL( *aOverrideText );
219
iDlg_wait_init->ExecuteLD( R_APPLICATION_DLG_WAIT_INIT );
220
iDlg_wait_initCallback = new ( ELeave ) CProgressDialogCallback(
221
this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL );
222
iDlg_wait_init->SetCallback( iDlg_wait_initCallback );
224
// ]]] end generated function
226
// [[[ begin generated function: do not modify
228
* Close and dispose of the wait dialog for dlg_wait_init
230
void Csymbian_ua_guiAppUi::RemoveDlg_wait_initL()
232
if ( iDlg_wait_init != NULL )
234
iDlg_wait_init->SetCallback( NULL );
235
iDlg_wait_init->ProcessFinishedL(); // deletes the dialog
236
iDlg_wait_init = NULL;
238
delete iDlg_wait_initCallback;
239
iDlg_wait_initCallback = NULL;
242
// ]]] end generated function
245
* Handle the canceled event.
247
void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL( CAknProgressDialog* /* aDialog */ )
249
// TODO: implement canceled event handler
253
void Csymbian_ua_guiAppUi::RunL()
255
RemoveDlg_wait_initL();
256
iSymbian_ua_guiSettingItemListView->HandleCommandL(EAknSoftkeySave);