mobilemessaging/smum/src/SmumServiceCentreItemDialog.cpp
changeset 0 72b543305e3a
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:  
       
    15 *     A dialog for adding new and editing old service centres.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <SMUM.rsg>                     // resource identifiers
       
    23 #include <smutset.h>                    // CSmsSettings
       
    24 #include <aknappui.h>                   // CEikStatusPane
       
    25 #include <akntitle.h>                   // CAknTitlePane
       
    26 #include <StringLoader.h>               // StringLoader
       
    27 #include <commonphoneparser.h>          // CommonPhoneParser
       
    28 #include <aknnotewrappers.h>
       
    29 #include <eikmenup.h>                   // CEikMenuPane
       
    30 #include <hlplch.h>                     // For HlpLauncher
       
    31 #include <bldvariant.hrh>
       
    32 #include <csxhelp/mce.hlp.hrh>
       
    33 // locals
       
    34 #include "SmumSettingsDialogGSM.h"         // KStringLength
       
    35 #include "SmumServiceCentreItemDialog.h"// CSmumAddEditServiceCentreDialog
       
    36 #include "SMSU.HRH"                     // resource header
       
    37 #include "SmumServiceCentresDialog.h"   // CSmsServiceCentresDialog
       
    38 #include "SmumUtil.h"                   // SmumUtil
       
    39 #include "smsui.pan"
       
    40 #include "smum.loc"                      
       
    41 
       
    42 //For logging
       
    43 #include "SmumLogging.h"
       
    44 
       
    45 // CONSTANTS
       
    46 const TInt KSCNameLength = 100;
       
    47 const TInt KSmumGranularity = 4;
       
    48 const TInt KSmumReplaceCharacterCount = 2;
       
    49 
       
    50 // ================= MEMBER FUNCTIONS =======================
       
    51 
       
    52 // C++ constructor can NOT contain any code, that
       
    53 // might leave.
       
    54 CSmumAddEditServiceCentreDialog::CSmumAddEditServiceCentreDialog(
       
    55     TDes&           aName, 
       
    56     TDes&           aNumber,
       
    57     TInt&           aExitCode,
       
    58     TBool           aHelpFeatureSupported,
       
    59     CSmumSCArray*   aSCDlgsAddressesList,
       
    60     TBool			aSimSCsOnly ) 
       
    61         :iName                  ( aName ), 
       
    62         iNumber                 ( aNumber ),
       
    63         iExitCode               ( aExitCode ),
       
    64         iHelpFeatureSupported   ( aHelpFeatureSupported ),
       
    65         iSCDlgsAddressesList    ( aSCDlgsAddressesList ),
       
    66         iSimSCsOnly				( aSimSCsOnly )
       
    67     {
       
    68     }
       
    69 
       
    70 // Destructor
       
    71 CSmumAddEditServiceCentreDialog::~CSmumAddEditServiceCentreDialog()
       
    72     {
       
    73     SMUMLOGGER_ENTERFN(" CSmumAddEditServiceCentreDialog::~CSmumAddEditServiceCentreDialog");
       
    74     if ( iListBox )
       
    75         {
       
    76         iListBox->SetScrollBarFrame( NULL, CEikListBox::EOwnedExternally );
       
    77         }
       
    78     delete iPreviousTitleText;
       
    79     // iSettingsArray, iListBox, iSCDlgsAddressesList, iTitlePane are
       
    80     // plain pointers to objects owned by other classes which take
       
    81     // care also about deletion.
       
    82     SMUMLOGGER_LEAVEFN(" CSmumAddEditServiceCentreDialog::~CSmumAddEditServiceCentreDialog");
       
    83     }
       
    84 
       
    85 // ----------------------------------------------------
       
    86 // CSmumAddEditServiceCentreDialog::OkToExitL
       
    87 //
       
    88 // ----------------------------------------------------
       
    89 TInt CSmumAddEditServiceCentreDialog::OkToExitL( TInt aButtonId )
       
    90     {
       
    91     SMUMLOGGER_ENTERFN(" CSmumAddEditServiceCentreDialog::OkToExitL");
       
    92     TInt returnValue;
       
    93 
       
    94     switch( aButtonId )
       
    95         {
       
    96         case ESmsSettingsChoiceMenuChange:
       
    97 	        {
       
    98 	        ProcessCommandL( aButtonId );
       
    99 	        returnValue = EFalse; // Cannot exit, since MSK was pressed
       
   100 	        }     
       
   101 	        break;
       
   102         // menu / system exit
       
   103         case EAknSoftkeyCancel: 
       
   104             {
       
   105             if ( iExitCode != ESmumSmsSettingsMenuExit &&
       
   106                 iExitCode != ESmumSmsSettingsSystemExit )
       
   107                 {
       
   108                 // system exit
       
   109                 iExitCode = ESmumSmsSettingsSystemExit;
       
   110                 }
       
   111             TRAP_IGNORE( ClosingSCItemDialogL() ); 
       
   112             returnValue = ETrue; // to be sure of not leaving and exiting
       
   113             }
       
   114             break;
       
   115         case EAknSoftkeyBack:
       
   116             {
       
   117             iExitCode = ESmumSmsSettingsBack;
       
   118             returnValue = ClosingSCItemDialogL();
       
   119             }
       
   120             break;
       
   121         default :
       
   122             returnValue = CAknDialog::OkToExitL( aButtonId );
       
   123             break;
       
   124         }
       
   125 
       
   126     SMUMLOGGER_LEAVEFN(" CSmumAddEditServiceCentreDialog::OkToExitL");
       
   127     return returnValue;
       
   128     }
       
   129 
       
   130 // ----------------------------------------------------
       
   131 // CSmumAddEditServiceCentreDialog::HandleListBoxEventL
       
   132 //
       
   133 // ----------------------------------------------------
       
   134 void CSmumAddEditServiceCentreDialog::HandleListBoxEventL(
       
   135     CEikListBox* /*aListBox*/, 
       
   136     TListBoxEvent aEventType )
       
   137     {
       
   138     SMUMLOGGER_ENTERFN(" CSmumAddEditServiceCentreDialog::HandleListBoxEventL");
       
   139     switch( aEventType )
       
   140         {
       
   141         case EEventEnterKeyPressed:
       
   142         case EEventItemSingleClicked:
       
   143             //for touch input
       
   144             OpenSettingPageL( ETrue );            
       
   145             break;
       
   146         default :
       
   147             // panic
       
   148             break;
       
   149         }
       
   150     SMUMLOGGER_LEAVEFN(" CSmumAddEditServiceCentreDialog::HandleListBoxEventL");
       
   151     }
       
   152 
       
   153 // ----------------------------------------------------
       
   154 // CSmumAddEditServiceCentreDialog::OfferKeyEventL
       
   155 //
       
   156 // ----------------------------------------------------
       
   157 TKeyResponse CSmumAddEditServiceCentreDialog::OfferKeyEventL(
       
   158     const TKeyEvent& aKeyEvent,
       
   159     TEventCode aType )
       
   160     {
       
   161     TKeyResponse returnValue = CAknDialog::OfferKeyEventL( aKeyEvent, aType );
       
   162     return returnValue;
       
   163     }
       
   164 
       
   165 // ----------------------------------------------------
       
   166 // CSmumAddEditServiceCentreDialog::ProcessCommandL
       
   167 //
       
   168 // ----------------------------------------------------
       
   169 void CSmumAddEditServiceCentreDialog::ProcessCommandL(
       
   170     TInt aCommandId )
       
   171     {
       
   172     SMUMLOGGER_ENTERFN(" CSmumAddEditServiceCentreDialog::ProcessCommandL");
       
   173     CAknDialog::ProcessCommandL( aCommandId ) ;
       
   174     switch ( aCommandId )
       
   175         {
       
   176         case ESmsSettingsChoiceMenuChange:
       
   177             OpenSettingPageL( EFalse );
       
   178         break;
       
   179         case EAknCmdHelp:           
       
   180             LaunchHelpL();            
       
   181             break;
       
   182         case ESmsSettingsChoiceMenuExit:
       
   183             { 
       
   184             iExitCode = ESmumSmsSettingsMenuExit;
       
   185             TryExitL( EAknSoftkeyCancel );
       
   186             }
       
   187             break;
       
   188         default :
       
   189             // panic
       
   190             break ;
       
   191         }
       
   192     SMUMLOGGER_LEAVEFN(" CSmumAddEditServiceCentreDialog::ProcessCommandL");
       
   193     }
       
   194 
       
   195 // ----------------------------------------------------
       
   196 // CSmumAddEditServiceCentreDialog::OpenSettingPageL
       
   197 //
       
   198 // ----------------------------------------------------
       
   199 void CSmumAddEditServiceCentreDialog::OpenSettingPageL(
       
   200     TBool aEnterPressed )
       
   201     {
       
   202     SMUMLOGGER_ENTERFN(" CSmumAddEditServiceCentreDialog::OpenSettingPageL");
       
   203     TInt index = iListBox->CurrentItemIndex();
       
   204     __ASSERT_DEBUG( index >= 0 , Panic( ESmsetdlgInvalidIndex ));
       
   205 	
       
   206 	if ( iSimSCsOnly ) // Only Sim SC's variation is on
       
   207 	    {
       
   208 		SmumUtil::ShowInformationNoteL( R_QTN_SMS_EMAIL_SETT_CANNOT_CHANGE );
       
   209 		return;
       
   210 	    }    
       
   211     if ( KErrNotFound != index )//check we have something in listbox
       
   212         {
       
   213         // Launched from CSmsMainSettingsDialog (no centres), 
       
   214         // so complex checking of names not needed.
       
   215         if ( !iSCDlgsAddressesList && ESmumServiceCentreName == index )
       
   216             {
       
   217             iSettingsArray->EditItemL( index, aEnterPressed );
       
   218             //Clear unwanted characters
       
   219             ReplaceCharacters( 
       
   220                 iSettingsArray->At( ESmumServiceCentreName ).iUserText );
       
   221             // Update title to show service centre name
       
   222             iTitlePane->SetTextL(
       
   223                 iSettingsArray->At( ESmumServiceCentreName ).iUserText );
       
   224             }
       
   225         // ESmumServiceCentreName is to be modified ? 
       
   226         else if ( ESmumServiceCentreName == index )
       
   227             {
       
   228             ModifyScNameL( aEnterPressed, index );
       
   229             }
       
   230         else{ // No, ESmumServiceCentreNumber is to be modified 
       
   231             ModifyScNumberL( aEnterPressed, index );
       
   232             }
       
   233         iListBox->DrawNow();
       
   234         }
       
   235     SMUMLOGGER_LEAVEFN(" CSmumAddEditServiceCentreDialog::OpenSettingPageL");
       
   236     }
       
   237 
       
   238 // ---------------------------------------------------------
       
   239 // CSmumAddEditServiceCentreDialog::DynInitMenuPaneL
       
   240 //
       
   241 // ---------------------------------------------------------
       
   242 void CSmumAddEditServiceCentreDialog::DynInitMenuPaneL(
       
   243     TInt aMenuId, 
       
   244     CEikMenuPane* aMenuPane)
       
   245     {
       
   246     SMUMLOGGER_ENTERFN(" CSmumAddEditServiceCentreDialog::DynInitMenuPaneL");
       
   247     switch ( aMenuId )
       
   248         {
       
   249         case R_SMS_SERVICECENTRE_ITEM_CHOICE_MENUPANE:
       
   250         	if ( iSimSCsOnly ) // Only Sim SC's variation is on
       
   251                 {
       
   252 	            aMenuPane->SetItemDimmed( ESmsSettingsChoiceMenuChange, ETrue );    	
       
   253 	            }  
       
   254             // Help handling
       
   255             aMenuPane->SetItemDimmed( EAknCmdHelp, !iHelpFeatureSupported );
       
   256             break;
       
   257         default :
       
   258             // panic
       
   259             break;
       
   260         }
       
   261     SMUMLOGGER_LEAVEFN(" CSmumAddEditServiceCentreDialog::DynInitMenuPaneL");
       
   262     }
       
   263 
       
   264 // ----------------------------------------------------
       
   265 // CSmumAddEditServiceCentreDialog::ModifyScNameL
       
   266 //
       
   267 // ----------------------------------------------------
       
   268 void CSmumAddEditServiceCentreDialog::ModifyScNameL( TBool aEnterPressed, TInt aIndex )
       
   269     {
       
   270     SMUMLOGGER_ENTERFN(" CSmumAddEditServiceCentreDialog::ModifyScNameL");
       
   271     TBuf<KSmumStringLength> name;
       
   272     TBool canExit = EFalse;
       
   273     TBool found = EFalse;
       
   274     const TInt lBoxCount = iSCDlgsAddressesList->Count();
       
   275     // Take the original name safe
       
   276     TBuf<KSCNameLength> origName = iSettingsArray->At( ESmumServiceCentreName ).iUserText;
       
   277     
       
   278     // Check for dublicates
       
   279     while ( !canExit )
       
   280         {
       
   281         // Did user press ok in setting page ?
       
   282         if ( iSettingsArray->EditItemL( aIndex, aEnterPressed ))
       
   283             {
       
   284             // yes, ok pressed
       
   285             ReplaceCharacters( iSettingsArray->At( ESmumServiceCentreName ).iUserText );
       
   286             iSettingsArray->At( ESmumServiceCentreName ).iUserText.Trim();
       
   287             name = iSettingsArray->At( ESmumServiceCentreName ).iUserText;
       
   288             found = EFalse;
       
   289             // Do we have many service centres defined ?
       
   290             if ( lBoxCount )
       
   291                 {
       
   292                 // Loop lBoxCount through for duplicates
       
   293                 for ( TInt loop=0; loop < lBoxCount && !found; loop++ )
       
   294                     {
       
   295                     if ( name != iSCDlgsAddressesList->SCNameInfo( loop ).Name()
       
   296                         || name == iName )
       
   297                         {                
       
   298                         canExit = ETrue;
       
   299                         // Update title to show service centre name
       
   300                         iTitlePane->SetTextL(
       
   301                             iSettingsArray->At( ESmumServiceCentreName ).iUserText);
       
   302                         }
       
   303                     else 
       
   304                         {
       
   305                         // Show "already in use"-query
       
   306                         HBufC* errorText = StringLoader::LoadLC(
       
   307                             R_QTN_FLDR_RENAME_QUERY, name, iCoeEnv );
       
   308                         CAknQueryDialog* dlg = CAknQueryDialog::NewL();
       
   309                         if ( !( dlg->ExecuteLD(R_SC_NAME_ALREADY_IN_USE_QUERY, *errorText )))
       
   310                             {// Rename? -> No, so cancelling name changing operation
       
   311                             CleanupStack::PopAndDestroy(); // errorText
       
   312                             iSettingsArray->At( ESmumServiceCentreName ).iUserText = origName;
       
   313                             return;
       
   314                             }
       
   315                         
       
   316                         CleanupStack::PopAndDestroy(); // errorText
       
   317                         
       
   318                         found = ETrue;
       
   319                         canExit = EFalse;
       
   320                         }
       
   321                     }
       
   322                 }
       
   323             else // no service centres, so no need to check for duplicates, can exit 
       
   324                 {
       
   325                 canExit = ETrue;
       
   326                 // Update title to show service centre name
       
   327                 iTitlePane->SetTextL(
       
   328                     iSettingsArray->At( ESmumServiceCentreName ).iUserText);
       
   329                 }
       
   330             }
       
   331         else
       
   332             {
       
   333             // no, cancel pressed
       
   334             canExit = ETrue;
       
   335             iSettingsArray->At( ESmumServiceCentreName ).iUserText = origName;
       
   336             }
       
   337         }
       
   338     SMUMLOGGER_LEAVEFN(" CSmumAddEditServiceCentreDialog::ModifyScNameL");
       
   339     }
       
   340 
       
   341 // ----------------------------------------------------
       
   342 // CSmumAddEditServiceCentreDialog::ModifyScNumberL
       
   343 //
       
   344 // ----------------------------------------------------
       
   345 void CSmumAddEditServiceCentreDialog::ModifyScNumberL( TBool aEnterPressed, TInt aIndex )
       
   346     {
       
   347     SMUMLOGGER_ENTERFN(" CSmumAddEditServiceCentreDialog::ModifyScNumberL");
       
   348     TBool validNumber = EFalse;
       
   349     TBool canExit = EFalse;
       
   350 
       
   351     // Take the original number safe
       
   352     TBuf<KSCNameLength> origNumber = iSettingsArray->At( ESmumServiceCentreNumber ).iUserText;
       
   353     
       
   354     // Check for dublicates
       
   355     while ( !canExit )
       
   356         {
       
   357         // Did user press ok in setting page ?
       
   358         if ( iSettingsArray->EditItemL( aIndex, aEnterPressed ))
       
   359             {
       
   360             // yes, ok pressed
       
   361             
       
   362             // Check number with commonphoneparser
       
   363             validNumber = CommonPhoneParser::ParsePhoneNumber( 
       
   364                 iSettingsArray->At(ESmumServiceCentreNumber).iUserText,
       
   365                 CommonPhoneParser::ESMSNumber );
       
   366             
       
   367             if ( validNumber )
       
   368                 {                
       
   369                 canExit = ETrue;
       
   370                 }
       
   371             else 
       
   372                 {
       
   373                 // Show "invalid number"-note
       
   374                 CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue ); // Wait-flag on 
       
   375                 HBufC* text = StringLoader::LoadLC( R_QTN_INFO_INVALID_NUMBER, iCoeEnv );
       
   376                 note->ExecuteLD( *text );
       
   377                 CleanupStack::PopAndDestroy(); // text
       
   378                 canExit = EFalse;
       
   379                 }            
       
   380             }
       
   381         else
       
   382             {
       
   383             // no, cancel pressed
       
   384 
       
   385             // In case of cancel, restore the value
       
   386             iSettingsArray->At( ESmumServiceCentreNumber ).iUserText = origNumber;
       
   387             canExit = ETrue;
       
   388             }
       
   389         }
       
   390     SMUMLOGGER_LEAVEFN(" CSmumAddEditServiceCentreDialog::ModifyScNumberL");
       
   391     }
       
   392 
       
   393 // ----------------------------------------------------
       
   394 // CSmumAddEditServiceCentreDialog::PreLayoutDynInitL
       
   395 //
       
   396 // ----------------------------------------------------
       
   397 void CSmumAddEditServiceCentreDialog::PreLayoutDynInitL()
       
   398     {
       
   399     SMUMLOGGER_ENTERFN(" CSmumAddEditServiceCentreDialog::PreLayoutDynInitL");
       
   400     // Setting arrays in order
       
   401     iListBox = STATIC_CAST( CEikTextListBox*, Control( ESmsSCAddEditId ));
       
   402     iSettingsArray = CMuiuSettingsArray::NewL( R_SERVICECENTRE_ITEMS );
       
   403 
       
   404     // Arabic-indic conversion not to be done to SMSC Name
       
   405     (*iSettingsArray)[0].iLangSpecificNumConv = EFalse;
       
   406 
       
   407     // Are we adding a new SC? If so let's get a default name for it.
       
   408     if ( !iName.Size())
       
   409         {
       
   410         // Do we have a list of names?
       
   411         if ( iSCDlgsAddressesList )
       
   412             { // Yes, let's make a nameArray and provide it to FindDefaultNameForSCL
       
   413             CDesCArrayFlat* nameArray = new ( ELeave ) CDesCArrayFlat( KSmumGranularity );
       
   414             CleanupStack::PushL( nameArray );
       
   415             
       
   416             TInt amountOfSCs = iSCDlgsAddressesList->Count();
       
   417             for ( TInt loop = 0 ; loop < amountOfSCs; loop++ )
       
   418                 {
       
   419                 nameArray->AppendL( iSCDlgsAddressesList->SCNameInfo( loop ).Name());
       
   420                 }
       
   421             
       
   422             SmumUtil::FindDefaultNameForSCL( iName, EFalse, nameArray );
       
   423             CleanupStack::PopAndDestroy();// nameArray
       
   424             }
       
   425         else
       
   426             {// No, so this have to be first SC.
       
   427             SmumUtil::FindDefaultNameForSCL( iName, EFalse );
       
   428             }
       
   429         }
       
   430 
       
   431     iSettingsArray->At( ESmumServiceCentreName ).iUserText.Copy( iName );
       
   432     iSettingsArray->At( ESmumServiceCentreNumber ).iUserText.Copy( iNumber );
       
   433 
       
   434     iListBox->SetListBoxObserver( this );
       
   435 
       
   436     CTextListBoxModel* model = iListBox->Model();
       
   437     model->SetItemTextArray( iSettingsArray );
       
   438     // scroll bars
       
   439     iListBox->CreateScrollBarFrameL( ETrue );
       
   440     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
       
   441         CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
       
   442 
       
   443     // Fetch pointer to titlepane
       
   444     CEikStatusPane *sp =  ( STATIC_CAST(
       
   445         CAknAppUi*, ( CEikonEnv::Static()->EikAppUi())))->StatusPane();
       
   446     iTitlePane = STATIC_CAST (
       
   447         CAknTitlePane*, sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle )));
       
   448 
       
   449     // Take old titlepane text safe and replace with current sc name
       
   450     iPreviousTitleText = ( *iTitlePane->Text()).Alloc();
       
   451     iTitlePane->SetTextL( iName, ETrue );
       
   452     SMUMLOGGER_LEAVEFN(" CSmumAddEditServiceCentreDialog::PreLayoutDynInitL");
       
   453     }
       
   454 
       
   455 // ----------------------------------------------------
       
   456 // CSmumAddEditServiceCentreDialog::ClosingSCItemDialogL
       
   457 //
       
   458 // ----------------------------------------------------
       
   459 TBool CSmumAddEditServiceCentreDialog::ClosingSCItemDialogL()
       
   460     {
       
   461     SMUMLOGGER_ENTERFN(" CSmumAddEditServiceCentreDialog::ClosingSCItemDialogL");
       
   462     TBool retValue = EFalse;
       
   463 
       
   464     // Did user left empty fields?
       
   465     if ( !iSettingsArray->At( ESmumServiceCentreNumber ).iUserText.Size() ||
       
   466         !iSettingsArray->At( ESmumServiceCentreName ).iUserText.Size())
       
   467         { // Yes, we have empty fields
       
   468         if ( iExitCode == ESmumSmsSettingsMenuExit ||
       
   469              iExitCode == ESmumSmsSettingsSystemExit ) // Are we exiting?
       
   470             { // Exiting fast without any queries or titlepane updates
       
   471             iNumber.Zero();
       
   472             iName.Zero();
       
   473             retValue = ETrue;
       
   474             }
       
   475         else 
       
   476             {
       
   477             // do we delete it?
       
   478             CAknQueryDialog* dlg = CAknQueryDialog::NewL();
       
   479             if ( dlg->ExecuteLD( R_SC_WITHOUT_ALL_FIELDS_DELETE_QUERY ))
       
   480                 {// Yes
       
   481                 
       
   482                 // reset values
       
   483                 iNumber.Zero();
       
   484                 iName.Zero();
       
   485                 retValue = ETrue;
       
   486                 }
       
   487             }
       
   488         
       
   489         }
       
   490     else{ // no empty fields
       
   491         iNumber.Copy( iSettingsArray->At( ESmumServiceCentreNumber ).iUserText);
       
   492         iName.Copy( iSettingsArray->At( ESmumServiceCentreName ).iUserText);
       
   493         retValue = ETrue;
       
   494         }
       
   495     
       
   496     if ( retValue && iExitCode == ESmumSmsSettingsBack )
       
   497         {
       
   498         // Replace title with old title text
       
   499         iTitlePane->SetTextL( *iPreviousTitleText );
       
   500         }
       
   501 
       
   502     SMUMLOGGER_LEAVEFN(" CSmumAddEditServiceCentreDialog::ClosingSCItemDialogL");
       
   503     return retValue;
       
   504     }
       
   505 
       
   506 // ----------------------------------------------------
       
   507 // CSmumAddEditServiceCentreDialog::ReplaceCharacters
       
   508 //
       
   509 // ----------------------------------------------------
       
   510 void CSmumAddEditServiceCentreDialog::ReplaceCharacters( TDes& aText )
       
   511     {
       
   512     TBuf<KSmumReplaceCharacterCount> replaceChars;
       
   513     replaceChars.Zero();
       
   514     replaceChars.Append( CEditableText::EParagraphDelimiter );
       
   515     replaceChars.Append( CEditableText::ETabCharacter );
       
   516     AknTextUtils::ReplaceCharacters(
       
   517         aText, 
       
   518         replaceChars, 
       
   519         CEditableText::ESpace );
       
   520     }
       
   521 
       
   522 // ----------------------------------------------------
       
   523 // CSmumAddEditServiceCentreDialog::LaunchHelpL
       
   524 // launch help using context
       
   525 //
       
   526 // ----------------------------------------------------
       
   527 void CSmumAddEditServiceCentreDialog::LaunchHelpL()
       
   528     {
       
   529     if ( iHelpFeatureSupported )
       
   530         {
       
   531         CCoeAppUi* editorAppUi = STATIC_CAST(CCoeAppUi*, ControlEnv()->AppUi());
       
   532         CArrayFix<TCoeHelpContext>* helpContext = editorAppUi->AppHelpContextL();
       
   533         HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), helpContext );
       
   534         }
       
   535     }
       
   536 
       
   537 // ----------------------------------------------------
       
   538 // CSmumAddEditServiceCentreDialog::GetHelpContext
       
   539 // returns helpcontext as aContext
       
   540 //
       
   541 // ----------------------------------------------------
       
   542 void CSmumAddEditServiceCentreDialog::GetHelpContext
       
   543         (TCoeHelpContext& aContext) const
       
   544     {    
       
   545     const TUid KUidMce ={0x100058C5};      
       
   546     aContext.iMajor = KUidMce;
       
   547     aContext.iContext = KSMS_HLP_SETTINGS_SCENTRES_EDIT;
       
   548     }
       
   549 
       
   550 //  End of File  
       
   551