|
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: Xuikon clock face. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _XNCLOCKFACE_H |
|
20 #define _XNCLOCKFACE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CXnClockAdapter; |
|
27 class CWindowGc; |
|
28 |
|
29 // CLASS DECLARATIONS |
|
30 /** |
|
31 * @ingroup group_xnclockfactory |
|
32 * @lib xnclockfactory.lib |
|
33 * @since S60 |
|
34 */ |
|
35 class CXnClockFace : public CBase |
|
36 { |
|
37 public: // Destructor |
|
38 |
|
39 /** |
|
40 * Destructor. |
|
41 */ |
|
42 virtual inline ~CXnClockFace() {}; |
|
43 |
|
44 public: // New methods |
|
45 |
|
46 /** |
|
47 * Draws the given time to the given buffer bitmap. |
|
48 * |
|
49 * @since S60 5.1 |
|
50 * |
|
51 * @param aAdapter Clock adapter |
|
52 * |
|
53 * @param aGc Graphics context that can be used to draw to |
|
54 * the clock |
|
55 * |
|
56 * @param aRect Rect where to scale the clock |
|
57 * |
|
58 * @param aTime Time to be used for drawing. |
|
59 */ |
|
60 virtual void DrawL( CXnClockAdapter& aAdapter, |
|
61 CWindowGc& aGc, |
|
62 const TRect& aRect, |
|
63 const TTime& aTime ) = 0; |
|
64 }; |
|
65 |
|
66 class CXnClockFaceDigital : public CXnClockFace |
|
67 { |
|
68 public: // Constructors and destructor |
|
69 |
|
70 /** |
|
71 * Two-phased constructor. |
|
72 */ |
|
73 static CXnClockFaceDigital* NewL(); |
|
74 |
|
75 /** |
|
76 * Destructor. |
|
77 */ |
|
78 virtual ~CXnClockFaceDigital(); |
|
79 |
|
80 public: // Functions from CXnClockFace |
|
81 |
|
82 /** |
|
83 * @see CXnClockFace::DrawL |
|
84 */ |
|
85 void DrawL( CXnClockAdapter& aAdapter, |
|
86 CWindowGc& aGc, |
|
87 const TRect& aRect, |
|
88 const TTime& aTime ); |
|
89 |
|
90 private: |
|
91 |
|
92 /** |
|
93 * C++ default constructor. |
|
94 */ |
|
95 CXnClockFaceDigital(); |
|
96 |
|
97 /** |
|
98 * By default Symbian 2nd phase constructor is private. |
|
99 */ |
|
100 void ConstructL(); |
|
101 |
|
102 private: // Data |
|
103 }; |
|
104 |
|
105 class CXnClockFaceAnalog : public CXnClockFace |
|
106 { |
|
107 public: // Constructors and destructor |
|
108 |
|
109 /** |
|
110 * Two-phased constructor. |
|
111 */ |
|
112 static CXnClockFaceAnalog* NewL(); |
|
113 |
|
114 /** |
|
115 * Destructor. |
|
116 */ |
|
117 virtual ~CXnClockFaceAnalog(); |
|
118 |
|
119 public: // Functions from CXnClockFace |
|
120 |
|
121 /** |
|
122 * @see CXnClockFace::DrawL |
|
123 */ |
|
124 void DrawL( CXnClockAdapter& aAdapter, |
|
125 CWindowGc& aGc, |
|
126 const TRect& aRect, |
|
127 const TTime& aTime ); |
|
128 |
|
129 private: // New functions |
|
130 |
|
131 /** |
|
132 * Draws the hands of the clock. |
|
133 * |
|
134 * @param aGc Graphics context that can be used to draw to the |
|
135 * clock |
|
136 * |
|
137 * @param aRect Rectangle defining the size of the clock. |
|
138 * |
|
139 * @param aDateTime Time to be used for drawing. |
|
140 */ |
|
141 void DrawHandsL( CWindowGc& aGc, const TRect& aRect, |
|
142 const TDateTime& aDateTime ); |
|
143 |
|
144 private: |
|
145 |
|
146 /** |
|
147 * C++ default constructor. |
|
148 */ |
|
149 CXnClockFaceAnalog(); |
|
150 |
|
151 /** |
|
152 * By default Symbian 2nd phase constructor is private. |
|
153 */ |
|
154 void ConstructL(); |
|
155 |
|
156 private: // Data |
|
157 }; |
|
158 |
|
159 #endif // _XNCLOCKFACE_H |
|
160 |
|
161 // End of File |