56
|
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 HGVGLETTERPOPUP_H_
|
|
19 |
#define HGVGLETTERPOPUP_H_
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <VG/openvg.h>
|
|
24 |
#include <gulcolor.h>
|
|
25 |
#include <AknLayout2ScalableDef.h>
|
|
26 |
|
|
27 |
class CHgVgDrawBuffer;
|
|
28 |
class CFont;
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Helper class for drawing letter strip.
|
|
32 |
*/
|
|
33 |
NONSHARABLE_CLASS(CHgVgPopup) : CBase
|
|
34 |
{
|
|
35 |
public:
|
|
36 |
|
|
37 |
/**
|
|
38 |
* Creates new CHgVgLetterStrip.
|
|
39 |
*
|
|
40 |
* @param aSize size of the letter strip in pixels.
|
|
41 |
* @param aFont font to use for letter rendering.
|
|
42 |
* @return HgVgLetterStrip-object
|
|
43 |
*/
|
|
44 |
static CHgVgPopup* NewL (const TRect& aRect, const CFont* aFont);
|
|
45 |
|
|
46 |
// Destructor.
|
|
47 |
virtual ~CHgVgPopup();
|
|
48 |
|
|
49 |
private:
|
|
50 |
CHgVgPopup(const TRect& aRect, const CFont* aFont);
|
|
51 |
|
|
52 |
public: // METHODS
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Sets letter in letter strip.
|
|
56 |
*
|
|
57 |
* @param aLetter
|
|
58 |
*/
|
|
59 |
void SetTextL(const TDesC& aText);
|
|
60 |
|
|
61 |
/**
|
|
62 |
* Set two text to popupup
|
|
63 |
*
|
|
64 |
* @param aText1
|
|
65 |
* @param aText2
|
|
66 |
*/
|
|
67 |
void SetTexts(const TDesC& aText1, const TDesC& aText2);
|
|
68 |
|
|
69 |
|
|
70 |
/**
|
|
71 |
* Draws lettter strip at position.
|
|
72 |
*
|
|
73 |
* @param aPosition position to draw letter strip.
|
|
74 |
*/
|
|
75 |
void Draw(const TRect& aWindowRect, TReal aAlpha);
|
|
76 |
|
|
77 |
/**
|
|
78 |
*
|
|
79 |
*/
|
|
80 |
void SetLayouts(const TAknWindowComponentLayout& aPopupLayout,
|
|
81 |
const TAknTextComponentLayout& aTextLayout, const TRect& aParentRect);
|
|
82 |
|
|
83 |
/**
|
|
84 |
*
|
|
85 |
*/
|
|
86 |
void EnableLandscapeRendering(TBool enabled);
|
|
87 |
|
|
88 |
protected: // Constructors
|
|
89 |
CHgVgPopup();
|
|
90 |
|
|
91 |
void ConstructL ( );
|
|
92 |
|
|
93 |
private:
|
|
94 |
|
|
95 |
TRect iRect;
|
|
96 |
const CFont* iFont;
|
|
97 |
CHgVgDrawBuffer* iDrawBuffer; // renderer for drawing glyphs, owns;
|
|
98 |
VGImage iLetterImage;
|
|
99 |
VGPath iLetterBgPath;
|
|
100 |
VGPaint iLetterBgPaint;
|
|
101 |
HBufC* iPrevText;
|
|
102 |
|
|
103 |
TAknWindowComponentLayout iPopupLayout;
|
|
104 |
TAknTextComponentLayout iTextLayout;
|
|
105 |
TRect iParentRect;
|
|
106 |
TBool iLandscape;
|
|
107 |
};
|
|
108 |
|
|
109 |
#endif /* HGVGLETTERPOPUP_H */
|