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