btobexprofiles/obexreceiveservices/bip/src/BIPController.cpp
changeset 63 bcf742120177
parent 52 4545c04e61e1
equal deleted inserted replaced
52:4545c04e61e1 63:bcf742120177
    32 #include    <es_sock.h>
    32 #include    <es_sock.h>
    33 #include    <bt_sock.h>
    33 #include    <bt_sock.h>
    34 #include    <msvids.h>
    34 #include    <msvids.h>
    35 #include    "debug.h"
    35 #include    "debug.h"
    36 #include    <bluetoothdevicedialogs.h>
    36 #include    <bluetoothdevicedialogs.h>
    37 #include <hbtextresolversymbian.h>
       
    38         
    37         
    39 // CONSTANTS
    38 // CONSTANTS
    40 _LIT8(KBipCapabilityType, "x-bt/img-capabilities\0");
    39 _LIT8(KBipCapabilityType, "x-bt/img-capabilities\0");
    41 const TInt KFileManagerUID3 = 0x101F84EB; /// File Manager application UID3
    40 const TInt KFileManagerUID3 = 0x101F84EB; /// File Manager application UID3
    42 const TInt    KBufferSize = 0x10000;  // 64 kB
    41 const TInt    KBufferSize = 0x10000;  // 64 kB
    43 _LIT( KBTDevDialogId, "com.nokia.hb.btdevicedialog/1.0" );
    42 _LIT( KBTDevDialogId, "com.nokia.hb.btdevicedialog/1.0" );
    44 _LIT(KLocFileName, "btdialogs_");
    43 const TInt KMaxDisplayFileName = 20; 
    45 _LIT(KPath, "z:/resource/qt/translations/");  
    44 const TInt KMinStringSize = 11;
    46 
    45 
    47 
    46 
    48 // ================= MEMBER FUNCTIONS =======================
    47 // ================= MEMBER FUNCTIONS =======================
    49 
    48 
    50 CBIPController* CBIPController::NewL()
    49 CBIPController* CBIPController::NewL()
    76     iLowMemoryActiveMMC = CObexUtilsPropertyNotifier::NewL(this, ECheckMMCMemory);
    75     iLowMemoryActiveMMC = CObexUtilsPropertyNotifier::NewL(this, ECheckMMCMemory);
    77     iDevMan = CBTEngDevMan::NewL(this);
    76     iDevMan = CBTEngDevMan::NewL(this);
    78     iResultArray = new(ELeave) CBTDeviceArray(1);
    77     iResultArray = new(ELeave) CBTDeviceArray(1);
    79     // Get default folder from CenRep 
    78     // Get default folder from CenRep 
    80     TObexUtilsMessageHandler::GetCenRepKeyStringValueL(KCRUidBluetoothEngine, KLCReceiveFolder, iCenRepFolder);
    79     TObexUtilsMessageHandler::GetCenRepKeyStringValueL(KCRUidBluetoothEngine, KLCReceiveFolder, iCenRepFolder);
    81     iDialog = CObexUtilsDialog::NewL(this);
       
    82     TBool ok = HbTextResolverSymbian::Init(KLocFileName, KPath);
       
    83     if (!ok) 
       
    84         {
       
    85         User::Leave( KErrNotFound );
       
    86         }
       
    87     TRACE_FUNC_EXIT
    80     TRACE_FUNC_EXIT
    88     }
    81     }
    89 
    82 
    90 // ---------------------------------------------------------
    83 // ---------------------------------------------------------
    91 // ~CBIPController()
    84 // ~CBIPController()
   106         {
    99         {
   107         iResultArray->ResetAndDestroy();
   100         iResultArray->ResetAndDestroy();
   108         delete iResultArray;
   101         delete iResultArray;
   109         }
   102         }
   110     iFs.Close();
   103     iFs.Close();
   111     delete iDialog;
   104     
   112     delete iProgressDialog;
   105     delete iProgressDialog;
       
   106     delete iFailureDialog;
   113     delete iRecvDoneDialog;
   107     delete iRecvDoneDialog;
       
   108     delete iMemoryFullDailog;
       
   109     
   114     TRACE_FUNC_EXIT    
   110     TRACE_FUNC_EXIT    
   115     }
   111     }
   116 
   112 
   117 // ---------------------------------------------------------
   113 // ---------------------------------------------------------
   118 // ErrorIndication()
   114 // ErrorIndication()
   142     TRACE_FUNC_ENTRY
   138     TRACE_FUNC_ENTRY
   143     iReceivingFailed = ETrue;
   139     iReceivingFailed = ETrue;
   144     iShowRecvCompleteDialog = EFalse;
   140     iShowRecvCompleteDialog = EFalse;
   145     if( iBTTransferState == ETransferPut || (!aAbort && iBTTransferState == ETransferPutDiskError) )
   141     if( iBTTransferState == ETransferPut || (!aAbort && iBTTransferState == ETransferPutDiskError) )
   146         {
   142         {
       
   143         CancelTransfer();
       
   144 
       
   145         TRAP_IGNORE( 
       
   146                     LaunchFailureDialogL();
       
   147                 );
       
   148         
   147         if(iBTObject)
   149         if(iBTObject)
   148             {
   150             {
   149             iBTObject->Reset();
   151             iBTObject->Reset();
   150             }
   152             }
   151         CancelTransfer();
       
   152 
       
   153         TRAP_IGNORE( 
       
   154                 HBufC* note = HbTextResolverSymbian::LoadLC(_L("txt_bt_dpophead_receiving_failed"));
       
   155                 iDialog->ShowErrorNoteL(note->Des());
       
   156                 CleanupStack::PopAndDestroy(note); 
       
   157                 );
       
   158         } 
   153         } 
   159     delete iBuf;
   154     delete iBuf;
   160     iBuf = NULL;
   155     iBuf = NULL;
   161     
   156     
   162     iBTTransferState = ETransferIdle;
   157     iBTTransferState = ETransferIdle;
   251 void CBIPController::TransportDownIndication()
   246 void CBIPController::TransportDownIndication()
   252     {
   247     {
   253     TRACE_FUNC  
   248     TRACE_FUNC  
   254     if(!iReceivingFailed && iShowRecvCompleteDialog)
   249     if(!iReceivingFailed && iShowRecvCompleteDialog)
   255         {
   250         {
       
   251         TFileName shortname;
       
   252         if ( iReceivingFileName.Length() > KMaxDisplayFileName ) 
       
   253             {
       
   254             // Filename is too long, 
       
   255             // We make it shorter. Hiding the chars in the middle part of filename. 
       
   256             shortname = iReceivingFileName.Mid(0,KMaxDisplayFileName/2);
       
   257             shortname.Append(_L("..."));
       
   258             shortname.Append(iReceivingFileName.Mid(iReceivingFileName.Length() - KMaxDisplayFileName/2, KMaxDisplayFileName/2));
       
   259             }
       
   260         else
       
   261             {
       
   262             shortname.Copy(iReceivingFileName);
       
   263             }
       
   264 
   256         //Launch recevice completed dialog.
   265         //Launch recevice completed dialog.
   257         iRecvDoneDialog = CHbDeviceDialogSymbian::NewL();
   266         iRecvDoneDialog = CHbDeviceDialogSymbian::NewL();
   258         iRecvDoneDialog->SetObserver(this);
   267         iRecvDoneDialog->SetObserver(this);
   259     
   268     
   260         CHbSymbianVariantMap* variantMap = CHbSymbianVariantMap::NewL();
   269         CHbSymbianVariantMap* variantMap = CHbSymbianVariantMap::NewL();
   261         CleanupStack::PushL(variantMap);
   270         CleanupStack::PushL(variantMap);
   262         
   271         
   263         TInt dialogIdx = TBluetoothDialogParams::EReceiveDone;
   272         TInt dialogIdx = TBluetoothDialogParams::EReceiveDone;
   264         CHbSymbianVariant* dialogType = CHbSymbianVariant::NewL( (TAny*) &(dialogIdx), 
   273         AddParamL(TBluetoothDialogParams::EDialogType, (TAny*) &dialogIdx,
   265                                                             CHbSymbianVariant::EInt );
   274                 CHbSymbianVariant::EInt, *variantMap);
   266         CleanupStack::PushL(dialogType);
   275         
   267         TBuf16<6> dialogTypeKey;
   276         AddParamL(TBluetoothDeviceDialog::EDeviceName, (TAny*) &iRemoteDeviceName,
   268         dialogTypeKey.Num(TBluetoothDialogParams::EDialogType);
   277                 CHbSymbianVariant::EDes, *variantMap);
   269         User::LeaveIfError(variantMap->Add(dialogTypeKey, dialogType));
   278         
   270         CleanupStack::Pop(dialogType);
   279         AddParamL(TBluetoothDeviceDialog::EReceivingFileName, (TAny*) &shortname,
   271         
   280                 CHbSymbianVariant::EDes, *variantMap);
   272         CHbSymbianVariant* deviceName = CHbSymbianVariant::NewL( (TAny*) (&iRemoteDeviceName), 
   281         
   273                                                             CHbSymbianVariant::EDes );
   282         AddParamL(TBluetoothDeviceDialog::EReceivingFileSize, (TAny*) &iTotalSizeByte,
   274         CleanupStack::PushL(deviceName);
   283                 CHbSymbianVariant::EInt, *variantMap);
   275         TBuf16<6> deviceNameKey;
   284         
   276         deviceNameKey.Num(TBluetoothDeviceDialog::EDeviceName);
   285         AddParamL(TBluetoothDeviceDialog::EReceivedFileCount, (TAny*) &iFileCount,
   277         User::LeaveIfError(variantMap->Add(deviceNameKey, deviceName));
   286                 CHbSymbianVariant::EInt, *variantMap);
   278         CleanupStack::Pop(deviceName);
   287         
   279         
   288         TBuf<KMinStringSize> key(_L("OpenCnvView"));
   280         CHbSymbianVariant* fileName = CHbSymbianVariant::NewL( (TAny*) (&iReceivingFileName), 
   289         TBool option = ETrue;
   281                                                             CHbSymbianVariant::EDes );
   290         CHbSymbianVariant* value = CHbSymbianVariant::NewL( (TAny*) &option, CHbSymbianVariant::EBool );
   282         CleanupStack::PushL(fileName);
   291         CleanupStack::PushL(value);
   283         TBuf16<6> fileNameKey;
   292         variantMap->Add(key, value);
   284         fileNameKey.Num(TBluetoothDeviceDialog::EReceivingFileName);
   293         CleanupStack::Pop(value);
   285         User::LeaveIfError(variantMap->Add(fileNameKey, fileName));
   294 
   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 );
   295         iRecvDoneDialog->Show( KBTDevDialogId(), *variantMap, this );
   305         CleanupStack::PopAndDestroy(variantMap);
   296         CleanupStack::PopAndDestroy(variantMap);
   306         
   297         
   307         iShowRecvCompleteDialog = EFalse;
   298         iShowRecvCompleteDialog = EFalse;
   308         }
   299         }
   381                 }
   372                 }
   382             if(!capacity)
   373             if(!capacity)
   383                 {
   374                 {
   384                 //TRAP_IGNORE(TObexUtilsUiLayer::ShowGlobalConfirmationQueryL(R_OUT_OF_MEMORY));
   375                 //TRAP_IGNORE(TObexUtilsUiLayer::ShowGlobalConfirmationQueryL(R_OUT_OF_MEMORY));
   385                 //todo: Need to use Localized string.
   376                 //todo: Need to use Localized string.
   386                 _LIT(KText, "Not enough memory to execute operation. Delete some documents and try again.");
   377                 //_LIT(KText, "Not enough memory to execute operation. Delete some documents and try again.");
   387                 TRAP_IGNORE(iDialog->ShowErrorNoteL(KText));
   378                 //TRAP_IGNORE(iDialog->ShowErrorNoteL(KText));
       
   379                 LaunchMemoryFullDialogL(iDrive);
   388     
   380     
   389                 return KErrDiskFull;
   381                 return KErrDiskFull;
   390                 }
   382                 }
   391             }
   383             }
   392         if(iBTObject->Name().Length() > KMaxFileName)
   384         if(iBTObject->Name().Length() > KMaxFileName)
   590     //
   582     //
   591     if (SysUtil::DiskSpaceBelowCriticalLevelL(&iFs, 0, iDrive))
   583     if (SysUtil::DiskSpaceBelowCriticalLevelL(&iFs, 0, iDrive))
   592         {
   584         {
   593         //TRAP_IGNORE(TObexUtilsUiLayer::ShowGlobalConfirmationQueryL(R_OUT_OF_MEMORY));
   585         //TRAP_IGNORE(TObexUtilsUiLayer::ShowGlobalConfirmationQueryL(R_OUT_OF_MEMORY));
   594         //todo: Need to use Localized string.
   586         //todo: Need to use Localized string.
   595         _LIT(KText, "Not enough memory to execute operation. Delete some documents and try again.");
   587         //_LIT(KText, "Not enough memory to execute operation. Delete some documents and try again.");
   596         TRAP_IGNORE(iDialog->ShowErrorNoteL(KText));
   588         //TRAP_IGNORE(iDialog->ShowErrorNoteL(KText));
   597     
   589         
       
   590         LaunchMemoryFullDialogL(iDrive);
   598         User::Leave(KErrGeneral);
   591         User::Leave(KErrGeneral);
   599         }
   592         }
   600     
   593     
   601     iBTObject = CObexBufObject::NewL(NULL);    
   594     iBTObject = CObexBufObject::NewL(NULL);    
   602     
   595     
   829     
   822     
   830     if(iTotalSizeByte > 0)
   823     if(iTotalSizeByte > 0)
   831         {
   824         {
   832         if(iReceivingFileName.Length() > 0)
   825         if(iReceivingFileName.Length() > 0)
   833             {
   826             {
       
   827             TFileName shortname;
       
   828             if ( iReceivingFileName.Length() > KMaxDisplayFileName ) 
       
   829                 {
       
   830                 // Filename is too long, 
       
   831                 // We make it shorter. Hiding the chars in the middle part of filename. 
       
   832                 shortname = iReceivingFileName.Mid(0,KMaxDisplayFileName/2);
       
   833                 shortname.Append(_L("..."));
       
   834                 shortname.Append(iReceivingFileName.Mid(iReceivingFileName.Length() - KMaxDisplayFileName/2, KMaxDisplayFileName/2));
       
   835                 }
       
   836             else
       
   837                 {
       
   838                 shortname.Copy(iReceivingFileName);
       
   839                 }
       
   840 
   834             iProgressDialog = CHbDeviceDialogSymbian::NewL();
   841             iProgressDialog = CHbDeviceDialogSymbian::NewL();
   835             iProgressDialog->SetObserver(this);
   842             iProgressDialog->SetObserver(this);
   836     
   843     
   837             CHbSymbianVariantMap* variantMap = CHbSymbianVariantMap::NewL();
   844             CHbSymbianVariantMap* variantMap = CHbSymbianVariantMap::NewL();
   838             CleanupStack::PushL(variantMap);
   845             CleanupStack::PushL(variantMap);
   839             
   846             
   840             TInt dialogIdx = TBluetoothDialogParams::EReceiveProgress;
   847             TInt dialogIdx = TBluetoothDialogParams::EReceiveProgress;
   841             CHbSymbianVariant* dialogType = CHbSymbianVariant::NewL( (TAny*) &(dialogIdx), 
   848             AddParamL(TBluetoothDialogParams::EDialogType, (TAny*) &dialogIdx, 
   842                                                                 CHbSymbianVariant::EInt );
   849                     CHbSymbianVariant::EInt, *variantMap);
   843             CleanupStack::PushL(dialogType);
       
   844             TBuf16<6> dialogTypeKey;
       
   845             dialogTypeKey.Num(TBluetoothDialogParams::EDialogType);
       
   846             User::LeaveIfError(variantMap->Add(dialogTypeKey, dialogType));
       
   847             CleanupStack::Pop(dialogType);
       
   848             
   850             
   849             CHbSymbianVariant* deviceName = CHbSymbianVariant::NewL( (TAny*) (&iRemoteDeviceName), 
   851             AddParamL(TBluetoothDeviceDialog::EDeviceName, (TAny*) &iRemoteDeviceName,
   850                                                                 CHbSymbianVariant::EDes );
   852                     CHbSymbianVariant::EDes, *variantMap);
   851             CleanupStack::PushL(deviceName);
       
   852             TBuf16<6> deviceNameKey;
       
   853             deviceNameKey.Num(TBluetoothDeviceDialog::EDeviceName);
       
   854             User::LeaveIfError(variantMap->Add(deviceNameKey, deviceName));
       
   855             CleanupStack::Pop(deviceName);
       
   856             
   853             
   857             CHbSymbianVariant* fileName = CHbSymbianVariant::NewL( (TAny*) (&iReceivingFileName), 
   854             AddParamL(TBluetoothDeviceDialog::EReceivingFileName, (TAny*) &shortname,
   858                                                                 CHbSymbianVariant::EDes );
   855                     CHbSymbianVariant::EDes, *variantMap);
   859             CleanupStack::PushL(fileName);
       
   860             TBuf16<6> fileNameKey;
       
   861             fileNameKey.Num(TBluetoothDeviceDialog::EReceivingFileName);
       
   862             User::LeaveIfError(variantMap->Add(fileNameKey, fileName));
       
   863             CleanupStack::Pop(fileName);
       
   864             
   856             
   865             CHbSymbianVariant* fileSz = CHbSymbianVariant::NewL( (TAny*) &iTotalSizeByte, 
   857             AddParamL(TBluetoothDeviceDialog::EReceivingFileSize, (TAny*) &iTotalSizeByte,
   866                                                                 CHbSymbianVariant::EInt );
   858                     CHbSymbianVariant::EInt, *variantMap);
   867             CleanupStack::PushL(fileSz);
       
   868             TBuf16<6> fileSzKey;
       
   869             fileSzKey.Num(TBluetoothDeviceDialog::EReceivingFileSize);
       
   870             User::LeaveIfError(variantMap->Add(fileSzKey, fileSz));
       
   871             CleanupStack::Pop(fileSz);
       
   872             
   859             
   873             CHbSymbianVariant* fileCnt = CHbSymbianVariant::NewL( (TAny*) &iFileCount, 
   860             AddParamL(TBluetoothDeviceDialog::EReceivedFileCount, (TAny*) &iFileCount,
   874                                                                 CHbSymbianVariant::EInt );
   861                     CHbSymbianVariant::EInt, *variantMap);
   875             CleanupStack::PushL(fileCnt);
   862 
   876             TBuf16<6> fileCntKey;
       
   877             fileCntKey.Num(TBluetoothDeviceDialog::EReceivedFileCount);
       
   878             User::LeaveIfError(variantMap->Add(fileCntKey, fileCnt));
       
   879             CleanupStack::Pop(fileCnt);
       
   880         
       
   881             iDialogActive = ETrue;
   863             iDialogActive = ETrue;
   882             iProgressDialog->Show( KBTDevDialogId(), *variantMap, this );
   864             iProgressDialog->Show( KBTDevDialogId(), *variantMap, this );
   883             CleanupStack::PopAndDestroy(variantMap);
   865             CleanupStack::PopAndDestroy(variantMap);
   884             }
   866             }
   885         else
   867         else
   909         TInt bytesReceived = iBTObject->BytesReceived();
   891         TInt bytesReceived = iBTObject->BytesReceived();
   910         CHbSymbianVariant* progress = CHbSymbianVariant::NewL( (TAny*) &bytesReceived, CHbSymbianVariant::EInt );
   892         CHbSymbianVariant* progress = CHbSymbianVariant::NewL( (TAny*) &bytesReceived, CHbSymbianVariant::EInt );
   911         CleanupStack::PushL(progress);
   893         CleanupStack::PushL(progress);
   912         User::LeaveIfError(variantMap->Add(_L("progress"), progress));
   894         User::LeaveIfError(variantMap->Add(_L("progress"), progress));
   913         CleanupStack::Pop(progress);
   895         CleanupStack::Pop(progress);
   914         
   896 
   915         iProgressDialog->Update(*variantMap);
   897         iProgressDialog->Update(*variantMap);
   916         CleanupStack::PopAndDestroy(variantMap);
   898         CleanupStack::PopAndDestroy(variantMap);
   917         }
   899         }
   918     }
   900     }
   919 
   901 
  1052              }
  1034              }
  1053          }
  1035          }
  1054      return EFalse;
  1036      return EFalse;
  1055      }
  1037      }
  1056  
  1038  
  1057  void CBIPController::DialogDismissed(TInt aButtonId)
       
  1058      {
       
  1059      (void) aButtonId;
       
  1060      }
       
  1061 
       
  1062  void CBIPController::DataReceived(CHbSymbianVariantMap& aData)
  1039  void CBIPController::DataReceived(CHbSymbianVariantMap& aData)
  1063      {
  1040      {
  1064      if(aData.Keys().MdcaPoint(0).Compare(_L("actionResult")) == 0)
  1041      if(aData.Keys().MdcaPoint(0).Compare(_L("actionResult")) == 0)
  1065          {
  1042          {
  1066          TInt val = *(static_cast<TInt*>(aData.Get(_L("actionResult"))->Data()));
  1043          TInt val = *(static_cast<TInt*>(aData.Get(_L("actionResult"))->Data()));
  1084                  //In case of Show, the device dialog will handle the opening of conversation view.
  1061                  //In case of Show, the device dialog will handle the opening of conversation view.
  1085                  iRecvDoneDialog->Cancel();
  1062                  iRecvDoneDialog->Cancel();
  1086                  delete iRecvDoneDialog;
  1063                  delete iRecvDoneDialog;
  1087                  iRecvDoneDialog = NULL;
  1064                  iRecvDoneDialog = NULL;
  1088                  }break;
  1065                  }break;
       
  1066              default:
       
  1067                  break;
  1089              }
  1068              }
  1090          }
  1069          }
  1091      }
  1070      }
  1092  
  1071  
  1093  void CBIPController::DeviceDialogClosed(TInt aCompletionCode)
  1072  void CBIPController::DeviceDialogClosed(TInt aCompletionCode)
  1094      {
  1073      {
  1095      (void) aCompletionCode;
  1074      (void) aCompletionCode;
  1096      }
  1075      }
  1097 
  1076 
       
  1077  void CBIPController::LaunchFailureDialogL()
       
  1078      {
       
  1079      if(iFailureDialog)
       
  1080          {
       
  1081          iFailureDialog->Cancel();
       
  1082          delete iFailureDialog;
       
  1083          iFailureDialog = NULL;
       
  1084          }
       
  1085 
       
  1086      iFailureDialog = CHbDeviceDialogSymbian::NewL();
       
  1087      
       
  1088      CHbSymbianVariantMap* variantMap = CHbSymbianVariantMap::NewL();
       
  1089      CleanupStack::PushL(variantMap);
       
  1090      
       
  1091      TInt dialogIdx = TBluetoothDialogParams::EInformationDialog;
       
  1092      AddParamL(TBluetoothDialogParams::EDialogType, (TAny*) &dialogIdx,
       
  1093              CHbSymbianVariant::EInt, *variantMap);
       
  1094      
       
  1095      AddParamL(TBluetoothDeviceDialog::EDeviceName, (TAny*) &iRemoteDeviceName,
       
  1096              CHbSymbianVariant::EDes, *variantMap);
       
  1097      
       
  1098      TInt dialogTitleIdx = TBluetoothDialogParams::ERecvFailed;
       
  1099      AddParamL(TBluetoothDialogParams::EDialogTitle, (TAny*) &dialogTitleIdx,
       
  1100              CHbSymbianVariant::EInt, *variantMap);
       
  1101      
       
  1102      TUint32 deviceClass = iResultArray->At(0)->DeviceClass().DeviceClass();
       
  1103      AddParamL(TBluetoothDeviceDialog::EDeviceClass, (TAny*) &deviceClass,
       
  1104              CHbSymbianVariant::EInt, *variantMap);
       
  1105      
       
  1106      iFailureDialog->Show( KBTDevDialogId(), *variantMap );
       
  1107      CleanupStack::PopAndDestroy(variantMap);
       
  1108      
       
  1109      iReceivingFailed = EFalse;
       
  1110      }
  1098  
  1111  
  1099 //////////////////////////// Global part ////////////////////////////
  1112  void CBIPController::LaunchMemoryFullDialogL(TInt aDrive)
       
  1113      {
       
  1114      if(iMemoryFullDailog)
       
  1115          {
       
  1116          iMemoryFullDailog->Cancel();
       
  1117          delete iMemoryFullDailog;
       
  1118          iMemoryFullDailog = NULL;
       
  1119          }
       
  1120 
       
  1121      iMemoryFullDailog = CHbDeviceDialogSymbian::NewL();
       
  1122      
       
  1123      CHbSymbianVariantMap* variantMap = CHbSymbianVariantMap::NewL();
       
  1124      CleanupStack::PushL(variantMap);
       
  1125      
       
  1126      TInt dialogIdx = TBluetoothDialogParams::EInformationDialog;
       
  1127      AddParamL(TBluetoothDialogParams::EDialogType, (TAny*) &dialogIdx,
       
  1128              CHbSymbianVariant::EInt, *variantMap);
       
  1129      
       
  1130      TInt dialogTitleIdx = TBluetoothDialogParams::EMemoryFull;
       
  1131      AddParamL(TBluetoothDialogParams::EDialogTitle, (TAny*) &dialogTitleIdx,
       
  1132              CHbSymbianVariant::EInt, *variantMap);
       
  1133      
       
  1134      TChar driveLetter;
       
  1135      iFs.DriveToChar(aDrive, driveLetter);
       
  1136      AddParamL(TBluetoothDeviceDialog::EDriveLetter, (TAny*) &driveLetter,
       
  1137              CHbSymbianVariant::EChar, *variantMap);
       
  1138      
       
  1139      TVolumeInfo volumeInfo;
       
  1140      iFs.Volume(volumeInfo, aDrive);
       
  1141      AddParamL(TBluetoothDeviceDialog::EDriveName, (TAny*) &(volumeInfo.iName),
       
  1142              CHbSymbianVariant::EDes, *variantMap);
       
  1143      
       
  1144      iMemoryFullDailog->Show( KBTDevDialogId(), *variantMap );
       
  1145      CleanupStack::PopAndDestroy(variantMap);
       
  1146      }
       
  1147 
       
  1148  void CBIPController::AddParamL(const TInt aKey, const TAny* aValue, 
       
  1149          CHbSymbianVariant::TType aValueType,  CHbSymbianVariantMap& aVariantMap)
       
  1150      {
       
  1151      //Prepare the key
       
  1152      TBuf<KMinStringSize> key;
       
  1153      key.Num(aKey);
       
  1154      
       
  1155      //Prepare the value
       
  1156      CHbSymbianVariant* value = CHbSymbianVariant::NewL( aValue, aValueType );
       
  1157      CleanupStack::PushL(value);
       
  1158      
       
  1159      //add the key-value pair to the variant map
       
  1160      User::LeaveIfError(aVariantMap.Add(key, value));
       
  1161      
       
  1162      CleanupStack::Pop(value);
       
  1163      }
       
  1164  
       
  1165  //////////////////////////// Global part ////////////////////////////
  1100 
  1166 
  1101 //  End of File
  1167 //  End of File