|
1 /* |
|
2 * Copyright (c) 2003 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: CScreensaverIndicatorText declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_SCREENSAVERINDICATORTEXT_H |
|
21 #define C_SCREENSAVERINDICATORTEXT_H |
|
22 |
|
23 #include "screensaverindicator.h" |
|
24 |
|
25 class CScreensaverIndicatorText : public CScreensaverIndicator |
|
26 { |
|
27 public: |
|
28 |
|
29 /** |
|
30 * Draw the indicator. it should be implemented by the derived class |
|
31 */ |
|
32 virtual void Draw( CWindowGc& aGc ) const; |
|
33 |
|
34 /** |
|
35 * two-phased constructor |
|
36 * |
|
37 * @param aReader the resource read of the STRUCT |
|
38 * SCREENSAVER_PARAMETERS_ARRAY defined by ourself |
|
39 * @param aBgColor the background color of display screen |
|
40 * @param aTextColor the text color |
|
41 */ |
|
42 virtual void ConstructL( TResourceReader &aReader, TUint32 aBgColor, TUint aTextColor ); |
|
43 |
|
44 /** |
|
45 * Set the parameters of drawing |
|
46 * |
|
47 * @param aCorner the position of the lefttop of the indicator |
|
48 * @param aParentRect |
|
49 */ |
|
50 virtual void SetupDrawingParameters( const TPoint& aCorner, const TRect& aParentRect ); |
|
51 |
|
52 /** |
|
53 * Check if indicator is visible or not |
|
54 * |
|
55 * @return TBool |
|
56 */ |
|
57 virtual TBool CheckVisibilityConditions() const; |
|
58 |
|
59 /** |
|
60 * Get the payload through the property |
|
61 * |
|
62 * @param aPayload the reference to the payload |
|
63 */ |
|
64 virtual void Payload( TIndicatorPayload& aPayload ) const; |
|
65 |
|
66 /** |
|
67 * Set the property through the payload |
|
68 * |
|
69 * @param aPayload |
|
70 */ |
|
71 virtual void SetPayload( const TIndicatorPayload& aPayload ); |
|
72 |
|
73 /** |
|
74 * Sets text position and font |
|
75 */ |
|
76 virtual void SetTextLayout( TAknLayoutText& aLayout, TInt aX = -1 ); |
|
77 |
|
78 /** |
|
79 * Returns the width where whole text fits |
|
80 */ |
|
81 virtual TInt PreferredWidth(); |
|
82 |
|
83 /** |
|
84 * Set available width |
|
85 */ |
|
86 virtual void SetWidth( TInt aWidth ); |
|
87 |
|
88 /** |
|
89 * Set x-position of indicator |
|
90 */ |
|
91 virtual void SetXPos( TInt aX ); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * The text should be displayed |
|
97 */ |
|
98 TBuf16<KMaxPayloadTextLength> iText; |
|
99 |
|
100 /** |
|
101 * The font of the text |
|
102 * Not owned. |
|
103 */ |
|
104 const CFont *iFont; |
|
105 |
|
106 /** |
|
107 * Rect inside which text is drawn |
|
108 */ |
|
109 TRect iTextRect; |
|
110 |
|
111 /** |
|
112 * Text baseline offset from text rect top |
|
113 */ |
|
114 TInt iTextOffset; |
|
115 }; |
|
116 |
|
117 #endif // C_SCREENSAVERINDICATORTEXT_H |