localconnectivityservice/obexreceiveservices/mtmuibluetooth/src/btmtmui.cpp
changeset 13 0feebc799606
parent 0 c3e98f10fcf4
equal deleted inserted replaced
1:388a17646e40 13:0feebc799606
    20 // INCLUDE FILES
    20 // INCLUDE FILES
    21 #include "btmtmui.h"
    21 #include "btmtmui.h"
    22 #include "btmtmuidebug.h"
    22 #include "btmtmuidebug.h"
    23 
    23 
    24 //#include <obexmtmuilayer.h>
    24 //#include <obexmtmuilayer.h>
       
    25 #ifdef NO101APPDEPFIXES
    25 #include <MuiuMsvProgressReporterOperation.h>
    26 #include <MuiuMsvProgressReporterOperation.h>
    26 #include <btcmtm.h>
    27 #endif  //NO101APPDEPFIXES
       
    28 
       
    29 #ifdef NO101APPDEPFIXES_NEW 
       
    30 #include <app/btcmtm.h>
       
    31 #endif //NO101APPDEPFIXES_NEW
       
    32 
    27 #include <mtmuidef.hrh>
    33 #include <mtmuidef.hrh>
    28 #include <mtclreg.h>
    34 #include <mtclreg.h>
    29 #include <obexutilsuilayer.h>
    35 #include <obexutilsuilayer.h>
    30 #include <obexutils.rsg>
    36 #include <Obexutils.rsg>
    31 #include <msvuids.h>
    37 #include <msvuids.h>
    32 #include <msvids.h>
    38 #include <msvids.h>
    33 #include <obexconstants.h>
    39 #include <obexconstants.h>
    34 
    40 
    35 
    41 
    36 // CONSTANTS
    42 // CONSTANTS
       
    43 #ifdef NO101APPDEPFIXES
    37 const TInt KBtMtmUiToFromFieldBuffer     = 80;
    44 const TInt KBtMtmUiToFromFieldBuffer     = 80;
    38 const TInt KBtMtmUiConnectionTimeout     = 20000000;
    45 const TInt KBtMtmUiConnectionTimeout     = 20000000;
    39 const TInt KBtMtmUiConnectionPutTimeout  = 0;
    46 const TInt KBtMtmUiConnectionPutTimeout  = 0;
    40 const TInt KBtMtmUiObexPort              = 1;
    47 const TInt KBtMtmUiObexPort              = 1;
    41 const TInt KBtMtmUiAddressMaxLength      = 3;
    48 const TInt KBtMtmUiAddressMaxLength      = 3;
       
    49 #endif  //NO101APPDEPFIXES
    42 
    50 
    43 // ENUMS
    51 // ENUMS
    44 enum TBtMtmAsyncCmds
    52 enum TBtMtmAsyncCmds
    45     {
    53     {
    46     EBtMtmCmdSend
    54     EBtMtmCmdSend
   221 // ---------------------------------------------------------
   229 // ---------------------------------------------------------
   222 //
   230 //
   223 CMsvOperation* CBtMtmUi::EditL( TRequestStatus& aStatus )
   231 CMsvOperation* CBtMtmUi::EditL( TRequestStatus& aStatus )
   224 	{
   232 	{
   225 	FLOG( _L( "[BtMtmUi] CBtMtmUi: EditL 2 \t" ) );
   233 	FLOG( _L( "[BtMtmUi] CBtMtmUi: EditL 2 \t" ) );
   226     TInt resourceId;
       
   227     TInt retVal=0;
       
   228 	switch( iBaseMtm.Entry().Entry().iType.iUid )
   234 	switch( iBaseMtm.Entry().Entry().iType.iUid )
   229 		{
   235 		{
   230 	    case KUidMsvMessageEntryValue:
   236 	    case KUidMsvMessageEntryValue:
   231 		    {
   237 		    {
   232 		    if( iBaseMtm.Entry().Entry().Parent() != KMsvDraftEntryId &&
   238 		    if( iBaseMtm.Entry().Entry().Parent() != KMsvDraftEntryId &&
   233 		       iBaseMtm.Entry().Entry().Parent() != KMsvGlobalOutBoxIndexEntryId )
   239 		       iBaseMtm.Entry().Entry().Parent() != KMsvGlobalOutBoxIndexEntryId )
   234 			    {
   240 			    {
   235 			    //   Edit/"use" entries in the Inbox
   241 			    //   Edit/"use" entries in the Inbox
   236 			    return LaunchEditorApplicationL( aStatus, iBaseMtm.Entry().Session() );   
   242 			    return LaunchEditorApplicationL( aStatus, iBaseMtm.Entry().Session() );   
   237 			    }
   243 			    }
       
   244 #ifdef NO101APPDEPFIXES
   238 		    else
   245 		    else
   239 			    {
   246 			    {
       
   247 			    TInt resourceId;
   240                 HBufC* password = HBufC::NewL(1);
   248                 HBufC* password = HBufC::NewL(1);
   241                 CleanupStack::PushL( password );  // 1st push
   249                 CleanupStack::PushL( password );  // 1st push
   242                 BaseMtm().LoadMessageL();
   250                 BaseMtm().LoadMessageL();
   243 
   251 
   244                 TBTDevAddr address;
   252                 TBTDevAddr address;
   252                 iDiscovery = CBTEngDiscovery::NewL(this);
   260                 iDiscovery = CBTEngDiscovery::NewL(this);
   253 				CBTDevice* iDevice = CBTDevice::NewL( );
   261 				CBTDevice* iDevice = CBTDevice::NewL( );
   254 				
   262 				
   255 
   263 
   256                 if ( iDiscovery->SearchRemoteDevice( iDevice ) == KErrNone )
   264                 if ( iDiscovery->SearchRemoteDevice( iDevice ) == KErrNone )
   257 				{ 
   265                     {
       
   266                     TInt retVal=0;
   258 				    iWaiter.Start();
   267 				    iWaiter.Start();
   259 				    
   268 				    
   260 				    if ( iState ==KErrNone)
   269 				    if ( iState ==KErrNone)
   261 				        {
   270 				        {
   262 					    address = iDevice->BDAddr();
   271 					    address = iDevice->BDAddr();
   361 
   370 
   362                 CleanupStack::Pop( reporter );
   371                 CleanupStack::Pop( reporter );
   363                 CleanupStack::PopAndDestroy(3);  // waiter, sel,  password
   372                 CleanupStack::PopAndDestroy(3);  // waiter, sel,  password
   364                 return reporter;
   373                 return reporter;
   365 			    }
   374 			    }
       
   375 #endif  //NO101APPDEPFIXES
   366 		    }
   376 		    }
   367 	    case KUidMsvServiceEntryValue:
   377 	    case KUidMsvServiceEntryValue:
   368 	    case KUidMsvAttachmentEntryValue:
   378 	    case KUidMsvAttachmentEntryValue:
   369 	    case KUidMsvFolderEntryValue:
   379 	    case KUidMsvFolderEntryValue:
   370             {
   380             {
   482 // calls leaving DisplayProgressSummaryL -function and
   492 // calls leaving DisplayProgressSummaryL -function and
   483 // traps the error.
   493 // traps the error.
   484 // ---------------------------------------------------------
   494 // ---------------------------------------------------------
   485 //
   495 //
   486 TInt CBtMtmUi::DisplayProgressSummaryL( const TDesC8& aProgress ) const
   496 TInt CBtMtmUi::DisplayProgressSummaryL( const TDesC8& aProgress ) const
   487 	{
   497     {
   488 	FLOG( _L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL\t" ) );
   498     #ifndef NO101APPDEPFIXES_NEW
       
   499     (void) aProgress;
       
   500     #endif //NO101APPDEPFIXES_NEW
       
   501 
       
   502     #ifdef NO101APPDEPFIXES_NEW
       
   503     FLOG( _L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL\t" ) );
   489     TInt resourceId;
   504     TInt resourceId;
   490     if( ( !aProgress.Length() ) || ( aProgress.Size() == sizeof( TMsvLocalOperationProgress ) ) )
   505     if( ( !aProgress.Length() ) || ( aProgress.Size() == sizeof( TMsvLocalOperationProgress ) ) )
   491         {
   506         {
   492         // Probably a CMsvCompletedOperation
   507         // Probably a CMsvCompletedOperation
   493         return KErrCancel;
   508         return KErrCancel;
   553             {
   568             {
   554             FTRACE( FPrint(_L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL: Default\t %d" ), progressType ) );
   569             FTRACE( FPrint(_L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL: Default\t %d" ), progressType ) );
   555             return KErrCancel;
   570             return KErrCancel;
   556             }
   571             }
   557         }
   572         }
       
   573   #endif //NO101APPDEPFIXES_NEW
   558 	return KErrNone;
   574 	return KErrNone;
   559 	}
   575 	}
   560 
   576 
   561 
   577 
   562 // ---------------------------------------------------------
   578 // ---------------------------------------------------------
   569                            TInt& aTotalEntryCount, 
   585                            TInt& aTotalEntryCount, 
   570                            TInt& aEntriesDone, 
   586                            TInt& aEntriesDone, 
   571                            TInt& aCurrentEntrySize, 
   587                            TInt& aCurrentEntrySize, 
   572                            TInt& aCurrentBytesTrans ) const
   588                            TInt& aCurrentBytesTrans ) const
   573 	{
   589 	{
   574     TInt resourceId;
   590 	#ifndef NO101APPDEPFIXES_NEW
   575 	FLOG( _L( "[CBtMtmUi] CBtMtmUi: GetProgress\t" ) );
   591 	(void) aProgress;
       
   592 	(void) aReturnString;
       
   593 	(void) aTotalEntryCount;
       
   594 	(void) aEntriesDone;
       
   595 	(void) aCurrentEntrySize;
       
   596 	(void) aCurrentBytesTrans;	
       
   597 	#endif //NO101APPDEPFIXES_NEW
       
   598 	
       
   599    #ifdef  NO101APPDEPFIXES_NEW
       
   600     TInt resourceId;    
       
   601 
       
   602 	FLOG( _L( "[CBtMtmUi] CBtMtmUi: GetProgress\t" ) );	
   576 	TPckgBuf<TObexMtmProgress> paramPack;
   603 	TPckgBuf<TObexMtmProgress> paramPack;
   577 	paramPack.Copy( aProgress );
   604 	paramPack.Copy( aProgress );
   578 	TObexMtmProgress& progress = paramPack();
   605 	TObexMtmProgress& progress = paramPack();
   579     const TObexMtmProgress::TSendState progressType	= progress.iSendState;
   606     const TObexMtmProgress::TSendState progressType	= progress.iSendState;
   580 	aTotalEntryCount	= progress.iTotalEntryCount;
   607 	aTotalEntryCount	= progress.iTotalEntryCount;
   623             {
   650             {
   624 		    return KErrCancel;
   651 		    return KErrCancel;
   625             }
   652             }
   626 		}
   653 		}
   627 	FLOG( _L( "[CBtMtmUi] CBtMtmUi: GetProgress Done\t" ) );
   654 	FLOG( _L( "[CBtMtmUi] CBtMtmUi: GetProgress Done\t" ) );
       
   655 	#endif //NO101APPDEPFIXES_NEW
   628 	return KErrNone;
   656 	return KErrNone;
   629 	}
   657 	}
   630 
   658 
   631 // ---------------------------------------------------------
   659 // ---------------------------------------------------------
   632 // LaunchEditorApplicationL(...)
   660 // LaunchEditorApplicationL(...)