camerauis/activepalette/Inc/ActivePalette2Tooltip.h
branchRCL_3
changeset 54 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
53:61bc0f252b2b 54:bac7acad7cb3
       
     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:  Active Palette Tooltip interface*
       
    15 */
       
    16 
       
    17 
       
    18 /**
       
    19  * @file ActivePalette2Tooltip.h
       
    20  * Active Palette Tooltip interface
       
    21  */
       
    22 
       
    23 #ifndef _ACTIVE_PALETTE_2_TOOLTIP_H
       
    24 #define _ACTIVE_PALETTE_2_TOOLTIP_H
       
    25 
       
    26 //  INCLUDES
       
    27 #include <e32std.h>
       
    28 #include <coecntrl.h>
       
    29 #include <activepalette2factory.h>
       
    30 
       
    31 #include "ActivePalette2Const.h"
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CActivePalette2Model;
       
    35 class CActivePalette2BasicUI;
       
    36 class CActivePalette2Styler;
       
    37 
       
    38 // CLASS DECLARATIONS
       
    39 
       
    40 /**
       
    41  * 2D tooltip renderer for Active Palette 2.
       
    42  */
       
    43 class CActivePalette2Tooltip : public CCoeControl
       
    44   {
       
    45   public:
       
    46 
       
    47     /** 
       
    48     * 2-stage construction
       
    49     * @param aParent Parent renderer
       
    50     * @param aModel Model driving the animation
       
    51     * @param aStyler Rendering styler to use
       
    52     */
       
    53     static CActivePalette2Tooltip * NewL( const CActivePalette2BasicUI*  aParent,
       
    54                                                 CActivePalette2Model*  aModel,
       
    55                                                 CActivePalette2Styler* aStyler );
       
    56                      
       
    57     /** 
       
    58     * Destructor
       
    59     */
       
    60     virtual ~CActivePalette2Tooltip();
       
    61 
       
    62   public: // From CCoeControl
       
    63 
       
    64     /** 
       
    65     * Draw's the tooltip within the specified rectangle
       
    66     * @param aRect The rectangle to draw within
       
    67     */
       
    68     virtual void Draw( const TRect& aRect ) const;
       
    69 
       
    70   public: // New methods
       
    71 
       
    72     /**
       
    73     * Sets the on-screen postion of the AP. The tooltip is drawn relative to this point.
       
    74     * @param aAnchor The AP position
       
    75     */
       
    76     virtual void SetAnchor( TPoint aAnchor );
       
    77 
       
    78     /**
       
    79     * Called when a new tooltip is first required
       
    80     * @return Total length, in pixels, of tooltip
       
    81     */
       
    82     virtual TInt TooltipUpdated();
       
    83     
       
    84     /**
       
    85     * Called when tooltip animation requires an update
       
    86     */
       
    87     virtual void TooltipAnimated();
       
    88     
       
    89     /**
       
    90     * Sets the graphics context to draw to.
       
    91     * @param aGc The graphics context to draw to
       
    92     */
       
    93     virtual void SetGc( CBitmapContext* aGc = NULL );
       
    94     
       
    95     /** 
       
    96     * Draw the pre-rendered tooltip to the screen
       
    97     */
       
    98     virtual void ProduceTooltipToScreen( TBool aActivateGc ) const;
       
    99 
       
   100   protected:
       
   101 
       
   102     /**
       
   103     * Returns where the tooltip should currently be on-screen
       
   104     * @return Where the tooltip should currently be on-screen
       
   105     */
       
   106     virtual TRect TooltipRect() const;
       
   107 
       
   108   protected: // Methods 
       
   109 
       
   110     /** 
       
   111     * Constructor
       
   112     * @param aModel Model driving the animation
       
   113     * @param aStyler Rendering styler to use
       
   114     */
       
   115     CActivePalette2Tooltip( CActivePalette2Model*  aModel,
       
   116                             CActivePalette2Styler* aStyler );
       
   117 
       
   118     /** 
       
   119     * Leaving constructor
       
   120     */
       
   121     void ConstructL( const CActivePalette2BasicUI* aParent );
       
   122 
       
   123   protected: // Data
       
   124 
       
   125     /// The position of the parent AP
       
   126     TPoint              iAnchor;
       
   127     
       
   128     /// The controlling model. Not owned.     
       
   129     CActivePalette2Model*           iModel;
       
   130     
       
   131     /// The parent renderer. Not owned.
       
   132     const CActivePalette2BasicUI*           iParent;
       
   133     
       
   134     /// The rendering styler to use.        
       
   135     CActivePalette2Styler* iStyler;
       
   136     
       
   137     /// The context to render to. If NULL (default), the screen is used. Not owned
       
   138     CBitmapContext* iRenderGc;
       
   139     
       
   140     /// Where the palette was last rendered
       
   141     mutable TRect iRenderedRect;
       
   142   };
       
   143 
       
   144 #endif // _ACTIVE_PALETTE_2_TOOLTIP_H
       
   145 
       
   146 // End of File