|
1 /* |
|
2 * Copyright (c) 2004-2006 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 "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 the CVtUiActivateBtHfDialog class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CVtUiActivateBtHfDialog.h" |
|
22 #include "MVtUiEngineCommandManager.h" |
|
23 #include <mvtengcommandhandler.h> |
|
24 #include <videotelui.rsg> |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CVtUiActivateBtHfDialog::CVtUiActivateBtHfDialog |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CVtUiActivateBtHfDialog::CVtUiActivateBtHfDialog( |
|
33 CEikDialog** aSelfPtr, |
|
34 TInt* aError, |
|
35 MVtEngCommandHandler& aCommandHandler, |
|
36 MVtUiEngineCommandManager& aCommandManager ) |
|
37 : CAknWaitDialog( aSelfPtr ), |
|
38 iCommandHandler( aCommandHandler ), |
|
39 iCommandManager( aCommandManager ), |
|
40 iError( aError ), |
|
41 iAudioRouting( MVtEngAudio::EActivateBT ) |
|
42 { |
|
43 } |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // CVtUiActivateBtHfDialog::~CVtUiActivateBtHfDialog |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 CVtUiActivateBtHfDialog::~CVtUiActivateBtHfDialog() |
|
50 { |
|
51 if ( iError ) |
|
52 { |
|
53 *iError = KErrCancel; |
|
54 iError = NULL; |
|
55 } |
|
56 |
|
57 if ( iCommandPerformed ) |
|
58 { |
|
59 iCommandHandler.CancelCommand( KVtEngSetAudioRouting ); // ignore error |
|
60 } |
|
61 iCommandManager.RemoveObserver( *this ); |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CVtUiActivateBtHfDialog::ExecuteDialogLD |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 void CVtUiActivateBtHfDialog::ExecuteDialogLD() |
|
69 { |
|
70 CleanupStack::PushL( this ); |
|
71 iCommandManager.AddObserverL( *this ); |
|
72 SetTone( CAknNoteDialog::ENoTone ); |
|
73 CleanupStack::Pop( this ); |
|
74 |
|
75 ExecuteLD( R_VIDEOTELUI_BTHF_CONNECT_WAIT_NOTE ); |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CVtUiActivateBtHfDialog::PostLayoutDynInitL |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 void CVtUiActivateBtHfDialog::PostLayoutDynInitL() |
|
83 { |
|
84 iCommandHandler.ExecuteL( KVtEngSetAudioRouting, &iAudioRouting ); |
|
85 iCommandPerformed = ETrue; |
|
86 |
|
87 CAknWaitDialog::PostLayoutDynInitL(); |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CVtUiActivateBtHfDialog::HandleVTCommandPerformedL |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 void CVtUiActivateBtHfDialog::HandleVTCommandPerformedL( |
|
95 TVtEngCommandId aCommand, |
|
96 const TInt aError ) |
|
97 { |
|
98 if ( aCommand == KVtEngSetAudioRouting ) |
|
99 { |
|
100 if ( iError ) |
|
101 { |
|
102 *iError = aError; |
|
103 iError = NULL; |
|
104 } |
|
105 |
|
106 ProcessFinishedL(); |
|
107 } |
|
108 } |
|
109 |
|
110 // End of File |