javauis/lcdui_akn/lcdui/inc/CMIDTextEditorEdwinCustomDraw.h
branchRCL_3
changeset 19 04becd199f91
child 23 98ccebc37403
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 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: Defines custom drawing for text editor edwin.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMIDTEXTEDITOREDWINCUSTOMDRAW_H
       
    20 #define CMIDTEXTEDITOREDWINCUSTOMDRAW_H
       
    21 
       
    22 // INTERNAL INCLUDES
       
    23 #include "CMIDTextEditorEdwin.h"
       
    24 
       
    25 // EXTERNAL INCLUDES
       
    26 #include <lafmain.h>
       
    27 
       
    28 // CLASS DESCRIPTION
       
    29 /**
       
    30  * Defines custom drawing for text editor edwin.
       
    31  *
       
    32  * Currently, only selection color is handled in this class. All other
       
    33  * drawing is delegated to the parent custom drawer.
       
    34  */
       
    35 NONSHARABLE_CLASS(CMIDTextEditorEdwinCustomDraw) :
       
    36         public CLafEdwinCustomDrawBase
       
    37 {
       
    38 
       
    39 public: // Constructors and destructor
       
    40 
       
    41     /**
       
    42      * Two-phased constructor. Creates an instance from this class
       
    43      * The caller takes the ownership of the returned instance
       
    44      *
       
    45      * @param aLafEnv Reference to LAF interface.
       
    46      * @param Reference to the parent custom drawer.
       
    47      * @param aEdwin The editor window to which this custom draw
       
    48      *        is associated to.
       
    49      * @return New instance from this class
       
    50      */
       
    51     CMIDTextEditorEdwinCustomDraw(
       
    52         const MLafEnv& aLafEnv,
       
    53         const MFormCustomDraw& aParentDraw,
       
    54         const CMIDTextEditorEdwin& aEdwin);
       
    55 
       
    56     /**
       
    57      * Destructor.
       
    58      */
       
    59     virtual ~CMIDTextEditorEdwinCustomDraw();
       
    60 
       
    61 public: // From
       
    62 
       
    63     /**
       
    64      * Called by the editor FW in order to draw the background for
       
    65      * the editor window.
       
    66      *
       
    67      * Currently ignores any drawing related to background.
       
    68      *
       
    69      * @param aParam Drawing parameters
       
    70      * @param aBackground Default background colour
       
    71      * @param aDrawn On return, the rectangle to which the function has
       
    72      *        drawn
       
    73          * @since S60 5.0
       
    74      */
       
    75     void DrawBackground(
       
    76         const TParam& aParam,
       
    77         const TRgb& aBackground,
       
    78         TRect& aDrawn) const;
       
    79 
       
    80     /**
       
    81      * Called by the editor FW in order to draw the line
       
    82      * graphics for the editor window.
       
    83      *
       
    84      * Currently delegates the drawing to the parent custom drawer.
       
    85      *
       
    86      * @param aParam Drawing parameters
       
    87      * @param aLineInfo The line information.
       
    88          * @since S60 5.0
       
    89      */
       
    90     void DrawLineGraphics(
       
    91         const TParam& aParam,
       
    92         const TLineInfo& aLineInfo) const;
       
    93 
       
    94     /**
       
    95      * Called by the editor FW in order to draw the the content of
       
    96      * the editor.
       
    97      *
       
    98      * Currently delegates the drawing to the parent custom drawer.
       
    99      *
       
   100      * @param aParam Drawing parameters.
       
   101      * @param aLineInfo The line information.
       
   102      * @param aFormat The current character format.
       
   103      * @param aText The content to draw.
       
   104      * @param aTextOrigin The origin of the text.
       
   105      * @param aExtraPixels The amount of extra pixels.
       
   106          * @since S60 5.0
       
   107      */
       
   108     void DrawText(
       
   109         const TParam& aParam,
       
   110         const TLineInfo& aLineInfo,
       
   111         const TCharFormat& aFormat,
       
   112         const TDesC& aText,
       
   113         const TPoint& aTextOrigin,
       
   114         TInt aExtraPixels) const;
       
   115 
       
   116     /**
       
   117      * Retrieves the system color for the specified color index.
       
   118      *
       
   119      * @param aColorIndex The index of the color to be returned.
       
   120      * @param aDefaultColor The default color for the specified index.
       
   121      * @return The system's (or custom) color for the specified color
       
   122      *         index.
       
   123          * @since S60 5.0
       
   124      */
       
   125     TRgb SystemColor(
       
   126         TUint aColorIndex,
       
   127         TRgb aDefaultColor) const;
       
   128 
       
   129 private: // Data
       
   130 
       
   131     // Reference to the editor window. Used.
       
   132     const CMIDTextEditorEdwin& iEdwin;
       
   133 
       
   134     // Reference to the parent drawer. Used.
       
   135     const MFormCustomDraw& iParentDraw;
       
   136 };
       
   137 
       
   138 #endif // CMIDTEXTEDITOREDWINCUSTOMDRAW_H
       
   139 
       
   140 // End of file