|
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 TDesC& aText=KNullDesC); |
|
46 |
|
47 // Destructor. |
|
48 virtual ~CHgVgLabel(); |
|
49 |
|
50 public: // Methods |
|
51 |
|
52 void SetTextL(const TDesC& aText); |
|
53 |
|
54 void Draw(const TRect& aWindowRect, TReal aAlpha=1.0); |
|
55 |
|
56 void SetLayout(const TAknTextComponentLayout& aLayout, const TRect& aParentRect); |
|
57 |
|
58 void DrawEmptyText(const TRect& aClientRect, const TDesC& aText); |
|
59 |
|
60 void EnableLandscapeRendering(TBool enabled); |
|
61 |
|
62 protected: // Constructors |
|
63 |
|
64 CHgVgLabel(const TRect& aRect); |
|
65 |
|
66 void ConstructL (const TDesC& aText); |
|
67 |
|
68 void Update(); |
|
69 |
|
70 private: // Data |
|
71 |
|
72 TRect iRect; |
|
73 |
|
74 HBufC* iText; // Item title. Own |
|
75 |
|
76 CHgVgDrawBuffer* iTextRenderer; // used to renrer text to bit gc, owns |
|
77 |
|
78 TRgb iTextColor; |
|
79 |
|
80 TRgb iShadowColor; |
|
81 |
|
82 VGImage iTextImage; // image containing texts, owns |
|
83 |
|
84 TBool iDirty; |
|
85 |
|
86 TAknTextComponentLayout iLayout; |
|
87 |
|
88 TRect iParentRect; |
|
89 |
|
90 TBool iLandscape; |
|
91 }; |
|
92 |
|
93 #endif /* HGVGLABEL */ |