connectionmonitoring/connectionmonitorui/src/ConnectionInfoBase.cpp
changeset 0 5a93021fdf25
child 2 086aae6fc07e
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Represents a connection
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <stdlib.h>
       
    22 #include <NIFVAR.H>
       
    23 #include <StringLoader.h>
       
    24 #include <ConnectionMonitorUi.rsg>
       
    25 #include <avkon.rsg>
       
    26 #include <AknUtils.h>
       
    27 #include <apgcli.h>
       
    28 
       
    29 #include "ConnectionMonitorUiLogger.h"
       
    30 #include "ConnectionInfoBase.h"
       
    31 #include "ActiveWrapper.h"
       
    32 
       
    33 // CONSTANTS
       
    34 
       
    35 const TUint KUpArrowChar = 0x2191; ///< ASCII code of UpArrow
       
    36 const TUint KDownArrowChar = 0x2193; ///< ASCII code of DownArrow
       
    37 const TUint KBannedServerUID = 0x101fd9c5; // Banned DHCP server UID
       
    38 
       
    39 const TInt KFeedsServerUid         = 0x1020728E;
       
    40 const TInt KDownloadMgrServerUid   = 0x10008D60;
       
    41 const TInt KMessagingServerUid     = 0x1000484b;
       
    42 const TInt KJavaVMUid              = 0x102033E6;
       
    43 const TInt KSUPLServerUid          = 0x102073CA;
       
    44 
       
    45 LOCAL_D const TInt KStringsGranularity = 5;
       
    46 
       
    47 _LIT( KMrouterName, "mRouter"); ///< see CheckMrouteIap
       
    48 _LIT( KEmpty, "");      ///< Empty string
       
    49 
       
    50 
       
    51 
       
    52 
       
    53 // ================= MEMBER FUNCTIONS =======================
       
    54 
       
    55 // ---------------------------------------------------------
       
    56 // CConnectionInfoBase::~CConnectionInfoBase
       
    57 // ---------------------------------------------------------
       
    58 //
       
    59 CConnectionInfoBase::~CConnectionInfoBase()
       
    60     {
       
    61     delete iDetailsArray;
       
    62     delete iAppNames;
       
    63     }
       
    64 
       
    65 
       
    66 // ---------------------------------------------------------
       
    67 // CConnectionInfoBase::CConnectionInfoBase
       
    68 // ---------------------------------------------------------
       
    69 //
       
    70 CConnectionInfoBase::CConnectionInfoBase(
       
    71                            TInt aConnectionId,
       
    72                            RConnectionMonitor* const aConnectionMonitor,
       
    73                            TConnMonBearerType aConnectionBearerType,
       
    74                            CActiveWrapper* aActiveWrapper ) :
       
    75     iConnectionMonitor( aConnectionMonitor ), 
       
    76     iStartTime( NULL ),
       
    77     iDeletedFromCMUI( EFalse ),
       
    78     iActiveWrapper( aActiveWrapper )
       
    79     {
       
    80     CMUILOGGER_WRITE( "CConnectionInfoBase constuctor - start " );
       
    81     iConnectionStatus = EConnectionUninitialized;
       
    82     iConnectionId = aConnectionId;
       
    83     iConnectionBearerType = aConnectionBearerType;
       
    84     iLastSpeedUpdate.UniversalTime();
       
    85     CMUILOGGER_WRITE( "CConnectionInfoBase constuctor - end " );
       
    86     }
       
    87 
       
    88 
       
    89 // ---------------------------------------------------------
       
    90 // CConnectionInfoBase::ConstructL
       
    91 // ---------------------------------------------------------
       
    92 //
       
    93 void CConnectionInfoBase::ConstructL()
       
    94     {
       
    95     CMUILOGGER_ENTERFN( "CConnectionInfoBase::ConstructL() start" );
       
    96 
       
    97     if ( iConnectionBearerType >= EBearerExternalCSD )
       
    98         {
       
    99         StringLoader::Load( iConnectionName,
       
   100                             R_QTN_CMON_ITEM_CONN_NAME_MODEM );
       
   101         }
       
   102     else
       
   103         {
       
   104         iActiveWrapper->StartGetStringAttribute( iConnectionId,
       
   105                                                  iConnectionMonitor,
       
   106                                                  KIAPName,
       
   107                                                  iConnectionName );
       
   108         TInt err( iActiveWrapper->iStatus.Int() );
       
   109         CMUILOGGER_WRITE_F( "CConnectionInfoBase::ConstructL() status: %d",
       
   110                             err );
       
   111         CMUILOGGER_WRITE_F( "iConnectionName : %S", &iConnectionName );
       
   112         CMUILOGGER_WRITE_F( "iConnectionId : %d", iConnectionId );
       
   113         CMUILOGGER_WRITE_F( "iConnectionBearerType : %d", 
       
   114                             ( TInt )iConnectionBearerType );
       
   115         if ( err != KErrNone )
       
   116             {
       
   117             User::Leave( err );
       
   118             }
       
   119         }
       
   120     
       
   121     if ( !iAppNames )
       
   122         {
       
   123         iAppNames = new( ELeave ) CDesCArrayFlat( KStringsGranularity );
       
   124         }
       
   125 
       
   126     StatusChangedL();
       
   127     if ( GetStatus() == EConnectionSuspended )
       
   128         {
       
   129         InitializeConnectionInfoL();
       
   130         }
       
   131     CMUILOGGER_LEAVEFN( "CConnectionInfoBase::ConstructL() end" );
       
   132     }
       
   133 
       
   134 
       
   135 // ---------------------------------------------------------
       
   136 // CConnectionInfoBase::StatusChangedL
       
   137 // ---------------------------------------------------------
       
   138 //
       
   139 void CConnectionInfoBase::StatusChangedL()
       
   140     {
       
   141     CMUILOGGER_WRITE( "CConnectionInfoBase::StatusChangedL() start" );
       
   142 
       
   143     RefreshConnectionStatus();
       
   144 
       
   145     switch ( iConnectionStatus )
       
   146         {
       
   147         case EConnectionCreated:
       
   148             {
       
   149             InitializeConnectionInfoL();
       
   150             break;
       
   151             }
       
   152         case EConnectionSuspended:
       
   153             {
       
   154             RefreshDetailsL();
       
   155             if ( !iDetailsArray )
       
   156                 {
       
   157                 ToArrayDetailsL();
       
   158                 }
       
   159             RefreshDetailsArrayL();
       
   160             break;
       
   161             }
       
   162         case EConnectionClosing:
       
   163         case EConnectionClosed:
       
   164         case EConnectionUninitialized:
       
   165         	{
       
   166         	if ( iDetailsArray ) // if there is details array
       
   167         	    {
       
   168         	    RefreshDetailsArrayL();
       
   169         	    }
       
   170             break;
       
   171         	}
       
   172         case EConnectionCreating:
       
   173         default :
       
   174             {
       
   175             break;
       
   176             }
       
   177         }
       
   178 
       
   179     RefreshConnectionListBoxItemTextL();
       
   180 
       
   181     CMUILOGGER_WRITE( "CConnectionInfoBase::StatusChangedL() end" );
       
   182     }
       
   183 
       
   184 // ---------------------------------------------------------
       
   185 // CConnectionInfoBase::IsAlive
       
   186 // ---------------------------------------------------------
       
   187 //
       
   188 TBool CConnectionInfoBase::IsAlive() const
       
   189     {
       
   190     TBool alive( EFalse );
       
   191     if ( ( iConnectionStatus == EConnectionSuspended ) ||
       
   192          ( iConnectionStatus == EConnectionCreated ) )
       
   193         {
       
   194         alive = ETrue;
       
   195         }
       
   196     return alive;
       
   197     }
       
   198     
       
   199 // ---------------------------------------------------------
       
   200 // CConnectionInfoBase::IsSuspended
       
   201 // ---------------------------------------------------------
       
   202 //
       
   203 TBool CConnectionInfoBase::IsSuspended() const
       
   204     {
       
   205     TBool suspended( EFalse );
       
   206     if ( iConnectionStatus == EConnectionSuspended )
       
   207         {
       
   208         suspended = ETrue;
       
   209         }
       
   210     return suspended;
       
   211     }    
       
   212 
       
   213 // ---------------------------------------------------------
       
   214 // CConnectionInfoBase::GetConnectionId
       
   215 // ---------------------------------------------------------
       
   216 //
       
   217 CDesCArrayFlat* CConnectionInfoBase::GetDetailsArray() const
       
   218     {
       
   219     CDesCArrayFlat* array = NULL;
       
   220     if ( ( iConnectionStatus == EConnectionSuspended ) ||
       
   221          ( iConnectionStatus == EConnectionCreated ) )
       
   222         {
       
   223         array = iDetailsArray;
       
   224         }
       
   225     return array;
       
   226     }
       
   227 
       
   228 // ---------------------------------------------------------
       
   229 // CConnectionInfoBase::GetConnectionId
       
   230 // ---------------------------------------------------------
       
   231 //
       
   232 TUint CConnectionInfoBase::GetConnectionId() const
       
   233     {
       
   234     return iConnectionId;
       
   235     }
       
   236 
       
   237 // ---------------------------------------------------------
       
   238 // CConnectionInfoBase::GetStatus
       
   239 // ---------------------------------------------------------
       
   240 //
       
   241 TConnectionStatus CConnectionInfoBase::GetStatus() const
       
   242     {
       
   243     return iConnectionStatus;
       
   244     }
       
   245 
       
   246 // ---------------------------------------------------------
       
   247 // CConnectionInfoBase::GetName
       
   248 // ---------------------------------------------------------
       
   249 //
       
   250 HBufC* CConnectionInfoBase::GetNameLC() const
       
   251     {
       
   252     HBufC* name = iConnectionName.AllocLC();
       
   253     return name;
       
   254     }
       
   255 
       
   256 // ---------------------------------------------------------
       
   257 // CConnectionInfoBase::GetBearerType
       
   258 // ---------------------------------------------------------
       
   259 //
       
   260 TConnMonBearerType CConnectionInfoBase::GetBearerType() const
       
   261     {
       
   262     return iConnectionBearerType;
       
   263     }
       
   264 
       
   265 
       
   266 // ---------------------------------------------------------
       
   267 // CConnectionInfoBase::GetConnectionListBoxItemText
       
   268 // ---------------------------------------------------------
       
   269 //
       
   270 TPtrC CConnectionInfoBase::GetConnectionListBoxItemText() const
       
   271     {
       
   272     return iListBoxItemText;
       
   273     }
       
   274 
       
   275 // ---------------------------------------------------------
       
   276 // CConnectionInfoBase::RefreshConnectionStatus
       
   277 // ---------------------------------------------------------
       
   278 //
       
   279 void CConnectionInfoBase::RefreshConnectionStatus()
       
   280     {
       
   281     TConnectionStatus connStatus( EConnectionUninitialized );
       
   282     iActiveWrapper->StartGetIntAttribute( iConnectionId,
       
   283                                           iConnectionMonitor,
       
   284                                           KConnectionStatus,
       
   285                                           ( ( TInt& )( connStatus ) ) );
       
   286     TInt err( iActiveWrapper->iStatus.Int() );
       
   287     CMUILOGGER_WRITE_F( "RefreshConnectionStatus status : %d",
       
   288                         err );
       
   289     if ( err == KErrNone )
       
   290         {
       
   291         RefreshConnectionStatus( connStatus );
       
   292         }
       
   293     else
       
   294         {
       
   295         iActiveWrapper->Cancel();
       
   296         }
       
   297     }
       
   298 
       
   299 // ---------------------------------------------------------
       
   300 // CConnectionInfoBase::RefreshConnectionStatus
       
   301 // ---------------------------------------------------------
       
   302 //
       
   303 void CConnectionInfoBase::RefreshConnectionStatus(
       
   304                                    const TConnectionStatus aConnectionStatus )
       
   305     {
       
   306     CMUILOGGER_ENTERFN( "RefreshConnectionStatus" );
       
   307     CMUILOGGER_WRITE_F( "RefreshConnectionStatus aConnectionStatus %d",
       
   308                         ( TInt )aConnectionStatus );
       
   309     CMUILOGGER_WRITE_F( "iConnectionStatus before %d",
       
   310                         ( TInt )iConnectionStatus );
       
   311                         
       
   312 
       
   313     if ( ( aConnectionStatus == KLinkLayerOpen ) ||
       
   314           ( ( aConnectionStatus == KConnectionOpen ) &&
       
   315             ( iConnectionBearerType >= EBearerExternalCSD ) ) )
       
   316         {
       
   317         CMUILOGGER_WRITE("1");
       
   318         iConnectionStatus = EConnectionCreated;
       
   319         }
       
   320     else if ( ( iConnectionStatus == EConnectionClosing ) &&
       
   321               ( ( aConnectionStatus == KConnectionClosed ) ||
       
   322                 ( aConnectionStatus == KLinkLayerClosed ) ) ) 
       
   323         {
       
   324         CMUILOGGER_WRITE("2");        
       
   325         iConnectionStatus = EConnectionClosed;
       
   326         }
       
   327     else if ( ( ( aConnectionStatus >= KMinAgtProgress ) &&
       
   328                ( aConnectionStatus <= KConnectionOpen ) ) ||
       
   329                ( aConnectionStatus == KStartingSelection ) ||
       
   330                ( aConnectionStatus == KFinishedSelection ) ||
       
   331                ( aConnectionStatus == KConfigDaemonStartingRegistration ) ||
       
   332                ( aConnectionStatus == KConfigDaemonFinishedRegistration ) )
       
   333         // creating
       
   334         {
       
   335         CMUILOGGER_WRITE("5");
       
   336         iConnectionStatus = EConnectionCreating;
       
   337         }
       
   338     else if ( aConnectionStatus == KDataTransferTemporarilyBlocked )
       
   339         {
       
   340         CMUILOGGER_WRITE("6");
       
   341         iConnectionStatus = EConnectionSuspended;
       
   342         }
       
   343     else if ( ( iConnectionStatus == EConnectionCreated ) &&
       
   344               ( ( aConnectionStatus >= KConnectionStartingClose ) &&
       
   345                 ( aConnectionStatus < KConnectionClosed ) ||  
       
   346                 ( aConnectionStatus == KConfigDaemonFinishedDeregistrationStop ) || 
       
   347                 ( aConnectionStatus == KConfigDaemonStartingDeregistration ) ||
       
   348                 ( aConnectionStatus == KLinkLayerClosed ) ||
       
   349                 ( aConnectionStatus == KConnectionUninitialised )
       
   350               ) )
       
   351         // closing
       
   352         {
       
   353         CMUILOGGER_WRITE("7");        
       
   354         iConnectionStatus = EConnectionClosing;
       
   355         }
       
   356     else if ( ( aConnectionStatus == KConnectionUninitialised ) &&
       
   357              ( iConnectionStatus == EConnectionSuspended ) )
       
   358         { // Back to created from suspended
       
   359         CMUILOGGER_WRITE("4");
       
   360         iConnectionStatus = EConnectionCreated;
       
   361         }
       
   362     else if ( aConnectionStatus == KConnectionUninitialised )
       
   363         {
       
   364         CMUILOGGER_WRITE("3");
       
   365         iConnectionStatus = EConnectionUninitialized;
       
   366         }
       
   367         
       
   368     else
       
   369         {
       
   370         CMUILOGGER_WRITE_F( " else iConnectionStatus  %d",
       
   371                             ( TInt )iConnectionStatus );
       
   372         CMUILOGGER_WRITE_F( "else aConnectionStatus  %d",
       
   373                             ( TInt )aConnectionStatus );
       
   374         
       
   375         CMUILOGGER_WRITE("else");
       
   376         }
       
   377 
       
   378 
       
   379     CMUILOGGER_WRITE_F( "iConnectionStatus after %d",
       
   380                         ( TInt )iConnectionStatus );
       
   381     CMUILOGGER_LEAVEFN( "RefreshConnectionStatus" );                                                
       
   382     }
       
   383 
       
   384 
       
   385 // ---------------------------------------------------------
       
   386 // CConnectionInfoBase::RefreshSentReceivedDataL
       
   387 // ---------------------------------------------------------
       
   388 //
       
   389 void CConnectionInfoBase::RefreshSentReceivedDataL()
       
   390     {
       
   391     CMUILOGGER_ENTERFN( "CConnectionInfoBase::RefreshSentReceivedDataL" );
       
   392     // Downloaded
       
   393 	CMUILOGGER_WRITE("Downloaded before");
       
   394     iActiveWrapper->StartGetUintAttribute( iConnectionId,
       
   395                                            iConnectionMonitor,
       
   396                                            KDownlinkData,
       
   397                                            iDownloaded );
       
   398     TInt errDownload( iActiveWrapper->iStatus.Int() );
       
   399     CMUILOGGER_WRITE_F( "Download status: %d", errDownload );
       
   400     if ( errDownload != KErrNone )
       
   401         {
       
   402         iActiveWrapper->Cancel();
       
   403         User::Leave( errDownload );
       
   404         }
       
   405    	CMUILOGGER_WRITE("Downloaded after");
       
   406     // Uploaded
       
   407 	CMUILOGGER_WRITE("Uploaded before");
       
   408     iActiveWrapper->StartGetUintAttribute( iConnectionId,
       
   409                                            iConnectionMonitor,
       
   410                                            KUplinkData,
       
   411                                            iUploaded );
       
   412     TInt errUpload( iActiveWrapper->iStatus.Int() );
       
   413     CMUILOGGER_WRITE_F( "Upload status: %d", errUpload );
       
   414     if ( errUpload != KErrNone )
       
   415         {
       
   416         iActiveWrapper->Cancel();
       
   417         User::Leave( errUpload );
       
   418         }
       
   419 	CMUILOGGER_WRITE("Uploaded after");
       
   420 
       
   421     CMUILOGGER_LEAVEFN( "CConnectionInfoBase::RefreshSentReceivedDataL" );
       
   422     }
       
   423 
       
   424 
       
   425 // ---------------------------------------------------------
       
   426 // CConnectionInfoBase::RefreshTransferSpeedsL
       
   427 // ---------------------------------------------------------
       
   428 //
       
   429 void CConnectionInfoBase::RefreshTransferSpeedsL()
       
   430     {
       
   431     CMUILOGGER_ENTERFN( "CConnectionInfoBase::RefreshTransferSpeedsL" );
       
   432     TUint up = iUploaded;
       
   433     TUint down = iDownloaded;
       
   434 
       
   435     RefreshSentReceivedDataL();
       
   436 
       
   437     TTime now;
       
   438     now.UniversalTime();
       
   439 
       
   440     // 100 * 1/1000sec
       
   441     const TUint KOnesec = 1000;
       
   442     TUint diffTime = I64LOW( now.MicroSecondsFrom( iLastSpeedUpdate ).Int64() /
       
   443                                                         TInt64( 1000 ) );
       
   444 
       
   445     if ( iLastSpeedUpdate.Int64() == 0 )
       
   446         {
       
   447         iLastSpeedUpdate = now;
       
   448 
       
   449         // speed cannot be calculated at the first time
       
   450         iUpSpeed.quot = 0;
       
   451         iUpSpeed.rem = 0;
       
   452         iDownSpeed.quot = 0;
       
   453         iDownSpeed.rem = 0;
       
   454         }
       
   455     else if ( diffTime > 500 )
       
   456         // at least 1/2sec passed
       
   457         {
       
   458         // bytes/sec
       
   459         div_t upSpeed = div( ( iUploaded - up ) * KOnesec, diffTime );
       
   460         div_t downSpeed = div( ( iDownloaded - down ) * KOnesec, diffTime );
       
   461         // kbytes/sec
       
   462         iUpSpeed = div( upSpeed.quot, 1024 );
       
   463         iDownSpeed = div( downSpeed.quot, 1024 );
       
   464 
       
   465         iLastSpeedUpdate = now;
       
   466         }
       
   467     CMUILOGGER_LEAVEFN( "CConnectionInfoBase::RefreshTransferSpeedsL" );
       
   468     }
       
   469 
       
   470 
       
   471 // ---------------------------------------------------------
       
   472 // CConnectionInfoBase::RefreshDuration
       
   473 // ---------------------------------------------------------
       
   474 //
       
   475 void CConnectionInfoBase::RefreshDuration()
       
   476     {
       
   477     CMUILOGGER_ENTERFN( "CConnectionInfoBase::RefreshDuration" );
       
   478     TTime now;
       
   479     now.UniversalTime();
       
   480 
       
   481     // passed time since connection established.
       
   482     iDuration = now.MicroSecondsFrom( iStartTime ).Int64();
       
   483     CMUILOGGER_LEAVEFN( "CConnectionInfoBase::RefreshDuration" );
       
   484     }
       
   485 
       
   486 
       
   487 // ---------------------------------------------------------
       
   488 // CConnectionInfoBase::RefreshAppNamesL
       
   489 // ---------------------------------------------------------
       
   490 //
       
   491 TInt CConnectionInfoBase::RefreshAppNamesL()
       
   492     {
       
   493     CMUILOGGER_ENTERFN( "CConnectionInfoBase::RefreshAppNamesL" );
       
   494     
       
   495     TInt sharings( 0 );
       
   496     
       
   497 if ( IsAlive() )
       
   498     {
       
   499     if ( iAppNames )
       
   500         {
       
   501         iAppNames->Reset();
       
   502         HBufC* actAppName = NULL;
       
   503         // Check whether it is an internal or external (modem) connection
       
   504         // External (modem) connections does not need application name
       
   505         if ( iConnectionBearerType < EBearerExternalCSD )
       
   506             {
       
   507             TInt count( 0 );
       
   508             TConnMonClientEnumBuf clientBuf;
       
   509             iActiveWrapper->StartGetConnSharings( iConnectionId,
       
   510                                                   iConnectionMonitor,
       
   511                                                   clientBuf );
       
   512             
       
   513             TInt err( iActiveWrapper->iStatus.Int() );
       
   514             CMUILOGGER_WRITE_F( "RefreshSharings status: %d", err );
       
   515             
       
   516             if ( !err )
       
   517                 {
       
   518                 count = clientBuf().iCount;
       
   519                 }
       
   520                 
       
   521             CMUILOGGER_WRITE_F( "clientBuf().iCount: %d", count );
       
   522                 
       
   523 #ifndef __WINS__ // Appl. uid is always zero in emulator
       
   524 
       
   525             RApaLsSession appSess;
       
   526             TApaAppInfo appInfo;
       
   527 
       
   528             // The connection could be shared by several applications
       
   529             User::LeaveIfError( appSess.Connect() );
       
   530                     
       
   531             TUint i;
       
   532             for ( i = 0; i < count; i++ )
       
   533                 {
       
   534                 actAppName = NULL;
       
   535                 appInfo.iCaption.Zero();
       
   536 
       
   537                 TInt result = appSess.GetAppInfo( appInfo, 
       
   538                                                   clientBuf().iUid[i] );
       
   539 
       
   540                 //================================
       
   541                 CMUILOGGER_WRITE_F( "result: %d", result ); 
       
   542                 CMUILOGGER_WRITE_F( "iClientInfo.iUid[i].iUid: %x", 
       
   543                                     clientBuf().iUid[i].iUid );
       
   544                 
       
   545                 if ( result != KErrNone )
       
   546                     {
       
   547                     TInt resId = 0;
       
   548                     switch ( clientBuf().iUid[i].iUid )
       
   549                         {
       
   550                         case KMessagingServerUid: // Messaging
       
   551                             {
       
   552                             resId = R_QTN_CMON_SHARING_APP_MSG_SERVER;
       
   553                             break;
       
   554                             }
       
   555                         case KDownloadMgrServerUid: // Downloads
       
   556                             {
       
   557                             resId = R_QTN_CMON_SHARING_APP_DL_MG;
       
   558                             break;
       
   559                             }
       
   560                         case KFeedsServerUid: // Web Feeds
       
   561                             {
       
   562                             resId = R_QTN_CMON_SHARING_APP_RSS_SERVER;
       
   563                             break;
       
   564                             }
       
   565                         case KJavaVMUid: // Application
       
   566                             {
       
   567                             resId = R_QTN_CMON_SHARING_APP_JAVA_MIDLET;
       
   568                             break;
       
   569                             }
       
   570                         case KBannedServerUID:
       
   571                             {   // Forget about DHCP server!
       
   572                             break;
       
   573                             }
       
   574                         case KSUPLServerUid:
       
   575                             {
       
   576                             resId = R_QTN_CMON_SHARING_APP_SUPL;
       
   577                             break;
       
   578                             }
       
   579                         default: // (unknown)
       
   580                             {
       
   581                             resId = R_QTN_CMON_SHARING_APP_UNKNOWN;
       
   582                             break;
       
   583                             }
       
   584                         }
       
   585 
       
   586                     if ( resId )
       
   587                         {
       
   588                         actAppName = StringLoader::LoadL( resId );
       
   589                         }
       
   590                     }
       
   591                 else
       
   592                     {
       
   593                     actAppName =  HBufC::NewL( appInfo.iCaption.Length() );
       
   594                     TPtr actAppNameBuf = actAppName->Des();
       
   595                     actAppNameBuf.Append( appInfo.iCaption );
       
   596                     }
       
   597 
       
   598                 if ( actAppName )
       
   599                     {
       
   600                     iAppNames->AppendL( actAppName->Des() );        
       
   601                     delete actAppName;
       
   602                     }
       
   603                 }
       
   604 
       
   605                 iAppNames->Sort();
       
   606                 appSess.Close();
       
   607 #else
       
   608             TInt countBan( 0 );
       
   609 
       
   610             if ( !err )
       
   611                 {
       
   612                 // remove the DHCP server is not actually 
       
   613                 // an owner of the connection
       
   614                 for ( TUint tmp = 0; tmp < count; ++tmp )
       
   615                     {
       
   616                     TUid uid = clientBuf().iUid[tmp];
       
   617             
       
   618                     if ( uid.iUid == KBannedServerUID )
       
   619                         {
       
   620                         ++countBan;
       
   621                         }
       
   622                     } // end
       
   623                 }
       
   624 
       
   625             _LIT( KStrApplication, "Application" );
       
   626             // Give a dummy name of the application
       
   627             for ( TInt i = 0; i < ( count - countBan ); i++ )
       
   628                 {
       
   629                 iAppNames->AppendL( KStrApplication );
       
   630                 }
       
   631 
       
   632 #endif // __WINS__
       
   633 
       
   634             }
       
   635         /* modem connections does not need application name
       
   636         else 
       
   637             {
       
   638             }
       
   639         */
       
   640         sharings = iAppNames->Count();
       
   641         }
       
   642     }
       
   643         
       
   644     CMUILOGGER_LEAVEFN( "CConnectionInfoBase::RefreshAppNamesL" );
       
   645     return sharings;
       
   646     }
       
   647 
       
   648 
       
   649 // ---------------------------------------------------------
       
   650 // CConnectionInfoBase::ToDetailsListBoxItemTextL
       
   651 // ---------------------------------------------------------
       
   652 //
       
   653 HBufC*  CConnectionInfoBase::ToDetailsListBoxItemTextL(
       
   654                                                 const TUint aResourceId,
       
   655                                                 const HBufC* aValueText ) const
       
   656     {
       
   657     CMUILOGGER_ENTERFN( "CConnectionInfoBase::ToDetailsListBoxItemTextL" );
       
   658 
       
   659     HBufC* columnName = NULL;
       
   660     if ( aResourceId )
       
   661         {
       
   662         columnName = StringLoader::LoadLC( aResourceId );
       
   663         }
       
   664     else
       
   665         {
       
   666         columnName = KEmpty().AllocLC();
       
   667         }
       
   668 
       
   669     HBufC* listBoxItemText = HBufC::NewL( KDetailsListItemText );
       
   670 
       
   671     TPtr ptrToListBoxItemText = listBoxItemText->Des();
       
   672 
       
   673     ptrToListBoxItemText.Format( KDetailsListItemTextFormat,
       
   674                                  columnName, aValueText );
       
   675     CleanupStack::PopAndDestroy( columnName );
       
   676 
       
   677 
       
   678     CMUILOGGER_LEAVEFN( "CConnectionInfoBase::ToDetailsListBoxItemTextL" );
       
   679 
       
   680     return listBoxItemText;
       
   681     }
       
   682 
       
   683 // ---------------------------------------------------------
       
   684 // CConnectionInfoBase::ToDetailsListBoxItemTextWithAppendL
       
   685 // ---------------------------------------------------------
       
   686 //
       
   687 void  CConnectionInfoBase::ToDetailsListBoxItemTextWithAppendL(
       
   688                                                 const TUint aResourceId,
       
   689                                                 const HBufC* aValueText )
       
   690     {
       
   691     HBufC* listBoxItemText = ToDetailsListBoxItemTextL( aResourceId,
       
   692                                                         aValueText );
       
   693     CleanupStack::PushL( listBoxItemText );
       
   694     CMUILOGGER_WRITE_F( "LISTBOXITEM: %S", listBoxItemText );
       
   695     iDetailsArray->AppendL( *listBoxItemText );
       
   696     CleanupStack::PopAndDestroy( listBoxItemText );
       
   697     }
       
   698 
       
   699 
       
   700 // ---------------------------------------------------------
       
   701 // CConnectionInfoBase::ToDetailsListBoxItemTextWithReplaceL
       
   702 // ---------------------------------------------------------
       
   703 //
       
   704 void  CConnectionInfoBase::ToDetailsListBoxItemTextWithReplaceL(
       
   705                                                     const TUint aResourceId,
       
   706                                                     const HBufC* aValueText,
       
   707                                                     TInt aIndex )
       
   708     {
       
   709     CMUILOGGER_ENTERFN
       
   710         ( "CConnectionInfoBase::ToDetailsListBoxItemTextWithReplaceL" );
       
   711     CMUILOGGER_WRITE_F( "aValueText: %S", aValueText );
       
   712 
       
   713     if ( /*( iDetailsArray ) && */
       
   714             ( aIndex < iDetailsArray->Count() ) &&
       
   715                 ( aIndex > KErrNotFound ) )
       
   716         {
       
   717         HBufC* listBoxItemText = ToDetailsListBoxItemTextL( aResourceId,
       
   718                                                             aValueText );
       
   719         iDetailsArray->Delete( aIndex );
       
   720         CleanupStack::PushL( listBoxItemText );
       
   721         iDetailsArray->InsertL( aIndex, *listBoxItemText );
       
   722         CleanupStack::PopAndDestroy( listBoxItemText );
       
   723         iDetailsArray->Compress();
       
   724         }
       
   725     CMUILOGGER_LEAVEFN
       
   726         ( "CConnectionInfoBase::ToDetailsListBoxItemTextWithReplaceL" );
       
   727 
       
   728     }
       
   729 
       
   730 // ---------------------------------------------------------
       
   731 // CConnectionInfoBase::ToStringBearerLC
       
   732 // ---------------------------------------------------------
       
   733 //
       
   734 HBufC* CConnectionInfoBase::ToStringBearerLC() const
       
   735     {
       
   736     HBufC* bearer = NULL;
       
   737     TUint resourceId( 0 );
       
   738 
       
   739     // Bearer type
       
   740     if ( iConnectionBearerType == EBearerHSCSD ||
       
   741         iConnectionBearerType == EBearerExternalHSCSD )
       
   742         {
       
   743         resourceId = R_QTN_CMON_BEARER_HSCSD;
       
   744 
       
   745         }
       
   746     else if ( iConnectionBearerType == EBearerCSD ||
       
   747              iConnectionBearerType == EBearerExternalCSD ||
       
   748              iConnectionBearerType == EBearerWcdmaCSD ||
       
   749              iConnectionBearerType == EBearerExternalWcdmaCSD )
       
   750         {
       
   751         resourceId = R_QTN_SET_BEARER_DATA_CALL;
       
   752         }
       
   753     else if ( iConnectionBearerType == EBearerWLAN )
       
   754         {
       
   755         resourceId = R_QTN_WLAN_SETT_BEARER_WLAN;
       
   756         }
       
   757     else
       
   758         {
       
   759         resourceId = R_QTN_SET_BEARER_PACKET_DATA;
       
   760         }
       
   761 
       
   762     bearer = StringLoader::LoadLC( resourceId );
       
   763 
       
   764     return bearer;
       
   765     }
       
   766 
       
   767 
       
   768 // ---------------------------------------------------------
       
   769 // CConnectionInfoBase::ToStringStatusLC
       
   770 // ---------------------------------------------------------
       
   771 //
       
   772 HBufC* CConnectionInfoBase::ToStringStatusLC( TBool aIsDetailsView ) const
       
   773     {
       
   774     HBufC* status = NULL;
       
   775     TUint resourceId( 0 );
       
   776     switch ( iConnectionStatus )
       
   777         {
       
   778         case EConnectionCreated:
       
   779             {
       
   780             if ( iUpSpeed.quot || iUpSpeed.rem ||
       
   781                 iDownSpeed.quot || iDownSpeed.rem )
       
   782                 {
       
   783                 resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_ACTIVE 
       
   784                                             : R_QTN_CMON_STATUS_ACTIVE;
       
   785                 }
       
   786             else
       
   787                 {
       
   788                 resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_IDLE 
       
   789                                             : R_QTN_CMON_STATUS_IDLE;
       
   790                 }
       
   791             break;
       
   792             }
       
   793         case EConnectionUninitialized:
       
   794         case EConnectionClosed:
       
   795             {
       
   796             resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_CLOSED 
       
   797                                         : R_QTN_CMON_STATUS_CLOSED;
       
   798             break;
       
   799             }
       
   800         case EConnectionClosing:
       
   801             {
       
   802             resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_CLOSING 
       
   803                                         : R_QTN_CMON_STATUS_CLOSING;
       
   804             break;
       
   805             }
       
   806         case EConnectionSuspended:
       
   807             {
       
   808             resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_SUSPENDED 
       
   809                                         : R_QTN_CMON_STATUS_SUSPENDED;
       
   810             break;
       
   811             }
       
   812         case EConnectionCreating:
       
   813         default :
       
   814             {
       
   815             resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_CREATING 
       
   816                                         : R_QTN_CMON_STATUS_CREATING;
       
   817             break;
       
   818             }
       
   819         }
       
   820 
       
   821     status = StringLoader::LoadLC( resourceId );
       
   822 
       
   823     return status;
       
   824     }
       
   825     
       
   826     
       
   827 // ---------------------------------------------------------
       
   828 // CConnectionInfoBase::ToStringTotalTransmittedDataLC
       
   829 // ---------------------------------------------------------
       
   830 //
       
   831 HBufC* CConnectionInfoBase::ToStringTotalTransmittedDataLC() const
       
   832     {
       
   833     TUint total = iUploaded + iDownloaded;
       
   834     CMUILOGGER_WRITE_F( "iUploaded : %d", iUploaded );
       
   835     CMUILOGGER_WRITE_F( "iDownloaded : %d", iDownloaded );
       
   836     CMUILOGGER_WRITE_F( "total : %d", total );
       
   837     
       
   838     return ToStringLoadedDataLC( total );
       
   839     }
       
   840 
       
   841 // ---------------------------------------------------------
       
   842 // CConnectionInfoBase::ToStringSentDataLC
       
   843 // ---------------------------------------------------------
       
   844 //
       
   845 HBufC* CConnectionInfoBase::ToStringSentDataLC( TBool aToBeThreeDigit ) const
       
   846     {
       
   847     return ToStringLoadedDataLC( iUploaded, aToBeThreeDigit, KUpArrowChar );
       
   848     }
       
   849 
       
   850 
       
   851 // ---------------------------------------------------------
       
   852 // CConnectionInfoBase::ToStringReceivedDataLC
       
   853 // ---------------------------------------------------------
       
   854 //
       
   855 HBufC* CConnectionInfoBase::ToStringReceivedDataLC( TBool aToBeThreeDigit ) const
       
   856     {
       
   857     return ToStringLoadedDataLC( iDownloaded, aToBeThreeDigit, KDownArrowChar );
       
   858     }
       
   859 
       
   860 
       
   861 // ---------------------------------------------------------
       
   862 // CConnectionInfoBase::ToStringTransferSpeedUpLC
       
   863 // ---------------------------------------------------------
       
   864 //
       
   865 HBufC* CConnectionInfoBase::ToStringTransferSpeedUpLC() const
       
   866     {
       
   867     return ToStringTransferSpeedLC( iUpSpeed, KUpArrowChar );
       
   868     }
       
   869 
       
   870 
       
   871 // ---------------------------------------------------------
       
   872 // CConnectionInfoBase::ToStringTransferSpeedDownLC
       
   873 // ---------------------------------------------------------
       
   874 //
       
   875 HBufC* CConnectionInfoBase::ToStringTransferSpeedDownLC() const
       
   876     {
       
   877     return ToStringTransferSpeedLC( iDownSpeed, KDownArrowChar );
       
   878     }
       
   879 
       
   880 
       
   881 // ---------------------------------------------------------
       
   882 // CConnectionInfoBase::ToStringDurationLC
       
   883 // ---------------------------------------------------------
       
   884 //
       
   885 HBufC* CConnectionInfoBase::ToStringDurationLC() const
       
   886     {
       
   887     const TUint KTimeStringLength = 64;
       
   888     const TUint KTimeFormatBuf = 16;
       
   889     const TUint KDateFormatBuf = 16;
       
   890     _LIT( KDayFormat, "%d" );
       
   891 
       
   892 
       
   893     TTime now;
       
   894     now.UniversalTime();
       
   895     HBufC* timeString = NULL;
       
   896     
       
   897     TTimeIntervalDays days = NULL;
       
   898     
       
   899     if  ( iStartTime != NULL )
       
   900         {
       
   901         // calculate days passed since connection started
       
   902         days = now.DaysFrom( iStartTime );
       
   903         CMUILOGGER_WRITEF( _L( "ToStringDurationLC days before: %d" ),
       
   904                                days.Int() );
       
   905         }
       
   906     
       
   907     // passed time since connection established.
       
   908     if ( days.Int() <= 0 )
       
   909         // it's still within 1 day
       
   910         {
       
   911         timeString = HBufC::NewLC( KTimeStringLength );
       
   912         TPtr16 tempBuf( timeString->Des() );
       
   913 
       
   914         HBufC* temp = StringLoader::LoadLC( R_QTN_TIME_DURAT_LONG_WITH_ZERO );
       
   915 
       
   916         iDuration.FormatL( tempBuf, *temp );
       
   917         CleanupStack::PopAndDestroy( temp );
       
   918         }
       
   919     else
       
   920         // more than 1 day
       
   921         {
       
   922         CMUILOGGER_WRITEF( _L( "ToStringDurationLC days after: %d" ),
       
   923                                days.Int() );
       
   924             
       
   925         TBuf<KDateFormatBuf>  dayFormat;
       
   926         dayFormat.Format( KDayFormat, days.Int() );
       
   927 
       
   928         // format time format string
       
   929         HBufC* tempFormat = StringLoader::LoadLC(
       
   930                                             R_QTN_TIME_DURAT_SHORT_WITH_ZERO );
       
   931         TBuf<KTimeFormatBuf> tempBuf;
       
   932 
       
   933         // format hours:mins
       
   934         iDuration.FormatL( tempBuf, *tempFormat );
       
   935 
       
   936         CDesCArrayFlat* strings = new( ELeave ) CDesCArrayFlat( 2 );
       
   937         CleanupStack::PushL( strings );
       
   938 
       
   939         strings->AppendL( dayFormat );
       
   940         strings->AppendL( tempBuf );
       
   941 
       
   942         timeString = StringLoader::LoadL( R_QTN_CMON_DURATION_OVER_24H,
       
   943                                           *strings );
       
   944 
       
   945         CleanupStack::PopAndDestroy( strings );
       
   946         CleanupStack::PopAndDestroy( tempFormat );
       
   947         CleanupStack::PushL( timeString );
       
   948         }
       
   949 
       
   950     CMUILOGGER_WRITE_F( "duration time1: %S", timeString );
       
   951     
       
   952     TPtr temp( timeString->Des() );
       
   953     AknTextUtils::DisplayTextLanguageSpecificNumberConversion( temp );
       
   954     CMUILOGGER_WRITE_F( "duration temp: %S", &temp );
       
   955     
       
   956     CMUILOGGER_WRITE_F( "duration time2: %S", timeString );
       
   957     
       
   958 
       
   959     return timeString;
       
   960     }
       
   961 
       
   962 
       
   963 // ---------------------------------------------------------
       
   964 // CConnectionInfoBase::CheckMrouterIap
       
   965 // ---------------------------------------------------------
       
   966 //
       
   967 TBool CConnectionInfoBase::CheckMrouterIap()
       
   968     {
       
   969     CMUILOGGER_ENTERFN( "CheckMrouterIap" );
       
   970     TBool result( ETrue );
       
   971 
       
   972     CMUILOGGER_WRITE_F( "IAP name: %S", &iConnectionName );
       
   973     iConnectionName.Trim();
       
   974     if ( iConnectionName.Left(
       
   975                       KMrouterName().Length() ).CompareF( KMrouterName ) )
       
   976         {
       
   977         result = EFalse;
       
   978         }
       
   979     CMUILOGGER_LEAVEFN( "CheckMrouterIap" );
       
   980     return result;
       
   981     }
       
   982 
       
   983 
       
   984 // ---------------------------------------------------------
       
   985 // CConnectionInfoBase::ToStringLoadedDataLC
       
   986 // ---------------------------------------------------------
       
   987 //
       
   988 HBufC* CConnectionInfoBase::ToStringLoadedDataLC( TUint aLoadedData, 
       
   989                                                   TBool aToBeThreeDigit, 
       
   990                                                   const TUint aArrowChar ) const
       
   991     {
       
   992     const TUint KTransferedBytesFormatBuf = 16;
       
   993     const TUint KTransferedBytesWidth = 10;
       
   994     TUint transferedBytesDecimalPlaces(2);
       
   995     TUint resId;
       
   996     HBufC* loadedTxt = NULL;
       
   997 
       
   998     TBuf<KTransferedBytesFormatBuf> buf;
       
   999 
       
  1000     if ( aLoadedData < 1000 )          // bytes
       
  1001         {
       
  1002         if ( aToBeThreeDigit ) // added arrow to listbox
       
  1003             {
       
  1004             _LIT( KUdLinkFormatBytes, "%c%d" );
       
  1005 
       
  1006             buf.Format( KUdLinkFormatBytes, aArrowChar, aLoadedData );
       
  1007             }
       
  1008         else
       
  1009             {
       
  1010             _LIT( KUdLinkFormatBytes, "%d" );
       
  1011 
       
  1012             buf.Format( KUdLinkFormatBytes, aLoadedData );
       
  1013             }
       
  1014         resId = R_QTN_LOG_GPRS_AMOUNT_B;
       
  1015         }
       
  1016     else
       
  1017         {                           // KB, MB, GB
       
  1018         TUint denom;
       
  1019 
       
  1020         if ( aLoadedData < 1000 * 1024 )
       
  1021             {
       
  1022             denom = 1024;
       
  1023             resId = R_QTN_LOG_GPRS_AMOUNT_KB;
       
  1024             }
       
  1025         else if ( aLoadedData < 1000 * 1024 * 1024 )
       
  1026             {
       
  1027             denom = 1024 * 1024;
       
  1028             resId = R_QTN_LOG_GPRS_AMOUNT_MB;
       
  1029             }
       
  1030         else
       
  1031             {
       
  1032             denom = 1024 * 1024 * 1024;
       
  1033             resId = R_QTN_LOG_GPRS_AMOUNT_GB;
       
  1034             }
       
  1035 
       
  1036         TReal value = STATIC_CAST( TReal, aLoadedData ) /
       
  1037                       STATIC_CAST( TReal, denom );
       
  1038                       
       
  1039 		if ( aToBeThreeDigit )
       
  1040 			{
       
  1041 			if ( value < 10 )	// number of decimal places
       
  1042 				{
       
  1043 				transferedBytesDecimalPlaces = 2;
       
  1044 				}
       
  1045 			else if ( value < 100 )
       
  1046 				{
       
  1047 				transferedBytesDecimalPlaces = 1;
       
  1048 				}
       
  1049 			else
       
  1050 				{
       
  1051 				transferedBytesDecimalPlaces = 0;
       
  1052 				}
       
  1053 			}
       
  1054 
       
  1055 		TRealFormat Format( KTransferedBytesWidth, 
       
  1056 							transferedBytesDecimalPlaces );
       
  1057 
       
  1058         HBufC* number = HBufC::NewLC( KTransferedBytesWidth );
       
  1059         number->Des().Num( value, Format );
       
  1060 
       
  1061         if ( aToBeThreeDigit ) // added arrow to listbox
       
  1062             {
       
  1063             _LIT( KUdFormatLarge, "%c%S" );
       
  1064             buf.Format( KUdFormatLarge, aArrowChar, number );
       
  1065             }
       
  1066         else
       
  1067             {
       
  1068             _LIT( KUdFormatLarge, "%S" );
       
  1069             buf.Format( KUdFormatLarge, number );
       
  1070             }
       
  1071         CleanupStack::PopAndDestroy( number );
       
  1072         }
       
  1073 
       
  1074     loadedTxt = StringLoader::LoadLC( resId, buf );
       
  1075 
       
  1076     TPtr temp( loadedTxt->Des() );
       
  1077     AknTextUtils::DisplayTextLanguageSpecificNumberConversion( temp );
       
  1078 
       
  1079     return  loadedTxt;
       
  1080     }
       
  1081 
       
  1082 
       
  1083 // ---------------------------------------------------------
       
  1084 // CConnectionInfoBase::ToStringTransferSpeedLC
       
  1085 // ---------------------------------------------------------
       
  1086 //
       
  1087 HBufC* CConnectionInfoBase::ToStringTransferSpeedLC( div_t aSpeed,
       
  1088                                                const TUint aArrowChar ) const
       
  1089     {
       
  1090     const TUint KUpDownSpeedBufSize = 16;
       
  1091     _LIT( KUdSpeedFmt, "%c%d%S%02d" );
       
  1092 
       
  1093     TBuf<KUpDownSpeedBufSize> buf;
       
  1094     TInt resId;
       
  1095 
       
  1096     HBufC* decSep = StringLoader::LoadLC( R_TEXT_CALC_DECIMAL_SEPARATOR );
       
  1097 
       
  1098     resId = R_QTN_CMON_DATA_TRANSF_RATE_UL;
       
  1099     buf.Format( KUdSpeedFmt, aArrowChar, aSpeed.quot, decSep, aSpeed.rem );
       
  1100 
       
  1101     CleanupStack::PopAndDestroy( decSep );
       
  1102 
       
  1103     HBufC* speedTxt = StringLoader::LoadLC( resId, buf );
       
  1104 
       
  1105     TPtr temp( speedTxt->Des() );
       
  1106     AknTextUtils::DisplayTextLanguageSpecificNumberConversion( temp );
       
  1107 
       
  1108     return speedTxt;
       
  1109     }
       
  1110 
       
  1111 // ---------------------------------------------------------
       
  1112 // CConnectionInfoBase::InitializeConnectionInfoL
       
  1113 // ---------------------------------------------------------
       
  1114 //
       
  1115 void CConnectionInfoBase::InitializeConnectionInfoL()
       
  1116     {
       
  1117     CMUILOGGER_WRITE( "InitializeConnectionInfoL - start " );
       
  1118     TConnMonTimeBuf timeBuf;
       
  1119     iActiveWrapper->StartGetConnTime( iConnectionId,
       
  1120                                       iConnectionMonitor,
       
  1121                                       timeBuf );
       
  1122     TInt err( iActiveWrapper->iStatus.Int() );
       
  1123     CMUILOGGER_WRITE_F( "IntiConnectionInfo() status: %d", err );
       
  1124     if ( err != KErrNone )
       
  1125         {
       
  1126         User::Leave( err );
       
  1127         }
       
  1128 
       
  1129     iStartTime = timeBuf();
       
  1130     TDateTime dt = iStartTime.DateTime();
       
  1131     CMUILOGGER_WRITE_F( "Day : %d", dt.Day() );
       
  1132     CMUILOGGER_WRITE_F( "Hour : %d", dt.Hour() );
       
  1133     CMUILOGGER_WRITE_F( "Minute : %d", dt.Minute() );
       
  1134     CMUILOGGER_WRITE_F( "Second : %d", dt.Second() );
       
  1135     
       
  1136     
       
  1137     RefreshDetailsL();
       
  1138     if ( !iDetailsArray )
       
  1139         {
       
  1140         ToArrayDetailsL();
       
  1141         }
       
  1142     CMUILOGGER_WRITE( "InitializeConnectionInfoL - end " );
       
  1143     }
       
  1144 
       
  1145 // ---------------------------------------------------------
       
  1146 // CConnectionInfoBase::StringMarkerRemoval
       
  1147 // ---------------------------------------------------------
       
  1148 //
       
  1149 void CConnectionInfoBase::StringMarkerRemoval( HBufC* aStringHolder )
       
  1150     {
       
  1151     TPtr bufPtr = aStringHolder->Des();
       
  1152     
       
  1153     const TText KLRMarker = 0x200E;
       
  1154     const TText KRLMarker = 0x200F;
       
  1155 
       
  1156     TBuf<2> markers;
       
  1157     markers.Append( KLRMarker );
       
  1158     markers.Append( KRLMarker );
       
  1159 
       
  1160     // This function is requested to remove directional markers, because they
       
  1161     // cause a display error in languages such Hebrew. Directional markers will
       
  1162     // be correctly added later, when the one or two parts of the time string 
       
  1163     // are merged, again with StringLoader functions.
       
  1164     AknTextUtils::StripCharacters( bufPtr, markers ); 
       
  1165     }
       
  1166     
       
  1167 // ---------------------------------------------------------
       
  1168 // CConnectionInfoBase::ToStringAppNameLC
       
  1169 // ---------------------------------------------------------
       
  1170 //
       
  1171 HBufC* CConnectionInfoBase::ToStringAppNameLC( TInt aAppIndex )
       
  1172     {
       
  1173     HBufC* appName = ( iAppNames->MdcaPoint( aAppIndex ) ).AllocLC();
       
  1174     
       
  1175     return appName;
       
  1176     }
       
  1177 
       
  1178 // ---------------------------------------------------------
       
  1179 // CConnectionInfoBase::GetDeletedFromCMUI
       
  1180 // ---------------------------------------------------------
       
  1181 //
       
  1182 TBool CConnectionInfoBase::GetDeletedFromCMUI() const
       
  1183 	{
       
  1184 	return iDeletedFromCMUI;	
       
  1185 	}
       
  1186 
       
  1187 // ---------------------------------------------------------
       
  1188 // CConnectionInfoBase::SetAllDeletedFromCMUI
       
  1189 // ---------------------------------------------------------
       
  1190 //
       
  1191 void CConnectionInfoBase::SetAllDeletedFromCMUI()
       
  1192 	{
       
  1193 	iConnectionStatus = EConnectionClosing;
       
  1194 	}
       
  1195 
       
  1196 // ---------------------------------------------------------
       
  1197 // CConnectionInfoBase::SetDeletedFromCMUI
       
  1198 // ---------------------------------------------------------
       
  1199 //
       
  1200 void CConnectionInfoBase::SetDeletedFromCMUI()
       
  1201 	{
       
  1202 	iConnectionStatus = EConnectionClosing;
       
  1203 	
       
  1204 	iDeletedFromCMUI = ETrue;	
       
  1205 	}
       
  1206 
       
  1207 
       
  1208 // End of File