uifw/ganes/inc/HgVgLabel.h
changeset 47 2f0c06423c72
parent 46 0e1e0022bd03
child 53 3c67ea82fafc
equal deleted inserted replaced
46:0e1e0022bd03 47:2f0c06423c72
     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:     
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HGVGLABEL_H_
       
    19 #define HGVGLABEL_H_
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <VG/openvg.h>
       
    24 #include <gulcolor.h>
       
    25 #include <AknLayout2ScalableDef.h>
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CHgVgDrawBuffer;
       
    30 class CFont;
       
    31 
       
    32 /**
       
    33  * Helper class for rendering titles to media wall
       
    34  */
       
    35 NONSHARABLE_CLASS(CHgVgLabel) : CBase
       
    36     {
       
    37 public:
       
    38 
       
    39     /**
       
    40      * Creates new CHgVgLabel
       
    41      * 
       
    42      * @param aRect Rectangle of the drawing area.
       
    43      * @return HgVgLabel-object.
       
    44      */
       
    45     static CHgVgLabel* NewL (const TRect& aRect, const CFont* aFont, const TDesC& aText=KNullDesC); 
       
    46         
       
    47     // Destructor.
       
    48     virtual ~CHgVgLabel();
       
    49    
       
    50 public: // Methods
       
    51     
       
    52     void SetTextL(const TDesC& aText);
       
    53     
       
    54     void SetFont(const CFont* aFont);
       
    55     
       
    56     void SetColor(const TRgb& aColor);
       
    57     
       
    58     void SetShadowColor(const TRgb& aColor);
       
    59         
       
    60     void Draw(const TRect& aWindowRect, TReal aAlpha=1.0);
       
    61     
       
    62     void SetLayout(const TAknTextComponentLayout& aLayout, const TRect& aParentRect);
       
    63     
       
    64     void DrawEmptyText(const TRect& aClientRect, const TDesC& aText);
       
    65 
       
    66 protected: // Constructors
       
    67 
       
    68     CHgVgLabel(const TRect& aRect, const CFont* aFont);
       
    69 
       
    70     void ConstructL (const TDesC& aText);
       
    71     
       
    72     void Update();
       
    73     
       
    74 private: // Data
       
    75 
       
    76     TRect iRect;
       
    77     
       
    78     const CFont* iFont;
       
    79     
       
    80     HBufC* iText; // Item title. Own
       
    81 
       
    82     CHgVgDrawBuffer* iTextRenderer; // used to renrer text to bit gc, owns
       
    83         
       
    84     TRgb iTextColor;
       
    85     
       
    86     TRgb iShadowColor;
       
    87         
       
    88     VGImage iTextImage; // image containing texts, owns
       
    89 
       
    90     TBool iDirty;
       
    91     
       
    92     TAknTextComponentLayout iLayout;
       
    93     
       
    94     TRect iParentRect;
       
    95     };
       
    96 
       
    97 #endif /* HGVGLABEL */