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: Video telephony engine TLS container. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CVtEngCRProxy.h" |
|
22 #include "CVtEngAccessoryHandler.h" |
|
23 #include "CVtEngSATClient.h" |
|
24 #include "VtEngUtils.h" |
|
25 #include "VtEngPanic.h" |
|
26 #include "CVtEngInitializer.h" |
|
27 #include "CVtEngSettings.h" |
|
28 #include "CVtEngDeviceLockMonitor.h" |
|
29 |
|
30 #include "CVtEngExtensions.h" |
|
31 #include "cvtengmdtrmessagelistener.h" |
|
32 #include "cvtengmdtrcommandsender.h" |
|
33 |
|
34 // ============================ MEMBER FUNCTIONS =============================== |
|
35 |
|
36 // ----------------------------------------------------------------------------- |
|
37 // CVtEngUtility::CVtEngUtility |
|
38 // C++ default constructor can NOT contain any code, that |
|
39 // might leave. |
|
40 // ----------------------------------------------------------------------------- |
|
41 // |
|
42 CVtEngUtility::CVtEngUtility() |
|
43 { |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CVtEngUtility::ConstructL |
|
48 // Symbian 2nd phase constructor can leave. |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 void CVtEngUtility::ConstructL( ) |
|
52 { |
|
53 __ASSERT_DEBUG( Dll::Tls() == NULL, Panic( EVtEngPanicTlsPanic )); |
|
54 Dll::SetTls( this ); |
|
55 iCRProxy = CVtEngCRProxy::NewL(); |
|
56 iAccessoryHandler = CVtEngAccessoryHandler::NewL(); |
|
57 iSettings = CVtEngSettings::NewL(); |
|
58 |
|
59 iLockMonitor = CVtEngDeviceLockMonitor::NewL(); |
|
60 iMdtrCommandSender = CVtEngMdtrCommandSender::NewL( *this ); |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CVtEngUtility::NewL |
|
65 // Two-phased constructor. |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 CVtEngUtility* CVtEngUtility::NewL() |
|
69 { |
|
70 CVtEngUtility* self = new( ELeave ) CVtEngUtility; |
|
71 |
|
72 CleanupStack::PushL( self ); |
|
73 self->ConstructL( ); |
|
74 CleanupStack::Pop(); |
|
75 |
|
76 return self; |
|
77 } |
|
78 |
|
79 |
|
80 // Destructor |
|
81 CVtEngUtility::~CVtEngUtility() |
|
82 { |
|
83 delete iMdtrMessageListener; |
|
84 delete iMdtrCommandSender; |
|
85 delete iCRProxy; |
|
86 delete iAccessoryHandler; |
|
87 delete iEngineInit; |
|
88 delete iSettings; |
|
89 delete iSATClient; |
|
90 delete iLockMonitor; |
|
91 Dll::SetTls( NULL ); |
|
92 } |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // CVtEngUtility::EngineUtils |
|
96 // Return pointer to Engine Utility. |
|
97 // |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 CVtEngUtility* CVtEngUtility::EngineUtils() |
|
101 { |
|
102 return reinterpret_cast<CVtEngUtility*>( Dll::Tls() ); |
|
103 } |
|
104 |
|
105 // ----------------------------------------------------------------------------- |
|
106 // CVtEngUtility::StateManager |
|
107 // Returns state manager. |
|
108 // |
|
109 // ----------------------------------------------------------------------------- |
|
110 // |
|
111 CVtEngStateManager* CVtEngUtility::StateManager() |
|
112 { |
|
113 return *(CVtEngUtility::EngineUtils()->iStateManager); |
|
114 } |
|
115 |
|
116 // ----------------------------------------------------------------------------- |
|
117 // CVtEngUtility::EventManager |
|
118 // ----------------------------------------------------------------------------- |
|
119 // |
|
120 CVtEngEventManager& CVtEngUtility::EventManager() |
|
121 { |
|
122 return **CVtEngUtility::EngineUtils()->iEventManager; |
|
123 } |
|
124 |
|
125 // ----------------------------------------------------------------------------- |
|
126 // CVtEngUtility::PrepareL |
|
127 // ----------------------------------------------------------------------------- |
|
128 // |
|
129 void CVtEngUtility::PrepareL( |
|
130 CVtEngHandlerContainer& aHandlers, |
|
131 CVtEngStateManager*& aStateManagerPtr, |
|
132 CVtEngEventManager*& aEventManagerPtr, |
|
133 CVtEngExtensions* aExtensionPtr ) |
|
134 { |
|
135 iEngineInit = CVtEngInitializer::NewL( aHandlers ); |
|
136 iStateManager = &aStateManagerPtr; |
|
137 iEventManager = &aEventManagerPtr; |
|
138 iExtensions = aExtensionPtr; |
|
139 } |
|
140 |
|
141 // ----------------------------------------------------------------------------- |
|
142 // CVtEngUtility::StartMediatorListenerL |
|
143 // Creates mediator message (event/command) listener. Cannot be done in |
|
144 // constructor because session control may be unavailable when we would |
|
145 // receive first mediator event => session state is still uninitialized. |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 void CVtEngUtility::StartMediatorListenerL() |
|
149 { |
|
150 iMdtrMessageListener = CVtEngMdtrMessageListener::NewL( *this ); |
|
151 } |
|
152 |
|
153 |
|
154 // ----------------------------------------------------------------------------- |
|
155 // CVtEngUtility::Settings |
|
156 // ----------------------------------------------------------------------------- |
|
157 // |
|
158 CVtEngSettings& CVtEngUtility::Settings() |
|
159 { |
|
160 return *CVtEngUtility::EngineUtils()->iSettings; |
|
161 } |
|
162 |
|
163 // ----------------------------------------------------------------------------- |
|
164 // CVtEngUtility::MediatorCommands |
|
165 // ----------------------------------------------------------------------------- |
|
166 // |
|
167 CVtEngMdtrCommandSender& CVtEngUtility::MediatorCommands() |
|
168 { |
|
169 return *CVtEngUtility::EngineUtils()->iMdtrCommandSender; |
|
170 } |
|
171 |
|
172 // ----------------------------------------------------------------------------- |
|
173 // CVtEngUtility::CRProxy |
|
174 // ----------------------------------------------------------------------------- |
|
175 // |
|
176 CVtEngCRProxy& CVtEngUtility::CRProxy() |
|
177 { |
|
178 return *CVtEngUtility::EngineUtils()->iCRProxy; |
|
179 } |
|
180 |
|
181 // ----------------------------------------------------------------------------- |
|
182 // CVtEngUtility::AccessoryHandler |
|
183 // ----------------------------------------------------------------------------- |
|
184 // |
|
185 CVtEngAccessoryHandler& CVtEngUtility::AccessoryHandler() |
|
186 { |
|
187 return *CVtEngUtility::EngineUtils()->iAccessoryHandler; |
|
188 } |
|
189 |
|
190 // ----------------------------------------------------------------------------- |
|
191 // CVtEngUtility::StartSATListenL |
|
192 // ----------------------------------------------------------------------------- |
|
193 // |
|
194 void CVtEngUtility::StartSATListenL() |
|
195 { |
|
196 iSATClient = CVtEngSATClient::NewL(); |
|
197 } |
|
198 |
|
199 // ----------------------------------------------------------------------------- |
|
200 // CVtEngUtility::NotifyLockState |
|
201 // ----------------------------------------------------------------------------- |
|
202 // |
|
203 void CVtEngUtility::NotifyLockState() |
|
204 { |
|
205 iLockMonitor->NotifyState(); |
|
206 } |
|
207 |
|
208 // ----------------------------------------------------------------------------- |
|
209 // CVtEngUtility::Extensions |
|
210 // ----------------------------------------------------------------------------- |
|
211 // |
|
212 CVtEngExtensions* CVtEngUtility::Extensions() |
|
213 { |
|
214 return CVtEngUtility::EngineUtils()->iExtensions; |
|
215 } |
|
216 |
|
217 // End of File |
|