~ubuntu-branches/ubuntu/saucy/sflphone/saucy

« back to all changes in this revision

Viewing changes to sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2010-12-24 16:33:55 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20101224163355-tkvvikqxbrbav6up
Tags: 0.9.11-1
* New upstream release
* Add new build dependencies on libwebkit-dev and libyaml-dev

* Bump Standards-Version up to 3.9.1
* Bump debhelper compatibility to 8
* Patch another typo in the upstream code (lintian notice)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 Name        : symbian_ua_guiAppUi.cpp
4
4
 Author      : nanang
5
5
 Copyright   : (c) 2008-2009 Teluu Inc.
6
 
 Description : 
 
6
 Description :
7
7
========================================================================
8
8
*/
9
9
// [[[ begin generated region: do not modify [Generated System Includes]
29
29
 
30
30
/**
31
31
 * Construct the Csymbian_ua_guiAppUi instance
32
 
 */ 
33
 
Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer(0)
34
 
        {
35
 
        // [[[ begin generated region: do not modify [Generated Contents]
36
 
        // ]]] end generated region [Generated Contents]
37
 
 
38
 
        }
39
 
 
40
 
/** 
 
32
 */
 
33
Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer (0)
 
34
{
 
35
    // [[[ begin generated region: do not modify [Generated Contents]
 
36
    // ]]] end generated region [Generated Contents]
 
37
 
 
38
}
 
39
 
 
40
/**
41
41
 * The appui's destructor removes the container from the control
42
42
 * stack and destroys it.
43
43
 */
44
44
Csymbian_ua_guiAppUi::~Csymbian_ua_guiAppUi()
45
 
        {
46
 
        // [[[ begin generated region: do not modify [Generated Contents]
47
 
        TRAPD( err_Dlg_wait_init, RemoveDlg_wait_initL() );
48
 
        // ]]] end generated region [Generated Contents]
49
 
        }
 
45
{
 
46
    // [[[ begin generated region: do not modify [Generated Contents]
 
47
    TRAPD (err_Dlg_wait_init, RemoveDlg_wait_initL());
 
48
    // ]]] end generated region [Generated Contents]
 
49
}
50
50
 
51
51
// [[[ begin generated function: do not modify
52
52
void Csymbian_ua_guiAppUi::InitializeContainersL()
53
 
        {
54
 
        iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL();
55
 
        AddViewL( iSymbian_ua_guiContainerView );
56
 
        iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL();
57
 
        AddViewL( iSymbian_ua_guiSettingItemListView );
58
 
        SetDefaultViewL( *iSymbian_ua_guiSettingItemListView );
59
 
        }
 
53
{
 
54
    iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL();
 
55
    AddViewL (iSymbian_ua_guiContainerView);
 
56
    iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL();
 
57
    AddViewL (iSymbian_ua_guiSettingItemListView);
 
58
    SetDefaultViewL (*iSymbian_ua_guiSettingItemListView);
 
59
}
60
60
// ]]] end generated function
61
61
 
62
62
/**
63
63
 * Handle a command for this appui (override)
64
64
 * @param aCommand command id to be handled
65
65
 */
66
 
void Csymbian_ua_guiAppUi::HandleCommandL( TInt aCommand )
67
 
        {
68
 
        // [[[ begin generated region: do not modify [Generated Code]
69
 
        TBool commandHandled = EFalse;
70
 
        switch ( aCommand )
71
 
                { // code to dispatch to the AppUi's menu and CBA commands is generated here
72
 
                default:
73
 
                        break;
74
 
                }
75
 
        
76
 
                
77
 
        if ( !commandHandled ) 
78
 
                {
79
 
                if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit )
80
 
                        {
81
 
                        symbian_ua_destroy();
82
 
                        Exit();
83
 
                        }
84
 
                }
85
 
        // ]]] end generated region [Generated Code]
86
 
        
87
 
        }
88
 
 
89
 
/** 
 
66
void Csymbian_ua_guiAppUi::HandleCommandL (TInt aCommand)
 
67
{
 
68
    // [[[ begin generated region: do not modify [Generated Code]
 
69
    TBool commandHandled = EFalse;
 
70
 
 
71
    switch (aCommand) { // code to dispatch to the AppUi's menu and CBA commands is generated here
 
72
        default:
 
73
            break;
 
74
    }
 
75
 
 
76
 
 
77
    if (!commandHandled) {
 
78
        if (aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit) {
 
79
            symbian_ua_destroy();
 
80
            Exit();
 
81
        }
 
82
    }
 
83
 
 
84
    // ]]] end generated region [Generated Code]
 
85
 
 
86
}
 
87
 
 
88
/**
90
89
 * Override of the HandleResourceChangeL virtual function
91
90
 */
92
 
void Csymbian_ua_guiAppUi::HandleResourceChangeL( TInt aType )
93
 
        {
94
 
        CAknViewAppUi::HandleResourceChangeL( aType );
95
 
        // [[[ begin generated region: do not modify [Generated Code]
96
 
        // ]]] end generated region [Generated Code]
97
 
        
98
 
        }
99
 
                                
100
 
/** 
 
91
void Csymbian_ua_guiAppUi::HandleResourceChangeL (TInt aType)
 
92
{
 
93
    CAknViewAppUi::HandleResourceChangeL (aType);
 
94
    // [[[ begin generated region: do not modify [Generated Code]
 
95
    // ]]] end generated region [Generated Code]
 
96
 
 
97
}
 
98
 
 
99
/**
101
100
 * Override of the HandleKeyEventL virtual function
102
101
 * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not
103
 
 * @param aKeyEvent 
104
 
 * @param aType 
 
102
 * @param aKeyEvent
 
103
 * @param aType
105
104
 */
106
 
TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL(
107
 
                const TKeyEvent& aKeyEvent,
108
 
                TEventCode aType )
109
 
        {
110
 
        // The inherited HandleKeyEventL is private and cannot be called
111
 
        // [[[ begin generated region: do not modify [Generated Contents]
112
 
        // ]]] end generated region [Generated Contents]
113
 
        
114
 
        return EKeyWasNotConsumed;
115
 
        }
116
 
 
117
 
/** 
 
105
TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL (
 
106
    const TKeyEvent& aKeyEvent,
 
107
    TEventCode aType)
 
108
{
 
109
    // The inherited HandleKeyEventL is private and cannot be called
 
110
    // [[[ begin generated region: do not modify [Generated Contents]
 
111
    // ]]] end generated region [Generated Contents]
 
112
 
 
113
    return EKeyWasNotConsumed;
 
114
}
 
115
 
 
116
/**
118
117
 * Override of the HandleViewDeactivation virtual function
119
118
 *
120
 
 * @param aViewIdToBeDeactivated 
121
 
 * @param aNewlyActivatedViewId 
 
119
 * @param aViewIdToBeDeactivated
 
120
 * @param aNewlyActivatedViewId
122
121
 */
123
 
void Csymbian_ua_guiAppUi::HandleViewDeactivation( 
124
 
                const TVwsViewId& aViewIdToBeDeactivated, 
125
 
                const TVwsViewId& aNewlyActivatedViewId )
126
 
        {
127
 
        CAknViewAppUi::HandleViewDeactivation( 
128
 
                        aViewIdToBeDeactivated, 
129
 
                        aNewlyActivatedViewId );
130
 
        // [[[ begin generated region: do not modify [Generated Contents]
131
 
        // ]]] end generated region [Generated Contents]
132
 
        
133
 
        }
 
122
void Csymbian_ua_guiAppUi::HandleViewDeactivation (
 
123
    const TVwsViewId& aViewIdToBeDeactivated,
 
124
    const TVwsViewId& aNewlyActivatedViewId)
 
125
{
 
126
    CAknViewAppUi::HandleViewDeactivation (
 
127
        aViewIdToBeDeactivated,
 
128
        aNewlyActivatedViewId);
 
129
    // [[[ begin generated region: do not modify [Generated Contents]
 
130
    // ]]] end generated region [Generated Contents]
 
131
 
 
132
}
134
133
 
135
134
/**
136
 
 * @brief Completes the second phase of Symbian object construction. 
137
 
 * Put initialization code that could leave here. 
138
 
 */ 
 
135
 * @brief Completes the second phase of Symbian object construction.
 
136
 * Put initialization code that could leave here.
 
137
 */
139
138
void Csymbian_ua_guiAppUi::ConstructL()
140
 
        {
141
 
        // [[[ begin generated region: do not modify [Generated Contents]
142
 
        BaseConstructL( EAknEnableSkin );
143
 
        InitializeContainersL();
144
 
        // ]]] end generated region [Generated Contents]
145
 
 
146
 
        // Create private folder
147
 
        RProcess process;
148
 
        TFileName path;
149
 
        
150
 
        path.Copy( process.FileName().Left(2) );
151
 
        
152
 
        if(path.Compare(_L("c")) || path.Compare(_L("C")))
153
 
                CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC);
154
 
        else if(path.Compare(_L("e")) || path.Compare(_L("E")))
155
 
                CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE);    
156
 
        
157
 
        // Init PJSUA
158
 
        if (symbian_ua_init() != 0) {
159
 
            symbian_ua_destroy();
160
 
            Exit();
161
 
        }
162
 
        
163
 
        ExecuteDlg_wait_initLD();
164
 
 
165
 
        CTimer::ConstructL();
166
 
        CActiveScheduler::Add( this );
167
 
        After(4000000);
168
 
        }
169
 
 
170
 
/** 
 
139
{
 
140
    // [[[ begin generated region: do not modify [Generated Contents]
 
141
    BaseConstructL (EAknEnableSkin);
 
142
    InitializeContainersL();
 
143
    // ]]] end generated region [Generated Contents]
 
144
 
 
145
    // Create private folder
 
146
    RProcess process;
 
147
    TFileName path;
 
148
 
 
149
    path.Copy (process.FileName().Left (2));
 
150
 
 
151
    if (path.Compare (_L ("c")) || path.Compare (_L ("C")))
 
152
        CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC);
 
153
    else if (path.Compare (_L ("e")) || path.Compare (_L ("E")))
 
154
        CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE);
 
155
 
 
156
    // Init PJSUA
 
157
    if (symbian_ua_init() != 0) {
 
158
        symbian_ua_destroy();
 
159
        Exit();
 
160
    }
 
161
 
 
162
    ExecuteDlg_wait_initLD();
 
163
 
 
164
    CTimer::ConstructL();
 
165
    CActiveScheduler::Add (this);
 
166
    After (4000000);
 
167
}
 
168
 
 
169
/**
171
170
 * Override of the HandleApplicationSpecificEventL virtual function
172
171
 */
173
 
void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL( 
174
 
                TInt aType, 
175
 
                const TWsEvent& anEvent )
176
 
        {
177
 
        CAknViewAppUi::HandleApplicationSpecificEventL( aType, anEvent );
178
 
        // [[[ begin generated region: do not modify [Generated Code]
179
 
        // ]]] end generated region [Generated Code]
180
 
        
181
 
        }
182
 
                                
183
 
/** 
 
172
void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL (
 
173
    TInt aType,
 
174
    const TWsEvent& anEvent)
 
175
{
 
176
    CAknViewAppUi::HandleApplicationSpecificEventL (aType, anEvent);
 
177
    // [[[ begin generated region: do not modify [Generated Code]
 
178
    // ]]] end generated region [Generated Code]
 
179
 
 
180
}
 
181
 
 
182
/**
184
183
 * Handle the applicationSpecificEvent event.
185
184
 */
186
 
void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL( 
187
 
                TInt /* aType */, 
188
 
                const TWsEvent& /* anEvent */ )
189
 
        {
190
 
        // TODO: implement applicationSpecificEvent event handler
191
 
        }
192
 
                                
 
185
void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL (
 
186
    TInt /* aType */,
 
187
    const TWsEvent& /* anEvent */)
 
188
{
 
189
    // TODO: implement applicationSpecificEvent event handler
 
190
}
 
191
 
193
192
// [[[ begin generated function: do not modify
194
193
/**
195
194
 * Execute the wait dialog for dlg_wait_init. This routine returns
198
197
 * @param aOverrideText optional override text. When null the text configured
199
198
 * in the UI Designer is used.
200
199
 */
201
 
void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD( const TDesC* aOverrideText )
202
 
        {
203
 
        iDlg_wait_init = new ( ELeave ) CAknWaitDialog( 
204
 
                        reinterpret_cast< CEikDialog** >( &iDlg_wait_init ), EFalse );
205
 
        if ( aOverrideText != NULL )
206
 
                {
207
 
                iDlg_wait_init->SetTextL( *aOverrideText );
208
 
                }
209
 
        iDlg_wait_init->ExecuteLD( R_APPLICATION_DLG_WAIT_INIT );
210
 
        iDlg_wait_initCallback = new ( ELeave ) CProgressDialogCallback( 
211
 
                this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL );
212
 
        iDlg_wait_init->SetCallback( iDlg_wait_initCallback );
213
 
        }
 
200
void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD (const TDesC* aOverrideText)
 
201
{
 
202
    iDlg_wait_init = new (ELeave) CAknWaitDialog (
 
203
        reinterpret_cast< CEikDialog** > (&iDlg_wait_init), EFalse);
 
204
 
 
205
    if (aOverrideText != NULL) {
 
206
        iDlg_wait_init->SetTextL (*aOverrideText);
 
207
    }
 
208
 
 
209
    iDlg_wait_init->ExecuteLD (R_APPLICATION_DLG_WAIT_INIT);
 
210
    iDlg_wait_initCallback = new (ELeave) CProgressDialogCallback (
 
211
        this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL);
 
212
    iDlg_wait_init->SetCallback (iDlg_wait_initCallback);
 
213
}
214
214
// ]]] end generated function
215
215
 
216
216
// [[[ begin generated function: do not modify
218
218
 * Close and dispose of the wait dialog for dlg_wait_init
219
219
 */
220
220
void Csymbian_ua_guiAppUi::RemoveDlg_wait_initL()
221
 
        {
222
 
        if ( iDlg_wait_init != NULL )
223
 
                {
224
 
                iDlg_wait_init->SetCallback( NULL );
225
 
                iDlg_wait_init->ProcessFinishedL();    // deletes the dialog
226
 
                iDlg_wait_init = NULL;
227
 
                }
228
 
        delete iDlg_wait_initCallback;
229
 
        iDlg_wait_initCallback = NULL;
230
 
        
231
 
        }
 
221
{
 
222
    if (iDlg_wait_init != NULL) {
 
223
        iDlg_wait_init->SetCallback (NULL);
 
224
        iDlg_wait_init->ProcessFinishedL();    // deletes the dialog
 
225
        iDlg_wait_init = NULL;
 
226
    }
 
227
 
 
228
    delete iDlg_wait_initCallback;
 
229
    iDlg_wait_initCallback = NULL;
 
230
 
 
231
}
232
232
// ]]] end generated function
233
233
 
234
 
/** 
 
234
/**
235
235
 * Handle the canceled event.
236
236
 */
237
 
void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL( CAknProgressDialog* /* aDialog */ )
238
 
        {
239
 
        // TODO: implement canceled event handler
240
 
        
241
 
        }
242
 
                                
 
237
void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL (CAknProgressDialog* /* aDialog */)
 
238
{
 
239
    // TODO: implement canceled event handler
 
240
 
 
241
}
 
242
 
243
243
void Csymbian_ua_guiAppUi::RunL()
244
 
        {
245
 
        RemoveDlg_wait_initL();
246
 
        iSymbian_ua_guiSettingItemListView->HandleCommandL(EAknSoftkeySave);
247
 
        }
 
244
{
 
245
    RemoveDlg_wait_initL();
 
246
    iSymbian_ua_guiSettingItemListView->HandleCommandL (EAknSoftkeySave);
 
247
}