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