32
|
1 |
/*
|
42
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
32
|
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 |
// INCLUDE FILES
|
42
|
20 |
#include "obexutilsdialog.h"
|
|
21 |
#include "obexutilsdialogtimer.h"
|
|
22 |
#include "obexutilsdebug.h"
|
|
23 |
#include <hbdevicenotificationdialogsymbian.h>
|
|
24 |
#include <btservices/bluetoothdevicedialogs.h>
|
|
25 |
#include <hbtextresolversymbian.h>
|
|
26 |
|
|
27 |
_LIT(KSendingDialog, "com.nokia.hb.btdevicedialog/1.0");
|
|
28 |
_LIT(KCurrentFileIndex,"currentFileIdx" );
|
|
29 |
_LIT(KTotalFileCount, "totalFilesCnt");
|
|
30 |
_LIT(KDestinationName, "destinationName");
|
|
31 |
_LIT(KFileName,"fileName");
|
|
32 |
_LIT(KFileSizeTxt,"fileSzTxt");
|
|
33 |
_LIT(KFileSize,"fileSz");
|
|
34 |
_LIT(KProgressValue,"progressValue");
|
|
35 |
|
|
36 |
_LIT(KSendingCancelledText, "txt_bt_dpophead_sending_cancelled");
|
|
37 |
_LIT(KDeviceText,"txt_bt_dpopinfo_sent_to_1");
|
|
38 |
|
|
39 |
const TInt KMaxDescriptionLength = 256;
|
|
40 |
const TInt KMinStringSize = 10;
|
|
41 |
const TInt KMinFileSize = 1024;
|
|
42 |
|
|
43 |
_LIT(KLocFileName, "btdialogs_");
|
|
44 |
_LIT(KPath, "z:/resource/qt/translations/");
|
32
|
45 |
|
|
46 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
47 |
|
|
48 |
// -----------------------------------------------------------------------------
|
|
49 |
// C++ default constructor can NOT contain any code, that
|
|
50 |
// might leave.
|
|
51 |
// -----------------------------------------------------------------------------
|
|
52 |
CObexUtilsDialog::CObexUtilsDialog( MObexUtilsDialogObserver* aObserverPtr ) :
|
|
53 |
iDialogObserverPtr( aObserverPtr )
|
|
54 |
{
|
|
55 |
}
|
|
56 |
|
|
57 |
// -----------------------------------------------------------------------------
|
|
58 |
// CObexUtilsDialog::NewL
|
|
59 |
// -----------------------------------------------------------------------------
|
|
60 |
EXPORT_C CObexUtilsDialog* CObexUtilsDialog::NewL( MObexUtilsDialogObserver* aObserverPtr )
|
|
61 |
{
|
|
62 |
CObexUtilsDialog* self = new ( ELeave ) CObexUtilsDialog( aObserverPtr );
|
|
63 |
CleanupStack::PushL( self );
|
|
64 |
self->ConstructL();
|
|
65 |
CleanupStack::Pop( self );
|
|
66 |
return( self );
|
|
67 |
}
|
|
68 |
|
|
69 |
// -----------------------------------------------------------------------------
|
|
70 |
// CObexUtilsDialog::NewLC
|
|
71 |
// -----------------------------------------------------------------------------
|
|
72 |
EXPORT_C CObexUtilsDialog* CObexUtilsDialog::NewLC( MObexUtilsDialogObserver* aObserverPtr )
|
|
73 |
{
|
|
74 |
CObexUtilsDialog* self = new ( ELeave ) CObexUtilsDialog( aObserverPtr );
|
|
75 |
CleanupStack::PushL( self );
|
|
76 |
self->ConstructL();
|
|
77 |
return( self );
|
|
78 |
}
|
|
79 |
|
|
80 |
// -----------------------------------------------------------------------------
|
|
81 |
// CObexUtilsDialog::ConstructL
|
|
82 |
// Symbian OS default constructor can leave.
|
|
83 |
// -----------------------------------------------------------------------------
|
|
84 |
void CObexUtilsDialog::ConstructL()
|
|
85 |
{
|
|
86 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::ConstructL()"));
|
|
87 |
|
|
88 |
if (!iDialogObserverPtr)
|
|
89 |
{
|
|
90 |
// The observer pointer was not given as an argument.
|
|
91 |
//
|
|
92 |
User::Leave(KErrArgument);
|
|
93 |
}
|
|
94 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::ConstructL() completed"));
|
|
95 |
}
|
|
96 |
|
|
97 |
// -----------------------------------------------------------------------------
|
|
98 |
// Destructor
|
|
99 |
// -----------------------------------------------------------------------------
|
42
|
100 |
EXPORT_C CObexUtilsDialog::~CObexUtilsDialog()
|
32
|
101 |
{
|
|
102 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::~CObexUtilsDialog()"));
|
42
|
103 |
iDeviceName.Close();
|
|
104 |
delete iWaitDialog;
|
|
105 |
delete iProgressDialog;
|
32
|
106 |
delete iObexDialogTimer;
|
42
|
107 |
delete iMessageBox;
|
32
|
108 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::~CObexUtilsDialog() completed"));
|
|
109 |
}
|
|
110 |
|
|
111 |
// -----------------------------------------------------------------------------
|
|
112 |
// CObexUtilsDialog::LaunchProgressDialogL
|
|
113 |
// -----------------------------------------------------------------------------
|
42
|
114 |
EXPORT_C void CObexUtilsDialog::LaunchProgressDialogL(
|
|
115 |
MObexUtilsProgressObserver* aObserverPtr, TInt aFileCount,
|
|
116 |
const TDesC& aDeviceName, TInt aTimeoutValue )
|
32
|
117 |
{
|
|
118 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchProgressDialogL()"));
|
42
|
119 |
|
|
120 |
TBuf<KMinStringSize> key;
|
32
|
121 |
if ( aObserverPtr )
|
|
122 |
{
|
|
123 |
// The observerPtr was given, so store it and start a timer
|
|
124 |
//
|
|
125 |
iProgressObserverPtr = aObserverPtr;
|
|
126 |
|
42
|
127 |
if ( !iObexDialogTimer )
|
32
|
128 |
{
|
42
|
129 |
iObexDialogTimer = CObexUtilsDialogTimer::NewL( this );
|
32
|
130 |
}
|
42
|
131 |
iObexDialogTimer->Cancel();
|
32
|
132 |
iObexDialogTimer->SetTimeout( aTimeoutValue );
|
|
133 |
}
|
|
134 |
|
42
|
135 |
iFileCount = aFileCount;
|
|
136 |
iDeviceName.Close();
|
|
137 |
iDeviceName.CreateL(aDeviceName);
|
|
138 |
iProgressDialog = CHbDeviceDialogSymbian::NewL();
|
32
|
139 |
|
42
|
140 |
CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL();
|
|
141 |
CleanupStack::PushL(map);
|
|
142 |
TInt data = TBluetoothDialogParams::ESend;
|
|
143 |
key.Num(TBluetoothDialogParams::EDialogType);
|
|
144 |
AddDataL( map, key, &data, CHbSymbianVariant::EInt );
|
|
145 |
User::LeaveIfError(iProgressDialog->Show(KSendingDialog(),*map,this));
|
|
146 |
CleanupStack::PopAndDestroy(map);
|
32
|
147 |
|
|
148 |
if ( iProgressObserverPtr )
|
|
149 |
{
|
|
150 |
iObexDialogTimer->Tickle();
|
|
151 |
}
|
|
152 |
|
42
|
153 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchProgressDialogL() completed"));
|
|
154 |
}
|
|
155 |
|
|
156 |
|
|
157 |
EXPORT_C void CObexUtilsDialog::UpdateProgressNoteL( TInt aFileSize,TInt aFileIndex, const TDesC& aFileName )
|
|
158 |
{
|
|
159 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::UpdateProgressNoteL()"));
|
|
160 |
HBufC* key = HBufC::NewL(KMaxDescriptionLength);
|
|
161 |
CleanupStack::PushL(key);
|
|
162 |
|
|
163 |
CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL();
|
|
164 |
CleanupStack::PushL(map);
|
|
165 |
|
|
166 |
iFileIndex = aFileIndex+1;
|
|
167 |
key->Des().Copy(KCurrentFileIndex());
|
|
168 |
AddDataL( map, *key, &iFileIndex, CHbSymbianVariant::EInt );
|
|
169 |
|
|
170 |
key->Des().Copy(KTotalFileCount());
|
|
171 |
AddDataL( map, *key, &iFileCount, CHbSymbianVariant::EInt );
|
|
172 |
|
|
173 |
key->Des().Copy(KDestinationName());
|
|
174 |
AddDataL( map, *key, &iDeviceName, CHbSymbianVariant::EDes );
|
|
175 |
|
|
176 |
key->Des().Copy(KFileName());
|
|
177 |
AddDataL( map, *key, &aFileName, CHbSymbianVariant::EDes );
|
|
178 |
|
|
179 |
// todo: localiation is needed for code below:
|
|
180 |
HBufC* value = HBufC::NewL(KMaxDescriptionLength);
|
|
181 |
CleanupStack::PushL(value);
|
|
182 |
key->Des().Copy(KFileSizeTxt());
|
|
183 |
value->Des().Zero();
|
|
184 |
if(aFileSize < KMinFileSize)
|
|
185 |
{
|
|
186 |
value->Des().AppendNum(aFileSize);
|
|
187 |
value->Des().Append(_L(" Bytes"));
|
|
188 |
}
|
|
189 |
else
|
|
190 |
{
|
|
191 |
TInt filesize = aFileSize/KMinFileSize;
|
|
192 |
value->Des().AppendNum(filesize);
|
|
193 |
value->Des().Append(_L(" KB"));
|
|
194 |
}
|
|
195 |
AddDataL( map, *key, value, CHbSymbianVariant::EDes );
|
|
196 |
CleanupStack::PopAndDestroy( value );
|
|
197 |
|
|
198 |
key->Des().Copy(KFileSize());
|
|
199 |
AddDataL( map, *key, &aFileSize, CHbSymbianVariant::EInt );
|
|
200 |
TInt ret = iProgressDialog->Update(*map);
|
|
201 |
CleanupStack::PopAndDestroy(map);
|
|
202 |
CleanupStack::PopAndDestroy(key);
|
|
203 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::UpdateProgressNoteL()Completed"));
|
32
|
204 |
}
|
|
205 |
|
|
206 |
// -----------------------------------------------------------------------------
|
|
207 |
// CObexUtilsDialog::LaunchWaitDialogL
|
|
208 |
// -----------------------------------------------------------------------------
|
42
|
209 |
EXPORT_C void CObexUtilsDialog::LaunchWaitDialogL( const TDesC& aDisplayText )
|
32
|
210 |
{
|
|
211 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchWaitDialogL()"));
|
|
212 |
|
|
213 |
if ( iWaitDialog || iProgressDialog )
|
|
214 |
{
|
|
215 |
// Allow only one dialog at a time
|
|
216 |
//
|
|
217 |
User::Leave( KErrInUse );
|
|
218 |
}
|
42
|
219 |
iWaitDialog = CHbDeviceProgressDialogSymbian::NewL(CHbDeviceProgressDialogSymbian::EWaitDialog,this);
|
|
220 |
iWaitDialog->SetTextL(aDisplayText);
|
|
221 |
iWaitDialog->ShowL();
|
32
|
222 |
|
|
223 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchWaitDialogL() completed"));
|
|
224 |
}
|
|
225 |
|
|
226 |
// -----------------------------------------------------------------------------
|
|
227 |
// CObexUtilsDialog::CancelWaitDialogL
|
|
228 |
// -----------------------------------------------------------------------------
|
42
|
229 |
EXPORT_C void CObexUtilsDialog::CancelWaitDialog()
|
32
|
230 |
{
|
|
231 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::CancelWaitDialogL()"));
|
|
232 |
|
|
233 |
if( iWaitDialog )
|
|
234 |
{
|
42
|
235 |
iWaitDialog->Close();
|
|
236 |
delete iWaitDialog;
|
32
|
237 |
iWaitDialog = NULL;
|
|
238 |
}
|
|
239 |
|
|
240 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::CancelWaitDialogL() completed"));
|
|
241 |
}
|
|
242 |
|
|
243 |
// -----------------------------------------------------------------------------
|
|
244 |
// CObexUtilsDialog::CancelProgressDialogL
|
|
245 |
// -----------------------------------------------------------------------------
|
42
|
246 |
EXPORT_C void CObexUtilsDialog::CancelProgressDialog()
|
32
|
247 |
{
|
|
248 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::CancelProgressDialogL()"));
|
|
249 |
|
|
250 |
if( iProgressDialog )
|
|
251 |
{
|
42
|
252 |
iProgressDialog->Cancel();
|
|
253 |
delete iProgressDialog;
|
32
|
254 |
iProgressDialog = NULL;
|
42
|
255 |
delete iObexDialogTimer;
|
|
256 |
iObexDialogTimer = NULL;
|
32
|
257 |
}
|
|
258 |
|
|
259 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::CancelProgressDialogL() completed"));
|
|
260 |
}
|
|
261 |
|
|
262 |
// -----------------------------------------------------------------------------
|
|
263 |
// CObexUtilsDialog::UpdateProgressDialogL
|
|
264 |
// -----------------------------------------------------------------------------
|
42
|
265 |
EXPORT_C void CObexUtilsDialog::UpdateProgressDialogL( TInt aProgressValue )
|
32
|
266 |
{
|
|
267 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::UpdateProgressDialogL()"));
|
|
268 |
|
|
269 |
if ( iProgressDialog )
|
|
270 |
{
|
42
|
271 |
HBufC* key = HBufC::NewL(KMaxDescriptionLength);
|
|
272 |
CleanupStack::PushL(key);
|
|
273 |
|
|
274 |
CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL();
|
|
275 |
CleanupStack::PushL(map);
|
32
|
276 |
|
42
|
277 |
key->Des().Copy(KProgressValue());
|
|
278 |
AddDataL( map, *key, &aProgressValue, CHbSymbianVariant::EInt );
|
|
279 |
|
|
280 |
HBufC* value = HBufC::NewL(KMaxDescriptionLength);
|
|
281 |
CleanupStack::PushL(value);
|
|
282 |
key->Des().Copy(KCurrentFileIndex());
|
|
283 |
value->Des().AppendNum(iFileIndex);
|
|
284 |
AddDataL( map, *key, value, CHbSymbianVariant::EDes );
|
|
285 |
CleanupStack::PopAndDestroy(value);
|
|
286 |
|
|
287 |
TInt ret = iProgressDialog->Update(*map);
|
|
288 |
|
|
289 |
CleanupStack::PopAndDestroy(map);
|
|
290 |
CleanupStack::PopAndDestroy(key);
|
32
|
291 |
}
|
|
292 |
|
|
293 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::UpdateProgressDialogL() completed"));
|
|
294 |
}
|
|
295 |
|
|
296 |
// -----------------------------------------------------------------------------
|
|
297 |
// CObexUtilsDialog::UpdateProgressDialog
|
|
298 |
// -----------------------------------------------------------------------------
|
|
299 |
void CObexUtilsDialog::UpdateProgressDialog()
|
|
300 |
{
|
|
301 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::UpdateProgressDialog()"));
|
|
302 |
|
|
303 |
TRAPD( ignoredError, UpdateProgressDialogL(
|
42
|
304 |
iProgressObserverPtr->GetProgressStatus()) );
|
32
|
305 |
|
|
306 |
if (ignoredError != KErrNone)
|
|
307 |
{
|
|
308 |
FLOG(_L("Ignore this error"));
|
|
309 |
}
|
|
310 |
|
|
311 |
if ( iObexDialogTimer )
|
|
312 |
{
|
|
313 |
iObexDialogTimer->Tickle();
|
|
314 |
}
|
|
315 |
|
|
316 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::UpdateProgressDialog() completed"));
|
|
317 |
}
|
|
318 |
|
|
319 |
// -----------------------------------------------------------------------------
|
|
320 |
// CObexUtilsDialog::LaunchQueryDialogL
|
|
321 |
// -----------------------------------------------------------------------------
|
|
322 |
//
|
42
|
323 |
EXPORT_C void CObexUtilsDialog::LaunchQueryDialogL( const TDesC& aConfirmText )
|
32
|
324 |
{
|
|
325 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchQueryDialogL()"));
|
42
|
326 |
if ( iMessageBox )
|
|
327 |
{
|
|
328 |
//todo: Already one dialog is displayed, currently not supported for
|
|
329 |
//multiple dialogs at the same time.
|
|
330 |
User::Leave( KErrGeneral );
|
|
331 |
}
|
|
332 |
iMessageBox = CreateAndShowMessageBoxL( CHbDeviceMessageBoxSymbian::EQuestion,
|
|
333 |
aConfirmText, this, 0 );
|
32
|
334 |
}
|
|
335 |
|
42
|
336 |
|
32
|
337 |
// -----------------------------------------------------------------------------
|
42
|
338 |
// CObexUtilsUiDialog::ShowErrorNoteL
|
32
|
339 |
// -----------------------------------------------------------------------------
|
42
|
340 |
EXPORT_C void CObexUtilsDialog::ShowErrorNoteL( const TDesC& aTextId )
|
32
|
341 |
{
|
42
|
342 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsUiDialog::ShowErrorNoteL"));
|
|
343 |
if ( iMessageBox )
|
|
344 |
{
|
|
345 |
//todo: Already one dialog is displayed, currently not supported for
|
|
346 |
//multiple dialogs at the same time.
|
|
347 |
User::Leave( KErrGeneral );
|
|
348 |
}
|
|
349 |
iMessageBox = CreateAndShowMessageBoxL( CHbDeviceMessageBoxSymbian::EWarning,
|
|
350 |
aTextId, this, 0 );
|
|
351 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsUiDialog::ShowErrorNoteL completed"));
|
|
352 |
}
|
32
|
353 |
|
42
|
354 |
// -----------------------------------------------------------------------------
|
|
355 |
// CObexUtilsUiDialog::ShowInformationNoteL
|
|
356 |
// -----------------------------------------------------------------------------
|
|
357 |
EXPORT_C void CObexUtilsDialog::ShowInformationNoteL( const TDesC& aTextId )
|
|
358 |
{
|
|
359 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsUiDialog::ShowInformationNoteL"));
|
|
360 |
if ( iMessageBox )
|
|
361 |
{
|
|
362 |
//todo: Already one dialog is displayed, currently not supported for
|
|
363 |
//multiple dialogs at the same time.
|
|
364 |
User::Leave( KErrGeneral );
|
|
365 |
}
|
|
366 |
iMessageBox = CreateAndShowMessageBoxL( CHbDeviceMessageBoxSymbian::EInformation,
|
|
367 |
aTextId, this, 0 );
|
|
368 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsUiDialog::ShowInformationNoteL completed"));
|
|
369 |
}
|
32
|
370 |
|
42
|
371 |
void CObexUtilsDialog::ProgressDialogCancelled(const CHbDeviceProgressDialogSymbian* aDialog)
|
|
372 |
{
|
|
373 |
FLOG(_L("[BTSU]\t CObexUtilsDialog::ProgressDialogCancelled(), cancelled by user"));
|
|
374 |
(void) aDialog;
|
|
375 |
if ( iDialogObserverPtr )
|
|
376 |
{
|
|
377 |
iDialogObserverPtr->DialogDismissed(ECancelButton);
|
|
378 |
}
|
|
379 |
delete iWaitDialog;
|
|
380 |
iWaitDialog = NULL;
|
32
|
381 |
}
|
|
382 |
|
|
383 |
// -----------------------------------------------------------------------------
|
42
|
384 |
// CObexUtilsDialog::MessageBoxClosed
|
32
|
385 |
// -----------------------------------------------------------------------------
|
42
|
386 |
void CObexUtilsDialog::MessageBoxClosed(const CHbDeviceMessageBoxSymbian *aMessageBox,
|
|
387 |
CHbDeviceMessageBoxSymbian::TButtonId aButton)
|
|
388 |
{
|
|
389 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsUiDialog::MessageBoxClosed"));
|
|
390 |
(void)aMessageBox;
|
|
391 |
delete iMessageBox;
|
|
392 |
iMessageBox = NULL;
|
|
393 |
if(iDialogObserverPtr)
|
|
394 |
{
|
|
395 |
//ETrue if user selects Yes, otherwise EFalse.
|
|
396 |
iDialogObserverPtr->DialogDismissed(
|
|
397 |
(aButton == CHbDeviceMessageBoxSymbian::EAcceptButton) ?
|
|
398 |
EYesButton : ENoButton );
|
|
399 |
}
|
|
400 |
FLOG(_L("[OBEXUTILS]\t CObexUtilsUiDialog::MessageBoxClosed completed"));
|
|
401 |
}
|
|
402 |
|
|
403 |
void CObexUtilsDialog::ProgressDialogClosed(const CHbDeviceProgressDialogSymbian* aDialog)
|
|
404 |
{
|
|
405 |
(void) aDialog;
|
|
406 |
}
|
|
407 |
|
|
408 |
void CObexUtilsDialog::DataReceived(CHbSymbianVariantMap& aData)
|
32
|
409 |
{
|
42
|
410 |
(void) aData;
|
|
411 |
}
|
|
412 |
|
|
413 |
void CObexUtilsDialog::DeviceDialogClosed(TInt aCompletionCode)
|
|
414 |
{
|
|
415 |
FLOG(_L("[BTSU]\t CObexUtilsDialog::DeviceDialogClosed()"));
|
|
416 |
(void) aCompletionCode;
|
|
417 |
|
|
418 |
delete iObexDialogTimer;
|
|
419 |
iObexDialogTimer = NULL;
|
|
420 |
delete iProgressDialog;
|
|
421 |
iProgressDialog = NULL;
|
|
422 |
|
|
423 |
TBool ok = HbTextResolverSymbian::Init(KLocFileName, KPath);
|
|
424 |
if(ok)
|
32
|
425 |
{
|
42
|
426 |
TRAP_IGNORE(
|
|
427 |
HBufC* deviceName = HbTextResolverSymbian::LoadLC(KDeviceText,iDeviceName);
|
|
428 |
HBufC* sendText = HbTextResolverSymbian::LoadLC(KSendingCancelledText);
|
|
429 |
CHbDeviceNotificationDialogSymbian::NotificationL(
|
|
430 |
KNullDesC, deviceName->Des(), sendText->Des());
|
|
431 |
CleanupStack::PopAndDestroy( sendText );
|
|
432 |
CleanupStack::PopAndDestroy( deviceName );
|
|
433 |
);
|
|
434 |
}
|
|
435 |
else
|
|
436 |
{
|
|
437 |
CHbDeviceNotificationDialogSymbian::NotificationL(
|
|
438 |
KNullDesC, KDeviceText(), KSendingCancelledText());
|
|
439 |
}
|
|
440 |
if ( iDialogObserverPtr )
|
|
441 |
{
|
|
442 |
iDialogObserverPtr->DialogDismissed(ECancelButton);
|
32
|
443 |
}
|
|
444 |
}
|
|
445 |
|
42
|
446 |
void CObexUtilsDialog::AddDataL(CHbSymbianVariantMap* aMap, const TDesC& aKey,
|
|
447 |
const TAny* aData, CHbSymbianVariant::TType aDataType)
|
32
|
448 |
{
|
42
|
449 |
CHbSymbianVariant* value = CHbSymbianVariant::NewL(aData, aDataType);
|
|
450 |
CleanupStack::PushL( value );
|
|
451 |
User::LeaveIfError( aMap->Add( aKey, value ) ); // aMap takes the ownership of value
|
|
452 |
CleanupStack::Pop( value );
|
|
453 |
}
|
|
454 |
|
|
455 |
CHbDeviceMessageBoxSymbian* CObexUtilsDialog::CreateAndShowMessageBoxL(
|
|
456 |
CHbDeviceMessageBoxSymbian::TType aType,
|
|
457 |
const TDesC& aText, MHbDeviceMessageBoxObserver* aObserver,
|
|
458 |
TInt aTimeout )
|
|
459 |
{
|
|
460 |
CHbDeviceMessageBoxSymbian* messageBox =
|
|
461 |
CHbDeviceMessageBoxSymbian::NewL( aType );
|
|
462 |
CleanupStack::PushL(messageBox);
|
|
463 |
//ToDo: Need to use localised strings.
|
|
464 |
messageBox->SetTextL(aText);
|
|
465 |
messageBox->SetObserver(aObserver);
|
|
466 |
messageBox->SetTimeout(aTimeout);
|
|
467 |
messageBox->ShowL();
|
|
468 |
CleanupStack::Pop(messageBox);
|
|
469 |
return messageBox;
|
32
|
470 |
}
|
|
471 |
|
|
472 |
// End of File
|