uiservicetab/vimpstui/src/cvimpstuitermsofusedlg.cpp
changeset 0 5e5d6b214f4f
child 6 78867dafe7eb
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2006 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:  UI dialog for showing the Terms of use of a certain server
       
    15 *
       
    16 */
       
    17 
       
    18 #include    "cvimpstuitermsofusedlg.h"
       
    19 
       
    20 #include    <txtrich.h>
       
    21 #include    <aknenv.h>
       
    22 #include    <AknSettingCache.h>
       
    23 #include    <bldvariant.hrh>
       
    24 #include    <AknQueryDialog.h>
       
    25 #include    <StringLoader.h>
       
    26 #include    <eikmenup.h>
       
    27 #include    <avkon.rsg>
       
    28 #include    <avkon.hrh>
       
    29 #include    <eikappui.h>
       
    30 #include    <eikenv.h>
       
    31 #include    <AknUtils.h>
       
    32 #include    <AknsUtils.h>
       
    33 #include    <hlplch.h>
       
    34 #include    <featmgr.h>
       
    35 #include    <AknsBasicBackgroundControlContext.h>
       
    36 #include    <aknEditStateIndicator.h>
       
    37 #include    <eikrted.h> // CEikRichTextEditor
       
    38 #include    <barsread.h>
       
    39 
       
    40 #include    <applayout.cdl.h> //cdl
       
    41 #include    <aknlayoutscalable_apps.cdl.h>
       
    42 
       
    43 #include    <vimpstuires.rsg>  
       
    44 // item finder (Automatic highlight)
       
    45 #include    <FindItemmenu.rsg>
       
    46 #include    <finditemmenu.h>
       
    47 #include    <finditem.hrh>
       
    48 #include    <finditemdialog.h>
       
    49 // title pane handling
       
    50 #include    <akntitle.h>
       
    51 #include    <aknlists.h>
       
    52 #include    <aknnavi.h>
       
    53 #include    <utf.h>
       
    54 #include    <txtetext.h>
       
    55 
       
    56 #include    <StringLoader.h>
       
    57 #include    "vimpstui.hrh"
       
    58 const TInt KTextMargin = 100;  // normal text margin in twips
       
    59 const TInt KSpaceBefore = 10;  // space before each paragraph (twips)
       
    60 const TInt KPixelsBetweenLines = 5; // pixels between text lines
       
    61 
       
    62 
       
    63 // ======== MEMBER FUNCTIONS ========
       
    64 
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // RunDialogLD
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 TInt CVIMPSTUiTermsOfUseDlg::RunDialogLD( TInt aResourceId )
       
    71     {
       
    72     TInt retVal;
       
    73     iRetVal = &retVal;
       
    74     
       
    75     ExecuteLD( aResourceId );
       
    76     
       
    77     return retVal;
       
    78     }
       
    79 
       
    80 // ---------------------------------------------------------------------------
       
    81 // NewL()
       
    82 // ---------------------------------------------------------------------------
       
    83 //
       
    84 CVIMPSTUiTermsOfUseDlg* CVIMPSTUiTermsOfUseDlg::NewL( )
       
    85     {
       
    86     CVIMPSTUiTermsOfUseDlg* self = CVIMPSTUiTermsOfUseDlg::NewLC( );
       
    87     CleanupStack::Pop( self );
       
    88     return self;
       
    89     }
       
    90 
       
    91 // ---------------------------------------------------------------------------
       
    92 // NewLC()
       
    93 // ---------------------------------------------------------------------------
       
    94 //
       
    95 CVIMPSTUiTermsOfUseDlg* CVIMPSTUiTermsOfUseDlg::NewLC( )
       
    96     {
       
    97     CVIMPSTUiTermsOfUseDlg* self = new( ELeave ) CVIMPSTUiTermsOfUseDlg;
       
    98     CleanupStack::PushL( self );
       
    99     self->ConstructL( );
       
   100     return self;
       
   101     }
       
   102 
       
   103 // ---------------------------------------------------------
       
   104 // CVIMPSTUiTermsOfUseDlg::ConstructL()
       
   105 // ---------------------------------------------------------
       
   106 //
       
   107 void CVIMPSTUiTermsOfUseDlg::ConstructL( )
       
   108     {
       
   109     
       
   110     iBgContext = CAknsBasicBackgroundControlContext::NewL( 
       
   111         KAknsIIDQsnBgAreaMainMessage, Rect(), ETrue );
       
   112     
       
   113     iItemFinder = CItemFinder::NewL();
       
   114     iItemFinder->AddObserver( *this );
       
   115  
       
   116     SetNewTitleTextL();
       
   117     }
       
   118 
       
   119 // ---------------------------------------------------------------------------
       
   120 // Destructor
       
   121 // ---------------------------------------------------------------------------
       
   122 //
       
   123 CVIMPSTUiTermsOfUseDlg::~CVIMPSTUiTermsOfUseDlg()
       
   124     {
       
   125     TRAP_IGNORE( RestoreTitlePaneTextL() );
       
   126     
       
   127     AknsUtils::DeregisterControlPosition( this );
       
   128 
       
   129     delete iBgContext;
       
   130     delete iItemFinder;    
       
   131     delete iOldTitleText;
       
   132     if(iToUText)
       
   133 	    {
       
   134 	    delete iToUText;
       
   135 	    }
       
   136     }
       
   137 
       
   138 // ---------------------------------------------------------------------------
       
   139 //  C++ constructor
       
   140 // ---------------------------------------------------------------------------
       
   141 //
       
   142 CVIMPSTUiTermsOfUseDlg::CVIMPSTUiTermsOfUseDlg()
       
   143     {
       
   144     }
       
   145 
       
   146 
       
   147 
       
   148 // ---------------------------------------------------------
       
   149 // CVIMPSTUiTermsOfUseDlg::HandleParsingComplete()
       
   150 // (other items were commented in a header).
       
   151 // ---------------------------------------------------------
       
   152 //
       
   153 void CVIMPSTUiTermsOfUseDlg::HandleParsingComplete()
       
   154     {
       
   155     //not implemented
       
   156     }
       
   157 // ---------------------------------------------------------
       
   158 // CVIMPSTUiTermsOfUseDlg::PreLayoutDynInitL()
       
   159 // (other items were commented in a header).
       
   160 // ---------------------------------------------------------
       
   161 //
       
   162 void CVIMPSTUiTermsOfUseDlg::PreLayoutDynInitL()
       
   163 	{						
       
   164 	CAknDialog::PreLayoutDynInitL();
       
   165     AknsUtils::RegisterControlPosition( this );
       
   166     
       
   167     iEditor = static_cast<CEikRichTextEditor*>( Control( ETOURichEditorId ) );   
       
   168 
       
   169     iParaFormatLayer = CParaFormatLayer::NewL(); 
       
   170     iEditor->SetParaFormatLayer( iParaFormatLayer );    // takes the ownership
       
   171     
       
   172     iCharFormatLayer = CCharFormatLayer::NewL();
       
   173     iEditor->SetCharFormatLayer( iCharFormatLayer );    // takes the ownership
       
   174     
       
   175     // Update text color from skin
       
   176     UpdateTextColorL();
       
   177     
       
   178     // Get ToU message
       
   179     if(iToUText)
       
   180 	    {
       
   181 	    iEditor->SetTextL( iToUText );
       
   182 	    delete iToUText;
       
   183 	    iToUText = NULL;
       
   184 	    }
       
   185     
       
   186     // Insert paragraph delimiter to make
       
   187     // iItemFinder scroll the view all the way down
       
   188     TChar lb( CEditableText::EParagraphDelimiter );
       
   189     iEditor->Text()->InsertL( iEditor->TextLength(), lb );
       
   190 
       
   191     iEditor->CreateScrollBarFrameL();
       
   192     // Only vertical scrollbar is needed
       
   193     iEditor->ScrollBarFrame()->SetScrollBarVisibilityL(
       
   194             CEikScrollBarFrame::EOff,CEikScrollBarFrame::EOn);
       
   195     iEditor->ScrollBarFrame()->SetScrollBarFrameObserver(this);
       
   196     
       
   197     }
       
   198 
       
   199 // -----------------------------------------------------------------------------
       
   200 // CVIMPSTUiTermsOfUseDlg::PostLayoutDynInitL
       
   201 // (other items were commented in a header).
       
   202 // -----------------------------------------------------------------------------
       
   203 //
       
   204 void CVIMPSTUiTermsOfUseDlg::PostLayoutDynInitL()
       
   205     {
       
   206     CAknDialog::PostLayoutDynInitL();
       
   207     
       
   208    
       
   209     iItemFinder->SetEditor( &iEditor );
       
   210     
       
   211     if ( iBgContext )
       
   212         {
       
   213         iBgContext->SetRect( Rect() );
       
   214         iBgContext->SetParentPos( PositionRelativeToScreen() );
       
   215         }
       
   216     // Try to scroll down
       
   217     if (! iItemFinder->NextItemOrScrollL( CItemFinder::ENextDown ) )
       
   218         {
       
   219         // at bottom => return
       
   220         UpdateCbaL();
       
   221         //return EFalse;
       
   222         }
       
   223     }
       
   224 
       
   225 // -----------------------------------------------------------------------------
       
   226 // CVIMPSTUiTermsOfUseDlg::SetSizeAndPosition
       
   227 // (other items were commented in a header).
       
   228 // -----------------------------------------------------------------------------
       
   229 //
       
   230 void CVIMPSTUiTermsOfUseDlg::SetSizeAndPosition( const TSize& /*aSize*/ )
       
   231     {    
       
   232     // dialog fills the mainpane
       
   233     TRect mainPane;
       
   234     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
       
   235     SetRect( mainPane );
       
   236     }
       
   237 
       
   238 // ---------------------------------------------------------
       
   239 // CVIMPSTUiTermsOfUseDlg::OkToExitL( TInt aButtonId )
       
   240 // (other items were commented in a header).
       
   241 // ---------------------------------------------------------
       
   242 //	
       
   243 TBool CVIMPSTUiTermsOfUseDlg::OkToExitL( TInt aButtonId )
       
   244 	{
       
   245 	switch( aButtonId )
       
   246 	    {
       
   247 	    case EAknSoftkeyCancel:
       
   248 	        {
       
   249 	        *iRetVal = EAknSoftkeyCancel;
       
   250 	        return ETrue;
       
   251 	        }
       
   252 	    case EIMPSCommonUITOUContinue:
       
   253 	        {            
       
   254 	        *iRetVal = EAknSoftkeyOk;
       
   255 	        return ETrue;
       
   256 	        }	   
       
   257 	    case EAknSoftkeyEmpty:
       
   258 	        {
       
   259 	        return EFalse;
       
   260 	        }
       
   261         default:
       
   262             {            
       
   263         	return ETrue;
       
   264             }
       
   265 	    }
       
   266 	}
       
   267 
       
   268 // -----------------------------------------------------------------------------
       
   269 // CVIMPSTUiTermsOfUseDlg::OfferKeyEventL
       
   270 // (other items were commented in a header).
       
   271 // -----------------------------------------------------------------------------
       
   272 //
       
   273 TKeyResponse CVIMPSTUiTermsOfUseDlg::OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   274                                                    TEventCode aType )
       
   275 	{
       
   276     if( aType != EEventKey )
       
   277         {
       
   278         return EKeyWasNotConsumed;
       
   279         }
       
   280 
       
   281     switch( aKeyEvent.iCode )
       
   282         {        
       
   283         case EKeyBackspace:
       
   284             {
       
   285             return EKeyWasConsumed;
       
   286             }
       
   287          
       
   288         case EKeyUpArrow:
       
   289             {
       
   290             TKeyResponse res =
       
   291                 iItemFinder->NextItemOrScrollL( CItemFinder::ENextUp ) ?
       
   292                    EKeyWasConsumed : EKeyWasNotConsumed;           
       
   293             return res;
       
   294             }
       
   295             
       
   296         case EKeyDownArrow:
       
   297             {
       
   298             TKeyResponse res =
       
   299                 iItemFinder->NextItemOrScrollL( CItemFinder::ENextDown ) ?
       
   300                    EKeyWasConsumed : EKeyWasNotConsumed;
       
   301             if ( res == EKeyWasConsumed )
       
   302                 {
       
   303                 UpdateCbaL();
       
   304                 }
       
   305             if ( !iItemFinder->NextItemOrScrollL( CItemFinder::ENextDown ) )
       
   306                 {
       
   307                 UpdateCbaL();
       
   308                 }
       
   309             return res;
       
   310             }
       
   311         
       
   312         case EKeyRightArrow:
       
   313             {
       
   314             return EKeyWasConsumed;
       
   315             }
       
   316             
       
   317         case EKeyEscape: // handle dialog shutdown.
       
   318             {
       
   319 			TryExitL( EAknSoftkeyExit );
       
   320             return EKeyWasConsumed;
       
   321             }
       
   322         default:
       
   323             {
       
   324             return EKeyWasConsumed;
       
   325             }
       
   326         }
       
   327     }
       
   328 
       
   329 void CVIMPSTUiTermsOfUseDlg::HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType)
       
   330     {
       
   331 
       
   332     if( !aScrollBar )
       
   333         {
       
   334         return ;
       
   335         }
       
   336     switch( aEventType )
       
   337         {
       
   338         
       
   339         case EEikScrollThumbDragVert :
       
   340         case EEikScrollDown:
       
   341         case EEikScrollBottom:
       
   342         case EEikScrollPageDown:
       
   343         case EEikScrollUp:
       
   344         case EEikScrollTop:
       
   345         case EEikScrollPageUp:
       
   346             {
       
   347 
       
   348             TInt pos = iEditor->ScrollBarFrame()->VerticalScrollBar()->ThumbPosition();
       
   349             iEditor->HandleScrollEventL(aScrollBar, aEventType);
       
   350             if( pos == iThumbMaxPos )
       
   351                 {
       
   352                 UpdateCbaL();
       
   353                 }
       
   354             break;
       
   355             }
       
   356         default:            
       
   357             break;
       
   358         }
       
   359 
       
   360     }
       
   361 // ---------------------------------------------------------
       
   362 // CVIMPSTUiTermsOfUseDlg::MopSupplyObject
       
   363 //
       
   364 // ---------------------------------------------------------
       
   365 //
       
   366 
       
   367 TTypeUid::Ptr CVIMPSTUiTermsOfUseDlg::MopSupplyObject( TTypeUid aId )
       
   368     { 
       
   369     if ( aId.iUid == MAknsControlContext::ETypeId )
       
   370         {
       
   371         return MAknsControlContext::SupplyMopObject( aId, iBgContext );
       
   372         }
       
   373 
       
   374     return CCoeControl::MopSupplyObject( aId );
       
   375     }
       
   376     
       
   377     
       
   378 // ---------------------------------------------------------
       
   379 // CVIMPSTUiTermsOfUseDlg::SizeChanged
       
   380 //
       
   381 // ---------------------------------------------------------
       
   382 //
       
   383 void CVIMPSTUiTermsOfUseDlg::SizeChanged()
       
   384     {   
       
   385     // base class method
       
   386     CAknDialog::SizeChanged();
       
   387     
       
   388     if ( iBgContext )
       
   389         {
       
   390         iBgContext->SetRect( Rect() );
       
   391         iBgContext->SetParentPos( PositionRelativeToScreen() );
       
   392         }
       
   393 
       
   394     if( iEditor )
       
   395         {
       
   396         TRect temp = Rect();
       
   397         temp.SetWidth(Rect().Width()-iEditor->ScrollBarFrame()->VerticalScrollBar()->ScrollBarBreadth());
       
   398         iEditor->SetRect( temp );
       
   399         }    
       
   400         
       
   401     // Update the font to correct size
       
   402     if( iParaFormatLayer && iCharFormatLayer )
       
   403         {
       
   404         // Correct font
       
   405         const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontSecondaryFont );
       
   406         
       
   407         // format richtext
       
   408         TInt lineSpacing( font->HeightInPixels() + KPixelsBetweenLines );
       
   409         CParaFormat paraFormat;
       
   410         TParaFormatMask paraFormatMask;
       
   411         paraFormat.iLineSpacingControl = 
       
   412                         CParaFormat::ELineSpacingExactlyInPixels;
       
   413         paraFormatMask.SetAttrib( EAttLineSpacingControl );
       
   414         paraFormat.iLineSpacingInTwips = lineSpacing;
       
   415         paraFormatMask.SetAttrib( EAttLineSpacing );
       
   416     	paraFormat.iLanguage = 
       
   417     	                CAknEnv::Static()->SettingCache().InputLanguage();
       
   418     	paraFormatMask.SetAttrib( EAttParaLanguage );
       
   419         paraFormat.iLeftMarginInTwips = KTextMargin;
       
   420         paraFormatMask.SetAttrib( EAttLeftMargin );
       
   421         paraFormat.iSpaceBeforeInTwips = KSpaceBefore;
       
   422         paraFormatMask.SetAttrib( EAttSpaceBefore );
       
   423 
       
   424         TCharFormat charFormat;
       
   425         TCharFormatMask charFormatMask;
       
   426         charFormat.iFontSpec = font->FontSpecInTwips();
       
   427         charFormatMask.SetAttrib( EAttFontTypeface );
       
   428         charFormatMask.SetAttrib( EAttFontHeight );
       
   429         
       
   430         //can't leave here
       
   431         TRAPD(err, iParaFormatLayer->SetL( &paraFormat, paraFormatMask );
       
   432                    iCharFormatLayer->SetL( charFormat, charFormatMask );
       
   433                    iEditor->HandleTextChangedL(); );
       
   434         if( err != KErrNone )
       
   435             {
       
   436             CActiveScheduler::Current()->Error( err );
       
   437             }       
       
   438 
       
   439         TRAP_IGNORE(iEditor->MoveDisplayL(TCursorPosition::EFPageDown) );
       
   440         TRAP_IGNORE(iEditor->MoveDisplayL(TCursorPosition::EFPageDown) );
       
   441         
       
   442         iThumbMaxPos = iEditor->ScrollBarFrame()->VerticalScrollBar()->ThumbPosition();
       
   443         
       
   444         TRAP_IGNORE(iEditor->MoveDisplayL(TCursorPosition::EFPageUp) );
       
   445         TRAP_IGNORE(iEditor->MoveDisplayL(TCursorPosition::EFPageUp) );
       
   446         }
       
   447     }
       
   448     
       
   449 // ---------------------------------------------------------
       
   450 // CVIMPSTUiTermsOfUseDlg::SetNewTitleText
       
   451 // (other items were commented in a header).
       
   452 // ---------------------------------------------------------
       
   453 //
       
   454 void CVIMPSTUiTermsOfUseDlg::SetNewTitleTextL()
       
   455     {
       
   456     CAknTitlePane* title = GetTitlePaneInstanceL();
       
   457     
       
   458     // Store old one
       
   459     HBufC* tmp = title->Text()->AllocL();
       
   460     delete iOldTitleText;
       
   461     iOldTitleText = tmp;
       
   462 
       
   463 	// Clear the navi pane
       
   464 	// Get pointer to status-pane
       
   465     CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->
       
   466 		    StatusPane();
       
   467 	// Get pointer to navi-pane
       
   468     CAknNavigationControlContainer* naviPane = 
       
   469             static_cast<CAknNavigationControlContainer*>(
       
   470 		        statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
       
   471 	naviPane->PushDefaultL( ETrue );    
       
   472     
       
   473     // Set the new text
       
   474     HBufC* tempTitle = iEikonEnv->AllocReadResourceLC( R_QTN_SERVTAB_TOU_TITLE );
       
   475     title->SetTextL( *tempTitle );
       
   476     CleanupStack::PopAndDestroy( tempTitle );
       
   477     }
       
   478 
       
   479 // ---------------------------------------------------------
       
   480 // CVIMPSTUiTermsOfUseDlg::GetTitlePaneInstanceL
       
   481 // Gets titlepane instance from CEikonEnv
       
   482 // (other items were commented in a header).
       
   483 // ---------------------------------------------------------
       
   484 //
       
   485 CAknTitlePane* CVIMPSTUiTermsOfUseDlg::GetTitlePaneInstanceL() const
       
   486     {
       
   487     CAknTitlePane* title = static_cast< CAknTitlePane* >
       
   488         ( CEikonEnv::Static()->AppUiFactory()->StatusPane()->ControlL(
       
   489                                         TUid::Uid( EEikStatusPaneUidTitle ) ) );
       
   490 	if ( !title )
       
   491 		{
       
   492 		User::Leave( KErrNotSupported );
       
   493 		}
       
   494     return title;
       
   495     }
       
   496 
       
   497 // ---------------------------------------------------------
       
   498 // CVIMPSTUiTermsOfUseDlg::DoRestoreTitlePaneTextL() const
       
   499 // Does the actual restoring.
       
   500 // (other items were commented in a header).
       
   501 // ---------------------------------------------------------
       
   502 //
       
   503 void CVIMPSTUiTermsOfUseDlg::RestoreTitlePaneTextL() const
       
   504     {
       
   505     CAknTitlePane* title = GetTitlePaneInstanceL();
       
   506 
       
   507     if ( iOldTitleText )
       
   508         {
       
   509         title->SetTextL( *iOldTitleText );
       
   510         }
       
   511     else
       
   512         {
       
   513         title->SetTextToDefaultL();
       
   514         }
       
   515 
       
   516 	// restore the navi pane
       
   517 	// Get pointer to status-pane
       
   518     CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->
       
   519 		    StatusPane();
       
   520 	// Get pointer to navi-pane
       
   521     CAknNavigationControlContainer* naviPane = 
       
   522         static_cast<CAknNavigationControlContainer*>(
       
   523 		    statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
       
   524 	naviPane->Pop();
       
   525     }
       
   526 
       
   527 // ---------------------------------------------------------
       
   528 // CVIMPSTUiTermsOfUseDlg::UpdateCbaL()
       
   529 // (other items were commented in a header).
       
   530 // ---------------------------------------------------------
       
   531 //
       
   532 void CVIMPSTUiTermsOfUseDlg::UpdateCbaL()
       
   533     {
       
   534     TInt cbaRes = R_CNUI_TERMS_OF_USE_DIALOG_CBA;  
       
   535     CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
       
   536     cba->SetCommandSetL( cbaRes );
       
   537     cba->DrawNow();
       
   538     }
       
   539 
       
   540 // ---------------------------------------------------------
       
   541 // CVIMPSTUiTermsOfUseDlg::UpdateTextColorL()
       
   542 // (other items were commented in a header).
       
   543 // ---------------------------------------------------------
       
   544 //
       
   545 void CVIMPSTUiTermsOfUseDlg::UpdateTextColorL()
       
   546     {
       
   547     if( !iEditor )
       
   548         {
       
   549         return;
       
   550         }
       
   551         
       
   552     // Get text color from skin
       
   553     TRgb textColor( KRgbBlack );
       
   554     AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), 
       
   555                                textColor,
       
   556                                KAknsIIDQsnTextColors,
       
   557                                EAknsCIQsnTextColorsCG6 );
       
   558 	TCharFormat charFormat;
       
   559     TCharFormatMask charFormatMask;
       
   560     charFormat.iFontPresentation.iTextColor = textColor;
       
   561     charFormatMask.SetAttrib( EAttColor );
       
   562     
       
   563     // Apply format
       
   564     int length = iEditor->RichText()->DocumentLength();
       
   565     iEditor->RichText()->SetInsertCharFormatL( charFormat, charFormatMask, length );
       
   566     iEditor->RichText()->ApplyCharFormatL( charFormat, charFormatMask, 0, length );
       
   567     }
       
   568 
       
   569 // ---------------------------------------------------------
       
   570 // CVIMPSTUiTermsOfUseDlg::HandleResourceChange
       
   571 // (other items were commented in a header).
       
   572 // ---------------------------------------------------------
       
   573 //
       
   574 void CVIMPSTUiTermsOfUseDlg::HandleResourceChange( TInt aType )
       
   575     {
       
   576     if ( aType == KAknsMessageSkinChange )
       
   577         {
       
   578         // When skin changes, we need to update text color
       
   579         TRAP_IGNORE( UpdateTextColorL();
       
   580                      iEditor->HandleTextChangedL(); );
       
   581         }
       
   582     CAknDialog::HandleResourceChange( aType );
       
   583     }
       
   584 
       
   585 // ---------------------------------------------------------
       
   586 // CVIMPSTUiTermsOfUseDlg::SetToUMsg
       
   587 // (other items were commented in a header).
       
   588 // ---------------------------------------------------------
       
   589 //
       
   590 void CVIMPSTUiTermsOfUseDlg::SetToUMsgL(HBufC*  aToUText)
       
   591 	{
       
   592 	iToUText = aToUText;
       
   593 	}
       
   594 
       
   595 
       
   596 
       
   597 // End of file