localconnectivityservice/obexreceiveservices/bip/src/BIPController.cpp
changeset 25 c4f07256ff37
parent 0 c3e98f10fcf4
child 5 11d83199e2d9
child 13 0feebc799606
equal deleted inserted replaced
0:c3e98f10fcf4 25:c4f07256ff37
   189         }
   189         }
   190     
   190     
   191     iFile = RFile();
   191     iFile = RFile();
   192     iFullPathFilename.Zero();
   192     iFullPathFilename.Zero();
   193     iCapabilityFileName.Zero();
   193     iCapabilityFileName.Zero();
   194     iMsvIdArray.Reset(); 
       
   195     }
   194     }
   196 
   195 
   197 // ---------------------------------------------------------
   196 // ---------------------------------------------------------
   198 // ObexConnectIndication()
   197 // ObexConnectIndication()
   199 // ---------------------------------------------------------
   198 // ---------------------------------------------------------
   234 // ---------------------------------------------------------
   233 // ---------------------------------------------------------
   235 //
   234 //
   236 void CBIPController::TransportDownIndication()
   235 void CBIPController::TransportDownIndication()
   237     {
   236     {
   238     TRACE_FUNC   
   237     TRACE_FUNC   
   239     TRAP_IGNORE(ShowFileReceivedQueryL());
   238     // Remove receiving buffer and files used during file receiving.
       
   239     //
       
   240     delete iBTObject;
       
   241     iBTObject = NULL;
       
   242     TRAP_IGNORE(TObexUtilsMessageHandler::RemoveTemporaryRFileL (iFullPathFilename));  
   240     iFs.Close();
   243     iFs.Close();
   241     }
   244     }
   242 
   245 
   243 // ---------------------------------------------------------
   246 // ---------------------------------------------------------
   244 // PutRequestIndication()
   247 // PutRequestIndication()
   564                                                                    iFullPathFilename,
   567                                                                    iFullPathFilename,
   565                                                                    iFile,
   568                                                                    iFile,
   566                                                                    iRemoteDeviceName));
   569                                                                    iRemoteDeviceName));
   567     if ( retVal == KErrNone)
   570     if ( retVal == KErrNone)
   568         {
   571         {
   569         TRAP (retVal, TObexUtilsMessageHandler::AddEntryToInboxL(iMsvIdParent, iFullPathFilename, &iMsvIdArray));
   572         TRAP (retVal, TObexUtilsMessageHandler::AddEntryToInboxL(iMsvIdParent, iFullPathFilename));
   570         }
   573         }
   571     
   574     
   572     
   575     
   573     if( retVal != KErrNone )
   576     if( retVal != KErrNone )
   574         {
   577         {
   804         iWaitDialog->ProcessFinished();
   807         iWaitDialog->ProcessFinished();
   805         delete iWaitDialog;
   808         delete iWaitDialog;
   806         iWaitDialog = NULL;
   809         iWaitDialog = NULL;
   807         }
   810         }
   808     }
   811     }
   809  
       
   810  // ---------------------------------------------------------
       
   811  // ShowFileReceivedQuery()
       
   812  // ---------------------------------------------------------
       
   813  // 
       
   814  void CBIPController::ShowFileReceivedQueryL()
       
   815      {
       
   816      // Remove receiving buffer and files used during file receiving.
       
   817      //
       
   818     delete iBTObject;
       
   819     iBTObject = NULL;
       
   820     TObexUtilsMessageHandler::RemoveTemporaryRFileL (iFullPathFilename);    
       
   821     
       
   822     TInt fileCount = iMsvIdArray.Count();         
       
   823     if ( fileCount )
       
   824         {
       
   825         TBool answer = EFalse;        
       
   826         TInt resourceID = R_BT_SAVED_SINGLE;
       
   827         if( fileCount > 1)
       
   828             {
       
   829             resourceID = R_BT_SAVED_MULTIPLE;
       
   830             }
       
   831         answer = TObexUtilsUiLayer::ShowGlobalFileOpenConfirmationQueryL(resourceID, iDefaultFolder);
       
   832         
       
   833         TInt sortMethod = 2; // 0 = by name 1 = by type 2 = most recent file and 3 = largest file
       
   834         
       
   835         if ( answer && fileCount == 1 )  // User accepts the query
       
   836             {
       
   837             TRAPD( error,  TObexUtilsUiLayer::LaunchEditorApplicationL(iMsvIdArray[0]));
       
   838             if ( error != KErrNone )  // file is unsupported
       
   839                 {
       
   840                 TObexUtilsUiLayer::LaunchFileManagerL(iFullPathFilename,
       
   841                                                       sortMethod,
       
   842                                                       EFalse);  // EFalse -> start file manager in standalone mode
       
   843                 }
       
   844             }
       
   845         
       
   846         if ( answer && fileCount > 1 )
       
   847             {
       
   848             // we open the file manager at default folder
       
   849             //
       
   850             TObexUtilsUiLayer::LaunchFileManagerL(iFullPathFilename,
       
   851                                                       sortMethod,
       
   852                                                       EFalse);  // EFalse -> start file manager in standalone mode
       
   853             }
       
   854         iMsvIdArray.Reset();
       
   855         }
       
   856     }
       
   857  
       
   858  
   812  
   859  // ---------------------------------------------------------
   813  // ---------------------------------------------------------
   860  // GetDriveWithMaximumFreeSpace()
   814  // GetDriveWithMaximumFreeSpace()
   861  // ---------------------------------------------------------
   815  // ---------------------------------------------------------
   862  // 
   816  //