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: CScreensaverIndicatorNumberAndIcon declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_SCREENSAVERINDICATORNUMBERANDICON_H |
|
21 #define C_SCREENSAVERINDICATORNUMBERANDICON_H |
|
22 |
|
23 #include "screensaverindicator.h" |
|
24 |
|
25 class CScreensaverIndicatorNumberAndIcon : public CScreensaverIndicator |
|
26 { |
|
27 public: |
|
28 ~CScreensaverIndicatorNumberAndIcon(); |
|
29 |
|
30 /** |
|
31 * Draw the indicator. it should be implemented by the derived class |
|
32 */ |
|
33 virtual void Draw( CWindowGc& aGc ) const; |
|
34 |
|
35 /** |
|
36 * two-phased constructor |
|
37 * |
|
38 * @param aReader the resource read of the STRUCT |
|
39 * SCREENSAVER_PARAMETERS_ARRAY defined by ourself |
|
40 * @param aBgColor the background color of display screen |
|
41 * @param aTextColor the text color |
|
42 */ |
|
43 virtual void ConstructL( TResourceReader &aReader, TUint32 aBgColor, TUint aTextColor ); |
|
44 |
|
45 /** |
|
46 * Set the parameters of drawing |
|
47 * |
|
48 * @param aCorner the position of the lefttop of the indicator |
|
49 * @param aParentRect |
|
50 */ |
|
51 virtual void SetupDrawingParameters( const TPoint& aCorner, const TRect& aParentRect ); |
|
52 |
|
53 /** |
|
54 * Check if indicator is visible or not |
|
55 * |
|
56 * @return TBool |
|
57 */ |
|
58 virtual TBool CheckVisibilityConditions() const; |
|
59 |
|
60 /** |
|
61 * Get the payload through the property |
|
62 * |
|
63 * @param aPayload the reference to the payload |
|
64 */ |
|
65 virtual void Payload( TIndicatorPayload& aPayload ) const; |
|
66 |
|
67 /** |
|
68 * Set the property through the payload |
|
69 * |
|
70 * @param aPayload |
|
71 */ |
|
72 virtual void SetPayload( const TIndicatorPayload& aPayload ); |
|
73 |
|
74 /** |
|
75 * Sets icon position and size |
|
76 */ |
|
77 virtual void SetIconLayout( TAknLayoutRect& aLayout, TInt aX = -1 ); |
|
78 |
|
79 /** |
|
80 * Sets text position and font |
|
81 */ |
|
82 virtual void SetTextLayout( TAknLayoutText& aLayout, TInt aX = -1 ); |
|
83 |
|
84 /** |
|
85 * Width function overrides |
|
86 */ |
|
87 virtual TInt PreferredWidth(); |
|
88 |
|
89 /** |
|
90 * Returns the icon width |
|
91 */ |
|
92 virtual TInt MinimumWidth(); |
|
93 |
|
94 /** |
|
95 * virtual void SetWidth(TInt aWidth); |
|
96 */ |
|
97 virtual void SetXPos( TInt aX ); |
|
98 |
|
99 /** |
|
100 * Initialize layout of graphics; |
|
101 */ |
|
102 virtual void InitializeLayout(); |
|
103 |
|
104 /** |
|
105 * Initialize icon; |
|
106 */ |
|
107 virtual void InitializeIconL( TResourceReader &aReader ); |
|
108 |
|
109 /** |
|
110 * draw icon; |
|
111 */ |
|
112 virtual void DrawIcon( CWindowGc& aGc ) const; |
|
113 |
|
114 private: |
|
115 |
|
116 /** |
|
117 * The icon will be displayer |
|
118 * |
|
119 * Owned |
|
120 */ |
|
121 CGulIcon* iIcon; |
|
122 |
|
123 /** |
|
124 * |
|
125 */ |
|
126 TInt iValue; |
|
127 |
|
128 /** |
|
129 * The font of the text |
|
130 * Not owned. |
|
131 */ |
|
132 const CFont *iFont; |
|
133 |
|
134 /** |
|
135 * The icon alignment |
|
136 */ |
|
137 TScreensaverAlignment iIconAlign; |
|
138 |
|
139 /** |
|
140 * Text position for legacy layout |
|
141 */ |
|
142 TPoint iTextPos; |
|
143 |
|
144 /** |
|
145 * Rect inside which text is drawn |
|
146 */ |
|
147 TRect iTextRect; |
|
148 |
|
149 /** |
|
150 * Text baseline offset from text rect top |
|
151 */ |
|
152 TInt iTextOffset; |
|
153 }; |
|
154 |
|
155 #endif // C_SCREENSAVERINDICATORNUMBERANDICON_H |
|