|
1 /* |
|
2 * Copyright (c) 2002-2007 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: AVKON skinnable clock face. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AKNSKINNABLECLOCKFACE_H |
|
20 #define C_AKNSKINNABLECLOCKFACE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <gdi.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CFbsBitmap; |
|
28 class CAknAlphaComposite; |
|
29 class CFbsBitmapDevice; |
|
30 //class CFbsBitGc; |
|
31 |
|
32 // CLASS DECLARATIONS |
|
33 |
|
34 /** |
|
35 * Base class for clock faces. |
|
36 * |
|
37 * This is an internal class not visible outside the library. |
|
38 * This class is not intended for derivation outside the library. |
|
39 * |
|
40 * @since 2.0 |
|
41 * |
|
42 * @internal |
|
43 */ |
|
44 class CAknSkinnableClockFace : public CBase |
|
45 { |
|
46 public: // Destructor |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual inline ~CAknSkinnableClockFace() {}; |
|
52 |
|
53 public: // New methods |
|
54 |
|
55 /** |
|
56 * Draws the given time to the given buffer bitmap. |
|
57 * |
|
58 * @since 2.0 |
|
59 * |
|
60 * @param aBuffer Buffer bitmap to be used for drawing. The bitmap may |
|
61 * contain background graphics. |
|
62 * |
|
63 * @param aBufferGc Graphics context that can be used to draw to |
|
64 * the buffer bitmap. |
|
65 * |
|
66 * @param aTime Time to be used for drawing. |
|
67 */ |
|
68 virtual void DrawTimeToBitmapL( TRect& aRect, |
|
69 CBitmapContext& aBufferGc, TTime& aTime ) =0; |
|
70 }; |
|
71 |
|
72 /** |
|
73 * Concrete drawer class for digital clock face. |
|
74 * |
|
75 * This is an internal class not visible outside the library. |
|
76 * This class is not intended for further derivation. |
|
77 * |
|
78 * @since 2.0 |
|
79 * |
|
80 * @internal |
|
81 */ |
|
82 NONSHARABLE_CLASS(CAknSkinnableClockFaceDigital) : public CAknSkinnableClockFace |
|
83 { |
|
84 public: // Constructors and destructor |
|
85 |
|
86 /** |
|
87 * Two-phased constructor. |
|
88 */ |
|
89 static CAknSkinnableClockFaceDigital* NewL(); |
|
90 |
|
91 /** |
|
92 * Destructor. |
|
93 */ |
|
94 virtual ~CAknSkinnableClockFaceDigital(); |
|
95 |
|
96 public: // Functions from MAknSkinnableClockFace |
|
97 |
|
98 /** |
|
99 * Draws the given time to the given buffer bitmap. |
|
100 * |
|
101 * @since 2.0 |
|
102 * |
|
103 * @param aBuffer Buffer bitmap to be used for drawing. The bitmap may |
|
104 * contain background graphics. |
|
105 * |
|
106 * @param aBufferGc Graphics context that can be used to draw to |
|
107 * the buffer bitmap. |
|
108 * |
|
109 * @param aTime Time to be used for drawing. |
|
110 */ |
|
111 void DrawTimeToBitmapL( TRect& aRect, CBitmapContext& aBufferGc, |
|
112 TTime& aTime ); |
|
113 |
|
114 private: // New functions |
|
115 |
|
116 /** |
|
117 * Blends a single digit into the buffer bitmap. |
|
118 * |
|
119 * @param aBuffer Buffer bitmap to be used as destination. |
|
120 * |
|
121 * @param aPos Position of the top left corner of the digit. |
|
122 * |
|
123 * @param aDigit Digit as an integer between 0 and 9 (inclusive). |
|
124 */ |
|
125 void BlendDigitL( CBitmapContext& aBufferGc, |
|
126 const TRect& aRect, const TInt aDigit, const TBool aHardMask ); |
|
127 |
|
128 private: |
|
129 |
|
130 /** |
|
131 * C++ default constructor. |
|
132 */ |
|
133 CAknSkinnableClockFaceDigital(); |
|
134 |
|
135 /** |
|
136 * By default Symbian 2nd phase constructor is private. |
|
137 */ |
|
138 void ConstructL(); |
|
139 |
|
140 private: // Data |
|
141 |
|
142 }; |
|
143 |
|
144 /** |
|
145 * Concrete drawer class for analog clock face. |
|
146 * |
|
147 * This is an internal class not visible outside the library. |
|
148 * This class is not intended for further derivation. |
|
149 * |
|
150 * @since 2.0 |
|
151 * |
|
152 * @internal |
|
153 */ |
|
154 NONSHARABLE_CLASS(CAknSkinnableClockFaceAnalogue) : public CAknSkinnableClockFace |
|
155 { |
|
156 public: // Constructors and destructor |
|
157 |
|
158 /** |
|
159 * Two-phased constructor. |
|
160 */ |
|
161 static CAknSkinnableClockFaceAnalogue* NewL( const TBool aShowDate ); |
|
162 |
|
163 /** |
|
164 * Destructor. |
|
165 */ |
|
166 virtual ~CAknSkinnableClockFaceAnalogue(); |
|
167 |
|
168 public: // Functions from MAknSkinnableClockFace |
|
169 |
|
170 /** |
|
171 * Draws the given time to the given buffer bitmap. |
|
172 * |
|
173 * @since 2.0 |
|
174 * |
|
175 * @param aBuffer Buffer bitmap to be used for drawing. The bitmap may |
|
176 * contain background graphics. |
|
177 * |
|
178 * @param aBufferGc Graphics context that can be used to draw to |
|
179 * the buffer bitmap. |
|
180 * |
|
181 * @param aTime Time to be used for drawing. |
|
182 */ |
|
183 void DrawTimeToBitmapL( TRect& aRect, CBitmapContext& aBufferGc, |
|
184 TTime& aTime ); |
|
185 |
|
186 private: // New functions |
|
187 |
|
188 /** |
|
189 * Draws the hands of the clock. |
|
190 * |
|
191 * @param aBufferGc Graphics context that can be used to draw to the |
|
192 * buffer bitmap. |
|
193 * |
|
194 * @param aBufferRect Rectangle defining the size of the buffer. |
|
195 * |
|
196 * @param aDateTime Time to be used for drawing. |
|
197 */ |
|
198 void DrawHands( CBitmapContext& aBufferGc, const TRect& aBufferRect, |
|
199 const TDateTime& aDateTime ); |
|
200 |
|
201 private: |
|
202 |
|
203 /** |
|
204 * C++ default constructor. |
|
205 */ |
|
206 CAknSkinnableClockFaceAnalogue( const TBool aShowDate ); |
|
207 |
|
208 /** |
|
209 * By default Symbian 2nd phase constructor is private. |
|
210 */ |
|
211 void ConstructL(); |
|
212 |
|
213 private: // Data |
|
214 |
|
215 TBool iShowDate; |
|
216 }; |
|
217 |
|
218 #endif // C_AKNSKINNABLECLOCKFACE_H |
|
219 |
|
220 // End of File |