emailuis/uicomponents/src/fstextviewerselecthotspot.cpp
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007 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: This file implements class CFsTextViewerSelectHotspot.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //<cmail> removed __FS_ALFRED_SUPPORT flag
       
    20 //#include <fsconfig.h>
       
    21 //</cmail> removed __FS_ALFRED_SUPPORT flag
       
    22 // <cmail> SF
       
    23 #include "emailtrace.h"
       
    24 #include <alf/alftextvisual.h>
       
    25 #include <alf/alfimagevisual.h>
       
    26 #include <aknnotewrappers.h>
       
    27 // </cmail>
       
    28 #include "fstextviewerselecthotspot.h"
       
    29 #include "fstextviewervisualizer.h"
       
    30 #include "fstextviewervisualizerdata.h"
       
    31 #include "fstextviewerselectsmanager.h"
       
    32 #include "fstextviewerskindata.h"
       
    33 #include "fstextstylemanager.h"
       
    34 
       
    35 CFsTextViewerSelectHotspot* CFsTextViewerSelectHotspot::NewL( 
       
    36         CFsTextViewerSelectsManager* aManager )
       
    37      {
       
    38     FUNC_LOG;
       
    39      CFsTextViewerSelectHotspot* self = 
       
    40          new (ELeave) CFsTextViewerSelectHotspot( aManager );
       
    41      CleanupStack::PushL( self );
       
    42      self->ConstructL();
       
    43      CleanupStack::Pop( self );
       
    44      return self;
       
    45      }
       
    46 
       
    47 // ---------------------------------------------------------------------------
       
    48 // SelectL
       
    49 // ---------------------------------------------------------------------------
       
    50 void CFsTextViewerSelectHotspot::SelectL()
       
    51     {
       
    52     FUNC_LOG;
       
    53     for ( TInt i = 0; i < iVisuals.Count(); ++i )
       
    54         {
       
    55         if ( !iVisuals[i]->iVisual )
       
    56             {
       
    57             return;
       
    58             }
       
    59         CAlfTextVisual* textVisual( dynamic_cast<CAlfTextVisual*>( iVisuals[i]->iVisual ) );
       
    60         if( textVisual )
       
    61             {
       
    62             textVisual->SetColor( 
       
    63                 iManager->Visualizer()->iSkinData->iHotspotSelectedColor );
       
    64             textVisual->SetTextStyle(
       
    65                     iManager->Visualizer()->iTextStyleManager
       
    66                     ->GetStyleIDWithOpositeUnderlineL(  
       
    67                         iManager->Visualizer()->Navigator()
       
    68                         ->GetTextStyle( textVisual ) ) 
       
    69                     );
       
    70             }
       
    71         }
       
    72     }
       
    73 
       
    74 // ---------------------------------------------------------------------------
       
    75 // Deselect
       
    76 // ---------------------------------------------------------------------------
       
    77 void CFsTextViewerSelectHotspot::DeselectL()
       
    78     {
       
    79     FUNC_LOG;
       
    80     for ( TInt i = 0; i < iVisuals.Count(); ++i )
       
    81         {
       
    82         if ( iVisuals[i]->iVisual )
       
    83             {
       
    84             CAlfTextVisual* textVisual( dynamic_cast<CAlfTextVisual*>( iVisuals[i]->iVisual ) );
       
    85             if ( textVisual )
       
    86                 {
       
    87                 textVisual->SetColor( 
       
    88                         iManager->Visualizer()->iSkinData->iHotspotDimmedColor );
       
    89                 
       
    90                 textVisual->SetTextStyle(
       
    91                         iManager->Visualizer()->iTextStyleManager
       
    92                         ->GetStyleIDWithOpositeUnderlineL(  
       
    93                             iVisuals[i]->iTextStyleId ) 
       
    94                         );
       
    95                 }
       
    96             }
       
    97         }
       
    98     }
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 // SelectedL
       
   102 // ---------------------------------------------------------------------------
       
   103 void CFsTextViewerSelectHotspot::SelectedL()
       
   104     {
       
   105     FUNC_LOG;
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------------------------
       
   109 // CFsTextViewerSelectHotspot
       
   110 // ---------------------------------------------------------------------------
       
   111 CFsTextViewerSelectHotspot::CFsTextViewerSelectHotspot( 
       
   112         CFsTextViewerSelectsManager* aManager ) 
       
   113     {
       
   114     FUNC_LOG;
       
   115     iManager = aManager;
       
   116     iType = EFsHotspotType;
       
   117     }
       
   118