|
1 /* |
|
2 * Copyright (c) 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: Mini dialer feature |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <aknutils.h> |
|
20 #include <peninputcmdparam.h> |
|
21 #include <cvtlogger.h> |
|
22 |
|
23 #include "cvtuidialer.h" |
|
24 #include "cvtuifeaturemanager.h" |
|
25 #include "mvtuicommandmanager.h" |
|
26 #include "mvtuicomponentmanager.h" |
|
27 #include "cvtuicmdopendialer.h" |
|
28 #include "cvtuicmdclosedialer.h" |
|
29 #include "cvtuidialercontainer.h" |
|
30 #include "cvtuidialervideocontrol.h" |
|
31 #include "CVtUiAppUi.h" |
|
32 #include "tvtuistates.h" |
|
33 #include "CVtUiContextControl.h" |
|
34 |
|
35 // ======== LOCAL FUNCTIONS ======== |
|
36 |
|
37 // Implementation of CVtUiDialer |
|
38 |
|
39 // --------------------------------------------------------------------------- |
|
40 // CVtUiDialer::NewL |
|
41 // --------------------------------------------------------------------------- |
|
42 // |
|
43 CVtUiDialer* CVtUiDialer::NewL( CVtUiFeatureManager& aFeatureManager ) |
|
44 { |
|
45 __VTPRINTENTER( "Dial.NewL" ) |
|
46 CVtUiDialer* self = NULL; |
|
47 self = new ( ELeave ) CVtUiDialer( aFeatureManager ); |
|
48 CleanupStack::PushL( self ); |
|
49 self->ConstructL(); |
|
50 CleanupStack::Pop(); // self |
|
51 __VTPRINTEXIT( "Dial.NewL" ) |
|
52 return self; |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // CVtUiDialer::~CVtUiDialer |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 CVtUiDialer::~CVtUiDialer() |
|
60 { |
|
61 __VTPRINTENTER( "Dial.~" ) |
|
62 delete iCmdOpen; |
|
63 delete iCmdClose; |
|
64 delete iDialerContainer; |
|
65 __VTPRINTEXIT( "Dial.~" ) |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------------------------- |
|
69 // CVtUiDialer::VideoWindow |
|
70 // --------------------------------------------------------------------------- |
|
71 // |
|
72 MVtUiVideoWindow& CVtUiDialer::VideoWindow() const |
|
73 { |
|
74 __VTPRINTENTER( "Dial.VideoWindow" ) |
|
75 __VTPRINTEXIT( "Dial.VideoWindow" ) |
|
76 return *iDialerContainer->ComponentAsVideoWindow(); |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // CVtUiDialer::VideoControl |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 CCoeControl& CVtUiDialer::VideoControl() const |
|
84 { |
|
85 __VTPRINTENTER( "Dial.VideoControl" ) |
|
86 __VTPRINTEXIT( "Dial.VideoControl" ) |
|
87 return *static_cast< MVtUiComponent* > |
|
88 ( iDialerContainer )->ComponentAsControl(); |
|
89 } |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // CVtUiDialer::StartL |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 void CVtUiDialer::StartL() |
|
96 { |
|
97 __VTPRINTENTER( "Dial.StartL" ) |
|
98 if ( State() == MVtUiFeature::EUnprepared ) |
|
99 { |
|
100 // fixed toolbar is set to be hidden |
|
101 iFeatureManager.AppUi().ContextControl().MakeVisible( EFalse ); |
|
102 iFeatureManager.UiStates().SetIsDialerActivating( ETrue ); |
|
103 iFeatureManager.UiStates().SetIsFixedToolbarVisible( EFalse ); |
|
104 iFeatureManager.CommandManager().RefreshL(); |
|
105 PrepareL(); |
|
106 iFeatureManager.ComponentManager().RequestActivationL( |
|
107 MVtUiComponent::EComponentIdDialer ); |
|
108 iFeatureState = EActive; |
|
109 iFeatureManager.AppUi().SwitchLayoutToFlatStatusPaneL( ETrue ); |
|
110 } |
|
111 __VTPRINTEXIT( "Dial.StartL" ) |
|
112 } |
|
113 |
|
114 // --------------------------------------------------------------------------- |
|
115 // CVtUiDialer::Stop |
|
116 // --------------------------------------------------------------------------- |
|
117 // |
|
118 void CVtUiDialer::Stop() |
|
119 { |
|
120 __VTPRINTENTER( "Dial.Stop" ) |
|
121 if ( State() == MVtUiFeature::EActive ) |
|
122 { |
|
123 TInt error; |
|
124 TRAP( error, |
|
125 { |
|
126 iFeatureManager.AppUi().SwitchLayoutToFlatStatusPaneL( EFalse ); |
|
127 iFeatureManager.ComponentManager().DeActivateComponentL( |
|
128 MVtUiComponent::EComponentIdDialer ); |
|
129 } ); |
|
130 Unprepare(); |
|
131 iFeatureManager.AppUi().ContextControl().MakeVisible( ETrue ); |
|
132 } |
|
133 __VTPRINTEXIT( "Dial.Stop" ) |
|
134 } |
|
135 |
|
136 // --------------------------------------------------------------------------- |
|
137 // CVtUiDialer::InitFeatureL |
|
138 // --------------------------------------------------------------------------- |
|
139 // |
|
140 void CVtUiDialer::InitFeatureL() |
|
141 { |
|
142 __VTPRINTENTER( "Dial.InitFeatureL" ) |
|
143 iDialerContainer = |
|
144 CVtUiDialerContainer::NewL( iFeatureManager ); |
|
145 iCmdOpen = CVtUiCmdOpenDialer::NewL( iFeatureManager.CommandManager(), |
|
146 *this ); |
|
147 iCmdClose = CVtUiCmdCloseDialer::NewL( iFeatureManager.CommandManager(), |
|
148 *this ); |
|
149 __VTPRINTEXIT( "Dial.InitFeatureL" ) |
|
150 } |
|
151 |
|
152 // --------------------------------------------------------------------------- |
|
153 // CVtUiDialer::CVtUiDialer |
|
154 // --------------------------------------------------------------------------- |
|
155 // |
|
156 CVtUiDialer::CVtUiDialer( CVtUiFeatureManager& aFeatureManager ) |
|
157 : CVtUiFeatureBase( EVtUiFeatureIdDialer, aFeatureManager ) |
|
158 { |
|
159 __VTPRINTENTER( "Dial.ctor" ) |
|
160 __VTPRINTEXIT( "Dial.ctor" ) |
|
161 } |
|
162 |
|
163 // --------------------------------------------------------------------------- |
|
164 // CVtUiDialer::ConstructL |
|
165 // --------------------------------------------------------------------------- |
|
166 // |
|
167 void CVtUiDialer::ConstructL() |
|
168 { |
|
169 __VTPRINTENTER( "Dial.ConstructL" ) |
|
170 BaseConstructL(); |
|
171 __VTPRINTEXIT( "Dial.ConstructL" ) |
|
172 } |
|
173 |
|
174 // --------------------------------------------------------------------------- |
|
175 // CVtUiDialer::PrepareL |
|
176 // --------------------------------------------------------------------------- |
|
177 // |
|
178 void CVtUiDialer::PrepareL() |
|
179 { |
|
180 __VTPRINTENTER( "Dial.PrepareL" ) |
|
181 iDialerContainer->RegisterComponentL(); |
|
182 iFeatureState = EReady; |
|
183 __VTPRINTEXIT( "Dial.PrepareL" ) |
|
184 } |
|
185 |
|
186 // --------------------------------------------------------------------------- |
|
187 // CVtUiDialer::Unprepare |
|
188 // --------------------------------------------------------------------------- |
|
189 // |
|
190 void CVtUiDialer::Unprepare() |
|
191 { |
|
192 __VTPRINTENTER( "Dial.Unprepare" ) |
|
193 iDialerContainer->UnregisterComponent(); |
|
194 iFeatureState = EUnprepared; |
|
195 __VTPRINTEXIT( "Dial.Unprepare" ) |
|
196 } |