mobilemessaging/smum/src/SMSI.CPP
changeset 0 72b543305e3a
child 17 caea42e26caa
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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: SMSI.CPP*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 // Standard includes
       
    21 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    22 #include <mtmuidsdef.hrh>
       
    23 #endif
       
    24 #include <mtmdef.h>     // MTM specific definitions for constants
       
    25 #include <eikon.rsg>    // Standard resources
       
    26 // Messaging includes
       
    27 #include <msvuids.h>    // Msv UIDs
       
    28 // Specific includes
       
    29 #include <MtmExtendedCapabilities.hrh>
       
    30 #include <SMUM.rsg>                     // for resource IDs
       
    31 #include <muiu.mbg>                     // bitmaps
       
    32 #include <avkon.rsg>                    // for resource IDs
       
    33 #include <StringLoader.h>               // stringloader
       
    34 #include "SMSI.H"                       
       
    35 #include "SMSU.HRH"                     // for KMtmUiFunctionSimDialog
       
    36 #include "smsui.pan"                    // for panics
       
    37 
       
    38 #include <AknUtils.h>
       
    39 #include <AknsUtils.h>
       
    40 #include <AknsConstants.h>//skinned icon ids
       
    41 #include <data_caging_path_literals.hrh>
       
    42 
       
    43 #include <csmsaccount.h>
       
    44 #include <centralrepository.h>
       
    45 #include <messaginginternalcrkeys.h>
       
    46 #include <smutset.h>                    // CSmsSettings
       
    47 
       
    48 
       
    49 //For logging
       
    50 #include "SmumLogging.h"
       
    51 
       
    52 //  LOCAL CONSTANTS AND MACROS
       
    53 const TInt KSmsViewerUid = 0x100058bd;
       
    54 const TInt KSmsiNumberOfZoomStates = 2; // Nothing to do with zoomstates, picture + mask = 2
       
    55 //const TUid KUidMsgTypeSMS = {0x1000102C};// already defined in <smut.h>
       
    56 const TInt KTBuf80Length=80;
       
    57 // Impossible for the next two figures to be accurate - sizes of messages
       
    58 // etc. depend greatly on the encoding/compression used on the message
       
    59 // Approximated to be 30 submessages long default 7 bit encoded sms.
       
    60 // Note : Rarely or newer used
       
    61 const TInt KSmsiMaxTotalMsgSize = 153 * 30;  
       
    62 
       
    63 _LIT(KSmsiResourceFile, "SMUM");
       
    64 // Correct path is added to literal when it is used.
       
    65 _LIT(KBitmapFile, "muiu.MBM");
       
    66 
       
    67 //  MEMBER FUNCTIONS
       
    68 
       
    69 // Factory constructor function
       
    70 CSmsMtmUiData* CSmsMtmUiData::NewL( CRegisteredMtmDll& aRegisteredDll )
       
    71     {
       
    72     SMUMLOGGER_ENTERFN("CSmsMtmUiData::NewL");
       
    73     CSmsMtmUiData* smsmtmuidata=new ( ELeave ) CSmsMtmUiData( aRegisteredDll );
       
    74     CleanupStack::PushL( smsmtmuidata );
       
    75     smsmtmuidata->ConstructL();
       
    76     CleanupStack::Pop();
       
    77     SMUMLOGGER_LEAVEFN("CSmsMtmUiData::NewL");
       
    78     return smsmtmuidata;
       
    79     }
       
    80 
       
    81 // C++ constructor can NOT contain any code, that
       
    82 // might leave.
       
    83 CSmsMtmUiData::CSmsMtmUiData( CRegisteredMtmDll& aRegisteredDll ):
       
    84     CBaseMtmUiData( aRegisteredDll )
       
    85     {
       
    86     }
       
    87 
       
    88 // Symbian OS default constructor can leave.
       
    89 void CSmsMtmUiData::ConstructL()
       
    90     {
       
    91     CBaseMtmUiData::ConstructL();
       
    92     //Initalize SMS Settings for the first time
       
    93     TInt timeStamp = 0;
       
    94     CSmsSettings* serviceSettings = CSmsSettings::NewL();
       
    95     CleanupStack::PushL( serviceSettings );
       
    96     CSmsAccount* smsAccount = CSmsAccount::NewLC();
       
    97     CRepository* cenRepSession = CRepository::NewLC( KCRUidSmum );
       
    98 
       
    99     if ( cenRepSession->Get( KSmumShowSMSCTimeStamp, timeStamp ) != KErrNone )
       
   100         {
       
   101         //In case of any error,set the default value to 0, so that device timestamp is used
       
   102         timeStamp = 0;
       
   103         SMUMLOGGER_WRITE("CSmsMtmUiData::ConstructL: cenRep get error");
       
   104         }
       
   105     SMUMLOGGER_WRITE_FORMAT("CSmsMtmUiData::ConstructL: cenRep timesatmp value:%d", timeStamp);
       
   106     smsAccount->LoadSettingsL( *serviceSettings );
       
   107     serviceSettings->SetUseServiceCenterTimeStampForDate(timeStamp);
       
   108 
       
   109     TRAPD( err, smsAccount->SaveSettingsL( *serviceSettings ) );
       
   110     if( err != KErrNone)
       
   111         {
       
   112         SMUMLOGGER_WRITE_FORMAT("CSmsMtmUiData::ConstructL: Settings saving error status: %d", err);
       
   113         }
       
   114     CleanupStack::PopAndDestroy( 3, serviceSettings ); // serviceSettings, smsAccount, cenRepSession
       
   115     }
       
   116 
       
   117 // Destructor
       
   118 CSmsMtmUiData::~CSmsMtmUiData()
       
   119     {
       
   120     }
       
   121 
       
   122 // ---------------------------------------------------------
       
   123 // CSmsMtmUiData::ContextIcon
       
   124 //
       
   125 // ---------------------------------------------------------
       
   126 const CBaseMtmUiData::CBitmapArray& CSmsMtmUiData::ContextIcon(
       
   127     const TMsvEntry& aContext, 
       
   128     TInt /*aStateFlags*/ ) const
       
   129     {
       
   130     SMUMLOGGER_ENTERFN("CSmsMtmUiData::ContextIcon");
       
   131     __ASSERT_DEBUG(aContext.iMtm==KUidMsgTypeSMS, Panic(ESmsiWrongMtm));
       
   132     __ASSERT_DEBUG(aContext.iType.iUid!=KUidMsvFolderEntryValue, Panic(ESmsiFoldersNotSupported));
       
   133     __ASSERT_DEBUG(aContext.iType.iUid!=KUidMsvAttachmentEntryValue, Panic(ESmsiNoIconForAttachment));
       
   134 
       
   135     //    Return the set of icons appropriate to the current context
       
   136     TInt bmpIndex; 
       
   137     if (aContext.iBioType!=0)
       
   138         {
       
   139         bmpIndex = aContext.Unread() ? 
       
   140             EMbmMuiuQgn_prop_mce_smart_unread : EMbmMuiuQgn_prop_mce_smart_read;
       
   141         }
       
   142     else
       
   143         {
       
   144         bmpIndex = aContext.Unread() ? 
       
   145             EMbmMuiuQgn_prop_mce_sms_unread : EMbmMuiuQgn_prop_mce_sms_read;
       
   146         }
       
   147 
       
   148     SMUMLOGGER_LEAVEFN("CSmsMtmUiData::ContextIcon");
       
   149 
       
   150     return *iIconArrays->At(( bmpIndex - EMbmMuiuQgn_prop_mce_sms_read ) / KSmsiNumberOfZoomStates );
       
   151     }
       
   152 
       
   153 // ---------------------------------------------------------
       
   154 // CSmsMtmUiData::OperationSupportedL
       
   155 //
       
   156 // ---------------------------------------------------------
       
   157 TInt CSmsMtmUiData::OperationSupportedL( TInt aOperationId, const TMsvEntry& aContext ) const
       
   158     {
       
   159     SMUMLOGGER_ENTERFN("CSmsMtmUiData::OperationSupportedL");
       
   160     //    SMS mtm client only has two functions which may be of use to the user
       
   161     //    NB as this implies, there are other functions.
       
   162     switch (aOperationId)
       
   163         {
       
   164         case KMtmUiFunctionSimDialog:
       
   165             return NULL;
       
   166         case KMtmUiFunctionMessageInfo:
       
   167             if (aContext.iType==KUidMsvMessageEntry)
       
   168                 {
       
   169                 return NULL;
       
   170                 }
       
   171             break;
       
   172         default:
       
   173             break;
       
   174         }
       
   175 
       
   176     SMUMLOGGER_LEAVEFN("CSmsMtmUiData::OperationSupportedL");
       
   177     return R_EIK_TBUF_NOT_AVAILABLE;
       
   178     }
       
   179 
       
   180 // ---------------------------------------------------------
       
   181 // CSmsMtmUiData::QueryCapability
       
   182 //
       
   183 // ---------------------------------------------------------
       
   184 TInt CSmsMtmUiData::QueryCapability( TUid aFunctionId, TInt& aResponse ) const
       
   185     {
       
   186     SMUMLOGGER_ENTERFN("CSmsMtmUiData::QueryCapability");
       
   187     TInt retVal = KErrNone;
       
   188     switch ( aFunctionId.iUid )
       
   189         {
       
   190         case KUidMsvMtmUiQueryMessagingInitialisation:
       
   191             aResponse = ETrue;
       
   192             break;
       
   193 
       
   194         case KUidMtmQuerySupportsBioMsgValue:   // Supports sending of Bio messages
       
   195             aResponse = ETrue;
       
   196             break;
       
   197 
       
   198         case KUidMtmQueryMaxBodySizeValue:
       
   199             aResponse = KSmsiMaxTotalMsgSize;        //    See notes at the definition
       
   200             break;
       
   201 
       
   202         case KUidMtmQueryMaxTotalMsgSizeValue:
       
   203             aResponse = KSmsiMaxTotalMsgSize;        //    See notes at the definition
       
   204             break;
       
   205         case KUidMtmQuerySupportedBodyValue:
       
   206             aResponse = KMtm7BitBody | KMtm8BitBody | KMtm16BitBody;
       
   207             break;
       
   208 
       
   209         case KUidMsvMtmQueryViewerUidValue:
       
   210             aResponse = KSmsViewerUid;
       
   211             break;
       
   212             
       
   213         case KMtmUiFunctionMessageInfo: 
       
   214             aResponse = KErrNone;
       
   215             break;
       
   216 
       
   217         case KUidMtmQueryCanSendMsgValue:        
       
   218         case KUidMtmQueryCanReceiveMsgValue:
       
   219             break;
       
   220 
       
   221         default:
       
   222             retVal=KErrNotSupported;
       
   223             break;
       
   224         }
       
   225     SMUMLOGGER_LEAVEFN("CSmsMtmUiData::QueryCapability");
       
   226     return retVal;
       
   227     }
       
   228 
       
   229 // ---------------------------------------------------------
       
   230 // CSmsMtmUiData::PopulateArraysL
       
   231 //
       
   232 // ---------------------------------------------------------
       
   233 void CSmsMtmUiData::PopulateArraysL()
       
   234     {
       
   235     SMUMLOGGER_ENTERFN("CSmsMtmUiData::PopulateArraysL");
       
   236     // Read additional functions
       
   237     ReadFunctionsFromResourceFileL( R_SMSI_FUNCTION_ARRAY );
       
   238     CreateSkinnedBitmapsL( KSmsiNumberOfZoomStates );
       
   239     SMUMLOGGER_LEAVEFN("CSmsMtmUiData::PopulateArraysL");
       
   240     }
       
   241 
       
   242 // ---------------------------------------------------------
       
   243 // CSmsMtmUiData::GetResourceFileName
       
   244 //
       
   245 // ---------------------------------------------------------
       
   246 void CSmsMtmUiData::GetResourceFileName( TFileName& aFileName ) const
       
   247     {
       
   248     aFileName = KSmsiResourceFile;
       
   249     }
       
   250 
       
   251 // ---------------------------------------------------------
       
   252 // CSmsMtmUiData::CanCreateEntryL
       
   253 //
       
   254 // ---------------------------------------------------------
       
   255 TBool CSmsMtmUiData::CanCreateEntryL(
       
   256     const TMsvEntry& aParent, 
       
   257     TMsvEntry& aNewEntry, 
       
   258     TInt& aReasonResourceId ) const
       
   259     {
       
   260     SMUMLOGGER_ENTERFN("CSmsMtmUiData::CanCreateEntryL");
       
   261     __ASSERT_DEBUG( aNewEntry.iMtm == KUidMsgTypeSMS, Panic( ESmsiWrongMtm ));
       
   262 
       
   263     //    We can create an entry if it is a message under the local service
       
   264     if( aNewEntry.iType == KUidMsvMessageEntry && 
       
   265         aNewEntry.iMtm == KUidMsgTypeSMS && 
       
   266         aParent.iType == KUidMsvFolderEntry )
       
   267         {
       
   268         aReasonResourceId = NULL;
       
   269         return ETrue;
       
   270         }
       
   271 
       
   272     aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   273     SMUMLOGGER_LEAVEFN("CSmsMtmUiData::CanCreateEntryL");
       
   274     return EFalse;
       
   275     }
       
   276 
       
   277 // ---------------------------------------------------------
       
   278 // CSmsMtmUiData::CanDeleteServiceL
       
   279 //
       
   280 // ---------------------------------------------------------
       
   281 TBool CSmsMtmUiData::CanDeleteServiceL(
       
   282     const TMsvEntry& /*aService*/, 
       
   283     TInt& aReasonResourceId ) const
       
   284     {
       
   285     SMUMLOGGER_ENTERFN("CSmsMtmUiData::CanDeleteServiceL");
       
   286     // these CanXXX functions not used in Series 60, except 
       
   287     // CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and 
       
   288     // CanUnDeleteFromEntryL 
       
   289     aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   290     SMUMLOGGER_LEAVEFN("CSmsMtmUiData::CanDeleteServiceL");
       
   291     return EFalse;
       
   292     }
       
   293 
       
   294 // ---------------------------------------------------------
       
   295 // CSmsMtmUiData::CanReplyToEntryL
       
   296 //
       
   297 // ---------------------------------------------------------
       
   298 TBool CSmsMtmUiData::CanReplyToEntryL(
       
   299     const TMsvEntry& aContext,
       
   300     TInt& aReasonResourceId ) const
       
   301     {
       
   302     SMUMLOGGER_ENTERFN("CSmsMtmUiData::CanReplyToEntryL");
       
   303     __ASSERT_DEBUG( aContext.iMtm == KUidMsgTypeSMS, Panic( ESmsiWrongMtm ));
       
   304     if ( aContext.iMtm == KUidMsgTypeSMS
       
   305         && aContext.iType == KUidMsvMessageEntry
       
   306         && aContext.ReadOnly()
       
   307         && !aContext.iBioType )
       
   308         {
       
   309         return ETrue;
       
   310         }
       
   311     else
       
   312         {
       
   313         aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   314         return EFalse;
       
   315         }
       
   316     }
       
   317 
       
   318 
       
   319 // ---------------------------------------------------------
       
   320 // CSmsMtmUiData::CanForwardEntryL
       
   321 //
       
   322 // ---------------------------------------------------------
       
   323 TBool CSmsMtmUiData::CanForwardEntryL(
       
   324     const TMsvEntry& aContext,
       
   325     TInt& aReasonResourceId ) const
       
   326     {
       
   327     SMUMLOGGER_ENTERFN("CSmsMtmUiData::CanForwardEntryL");
       
   328     __ASSERT_DEBUG( aContext.iMtm == KUidMsgTypeSMS, Panic( ESmsiWrongMtm ));
       
   329     if ( aContext.iMtm == KUidMsgTypeSMS
       
   330         && aContext.iType == KUidMsvMessageEntry
       
   331         && aContext.ReadOnly()
       
   332         && !aContext.iBioType )
       
   333         {
       
   334         return ETrue;
       
   335         }
       
   336     else
       
   337         {
       
   338         aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   339         return EFalse;
       
   340         }
       
   341     }
       
   342 
       
   343 // ---------------------------------------------------------
       
   344 // CSmsMtmUiData::CanEditEntryL
       
   345 //
       
   346 // ---------------------------------------------------------
       
   347 TBool CSmsMtmUiData::CanEditEntryL(
       
   348     const TMsvEntry& /*aContext*/,
       
   349     TInt& aReasonResourceId ) const
       
   350     {
       
   351     SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanEditEntryL");
       
   352     // these CanXXX functions not used in Series 60, except 
       
   353     // CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and 
       
   354     // CanUnDeleteFromEntryL 
       
   355     aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   356     return EFalse;
       
   357     }
       
   358 
       
   359 // ---------------------------------------------------------
       
   360 // CSmsMtmUiData::CanViewEntryL
       
   361 //
       
   362 // ---------------------------------------------------------
       
   363 TBool CSmsMtmUiData::CanViewEntryL(
       
   364     const TMsvEntry& /*aContext*/,
       
   365     TInt& aReasonResourceId ) const
       
   366     {
       
   367     SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanViewEntryL");
       
   368     // these CanXXX functions not used in Series 60, except 
       
   369     // CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and 
       
   370     // CanUnDeleteFromEntryL 
       
   371     aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   372     return EFalse;
       
   373     }
       
   374 
       
   375 // ---------------------------------------------------------
       
   376 // CSmsMtmUiData::CanOpenEntryL
       
   377 //
       
   378 // ---------------------------------------------------------
       
   379 TBool CSmsMtmUiData::CanOpenEntryL(
       
   380     const TMsvEntry& /*aContext*/,
       
   381     TInt& aReasonResourceId ) const
       
   382     {
       
   383     SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanOpenEntryL");
       
   384     // these CanXXX functions not used in Series 60, except 
       
   385     // CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and 
       
   386     // CanUnDeleteFromEntryL 
       
   387     aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   388     return EFalse;
       
   389     }
       
   390 
       
   391 // ---------------------------------------------------------
       
   392 // CSmsMtmUiData::CanCloseEntryL
       
   393 //
       
   394 // ---------------------------------------------------------
       
   395 TBool CSmsMtmUiData::CanCloseEntryL(
       
   396     const TMsvEntry& /*aContext*/,
       
   397     TInt& aReasonResourceId ) const
       
   398     {
       
   399     SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanCloseEntryL");
       
   400     // these CanXXX functions not used in Series 60, except 
       
   401     // CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and 
       
   402     // CanUnDeleteFromEntryL 
       
   403     aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   404     return EFalse;
       
   405     }
       
   406 
       
   407 // ---------------------------------------------------------
       
   408 // CSmsMtmUiData::CanDeleteFromEntryL
       
   409 //
       
   410 // ---------------------------------------------------------
       
   411 TBool CSmsMtmUiData::CanDeleteFromEntryL(
       
   412     const TMsvEntry& /*aContext*/, 
       
   413     TInt& aReasonResourceId ) const
       
   414     {
       
   415     SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanDeleteFromEntryL");
       
   416     // these CanXXX functions not used in Series 60, except 
       
   417     // CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and 
       
   418     // CanUnDeleteFromEntryL 
       
   419     aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   420     return EFalse;
       
   421     }
       
   422 
       
   423 // ---------------------------------------------------------
       
   424 // CSmsMtmUiData::CanCopyMoveToEntryL
       
   425 //
       
   426 // ---------------------------------------------------------
       
   427 TBool CSmsMtmUiData::CanCopyMoveToEntryL(
       
   428     const TMsvEntry& /*aContext*/, 
       
   429     TInt& aReasonResourceId ) const
       
   430     {
       
   431     SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanCopyMoveToEntryL");
       
   432     // these CanXXX functions not used in Series 60, except 
       
   433     // CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and 
       
   434     // CanUnDeleteFromEntryL 
       
   435     aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   436     return EFalse;
       
   437     }
       
   438 
       
   439 // ---------------------------------------------------------
       
   440 // CSmsMtmUiData::CanCopyMoveFromEntryL
       
   441 //
       
   442 // ---------------------------------------------------------
       
   443 TBool CSmsMtmUiData::CanCopyMoveFromEntryL(
       
   444     const TMsvEntry& /*aContext*/, 
       
   445     TInt& aReasonResourceId ) const
       
   446     {
       
   447     SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanCopyMoveFromEntryL");
       
   448     // these CanXXX functions not used in Series 60, except 
       
   449     // CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and 
       
   450     // CanUnDeleteFromEntryL 
       
   451     aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   452     return EFalse;
       
   453     }
       
   454 
       
   455 // ---------------------------------------------------------
       
   456 // CSmsMtmUiData::CanCancelL
       
   457 //
       
   458 // ---------------------------------------------------------
       
   459 TBool CSmsMtmUiData::CanCancelL(
       
   460     const TMsvEntry& /*aContext*/, 
       
   461     TInt& aReasonResourceId ) const
       
   462     {
       
   463     SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanCancelL");
       
   464     // these CanXXX functions not used in Series 60, except 
       
   465     // CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and 
       
   466     // CanUnDeleteFromEntryL 
       
   467     aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
       
   468     return EFalse;
       
   469     }
       
   470 
       
   471 // ---------------------------------------------------------
       
   472 // CSmsMtmUiData::StatusTextL
       
   473 //
       
   474 // ---------------------------------------------------------
       
   475 HBufC* CSmsMtmUiData::StatusTextL( const TMsvEntry& aContext ) const
       
   476     {
       
   477     SMUMLOGGER_ENTERFN(" CSmsMtmUiData::StatusTextL");
       
   478 
       
   479     TInt res = 0;
       
   480     TUint sendingState = aContext.SendingState();
       
   481     switch( sendingState )
       
   482         {
       
   483         case KMsvSendStateFailed:
       
   484             res = R_QTN_MCE_OUTBOX_STATUS_FAILED;
       
   485             break;
       
   486 
       
   487         case KMsvSendStateUponRequest: // Mapped to be the same
       
   488         case KMsvSendStateSuspended:
       
   489             res = R_QTN_MCE_OUTBOX_STATUS_SUSPENDED;
       
   490             break;
       
   491         
       
   492         case KMsvSendStateScheduled: // Mapped to be the same
       
   493         case KMsvSendStateWaiting:
       
   494             res = R_QTN_MCE_OUTBOX_STATUS_WAITING;
       
   495             break;
       
   496             
       
   497         case KMsvSendStateResend:
       
   498             res = R_QTN_MCE_OUTBOX_STATUS_RETRY_AT;
       
   499             break;
       
   500             
       
   501         case KMsvSendStateSending:
       
   502             res = R_QTN_MCE_OUTBOX_STATUS_SENDING;
       
   503             break;
       
   504         
       
   505         case KMsvSendStateSent:
       
   506         case KMsvSendStateNotApplicable:
       
   507             res = 0;
       
   508             break;
       
   509             
       
   510             // Unknown 
       
   511         case KMsvSendStateUnknown:
       
   512         default:
       
   513 #ifdef _DEBUG
       
   514             Panic( ESmsiMtmUdUnknownMsgStatus );
       
   515 #endif
       
   516             User::Leave( KErrNotSupported );
       
   517             break;
       
   518         }
       
   519     
       
   520         if (!res)
       
   521             {
       
   522             return HBufC::NewL(0);
       
   523             }
       
   524       
       
   525         if ( sendingState == KMsvSendStateResend )
       
   526             {
       
   527             TBuf<KTBuf80Length> bufTimeFormat;
       
   528             TBuf<KTBuf80Length> bufTimeFormatted;
       
   529             StringLoader::Load( 
       
   530                 bufTimeFormat, R_QTN_TIME_USUAL_WITH_ZERO, iCoeEnv );
       
   531                 
       
   532             TTime localTime = aContext.iDate;
       
   533             TLocale locale;
       
   534     	    // Add time difference
       
   535             localTime += locale.UniversalTimeOffset();
       
   536     	    if (locale.QueryHomeHasDaylightSavingOn())          
       
   537     		    { // and possible daylight saving time
       
   538     		    TTimeIntervalHours daylightSaving(1);          
       
   539     		    localTime += daylightSaving;
       
   540     		    }
       
   541     		localTime.FormatL( bufTimeFormatted, bufTimeFormat );
       
   542     		AknTextUtils::LanguageSpecificNumberConversion( bufTimeFormatted );
       
   543     	    SMUMLOGGER_LEAVEFN(" CSmsMtmUiData::StatusTextL - 1");
       
   544             return StringLoader::LoadL( 
       
   545                 R_QTN_MCE_OUTBOX_STATUS_RETRY_AT, bufTimeFormatted, iCoeEnv );
       
   546             }
       
   547         else
       
   548             {
       
   549             SMUMLOGGER_LEAVEFN(" CSmsMtmUiData::StatusTextL - 2");
       
   550             return StringLoader::LoadL( res, iCoeEnv );
       
   551             }
       
   552     }
       
   553 
       
   554 // ---------------------------------------------------------
       
   555 // CSmsMtmUiData::CreateSkinnedBitmapsL
       
   556 //
       
   557 // ---------------------------------------------------------
       
   558 void CSmsMtmUiData::CreateSkinnedBitmapsL( TInt aNumZoomStates )
       
   559     {
       
   560     SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CreateSkinnedBitmapsL");
       
   561 
       
   562     MAknsSkinInstance* skins = AknsUtils::SkinInstance();
       
   563     TAknsItemID id;
       
   564     CFbsBitmap* bitmap;
       
   565     CFbsBitmap* bitmapMask;
       
   566     TBool found = ETrue;
       
   567     
       
   568     for( TInt i=EMbmMuiuQgn_prop_mce_sms_read; i<EMbmMuiuQgn_prop_mce_smart_unread_mask+1; i++ )
       
   569         {
       
   570         found = ETrue;
       
   571         switch( i )
       
   572             {
       
   573             // Add to iIconArrays in this order
       
   574             case EMbmMuiuQgn_prop_mce_sms_read:
       
   575                 id.Set( KAknsIIDQgnPropMceSmsRead );
       
   576                 break;
       
   577             case EMbmMuiuQgn_prop_mce_sms_unread:
       
   578                 id.Set( KAknsIIDQgnPropMceSmsUnread );
       
   579                 break;
       
   580             case EMbmMuiuQgn_prop_mce_smart_read:
       
   581                 id.Set( KAknsIIDQgnPropMceSmartRead );
       
   582                 break;
       
   583             case EMbmMuiuQgn_prop_mce_smart_unread:
       
   584                 id.Set( KAknsIIDQgnPropMceSmartUnread );
       
   585                 break;
       
   586             default:
       
   587                 found = EFalse;
       
   588                 break;
       
   589             }
       
   590             if( found )
       
   591                 {
       
   592                 CArrayPtrFlat<CFbsBitmap>* array = 
       
   593                     new (ELeave) CArrayPtrFlat<CFbsBitmap>( aNumZoomStates );
       
   594                 CleanupStack::PushL( array );
       
   595                 array->SetReserveL( aNumZoomStates ); // AppendLs will not LEAVE
       
   596                 TParse tp;
       
   597                 tp.Set( KBitmapFile, &KDC_APP_BITMAP_DIR, NULL );
       
   598 
       
   599                 AknsUtils::CreateIconL( skins, id, bitmap,
       
   600                     bitmapMask, tp.FullName(), i, i + 1 );
       
   601                     
       
   602                 array->AppendL(bitmap);
       
   603                 array->AppendL(bitmapMask);
       
   604                 iIconArrays->AppendL(array);
       
   605 
       
   606                 CleanupStack::Pop();//array
       
   607                 }
       
   608                 
       
   609         }
       
   610     SMUMLOGGER_LEAVEFN(" CSmsMtmUiData::CreateSkinnedBitmapsL");
       
   611     }
       
   612 //  End of File