~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_guiContainerView.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_guiContainerView.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]
39
39
// ]]] end generated region [Generated Constants]
40
40
 
41
41
Csymbian_ua_guiContainerView *myinstance = NULL;
42
 
_LIT(KStCall, "Call");
43
 
_LIT(KStHangUp, "Hang Up");
44
 
 
45
 
void on_info(const wchar_t* buf)
46
 
{
47
 
        TPtrC aBuf((const TUint16*)buf);
48
 
        
49
 
        if (myinstance)
50
 
                myinstance->PutMessage(aBuf);
51
 
}
52
 
 
53
 
void on_incoming_call(const wchar_t* caller_disp, const wchar_t* caller_uri)
54
 
{
55
 
        TBuf<512> buf;
56
 
        TPtrC aDisp((const TUint16*)caller_disp);
57
 
        TPtrC aUri((const TUint16*)caller_uri);
58
 
        _LIT(KFormat, "Incoming call from %S, accept?");
59
 
        
60
 
        buf.Format(KFormat, &aDisp);
61
 
        if (Csymbian_ua_guiContainerView::RunQry_accept_callL(&buf) == EAknSoftkeyYes)
62
 
        {
63
 
                CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
64
 
                if (cba != NULL) {
65
 
                        TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp));
66
 
                        cba->DrawDeferred();
67
 
                }
68
 
                symbian_ua_answercall();
69
 
        } else {
70
 
                symbian_ua_endcall();   
71
 
        }
72
 
}
73
 
 
74
 
void on_call_end(const wchar_t* reason)
75
 
{
76
 
        TPtrC aReason((const TUint16*)reason);
77
 
        
78
 
        CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
79
 
        if (cba != NULL) {
80
 
                TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall));
81
 
                cba->DrawDeferred();
82
 
        }
83
 
        
84
 
        Csymbian_ua_guiContainerView::RunNote_infoL(&aReason);
85
 
}
86
 
 
87
 
void on_reg_state(bool success)
88
 
{
89
 
        if (success)
90
 
                Csymbian_ua_guiContainerView::RunNote_infoL();
91
 
        else
92
 
                Csymbian_ua_guiContainerView::RunNote_warningL();
93
 
}
94
 
 
95
 
void on_unreg_state(bool success)
96
 
{
97
 
        TPtrC st_success(_L("Unregistration Success!"));
98
 
        TPtrC st_failed(_L("Unregistration Failed!"));
99
 
        
100
 
        if (success)
101
 
                Csymbian_ua_guiContainerView::RunNote_infoL(&st_success);
102
 
        else
103
 
                Csymbian_ua_guiContainerView::RunNote_warningL(&st_failed);
104
 
}
105
 
 
106
 
void Csymbian_ua_guiContainerView::PutMessage(const TDesC &msg)
107
 
        {
108
 
        if (!iSymbian_ua_guiContainer)
109
 
                return;
110
 
        
111
 
        CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_info);
112
 
 
113
 
        obj_info->SetTextL(&msg);
114
 
        obj_info->DrawDeferred();
115
 
        }
 
42
_LIT (KStCall, "Call");
 
43
_LIT (KStHangUp, "Hang Up");
 
44
 
 
45
void on_info (const wchar_t* buf)
 
46
{
 
47
    TPtrC aBuf ( (const TUint16*) buf);
 
48
 
 
49
    if (myinstance)
 
50
        myinstance->PutMessage (aBuf);
 
51
}
 
52
 
 
53
void on_incoming_call (const wchar_t* caller_disp, const wchar_t* caller_uri)
 
54
{
 
55
    TBuf<512> buf;
 
56
    TPtrC aDisp ( (const TUint16*) caller_disp);
 
57
    TPtrC aUri ( (const TUint16*) caller_uri);
 
58
    _LIT (KFormat, "Incoming call from %S, accept?");
 
59
 
 
60
    buf.Format (KFormat, &aDisp);
 
61
 
 
62
    if (Csymbian_ua_guiContainerView::RunQry_accept_callL (&buf) == EAknSoftkeyYes) {
 
63
        CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
 
64
 
 
65
        if (cba != NULL) {
 
66
            TRAPD (result, cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp));
 
67
            cba->DrawDeferred();
 
68
        }
 
69
 
 
70
        symbian_ua_answercall();
 
71
    } else {
 
72
        symbian_ua_endcall();
 
73
    }
 
74
}
 
75
 
 
76
void on_call_end (const wchar_t* reason)
 
77
{
 
78
    TPtrC aReason ( (const TUint16*) reason);
 
79
 
 
80
    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
 
81
 
 
82
    if (cba != NULL) {
 
83
        TRAPD (result, cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStCall));
 
84
        cba->DrawDeferred();
 
85
    }
 
86
 
 
87
    Csymbian_ua_guiContainerView::RunNote_infoL (&aReason);
 
88
}
 
89
 
 
90
void on_reg_state (bool success)
 
91
{
 
92
    if (success)
 
93
        Csymbian_ua_guiContainerView::RunNote_infoL();
 
94
    else
 
95
        Csymbian_ua_guiContainerView::RunNote_warningL();
 
96
}
 
97
 
 
98
void on_unreg_state (bool success)
 
99
{
 
100
    TPtrC st_success (_L ("Unregistration Success!"));
 
101
    TPtrC st_failed (_L ("Unregistration Failed!"));
 
102
 
 
103
    if (success)
 
104
        Csymbian_ua_guiContainerView::RunNote_infoL (&st_success);
 
105
    else
 
106
        Csymbian_ua_guiContainerView::RunNote_warningL (&st_failed);
 
107
}
 
108
 
 
109
void Csymbian_ua_guiContainerView::PutMessage (const TDesC &msg)
 
110
{
 
111
    if (!iSymbian_ua_guiContainer)
 
112
        return;
 
113
 
 
114
    CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl (iSymbian_ua_guiContainer->EEd_info);
 
115
 
 
116
    obj_info->SetTextL (&msg);
 
117
    obj_info->DrawDeferred();
 
118
}
116
119
 
117
120
/**
118
121
 * First phase of Symbian two-phase construction. Should not contain any
119
122
 * code that could leave.
120
123
 */
121
124
Csymbian_ua_guiContainerView::Csymbian_ua_guiContainerView()
122
 
        {
123
 
        // [[[ begin generated region: do not modify [Generated Contents]
124
 
        iSymbian_ua_guiContainer = NULL;
125
 
        // ]]] end generated region [Generated Contents]
126
 
        
127
 
        }
128
 
/** 
 
125
{
 
126
    // [[[ begin generated region: do not modify [Generated Contents]
 
127
    iSymbian_ua_guiContainer = NULL;
 
128
    // ]]] end generated region [Generated Contents]
 
129
 
 
130
}
 
131
/**
129
132
 * The view's destructor removes the container from the control
130
133
 * stack and destroys it.
131
134
 */
132
135
Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView()
133
 
        {
134
 
        // [[[ begin generated region: do not modify [Generated Contents]
135
 
        delete iSymbian_ua_guiContainer;
136
 
        iSymbian_ua_guiContainer = NULL;
137
 
        // ]]] end generated region [Generated Contents]
138
 
        
139
 
        symbian_ua_set_info_callback(NULL);
140
 
        myinstance = NULL;
141
 
        }
 
136
{
 
137
    // [[[ begin generated region: do not modify [Generated Contents]
 
138
    delete iSymbian_ua_guiContainer;
 
139
    iSymbian_ua_guiContainer = NULL;
 
140
    // ]]] end generated region [Generated Contents]
 
141
 
 
142
    symbian_ua_set_info_callback (NULL);
 
143
    myinstance = NULL;
 
144
}
142
145
 
143
146
/**
144
147
 * Symbian two-phase constructor.
147
150
 * @return new instance of Csymbian_ua_guiContainerView
148
151
 */
149
152
Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL()
150
 
        {
151
 
        Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC();
152
 
        CleanupStack::Pop( self );
153
 
        return self;
154
 
        }
 
153
{
 
154
    Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC();
 
155
    CleanupStack::Pop (self);
 
156
    return self;
 
157
}
155
158
 
156
159
/**
157
160
 * Symbian two-phase constructor.
160
163
 * @return new instance of Csymbian_ua_guiContainerView
161
164
 */
162
165
Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewLC()
163
 
        {
164
 
        Csymbian_ua_guiContainerView* self = new ( ELeave ) Csymbian_ua_guiContainerView();
165
 
        CleanupStack::PushL( self );
166
 
        self->ConstructL();
167
 
        return self;
168
 
        }
 
166
{
 
167
    Csymbian_ua_guiContainerView* self = new (ELeave) Csymbian_ua_guiContainerView();
 
168
    CleanupStack::PushL (self);
 
169
    self->ConstructL();
 
170
    return self;
 
171
}
169
172
 
170
173
 
171
174
/**
172
 
 * Second-phase constructor for view.  
 
175
 * Second-phase constructor for view.
173
176
 * Initialize contents from resource.
174
 
 */ 
 
177
 */
175
178
void Csymbian_ua_guiContainerView::ConstructL()
176
 
        {
177
 
        // [[[ begin generated region: do not modify [Generated Code]
178
 
        BaseConstructL( R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW );
179
 
        // ]]] end generated region [Generated Code]
180
 
        
181
 
        // add your own initialization code here
182
 
        symbian_ua_info_cb_t cb;
183
 
        Mem::FillZ(&cb, sizeof(cb));
184
 
 
185
 
        cb.on_info = &on_info;
186
 
        cb.on_incoming_call = &on_incoming_call;
187
 
        cb.on_reg_state = &on_reg_state;
188
 
        cb.on_unreg_state = &on_unreg_state;
189
 
        cb.on_call_end = &on_call_end;
190
 
        
191
 
        symbian_ua_set_info_callback(&cb);
192
 
        myinstance = this;
193
 
        }
194
 
        
 
179
{
 
180
    // [[[ begin generated region: do not modify [Generated Code]
 
181
    BaseConstructL (R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW);
 
182
    // ]]] end generated region [Generated Code]
 
183
 
 
184
    // add your own initialization code here
 
185
    symbian_ua_info_cb_t cb;
 
186
    Mem::FillZ (&cb, sizeof (cb));
 
187
 
 
188
    cb.on_info = &on_info;
 
189
    cb.on_incoming_call = &on_incoming_call;
 
190
    cb.on_reg_state = &on_reg_state;
 
191
    cb.on_unreg_state = &on_unreg_state;
 
192
    cb.on_call_end = &on_call_end;
 
193
 
 
194
    symbian_ua_set_info_callback (&cb);
 
195
    myinstance = this;
 
196
}
 
197
 
195
198
/**
196
199
 * @return The UID for this view
197
200
 */
198
201
TUid Csymbian_ua_guiContainerView::Id() const
199
 
        {
200
 
        return TUid::Uid( ESymbian_ua_guiContainerViewId );
201
 
        }
 
202
{
 
203
    return TUid::Uid (ESymbian_ua_guiContainerViewId);
 
204
}
202
205
 
203
206
/**
204
207
 * Handle a command for this view (override)
205
208
 * @param aCommand command id to be handled
206
209
 */
207
 
void Csymbian_ua_guiContainerView::HandleCommandL( TInt aCommand )
208
 
        {   
209
 
        // [[[ begin generated region: do not modify [Generated Code]
210
 
        TBool commandHandled = EFalse;
211
 
        switch ( aCommand )
212
 
                {       // code to dispatch to the AknView's menu and CBA commands is generated here
213
 
        
214
 
                case ESymbian_ua_guiContainerViewControlPaneRightId:
215
 
                        commandHandled = CallSoftKeyPressedL( aCommand );
216
 
                        break;
217
 
                case ESymbian_ua_guiContainerViewSettingMenuItemCommand:
218
 
                        commandHandled = HandleSettingMenuItemSelectedL( aCommand );
219
 
                        break;
220
 
                default:
221
 
                        break;
222
 
                }
223
 
        
224
 
                
225
 
        if ( !commandHandled ) 
226
 
                {
227
 
        
228
 
                if ( aCommand == ESymbian_ua_guiContainerViewControlPaneRightId )
229
 
                        {
230
 
                        AppUi()->HandleCommandL( EEikCmdExit );
231
 
                        }
232
 
        
233
 
                }
234
 
        // ]]] end generated region [Generated Code]
235
 
        
236
 
        }
 
210
void Csymbian_ua_guiContainerView::HandleCommandL (TInt aCommand)
 
211
{
 
212
    // [[[ begin generated region: do not modify [Generated Code]
 
213
    TBool commandHandled = EFalse;
 
214
 
 
215
    switch (aCommand) { // code to dispatch to the AknView's menu and CBA commands is generated here
 
216
 
 
217
        case ESymbian_ua_guiContainerViewControlPaneRightId:
 
218
            commandHandled = CallSoftKeyPressedL (aCommand);
 
219
            break;
 
220
        case ESymbian_ua_guiContainerViewSettingMenuItemCommand:
 
221
            commandHandled = HandleSettingMenuItemSelectedL (aCommand);
 
222
            break;
 
223
        default:
 
224
            break;
 
225
    }
 
226
 
 
227
 
 
228
    if (!commandHandled) {
 
229
 
 
230
        if (aCommand == ESymbian_ua_guiContainerViewControlPaneRightId) {
 
231
            AppUi()->HandleCommandL (EEikCmdExit);
 
232
        }
 
233
 
 
234
    }
 
235
 
 
236
    // ]]] end generated region [Generated Code]
 
237
 
 
238
}
237
239
 
238
240
/**
239
 
 *      Handles user actions during activation of the view, 
 
241
 *      Handles user actions during activation of the view,
240
242
 *      such as initializing the content.
241
243
 */
242
 
void Csymbian_ua_guiContainerView::DoActivateL(
243
 
                const TVwsViewId& /*aPrevViewId*/,
244
 
                TUid /*aCustomMessageId*/,
245
 
                const TDesC8& /*aCustomMessage*/ )
246
 
        {
247
 
        // [[[ begin generated region: do not modify [Generated Contents]
248
 
        SetupStatusPaneL();
249
 
        
250
 
        CEikButtonGroupContainer* cba = AppUi()->Cba();
251
 
        if ( cba != NULL ) 
252
 
                {
253
 
                cba->MakeVisible( EFalse );
254
 
                }
255
 
        
256
 
        if ( iSymbian_ua_guiContainer == NULL )
257
 
                {
258
 
                iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL( ClientRect(), NULL, this );
259
 
                iSymbian_ua_guiContainer->SetMopParent( this );
260
 
                AppUi()->AddToStackL( *this, iSymbian_ua_guiContainer );
261
 
                } 
262
 
        // ]]] end generated region [Generated Contents]
263
 
        
264
 
        cba = CEikButtonGroupContainer::Current();
265
 
        if (cba != NULL) {
266
 
                if (symbian_ua_anycall())
267
 
                        cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp);
268
 
                else
269
 
                        cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall);
270
 
        }
271
 
        
272
 
        }
 
244
void Csymbian_ua_guiContainerView::DoActivateL (
 
245
    const TVwsViewId& /*aPrevViewId*/,
 
246
    TUid /*aCustomMessageId*/,
 
247
    const TDesC8& /*aCustomMessage*/)
 
248
{
 
249
    // [[[ begin generated region: do not modify [Generated Contents]
 
250
    SetupStatusPaneL();
 
251
 
 
252
    CEikButtonGroupContainer* cba = AppUi()->Cba();
 
253
 
 
254
    if (cba != NULL) {
 
255
        cba->MakeVisible (EFalse);
 
256
    }
 
257
 
 
258
    if (iSymbian_ua_guiContainer == NULL) {
 
259
        iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL (ClientRect(), NULL, this);
 
260
        iSymbian_ua_guiContainer->SetMopParent (this);
 
261
        AppUi()->AddToStackL (*this, iSymbian_ua_guiContainer);
 
262
    }
 
263
 
 
264
    // ]]] end generated region [Generated Contents]
 
265
 
 
266
    cba = CEikButtonGroupContainer::Current();
 
267
 
 
268
    if (cba != NULL) {
 
269
        if (symbian_ua_anycall())
 
270
            cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp);
 
271
        else
 
272
            cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStCall);
 
273
    }
 
274
 
 
275
}
273
276
 
274
277
/**
275
278
 */
276
279
void Csymbian_ua_guiContainerView::DoDeactivate()
277
 
        {
278
 
        // [[[ begin generated region: do not modify [Generated Contents]
279
 
        CleanupStatusPane();
280
 
        
281
 
        CEikButtonGroupContainer* cba = AppUi()->Cba();
282
 
        if ( cba != NULL ) 
283
 
                {
284
 
                cba->MakeVisible( ETrue );
285
 
                cba->DrawDeferred();
286
 
                }
287
 
        
288
 
        if ( iSymbian_ua_guiContainer != NULL )
289
 
                {
290
 
                AppUi()->RemoveFromViewStack( *this, iSymbian_ua_guiContainer );
291
 
                delete iSymbian_ua_guiContainer;
292
 
                iSymbian_ua_guiContainer = NULL;
293
 
                }
294
 
        // ]]] end generated region [Generated Contents]
295
 
        
296
 
        }
 
280
{
 
281
    // [[[ begin generated region: do not modify [Generated Contents]
 
282
    CleanupStatusPane();
 
283
 
 
284
    CEikButtonGroupContainer* cba = AppUi()->Cba();
 
285
 
 
286
    if (cba != NULL) {
 
287
        cba->MakeVisible (ETrue);
 
288
        cba->DrawDeferred();
 
289
    }
 
290
 
 
291
    if (iSymbian_ua_guiContainer != NULL) {
 
292
        AppUi()->RemoveFromViewStack (*this, iSymbian_ua_guiContainer);
 
293
        delete iSymbian_ua_guiContainer;
 
294
        iSymbian_ua_guiContainer = NULL;
 
295
    }
 
296
 
 
297
    // ]]] end generated region [Generated Contents]
 
298
 
 
299
}
297
300
 
298
301
// [[[ begin generated function: do not modify
299
302
void Csymbian_ua_guiContainerView::SetupStatusPaneL()
300
 
        {
301
 
        // reset the context pane
302
 
        TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
303
 
        CEikStatusPaneBase::TPaneCapabilities subPaneContext = 
304
 
                StatusPane()->PaneCapabilities( contextPaneUid );
305
 
        if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
306
 
                {
307
 
                CAknContextPane* context = static_cast< CAknContextPane* > ( 
308
 
                        StatusPane()->ControlL( contextPaneUid ) );
309
 
                context->SetPictureToDefaultL();
310
 
                }
311
 
        
312
 
        // setup the title pane
313
 
        TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
314
 
        CEikStatusPaneBase::TPaneCapabilities subPaneTitle = 
315
 
                StatusPane()->PaneCapabilities( titlePaneUid );
316
 
        if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
317
 
                {
318
 
                CAknTitlePane* title = static_cast< CAknTitlePane* >( 
319
 
                        StatusPane()->ControlL( titlePaneUid ) );
320
 
                TResourceReader reader;
321
 
                iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE );
322
 
                title->SetFromResourceL( reader );
323
 
                CleanupStack::PopAndDestroy(); // reader internal state
324
 
                }
325
 
                                
326
 
        }
 
303
{
 
304
    // reset the context pane
 
305
    TUid contextPaneUid = TUid::Uid (EEikStatusPaneUidContext);
 
306
    CEikStatusPaneBase::TPaneCapabilities subPaneContext =
 
307
        StatusPane()->PaneCapabilities (contextPaneUid);
 
308
 
 
309
    if (subPaneContext.IsPresent() && subPaneContext.IsAppOwned()) {
 
310
        CAknContextPane* context = static_cast< CAknContextPane* > (
 
311
                                       StatusPane()->ControlL (contextPaneUid));
 
312
        context->SetPictureToDefaultL();
 
313
    }
 
314
 
 
315
    // setup the title pane
 
316
    TUid titlePaneUid = TUid::Uid (EEikStatusPaneUidTitle);
 
317
    CEikStatusPaneBase::TPaneCapabilities subPaneTitle =
 
318
        StatusPane()->PaneCapabilities (titlePaneUid);
 
319
 
 
320
    if (subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned()) {
 
321
        CAknTitlePane* title = static_cast< CAknTitlePane* > (
 
322
                                   StatusPane()->ControlL (titlePaneUid));
 
323
        TResourceReader reader;
 
324
        iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE);
 
325
        title->SetFromResourceL (reader);
 
326
        CleanupStack::PopAndDestroy(); // reader internal state
 
327
    }
 
328
 
 
329
}
327
330
// ]]] end generated function
328
331
 
329
332
// [[[ begin generated function: do not modify
330
333
void Csymbian_ua_guiContainerView::CleanupStatusPane()
331
 
        {
332
 
        }
 
334
{
 
335
}
333
336
// ]]] end generated function
334
337
 
335
 
/** 
 
338
/**
336
339
 * Handle status pane size change for this view (override)
337
340
 */
338
341
void Csymbian_ua_guiContainerView::HandleStatusPaneSizeChange()
339
 
        {
340
 
        CAknView::HandleStatusPaneSizeChange();
341
 
        
342
 
        // this may fail, but we're not able to propagate exceptions here
343
 
        TInt result;
344
 
        TRAP( result, SetupStatusPaneL() ); 
345
 
        }
346
 
        
347
 
/** 
 
342
{
 
343
    CAknView::HandleStatusPaneSizeChange();
 
344
 
 
345
    // this may fail, but we're not able to propagate exceptions here
 
346
    TInt result;
 
347
    TRAP (result, SetupStatusPaneL());
 
348
}
 
349
 
 
350
/**
348
351
 * Handle the rightSoftKeyPressed event.
349
352
 * @return ETrue if the command was handled, EFalse if not
350
353
 */
351
 
TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL( TInt aCommand )
352
 
        {
353
 
        CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_url);
354
 
        CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
355
 
        
356
 
        if (symbian_ua_anycall()) {
357
 
                symbian_ua_endcall();
358
 
                return ETrue;
359
 
        }
360
 
 
361
 
        PutMessage(_L("Making call..."));
362
 
        if ( cba != NULL ) {
363
 
                cba->SetCommandL(aCommand, KStHangUp);
364
 
                cba->DrawDeferred();
365
 
        }
366
 
        
367
 
 
368
 
        TUint8 url[256];
369
 
        TPtr8 aUrl(url, 256);
370
 
 
371
 
        HBufC *buf = obj_url->GetTextInHBufL();
372
 
        CnvUtfConverter::ConvertFromUnicodeToUtf8(aUrl, *buf);
373
 
        delete buf;
374
 
 
375
 
        if (symbian_ua_makecall((char *)aUrl.PtrZ()) != 0) {
376
 
                PutMessage(_L("Making call failed!"));
377
 
                if ( cba != NULL ) {
378
 
                        cba->SetCommandL(aCommand, KStCall);
379
 
                        cba->DrawDeferred();
380
 
                }
381
 
        }
382
 
        
383
 
        return ETrue;
384
 
        }
385
 
                                
386
 
/** 
 
354
TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL (TInt aCommand)
 
355
{
 
356
    CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl (iSymbian_ua_guiContainer->EEd_url);
 
357
    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
 
358
 
 
359
    if (symbian_ua_anycall()) {
 
360
        symbian_ua_endcall();
 
361
        return ETrue;
 
362
    }
 
363
 
 
364
    PutMessage (_L ("Making call..."));
 
365
 
 
366
    if (cba != NULL) {
 
367
        cba->SetCommandL (aCommand, KStHangUp);
 
368
        cba->DrawDeferred();
 
369
    }
 
370
 
 
371
 
 
372
    TUint8 url[256];
 
373
    TPtr8 aUrl (url, 256);
 
374
 
 
375
    HBufC *buf = obj_url->GetTextInHBufL();
 
376
    CnvUtfConverter::ConvertFromUnicodeToUtf8 (aUrl, *buf);
 
377
    delete buf;
 
378
 
 
379
    if (symbian_ua_makecall ( (char *) aUrl.PtrZ()) != 0) {
 
380
        PutMessage (_L ("Making call failed!"));
 
381
 
 
382
        if (cba != NULL) {
 
383
            cba->SetCommandL (aCommand, KStCall);
 
384
            cba->DrawDeferred();
 
385
        }
 
386
    }
 
387
 
 
388
    return ETrue;
 
389
}
 
390
 
 
391
/**
387
392
 * Handle the selected event.
388
393
 * @param aCommand the command id invoked
389
394
 * @return ETrue if the command was handled, EFalse if not
390
395
 */
391
 
TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL( TInt aCommand )
392
 
        {
393
 
        AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiSettingItemListViewId));
394
 
        return ETrue;
395
 
        }
396
 
                                
 
396
TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL (TInt aCommand)
 
397
{
 
398
    AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiSettingItemListViewId));
 
399
    return ETrue;
 
400
}
 
401
 
397
402
// [[[ begin generated function: do not modify
398
403
/**
399
404
 * Show the popup note for note_error
400
405
 * @param aOverrideText optional override text
401
406
 */
402
 
void Csymbian_ua_guiContainerView::RunNote_errorL( const TDesC* aOverrideText )
403
 
        {
404
 
        CAknErrorNote* note = new ( ELeave ) CAknErrorNote();
405
 
        if ( aOverrideText == NULL )
406
 
                {
407
 
                HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR );
408
 
                note->ExecuteLD( *noteText );
409
 
                CleanupStack::PopAndDestroy( noteText );
410
 
                }
411
 
        else
412
 
                {
413
 
                note->ExecuteLD( *aOverrideText );
414
 
                }
415
 
        }
 
407
void Csymbian_ua_guiContainerView::RunNote_errorL (const TDesC* aOverrideText)
 
408
{
 
409
    CAknErrorNote* note = new (ELeave) CAknErrorNote();
 
410
 
 
411
    if (aOverrideText == NULL) {
 
412
        HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR);
 
413
        note->ExecuteLD (*noteText);
 
414
        CleanupStack::PopAndDestroy (noteText);
 
415
    } else {
 
416
        note->ExecuteLD (*aOverrideText);
 
417
    }
 
418
}
416
419
// ]]] end generated function
417
420
 
418
421
// [[[ begin generated function: do not modify
420
423
 * Show the popup note for note_info
421
424
 * @param aOverrideText optional override text
422
425
 */
423
 
void Csymbian_ua_guiContainerView::RunNote_infoL( const TDesC* aOverrideText )
424
 
        {
425
 
        CAknInformationNote* note = new ( ELeave ) CAknInformationNote();
426
 
        if ( aOverrideText == NULL )
427
 
                {
428
 
                HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO );
429
 
                note->ExecuteLD( *noteText );
430
 
                CleanupStack::PopAndDestroy( noteText );
431
 
                }
432
 
        else
433
 
                {
434
 
                note->ExecuteLD( *aOverrideText );
435
 
                }
436
 
        }
 
426
void Csymbian_ua_guiContainerView::RunNote_infoL (const TDesC* aOverrideText)
 
427
{
 
428
    CAknInformationNote* note = new (ELeave) CAknInformationNote();
 
429
 
 
430
    if (aOverrideText == NULL) {
 
431
        HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO);
 
432
        note->ExecuteLD (*noteText);
 
433
        CleanupStack::PopAndDestroy (noteText);
 
434
    } else {
 
435
        note->ExecuteLD (*aOverrideText);
 
436
    }
 
437
}
437
438
// ]]] end generated function
438
439
 
439
440
// [[[ begin generated function: do not modify
441
442
 * Show the popup note for note_warning
442
443
 * @param aOverrideText optional override text
443
444
 */
444
 
void Csymbian_ua_guiContainerView::RunNote_warningL( const TDesC* aOverrideText )
445
 
        {
446
 
        CAknWarningNote* note = new ( ELeave ) CAknWarningNote();
447
 
        if ( aOverrideText == NULL )
448
 
                {
449
 
                HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING );
450
 
                note->ExecuteLD( *noteText );
451
 
                CleanupStack::PopAndDestroy( noteText );
452
 
                }
453
 
        else
454
 
                {
455
 
                note->ExecuteLD( *aOverrideText );
456
 
                }
457
 
        }
 
445
void Csymbian_ua_guiContainerView::RunNote_warningL (const TDesC* aOverrideText)
 
446
{
 
447
    CAknWarningNote* note = new (ELeave) CAknWarningNote();
 
448
 
 
449
    if (aOverrideText == NULL) {
 
450
        HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING);
 
451
        note->ExecuteLD (*noteText);
 
452
        CleanupStack::PopAndDestroy (noteText);
 
453
    } else {
 
454
        note->ExecuteLD (*aOverrideText);
 
455
    }
 
456
}
458
457
// ]]] end generated function
459
458
 
460
459
// [[[ begin generated function: do not modify
463
462
 * @param aOverrideText optional override text
464
463
 * @return EAknSoftkeyYes (left soft key id) or 0
465
464
 */
466
 
TInt Csymbian_ua_guiContainerView::RunQry_accept_callL( const TDesC* aOverrideText )
467
 
        {
468
 
                                
469
 
        CAknQueryDialog* queryDialog = CAknQueryDialog::NewL(); 
470
 
        
471
 
        if ( aOverrideText != NULL )
472
 
                {
473
 
                queryDialog->SetPromptL( *aOverrideText );
474
 
                }
475
 
        return queryDialog->ExecuteLD( R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL );
476
 
        }
 
465
TInt Csymbian_ua_guiContainerView::RunQry_accept_callL (const TDesC* aOverrideText)
 
466
{
 
467
 
 
468
    CAknQueryDialog* queryDialog = CAknQueryDialog::NewL();
 
469
 
 
470
    if (aOverrideText != NULL) {
 
471
        queryDialog->SetPromptL (*aOverrideText);
 
472
    }
 
473
 
 
474
    return queryDialog->ExecuteLD (R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL);
 
475
}
477
476
// ]]] end generated function
478
477