1 /* |
|
2 * Copyright (c) 2007 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MUSUISENDCONTROLLER_H |
|
20 #define MUSUISENDCONTROLLER_H |
|
21 |
|
22 #include "musuieventcontroller.h" |
|
23 #include "musengoutsessionobserver.h" |
|
24 #include "musunittesting.h" |
|
25 |
|
26 #include "musengoutsessionobserver.h" |
|
27 #include <AknProgressDialog.h> |
|
28 |
|
29 class MMusUiSendObserver; |
|
30 class CMusEngMceOutSession; |
|
31 class CDirectoryLocalizer; |
|
32 |
|
33 /** |
|
34 * |
|
35 * |
|
36 * @lib musui.exe |
|
37 */ |
|
38 class CMusUiSendController : public CMusUiEventController, |
|
39 public MMusEngOutSessionObserver |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 virtual ~CMusUiSendController(); |
|
45 |
|
46 |
|
47 public: // From CMusUiEventController: |
|
48 |
|
49 /** |
|
50 * Returns a pointer to engine side session. |
|
51 */ |
|
52 virtual CMusEngMceSession* EngineSession(); |
|
53 |
|
54 /** |
|
55 * |
|
56 */ |
|
57 virtual const TDesC& TypedAddress() const; |
|
58 |
|
59 /** |
|
60 * |
|
61 */ |
|
62 virtual TBool ManualAddressTyped() const; |
|
63 |
|
64 /** |
|
65 * Makes out session specific preparations for engine session deletion. |
|
66 */ |
|
67 virtual void DeleteEngineSession(); |
|
68 |
|
69 |
|
70 public: // From MMusUiPropertyObserver |
|
71 |
|
72 virtual void HandlePropertyError( const TInt aReason ); |
|
73 |
|
74 |
|
75 public: // From MMusUiCallbackObserver |
|
76 |
|
77 /** |
|
78 * Handles async events common to outgoing session types. |
|
79 * Should be called if child classes are not able to handle the call. |
|
80 */ |
|
81 virtual void HandleAsyncEventL( TMusUiAsyncEvent aEventId ); |
|
82 |
|
83 |
|
84 public: // new functions: |
|
85 |
|
86 /** |
|
87 * Returns a pointer to engine side session. |
|
88 */ |
|
89 virtual CMusEngMceOutSession* EngineOutSession() = 0; |
|
90 |
|
91 virtual void InviteL( const TDesC& aRecipient ) = 0; |
|
92 |
|
93 virtual void HandleSliderValueChangeL( TInt aNewLevel ) = 0; |
|
94 |
|
95 void StartInvitationL(); |
|
96 |
|
97 void InviteL(); |
|
98 |
|
99 void CancelInvitationL(); |
|
100 |
|
101 virtual void HandleForegroundEventL( TBool aForeground ); |
|
102 |
|
103 virtual void PlayL(); |
|
104 |
|
105 virtual void PauseL(); |
|
106 |
|
107 TBool IsPlayingL(); |
|
108 |
|
109 |
|
110 public: // from MMusEngSessionObserver |
|
111 |
|
112 virtual void SessionEstablished(); |
|
113 |
|
114 |
|
115 public: // from MMusEngOutSessionObserver |
|
116 |
|
117 virtual void SessionRejected(); // e.g. 603 DECLINE |
|
118 |
|
119 virtual void SessionBadRequest(); // 400 |
|
120 |
|
121 virtual void SessionUnauthorized(); // 401 |
|
122 |
|
123 virtual void SessionPaymentRequired(); // 402 |
|
124 |
|
125 virtual void SessionRecipientNotFound(); // 404 |
|
126 |
|
127 virtual void SessionProxyAuthenticationRequired(); // 407 |
|
128 |
|
129 virtual void SessionRequestTimeOut(); // 408 |
|
130 |
|
131 virtual void SessionUnsupportedMediaType(); // 415 |
|
132 |
|
133 virtual void SessionBusyHere(); // 486 |
|
134 |
|
135 virtual void SessionRequestCancelled(); // 487 |
|
136 |
|
137 virtual void SessionTemporarilyNotAvailable(); // 480 |
|
138 |
|
139 |
|
140 protected: // Contructors |
|
141 |
|
142 void ConstructL(); |
|
143 |
|
144 CMusUiSendController( MMusUiEventObserver& aEventObserver, |
|
145 MMusUiSharingObserver& aSharingObserver, |
|
146 MMusUiSendObserver& aSendObserver ); |
|
147 |
|
148 |
|
149 protected: // from MusUiEventController |
|
150 |
|
151 /** |
|
152 * Send specific functionality of exit procedure |
|
153 */ |
|
154 virtual void ExitProcedureL( TBool aUserAcceptance ); |
|
155 |
|
156 /** |
|
157 * Handles status changes specific to sending side sharing types. |
|
158 * To be overridden in sibling classes for sharing type specific |
|
159 * status changes. Calls base class version if status change is not |
|
160 * sending side specific. |
|
161 */ |
|
162 virtual void HandleChangedStatusL( TMusAvailabilityStatus aStatus ); |
|
163 |
|
164 |
|
165 protected: |
|
166 |
|
167 /** |
|
168 * |
|
169 */ |
|
170 const TDesC& VideoFileNameL(); |
|
171 |
|
172 void ShowInvitingWaitDialogL(); |
|
173 |
|
174 void DismissWaitDialog(); |
|
175 |
|
176 |
|
177 private: // Helpers |
|
178 |
|
179 void SplitL( const TDesC& aDes, const TDesC& aChar, CDesCArray* aArray ); |
|
180 |
|
181 void SetVideoPathValueL(); |
|
182 |
|
183 void ShowVideoSavedDialogL(); |
|
184 |
|
185 void DeleteVideoL(); |
|
186 |
|
187 |
|
188 protected: // Data |
|
189 |
|
190 /* |
|
191 * Interface for outgoing session specific callbacks |
|
192 */ |
|
193 MMusUiSendObserver& iSendObserver; |
|
194 |
|
195 HBufC* iAddress; |
|
196 |
|
197 TBool iVideoToBeSaved; |
|
198 |
|
199 TBool iManualAddressTyped; |
|
200 |
|
201 TInt iTriedInvitations; |
|
202 |
|
203 /** |
|
204 * |
|
205 */ |
|
206 TBool iSipRegistrationPending; |
|
207 |
|
208 /** |
|
209 * |
|
210 */ |
|
211 HBufC* iRemoteSipAddress; |
|
212 |
|
213 /** |
|
214 * |
|
215 */ |
|
216 HBufC* iRemoteSipAddressProposal; |
|
217 |
|
218 |
|
219 private: // Data |
|
220 |
|
221 /** |
|
222 * If this variable is ETrue, playback should be continued |
|
223 * when gaining focus. ETrue by default. |
|
224 */ |
|
225 TBool iContinuePlayingWhenForeground; |
|
226 |
|
227 /** |
|
228 * |
|
229 */ |
|
230 HBufC* iVideoFileName; |
|
231 |
|
232 CDirectoryLocalizer* iLocalizer; |
|
233 |
|
234 protected: |
|
235 /** |
|
236 * The class is used as a call back service of the wait dialog |
|
237 */ |
|
238 class TWaitDialogCallback : public MProgressDialogCallback |
|
239 { |
|
240 public: |
|
241 TWaitDialogCallback( CMusUiSendController& aController ); |
|
242 void DialogDismissedL( TInt /*aButtonId*/ ); |
|
243 |
|
244 private: |
|
245 CMusUiSendController& iController; |
|
246 |
|
247 }iWaitDialogCallback; |
|
248 |
|
249 /** |
|
250 * If this variable is ETrue, playback should be continued |
|
251 * when gaining focus. ETrue by default. |
|
252 */ |
|
253 }; |
|
254 |
|
255 #endif // MUSUISENDCONTROLLER_H |
|
256 |
|
257 // end of file |
|