webengine/osswebengine/WebCore/platform/symbian/PictographSymbian.cpp
changeset 0 dd21522fd290
child 48 79859ed3eea9
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     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 the License "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 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "config.h"
       
    21 #include "PictographSymbian.h"
       
    22 #include "WebCoreGraphicsContext.h"
       
    23 #include <FeatMgr.h>
       
    24 
       
    25 // DEFINES
       
    26 using namespace WebCore;
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // LOCAL FUNCTION PROTOTYPES
       
    31 
       
    32 //-------------------------------------------------------------------------------
       
    33 // 
       
    34 // 
       
    35 //-------------------------------------------------------------------------------
       
    36 PictographSymbian::PictographSymbian()
       
    37 {
       
    38     if (FeatureManager::FeatureSupported(KFeatureIdJapanesePicto))
       
    39         {                             
       
    40         iPictographInterface = NULL;
       
    41         //This parameter is not used.
       
    42         CCoeControl* coeemptyctrlnotused = NULL;        
       
    43         TRAP_IGNORE(iPictographInterface = CAknPictographInterface::NewL(*coeemptyctrlnotused,*this));
       
    44         }
       
    45     else
       
    46         {
       
    47         iPictographInterface = NULL;
       
    48         }        
       
    49 }
       
    50 
       
    51 //-------------------------------------------------------------------------------
       
    52 // 
       
    53 // 
       
    54 //-------------------------------------------------------------------------------
       
    55 PictographSymbian::~PictographSymbian()
       
    56 {
       
    57     delete iPictographInterface;
       
    58 }
       
    59 
       
    60 //-------------------------------------------------------------------------------
       
    61 // DrawPictographsInText
       
    62 // Draw Pictographs in text given the TPoint
       
    63 //-------------------------------------------------------------------------------
       
    64 void PictographSymbian::DrawPictographsInText(WebCoreGraphicsContext* aContext, CBitmapContext& aGc, const CFont& aFont, const TDesC& aText, const TPoint& aPosition)
       
    65     {
       
    66     if (iPictographInterface)
       
    67         {
       
    68         iContext = aContext;
       
    69         iPictographInterface->Interface()->DrawPictographsInText(aGc, aFont, aText, aPosition);
       
    70         }
       
    71     }
       
    72 
       
    73 //-------------------------------------------------------------------------------
       
    74 // DrawPictographsInText
       
    75 // Draw Pictographs in text given the offset, alignment and left margin
       
    76 //-------------------------------------------------------------------------------
       
    77 void PictographSymbian::DrawPictographsInText(WebCoreGraphicsContext* aContext, CBitmapContext& aGc, 
       
    78                                                 const CFont& aFont, const TDesC& aText,
       
    79                                                 const TRect& aBox, TInt aBaselineOffset, 
       
    80                                                 CGraphicsContext::TTextAlign aAlignment ,TInt aLeftMargin )
       
    81     {
       
    82     if (iPictographInterface)
       
    83         {
       
    84         iContext = aContext;
       
    85         iPictographInterface->Interface()->DrawPictographsInText(aGc, aFont, aText, aBox, aBaselineOffset, aAlignment, aLeftMargin);
       
    86         }
       
    87     }
       
    88 
       
    89 
       
    90 //-------------------------------------------------------------------------------
       
    91 // DrawPictographArea
       
    92 // Callback function called by the Pictograph Drawer Interface
       
    93 //-------------------------------------------------------------------------------
       
    94 void PictographSymbian::DrawPictographArea()
       
    95     {
       
    96     if (iContext)
       
    97         {
       
    98         iContext->view().draw(*iContext, iContext->view().visibleRect());
       
    99         iContext->view().invalidateRect(iContext->view().visibleRect(), ETrue);            
       
   100         }
       
   101     }
       
   102 
       
   103 
       
   104 
       
   105 // End of File
       
   106 
       
   107