localconnectivityservice/obexreceiveservices/mtmuiinfrared/src/irmtmui.cpp
branchRCL_3
changeset 39 4096754ee773
parent 38 3dcb815346df
child 40 52a167391590
equal deleted inserted replaced
38:3dcb815346df 39:4096754ee773
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     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 *      CIrMtmui class
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "irmtmui.h"
       
    23 #include "debug.h"
       
    24 
       
    25 #include <MuiuMsvProgressReporterOperation.h>
       
    26 #include <ircmtm.h>
       
    27 #include <mtmuidef.hrh>
       
    28 #include <mtclreg.h>
       
    29 #include <obexutilsuilayer.h>
       
    30 #include <Obexutils.rsg>
       
    31 #include <msvuids.h>
       
    32 #include <msvids.h>
       
    33 #include <obexconstants.h>
       
    34 #include <btnotif.h>        	// Notifier UID's
       
    35 #include <aknnotewrappers.h> 	//For notifier
       
    36 #include <featmgr.h>
       
    37 #include <SecondaryDisplay/obexutilssecondarydisplayapi.h>
       
    38 
       
    39 const TInt KIrMtmUiConnectionTimeout     = 20000000;
       
    40 const TInt KIrMtmUiReceiveTimeout        = 0;
       
    41 
       
    42 // ================= MEMBER FUNCTIONS =======================
       
    43 
       
    44 // C++ default constructor can NOT contain any code, that
       
    45 // might leave.
       
    46 //
       
    47 CIrMtmUi::CIrMtmUi(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll)
       
    48     :   CBaseMtmUi(aBaseMtm, aRegisteredMtmDll)
       
    49     {
       
    50     }
       
    51 
       
    52 // Two-phased constructor.
       
    53 CIrMtmUi* CIrMtmUi::NewL(
       
    54     CBaseMtm& aBaseMtm, 
       
    55     CRegisteredMtmDll& aRegisteredMtmDll)
       
    56     {
       
    57     CIrMtmUi* self=new(ELeave) CIrMtmUi(aBaseMtm, aRegisteredMtmDll);
       
    58     CleanupStack::PushL(self);
       
    59     self->ConstructL();
       
    60     CleanupStack::Pop(self);
       
    61     return self;
       
    62     }
       
    63 
       
    64 // Destructor
       
    65 CIrMtmUi::~CIrMtmUi()
       
    66     {
       
    67     delete iClientRegistry;
       
    68     }
       
    69 
       
    70 
       
    71 // Symbian OS default constructor can leave.
       
    72 void CIrMtmUi::ConstructL()
       
    73     {
       
    74     // --- Make sure base class correctly constructed ---
       
    75     CBaseMtmUi::ConstructL();
       
    76     TObexUtilsUiLayer::ReadResourceL( iConnectingText, R_IR_CONNECTING );
       
    77     TObexUtilsUiLayer::ReadResourceL( iSendingText, R_IR_SENDING_DATA );
       
    78     iCurrentlySending = EFalse;
       
    79     }
       
    80 
       
    81 // ---------------------------------------------------------
       
    82 // GetResourceFileName(...)
       
    83 // return progress status.
       
    84 // ---------------------------------------------------------
       
    85 //
       
    86 void CIrMtmUi::GetResourceFileName( TFileName& aFileName ) const
       
    87     { 
       
    88     FLOG( _L( "[CIrMtmUi] CIrMtmUi: GetResourceFileName\t" ) );
       
    89     aFileName = KObexUtilsFileDrive;
       
    90     aFileName += KDC_RESOURCE_FILES_DIR;
       
    91     aFileName += KObexUtilsResourceFileName;
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------
       
    95 // QueryCapability(TUid aCapability, TInt& aResponse)
       
    96 // return capability of mtm.
       
    97 // ---------------------------------------------------------
       
    98 //
       
    99 TInt CIrMtmUi::QueryCapability(TUid aCapability, TInt& aResponse)
       
   100     {  // Querying of menu availablility is done in syni.
       
   101     FLOG( _L( "[IRU] CIrMtmUi: QueryCapability\t" ) );
       
   102     if (aCapability.iUid == KUidMsvMtmUiQueryCanPrintMsgValue)
       
   103         {
       
   104         aResponse=ETrue;
       
   105         return KErrNone;
       
   106         }
       
   107     return CBaseMtmUi::QueryCapability(aCapability, aResponse);
       
   108     }
       
   109 
       
   110 // ---------------------------------------------------------
       
   111 // InvokeSyncFunctionL(...)
       
   112 // Invoke sync -function from BaseMTM.
       
   113 // ---------------------------------------------------------
       
   114 //
       
   115 void CIrMtmUi::InvokeSyncFunctionL(
       
   116     TInt aFunctionId, 
       
   117     const CMsvEntrySelection& aSelection, 
       
   118     TDes8& aParameter)
       
   119     {
       
   120     FLOG( _L( "[IRU] CIrMtmUi: InvokeSyncFunctionL\t" ) );
       
   121     CBaseMtmUi::InvokeSyncFunctionL(aFunctionId, aSelection, aParameter);
       
   122     }
       
   123 
       
   124 
       
   125 // ---------------------------------------------------------
       
   126 // CreateL(...)
       
   127 // Entry creation forbidden.
       
   128 // ---------------------------------------------------------
       
   129 //
       
   130 CMsvOperation* CIrMtmUi::CreateL(
       
   131     const TMsvEntry& /*aEntry*/,
       
   132     CMsvEntry& /*aParent*/, 
       
   133     TRequestStatus& /*aStatus*/)
       
   134     {
       
   135     // Entries created through utility functions.
       
   136     User::Leave(KErrNotSupported);  
       
   137     return NULL;
       
   138     }
       
   139 
       
   140 
       
   141 // ---------------------------------------------------------
       
   142 // OpenL(TRequestStatus& aStatus)
       
   143 // handles opening entry.
       
   144 // ---------------------------------------------------------
       
   145 //
       
   146 CMsvOperation* CIrMtmUi::OpenL(TRequestStatus& aStatus)
       
   147     {
       
   148     FLOG( _L( "[IRU] CIrMtmUi: OpenL\t" ) );
       
   149     const TMsvEntry& context=iBaseMtm.Entry().Entry();
       
   150     const TUid type(context.iType);
       
   151 
       
   152     if ( (type==KUidMsvMessageEntry) &&  
       
   153          ((context.Parent()==KMsvSentEntryIdValue)
       
   154          ||(context.Parent()==KMsvGlobalInBoxIndexEntryIdValue))
       
   155        )
       
   156         {
       
   157         // Message is in the sent folder, so can't be edited
       
   158         return ViewL(aStatus);
       
   159         }
       
   160 
       
   161     return EditL(aStatus);
       
   162     }
       
   163 
       
   164 // ---------------------------------------------------------
       
   165 // OpenL(...)
       
   166 // handles opening entry using selection.
       
   167 // ---------------------------------------------------------
       
   168 //
       
   169 CMsvOperation* CIrMtmUi::OpenL(
       
   170     TRequestStatus& aStatus, 
       
   171     const CMsvEntrySelection& aSelection)
       
   172     {
       
   173     iBaseMtm.Entry().SetEntryL(aSelection.At(0));
       
   174     return OpenL(aStatus);
       
   175     }
       
   176 
       
   177 // ---------------------------------------------------------
       
   178 // CloseL(TRequestStatus& aStatus)
       
   179 // Closes entry.
       
   180 // ---------------------------------------------------------
       
   181 //
       
   182 CMsvOperation* CIrMtmUi::CloseL(TRequestStatus& aStatus)
       
   183     {
       
   184     FLOG( _L( "[IRU] CIrMtmUi: CloseL\t" ) );
       
   185     CMsvCompletedOperation* op=CMsvCompletedOperation::NewL(
       
   186         Session(), 
       
   187         Type(), 
       
   188         KNullDesC8, 
       
   189         KMsvLocalServiceIndexEntryId, 
       
   190         aStatus);
       
   191     return op;
       
   192     }
       
   193 
       
   194 // ---------------------------------------------------------
       
   195 // CloseL(TRequestStatus& aStatus)
       
   196 // Closes entry using selection.
       
   197 // ---------------------------------------------------------
       
   198 //
       
   199 CMsvOperation* CIrMtmUi::CloseL(
       
   200     TRequestStatus& aStatus, 
       
   201     const CMsvEntrySelection& aSelection)
       
   202     {
       
   203     iBaseMtm.Entry().SetEntryL(aSelection.At(0));
       
   204     return CloseL(aStatus);
       
   205     }
       
   206 
       
   207 // ---------------------------------------------------------
       
   208 // EditL(TRequestStatus& aStatus)
       
   209 // Handles message sending.
       
   210 // ---------------------------------------------------------
       
   211 //
       
   212 CMsvOperation* CIrMtmUi::EditL(TRequestStatus& aStatus)
       
   213     {
       
   214     FLOG( _L( "[IRU] CIrMtmUi: EditL\t" ) );
       
   215     switch( iBaseMtm.Entry().Entry().iType.iUid )
       
   216         {
       
   217         case KUidMsvMessageEntryValue:
       
   218             {
       
   219             if( iBaseMtm.Entry().Entry().Parent() != KMsvDraftEntryId &&
       
   220                iBaseMtm.Entry().Entry().Parent() != KMsvGlobalOutBoxIndexEntryId )
       
   221                 {
       
   222                 //   Edit/"use" entries in the Inbox
       
   223                 return LaunchEditorApplicationL( aStatus, iBaseMtm.Entry().Session() );
       
   224                 }
       
   225             else
       
   226                 {
       
   227                 FeatureManager::InitializeLibL();                    	
       
   228                 if(!FeatureManager::FeatureSupported(KFeatureIdIrda))
       
   229     			    {
       
   230    					FLOG(_L("[IRSS]\t FeatMgr doesn't find IrDA, show not_supported "));
       
   231 	    			RNotifier notifier;    
       
   232 	    			User::LeaveIfError( notifier.Connect() );
       
   233 					TBTGenericInfoNotiferParamsPckg paramsPckg;
       
   234 					paramsPckg().iMessageType=EIRNotSupported;		
       
   235 		            TInt status = notifier.StartNotifier(KBTGenericInfoNotifierUid, paramsPckg);
       
   236 	                if ( status != KErrNone )
       
   237 	                    {
       
   238 	                    FTRACE(FPrint(_L("[IRSS]\t void CIrMtmUi::EditL()  ERROR: StartNotifier() failed. Code: %d "), status));
       
   239 	                    }	    
       
   240 	                notifier.Close();    	
       
   241 	                User::Leave(KErrNone);
       
   242     	            }    	
       
   243     		    FeatureManager::UnInitializeLib();
       
   244                 CIrClientMtm::STimeouts timeouts;
       
   245                 timeouts.iConnectTimeout = KIrMtmUiConnectionTimeout;
       
   246                 timeouts.iPutTimeout     = KIrMtmUiReceiveTimeout;
       
   247 
       
   248                 TPckgBuf<CIrClientMtm::STimeouts> timeoutBuf( timeouts );
       
   249 
       
   250                 CMsvEntrySelection* sel = new( ELeave ) CMsvEntrySelection();
       
   251                 CleanupStack::PushL( sel );
       
   252 
       
   253                 sel->AppendL( BaseMtm().Entry().EntryId() );
       
   254 
       
   255                 CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
       
   256 
       
   257                 TBuf<KObexUtilsMaxCharToFromField> toFrom;
       
   258                 TInt resourceId = R_IR_SEND_OUTBOX_SENDING;
       
   259                 TObexUtilsUiLayer::ReadResourceL( toFrom, resourceId );
       
   260 
       
   261                 TMsvEntry newTEntry( iBaseMtm.Entry().Entry() );
       
   262                 newTEntry.iDetails.Set( toFrom );
       
   263                 newTEntry.SetVisible( ETrue );
       
   264                 newTEntry.SetInPreparation( ETrue );
       
   265 
       
   266                 iBaseMtm.Entry().ChangeL( newTEntry );
       
   267 
       
   268                 CMsvEntry* entry = 
       
   269                     BaseMtm().Session().GetEntryL( KMsvDraftEntryId );
       
   270 
       
   271                 CleanupStack::PushL( entry );
       
   272 
       
   273                 CMsvOperation* moveOp = entry->MoveL(
       
   274                     *sel, 
       
   275                     KMsvGlobalOutBoxIndexEntryId, 
       
   276                     waiter->iStatus );
       
   277 
       
   278                 CleanupStack::PopAndDestroy(entry);
       
   279                 
       
   280                 waiter->Start();
       
   281                 CActiveScheduler::Start();
       
   282                 delete moveOp;
       
   283 
       
   284                 CleanupStack::PopAndDestroy(waiter);
       
   285 
       
   286                 TInt dialogIndex =((R_IR_SENDING_DATA & KResourceNumberMask) - KFirstResourceOffset) + KEnumStart;
       
   287                 CMsvProgressReporterOperation* reporter = 
       
   288                     CMsvProgressReporterOperation::NewL( Session(), aStatus, dialogIndex, KObexUtilsCategory);
       
   289                 CleanupStack::PushL( reporter );
       
   290 
       
   291                 CMsvOperation* op = BaseMtm().InvokeAsyncFunctionL(
       
   292                     CIrClientMtm::EIrcCmdSend, 
       
   293                     *sel, 
       
   294                     timeoutBuf, 
       
   295                     reporter->RequestStatus() );
       
   296 
       
   297                 // ownership of op transfered to reporter
       
   298                 reporter->SetOperationL( op ); 
       
   299                 reporter->SetTitleL(iConnectingText);
       
   300                 aStatus = KRequestPending;
       
   301                 
       
   302                 CleanupStack::Pop(reporter);
       
   303                 CleanupStack::PopAndDestroy(sel);
       
   304                 // ownership of reporter transfered to caller
       
   305                 return reporter; 
       
   306                 }
       
   307             }
       
   308         case KUidMsvServiceEntryValue:
       
   309         case KUidMsvAttachmentEntryValue:
       
   310         case KUidMsvFolderEntryValue:
       
   311             {
       
   312             User::Leave( KErrNotSupported );
       
   313             break;
       
   314             }
       
   315         default:
       
   316             {
       
   317             break;
       
   318             }
       
   319         }
       
   320 
       
   321     CMsvCompletedOperation* op = CMsvCompletedOperation::NewL(
       
   322         Session(), 
       
   323         Type(), 
       
   324         KNullDesC8, 
       
   325         KMsvLocalServiceIndexEntryId, 
       
   326         aStatus );
       
   327     FLOG( _L( "[IrMtmUi] CIrMtmUi: EditL Done\t" ) );
       
   328     
       
   329     aStatus = KRequestPending;
       
   330     return op;
       
   331     }
       
   332 
       
   333 // ---------------------------------------------------------
       
   334 // EditL(...)
       
   335 // Handles message sending using selection.
       
   336 // ---------------------------------------------------------
       
   337 //
       
   338 CMsvOperation* CIrMtmUi::EditL( TRequestStatus& aStatus, 
       
   339                                const CMsvEntrySelection& aSelection)
       
   340     {
       
   341     iBaseMtm.Entry().SetEntryL( aSelection.At(0) );
       
   342     return EditL( aStatus );
       
   343     }
       
   344 
       
   345 // ---------------------------------------------------------
       
   346 // ViewL(TRequestStatus& aStatus)
       
   347 // Handles viewing of received object.
       
   348 // ---------------------------------------------------------
       
   349 //
       
   350 CMsvOperation* CIrMtmUi::ViewL( TRequestStatus& aStatus )
       
   351     {
       
   352     FLOG( _L( "[IRU] CIrMtmUi: ViewL\t" ) );
       
   353     return LaunchEditorApplicationL(aStatus, iBaseMtm.Entry().Session());
       
   354     }
       
   355 
       
   356 // ---------------------------------------------------------
       
   357 // ViewL(...)
       
   358 // Handles viewing of received object using selection.
       
   359 // ---------------------------------------------------------
       
   360 //
       
   361 CMsvOperation* CIrMtmUi::ViewL( TRequestStatus& aStatus, 
       
   362                                const CMsvEntrySelection& aSelection )
       
   363     {
       
   364     iBaseMtm.Entry().SetEntryL(aSelection.At(0));
       
   365     return ViewL(aStatus);
       
   366     }
       
   367 
       
   368 // ---------------------------------------------------------
       
   369 // CopyFromL(...)
       
   370 // Not supported.
       
   371 // ---------------------------------------------------------
       
   372 //
       
   373 CMsvOperation* CIrMtmUi::CopyFromL( const CMsvEntrySelection& /*aSelection*/, 
       
   374                                    TMsvId /*aTargetId*/, 
       
   375                                    TRequestStatus& /*aStatus*/)
       
   376     {
       
   377     User::Leave(KErrNotSupported);
       
   378     return NULL;
       
   379     }
       
   380 
       
   381 // ---------------------------------------------------------
       
   382 // MoveFromL(...)
       
   383 // Not supported.
       
   384 // ---------------------------------------------------------
       
   385 //
       
   386 CMsvOperation* CIrMtmUi::MoveFromL( const CMsvEntrySelection& /*aSelection*/, 
       
   387                                    TMsvId /*aTargetId*/, 
       
   388                                    TRequestStatus& /*aStatus*/)
       
   389     {
       
   390     User::Leave(KErrNotSupported);
       
   391     return NULL;
       
   392     }
       
   393 
       
   394 // ---------------------------------------------------------
       
   395 // MoveToL(...)
       
   396 // Not supported.
       
   397 // ---------------------------------------------------------
       
   398 //
       
   399 CMsvOperation* CIrMtmUi::MoveToL( const CMsvEntrySelection& /*aSelection*/, 
       
   400                                  TRequestStatus& /*aStatus*/)
       
   401     {
       
   402     User::Leave(KErrNotSupported);
       
   403     return NULL;
       
   404     }
       
   405 
       
   406 // ---------------------------------------------------------
       
   407 // CopyToL(...)
       
   408 // Not supported.
       
   409 // ---------------------------------------------------------
       
   410 //
       
   411 CMsvOperation* CIrMtmUi::CopyToL( const CMsvEntrySelection& /*aSelection*/, 
       
   412                                  TRequestStatus& /*aStatus*/ )
       
   413     {
       
   414     User::Leave(KErrNotSupported);
       
   415     return NULL;
       
   416     }
       
   417 
       
   418 // ---------------------------------------------------------
       
   419 // DisplayProgressSummary(const TDesC8& aProgress) const
       
   420 // calls leaving DisplayProgressSummaryL -function and
       
   421 // traps the error.
       
   422 // ---------------------------------------------------------
       
   423 //
       
   424 TInt CIrMtmUi::DisplayProgressSummary( const TDesC8& aProgress ) const
       
   425     {
       
   426     FLOG( _L( "[IRU] CIrMtmUi: DisplayProgressSummary\t" ) );
       
   427     TInt retVal = KErrNone;
       
   428     TRAP( retVal, retVal = DisplayProgressSummaryL( aProgress ) );
       
   429     return retVal;
       
   430     }
       
   431 
       
   432 // ---------------------------------------------------------
       
   433 // TInt CIrMtmUi::DisplayProgressSummaryL(const TDesC8& aProgress) const
       
   434 // Shows connection summary.
       
   435 // ---------------------------------------------------------
       
   436 //
       
   437 TInt CIrMtmUi::DisplayProgressSummaryL( const TDesC8& aProgress ) const
       
   438     {
       
   439     FLOG( _L( "[IRU] CIrMtmUi: DisplayProgressSummaryL\t" ) );
       
   440     TInt resourceId;
       
   441     if( ( !aProgress.Length() ) || 
       
   442          ( aProgress.Size() == sizeof( TMsvLocalOperationProgress ) ) )
       
   443         {
       
   444         // Probably a CMsvCompletedOperation
       
   445         return KErrCancel;
       
   446         }
       
   447     TPckgBuf<TObexMtmProgress> paramPack;
       
   448     paramPack.Copy( aProgress );
       
   449     TObexMtmProgress& progress = paramPack();
       
   450 
       
   451     const TObexMtmProgress::TSendState progressType = progress.iSendState;
       
   452     const TInt error = progress.iError;
       
   453 
       
   454     if( error == KErrInUse )
       
   455         {
       
   456         resourceId = R_IR_CANNOT_ESTABLISH;
       
   457         TObexUtilsUiLayer::ShowInformationNoteL( resourceId );
       
   458         return KErrNone;
       
   459         }
       
   460 
       
   461     switch( progressType )
       
   462         {
       
   463         case TObexMtmProgress::EDisconnected:
       
   464             {
       
   465             // Allowed to send again.
       
   466             CONST_CAST( CIrMtmUi*, this )->iCurrentlySending = EFalse;
       
   467             resourceId = R_IR_DATA_SENT;
       
   468             TObexUtilsUiLayer::ShowInformationNoteL( resourceId );
       
   469             break;
       
   470             }
       
   471         case TObexMtmProgress::ESendError:
       
   472             {
       
   473             if( error == KErrIrObexClientNoDevicesFound )
       
   474                 {
       
   475                 resourceId = R_IR_CANNOT_ESTABLISH;
       
   476                 TObexUtilsUiLayer::ShowInformationNoteL( resourceId );
       
   477                 }
       
   478             else
       
   479                 {
       
   480                 resourceId = R_IR_SENDING_FAILED;
       
   481                 TObexUtilsUiLayer::ShowErrorNoteL( resourceId );
       
   482                 }
       
   483             break;
       
   484             }
       
   485         case TObexMtmProgress::ESendComplete:
       
   486             {
       
   487             break;
       
   488             }
       
   489         case TObexMtmProgress::EInitialise:
       
   490         case TObexMtmProgress::EConnect:
       
   491         case TObexMtmProgress::EConnectAttemptComplete:
       
   492         case TObexMtmProgress::ESendObject:
       
   493         case TObexMtmProgress::ESendNextObject:
       
   494             {
       
   495             return KErrCancel;
       
   496             }
       
   497         case TObexMtmProgress::EUserCancelled:
       
   498             {
       
   499             return KErrCancel;
       
   500             }
       
   501         default:
       
   502             {
       
   503             return KErrCancel;
       
   504             }
       
   505         }
       
   506     FLOG( _L( "[IRU] CIrMtmUi: DisplayProgressSummaryL Done\t" ) );
       
   507     return KErrNone;
       
   508     }
       
   509 
       
   510 // ---------------------------------------------------------
       
   511 // GetProgress(...)
       
   512 // return progress status.
       
   513 // ---------------------------------------------------------
       
   514 //
       
   515 TInt CIrMtmUi::GetProgress( const TDesC8& aProgress,
       
   516                            TBuf<EProgressStringMaxLen>& aReturnString, 
       
   517                            TInt& aTotalEntryCount, 
       
   518                            TInt& aEntriesDone,
       
   519                            TInt& aCurrentEntrySize, 
       
   520                            TInt& aCurrentBytesTrans ) const
       
   521     {
       
   522     FLOG( _L( "[CIrMtmUi] CIrMtmUi: GetProgress\t" ) );
       
   523     TPckgBuf<TObexMtmProgress> paramPack;
       
   524     paramPack.Copy( aProgress );
       
   525     TObexMtmProgress& progress = paramPack();
       
   526     const TObexMtmProgress::TSendState progressType = progress.iSendState;
       
   527     aTotalEntryCount    = progress.iTotalEntryCount;
       
   528     aEntriesDone        = progress.iEntriesDone;
       
   529     aCurrentEntrySize   = progress.iCurrentEntrySize; 
       
   530     aCurrentBytesTrans  = progress.iCurrentBytesTrans;
       
   531 
       
   532     if( aTotalEntryCount > 1 ) // This is for progress bar multisending
       
   533         {
       
   534         aCurrentEntrySize = 0;
       
   535         }
       
   536     switch( progressType )
       
   537         {
       
   538         case TObexMtmProgress::ENullOp:
       
   539         case TObexMtmProgress::ESendError:
       
   540             {
       
   541             aReturnString = KNullDesC;
       
   542             break;
       
   543             }
       
   544         case TObexMtmProgress::EInitialise:
       
   545         case TObexMtmProgress::EConnect:
       
   546         case TObexMtmProgress::EConnectAttemptComplete:
       
   547             {
       
   548             aReturnString = iConnectingText;
       
   549             break;
       
   550             }
       
   551         case TObexMtmProgress::ESendObject:
       
   552         case TObexMtmProgress::ESendNextObject:
       
   553         case TObexMtmProgress::ESendComplete:
       
   554             {
       
   555             aReturnString = iSendingText;
       
   556             break;
       
   557             }
       
   558         case TObexMtmProgress::EDisconnected:
       
   559             {
       
   560             break;
       
   561             }
       
   562         default:
       
   563             {
       
   564             return KErrCancel;
       
   565             }
       
   566         }
       
   567     FLOG( _L( "[CBtMtmUi] CBtMtmUi: GetProgress Done\t" ) );
       
   568     return KErrNone;
       
   569     }
       
   570 
       
   571 // ---------------------------------------------------------
       
   572 // LaunchEditorApplicationL(...)
       
   573 // Launch viewer for selected object. The first is object's 
       
   574 // recognition(document handler).
       
   575 // ---------------------------------------------------------
       
   576 //
       
   577 CMsvOperation* CIrMtmUi::LaunchEditorApplicationL( TRequestStatus& aStatus,
       
   578                                                   CMsvSession& aSession)
       
   579     {
       
   580 	FLOG( _L( "[CIrMtmUi] CIrMtmUi: LaunchEditorApplicationL\t" ) );
       
   581 	CMsvEntry* message;
       
   582 	message = &iBaseMtm.Entry();    
       
   583 	return TObexUtilsUiLayer::LaunchEditorApplicationOperationL( aSession, message, aStatus );
       
   584     }
       
   585 
       
   586 
       
   587 // ---------------------------------------------------------
       
   588 // GetClientMtmLC(TUid aMtmType)
       
   589 // Handles MTM registration.
       
   590 // ---------------------------------------------------------
       
   591 //
       
   592 CBaseMtm* CIrMtmUi::GetClientMtmLC( TUid aMtmType )
       
   593     {
       
   594     if (!iClientRegistry)
       
   595         {
       
   596         iClientRegistry = CClientMtmRegistry::NewL( Session() );
       
   597         }
       
   598     CBaseMtm* mtm=iClientRegistry->NewMtmL( aMtmType );
       
   599     CleanupStack::PushL( mtm );
       
   600     return mtm;
       
   601     }
       
   602 
       
   603 // ---------------------------------------------------------
       
   604 // DeleteFromL(TUid aMtmType)
       
   605 // passes entry selection to Base for deletion.
       
   606 // ---------------------------------------------------------
       
   607 //
       
   608 CMsvOperation* CIrMtmUi::DeleteFromL( const CMsvEntrySelection& aSelection, 
       
   609                                      TRequestStatus& aStatus)
       
   610 
       
   611     {
       
   612     return CBaseMtmUi::DeleteFromL(aSelection, aStatus);
       
   613     }
       
   614 
       
   615 // ---------------------------------------------------------
       
   616 // DeleteServiceL(...)
       
   617 // IR has no service, just complete it.
       
   618 // ---------------------------------------------------------
       
   619 //
       
   620 CMsvOperation* CIrMtmUi::DeleteServiceL( const TMsvEntry& /*aService*/, 
       
   621                                         TRequestStatus& aStatus)
       
   622 
       
   623     {
       
   624     return CMsvCompletedOperation::NewL(
       
   625         Session(), 
       
   626         Type(), 
       
   627         KNullDesC8, 
       
   628         KMsvLocalServiceIndexEntryId, 
       
   629         aStatus);
       
   630     }
       
   631 
       
   632 // ---------------------------------------------------------
       
   633 // ReplyL(...)
       
   634 // Reply is forbidden.
       
   635 // ---------------------------------------------------------
       
   636 //
       
   637 CMsvOperation* CIrMtmUi::ReplyL( TMsvId /*aDestination*/, 
       
   638                                 TMsvPartList /*aPartlist*/, 
       
   639                                 TRequestStatus& /*aCompletionStatus*/)
       
   640     {
       
   641     User::Leave(KErrNotSupported);
       
   642     // Return value is needed for removing compilation errors
       
   643     return NULL;
       
   644     }
       
   645 
       
   646 // ---------------------------------------------------------
       
   647 // ForwardL(...)
       
   648 // Forward is forbidden.
       
   649 // ---------------------------------------------------------
       
   650 //
       
   651 CMsvOperation* CIrMtmUi::ForwardL( TMsvId /*aDestination*/, 
       
   652                                   TMsvPartList /*aPartList*/, 
       
   653                                   TRequestStatus& /*aCompletionStatus*/ )
       
   654     {
       
   655     User::Leave(KErrNotSupported);
       
   656     // Return value is needed for removing compilation errors
       
   657     return NULL;
       
   658     }
       
   659 
       
   660 // ---------------------------------------------------------
       
   661 // CancelL(...)
       
   662 // No MS way of sending a message from the outbox, so no need to cancel.
       
   663 // Just complete it.
       
   664 // ---------------------------------------------------------
       
   665 //
       
   666 CMsvOperation* CIrMtmUi::CancelL( TRequestStatus& aStatus, 
       
   667                                  const CMsvEntrySelection& /*aSelection*/ )
       
   668     { 
       
   669     return CMsvCompletedOperation::NewL(
       
   670         Session(), 
       
   671         Type(), 
       
   672         KNullDesC8, 
       
   673         KMsvLocalServiceIndexEntryId, 
       
   674         aStatus, 
       
   675         KErrNone);
       
   676     }
       
   677 
       
   678 // End of File