245 // TransportDownIndication() |
248 // TransportDownIndication() |
246 // --------------------------------------------------------- |
249 // --------------------------------------------------------- |
247 // |
250 // |
248 void CBIPController::TransportDownIndication() |
251 void CBIPController::TransportDownIndication() |
249 { |
252 { |
250 TRACE_FUNC |
253 TRACE_FUNC |
|
254 if(!iReceivingFailed && iShowRecvCompleteDialog) |
|
255 { |
|
256 //Launch recevice completed dialog. |
|
257 iRecvDoneDialog = CHbDeviceDialogSymbian::NewL(); |
|
258 iRecvDoneDialog->SetObserver(this); |
|
259 |
|
260 CHbSymbianVariantMap* variantMap = CHbSymbianVariantMap::NewL(); |
|
261 CleanupStack::PushL(variantMap); |
|
262 |
|
263 TInt dialogIdx = TBluetoothDialogParams::EReceiveDone; |
|
264 CHbSymbianVariant* dialogType = CHbSymbianVariant::NewL( (TAny*) &(dialogIdx), |
|
265 CHbSymbianVariant::EInt ); |
|
266 CleanupStack::PushL(dialogType); |
|
267 TBuf16<6> dialogTypeKey; |
|
268 dialogTypeKey.Num(TBluetoothDialogParams::EDialogType); |
|
269 User::LeaveIfError(variantMap->Add(dialogTypeKey, dialogType)); |
|
270 CleanupStack::Pop(dialogType); |
|
271 |
|
272 CHbSymbianVariant* deviceName = CHbSymbianVariant::NewL( (TAny*) (&iRemoteDeviceName), |
|
273 CHbSymbianVariant::EDes ); |
|
274 CleanupStack::PushL(deviceName); |
|
275 TBuf16<6> deviceNameKey; |
|
276 deviceNameKey.Num(TBluetoothDeviceDialog::EDeviceName); |
|
277 User::LeaveIfError(variantMap->Add(deviceNameKey, deviceName)); |
|
278 CleanupStack::Pop(deviceName); |
|
279 |
|
280 CHbSymbianVariant* fileName = CHbSymbianVariant::NewL( (TAny*) (&iReceivingFileName), |
|
281 CHbSymbianVariant::EDes ); |
|
282 CleanupStack::PushL(fileName); |
|
283 TBuf16<6> fileNameKey; |
|
284 fileNameKey.Num(TBluetoothDeviceDialog::EReceivingFileName); |
|
285 User::LeaveIfError(variantMap->Add(fileNameKey, fileName)); |
|
286 CleanupStack::Pop(fileName); |
|
287 |
|
288 CHbSymbianVariant* fileSz = CHbSymbianVariant::NewL( (TAny*) &iTotalSizeByte, |
|
289 CHbSymbianVariant::EInt ); |
|
290 CleanupStack::PushL(fileSz); |
|
291 TBuf16<6> fileSzKey; |
|
292 fileSzKey.Num(TBluetoothDeviceDialog::EReceivingFileSize); |
|
293 User::LeaveIfError(variantMap->Add(fileSzKey, fileSz)); |
|
294 CleanupStack::Pop(fileSz); |
|
295 |
|
296 CHbSymbianVariant* fileCnt = CHbSymbianVariant::NewL( (TAny*) &iFileCount, |
|
297 CHbSymbianVariant::EInt ); |
|
298 CleanupStack::PushL(fileCnt); |
|
299 TBuf16<6> fileCntKey; |
|
300 fileCntKey.Num(TBluetoothDeviceDialog::EReceivedFileCount); |
|
301 User::LeaveIfError(variantMap->Add(fileCntKey, fileCnt)); |
|
302 CleanupStack::Pop(fileCnt); |
|
303 |
|
304 iRecvDoneDialog->Show( KBTDevDialogId(), *variantMap, this ); |
|
305 CleanupStack::PopAndDestroy(variantMap); |
|
306 |
|
307 iShowRecvCompleteDialog = EFalse; |
|
308 } |
|
309 |
251 // Remove receiving buffer and files used during file receiving. |
310 // Remove receiving buffer and files used during file receiving. |
252 // |
311 // |
253 delete iBTObject; |
312 delete iBTObject; |
254 iBTObject = NULL; |
313 iBTObject = NULL; |
255 TRAP_IGNORE(TObexUtilsMessageHandler::RemoveTemporaryRFileL (iFullPathFilename)); |
314 TRAP_IGNORE(TObexUtilsMessageHandler::RemoveTemporaryRFileL (iFullPathFilename)); |
1002 void CBIPController::DataReceived(CHbSymbianVariantMap& aData) |
1062 void CBIPController::DataReceived(CHbSymbianVariantMap& aData) |
1003 { |
1063 { |
1004 if(aData.Keys().MdcaPoint(0).Compare(_L("actionResult")) == 0) |
1064 if(aData.Keys().MdcaPoint(0).Compare(_L("actionResult")) == 0) |
1005 { |
1065 { |
1006 TInt val = *(static_cast<TInt*>(aData.Get(_L("actionResult"))->Data())); |
1066 TInt val = *(static_cast<TInt*>(aData.Get(_L("actionResult"))->Data())); |
1007 if(!val) |
1067 switch(val) |
1008 { |
1068 { |
1009 //Cancel has been clicked |
1069 case TBluetoothDialogParams::ECancelReceive: |
1010 CancelTransfer(); |
1070 { |
1011 } |
1071 //User choose to cancel receiving. |
1012 else |
1072 CancelTransfer(); |
1013 { |
1073 }break; |
1014 //Hide has been clicked |
1074 |
1015 CloseReceivingIndicator(EFalse); |
1075 case TBluetoothDialogParams::EHide: |
|
1076 { |
|
1077 //Use choose to hide the progress dialog. |
|
1078 CloseReceivingIndicator(EFalse); |
|
1079 }break; |
|
1080 |
|
1081 case TBluetoothDialogParams::EShow: |
|
1082 case TBluetoothDialogParams::ECancelShow: |
|
1083 { |
|
1084 //In case of Show, the device dialog will handle the opening of conversation view. |
|
1085 iRecvDoneDialog->Cancel(); |
|
1086 delete iRecvDoneDialog; |
|
1087 iRecvDoneDialog = NULL; |
|
1088 }break; |
1016 } |
1089 } |
1017 } |
1090 } |
1018 } |
1091 } |
1019 |
1092 |
1020 void CBIPController::DeviceDialogClosed(TInt aCompletionCode) |
1093 void CBIPController::DeviceDialogClosed(TInt aCompletionCode) |