--- a/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockface.h Wed Sep 01 12:32:46 2010 +0100
+++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockface.h Tue Sep 14 20:58:58 2010 +0300
@@ -24,6 +24,7 @@
// FORWARD DECLARATIONS
class CXnClockAdapter;
+class CXnNodePluginIf;
class CWindowGc;
// CLASS DECLARATIONS
@@ -49,22 +50,35 @@
* @since S60 5.1
*
* @param aAdapter Clock adapter
- *
* @param aGc Graphics context that can be used to draw to
- * the clock
- *
- * @param aRect Rect where to scale the clock
- *
+ * the clock
+ * @param aNode Node which contains drawing info
* @param aTime Time to be used for drawing.
+ * @param aAmpm Possible am\pm text to draw
*/
virtual void DrawL( CXnClockAdapter& aAdapter,
CWindowGc& aGc,
- const TRect& aRect,
- const TTime& aTime ) = 0;
+ CXnNodePluginIf& aNode,
+ const TTime& aTime,
+ CXnNodePluginIf* aAmpm ) = 0;
+
+ /**
+ * Reset font
+ */
+ virtual void ResetFont() = 0;
};
class CXnClockFaceDigital : public CXnClockFace
{
+ public:
+ /**
+ * Type of font, digital or for am/pm text
+ */
+ enum TXnClockFontType {
+ EClock,
+ EAmpm
+ };
+
public: // Constructors and destructor
/**
@@ -84,8 +98,14 @@
*/
void DrawL( CXnClockAdapter& aAdapter,
CWindowGc& aGc,
- const TRect& aRect,
- const TTime& aTime );
+ CXnNodePluginIf& aNode,
+ const TTime& aTime,
+ CXnNodePluginIf* aAmpm );
+
+ /**
+ * @see CXnClockFace::ResetFont
+ */
+ void ResetFont();
private:
@@ -98,8 +118,60 @@
* By default Symbian 2nd phase constructor is private.
*/
void ConstructL();
+
+ /**
+ * Draws am/pm text
+ *
+ * @param aAdapter Clock adapter
+ * @param aGc Graphics context that can be used to draw to
+ * the clock
+ * @param aTime Time to be used for drawing.
+ * @param aAmpm Contains info for drawing
+ */
+ void DrawAmpmL( CXnClockAdapter& aAdapter,
+ CWindowGc& aGc,
+ const TTime& aTime,
+ CXnNodePluginIf& aAmpm );
+
+ /**
+ * Creates font
+ *
+ * @param aAdapter Clock adapter
+ * @param aNode Contains info to create font
+ * @param aFontType Digital clock font or am/pm font
+ *
+ * @return CAknLayoutFont
+ */
+ const CAknLayoutFont* CreateFontL( CXnClockAdapter& aAdapter,
+ CXnNodePluginIf& aNode,
+ TXnClockFontType aFontType );
+
+ /**
+ * Creates font color
+ *
+ * @param aAdapter Clock adapter
+ * @param aNode Contains info to create color
+ * @param aFontType Digital clock font color or am/pm font color
+ *
+ * @return Color
+ */
+ const TRgb& CreateColorL( CXnClockAdapter& aAdapter,
+ CXnNodePluginIf& aNode,
+ TXnClockFontType aFontType);
private: // Data
+ // Date font, not owned
+ CFont* iClockFont;
+ // Date font, not owned
+ CFont* iAmpmFont;
+ // Digital clock font color
+ TRgb iFaceColor;
+ // Indicates whether digital clock color should be created
+ TBool iIsFaceColorSet;
+ // Am/pm text font color
+ TRgb iAmpmColor;
+ // Indicates whether am/pm font color should be created
+ TBool iIsAmpmColorSet;
};
class CXnClockFaceAnalog : public CXnClockFace
@@ -123,8 +195,14 @@
*/
void DrawL( CXnClockAdapter& aAdapter,
CWindowGc& aGc,
- const TRect& aRect,
- const TTime& aTime );
+ CXnNodePluginIf& aNode,
+ const TTime& aTime,
+ CXnNodePluginIf* aAmpm );
+
+ /**
+ * @see CXnClockFace::ResetFont
+ */
+ void ResetFont();
private: // New functions
@@ -132,10 +210,8 @@
* Draws the hands of the clock.
*
* @param aGc Graphics context that can be used to draw to the
- * clock
- *
+ * clock
* @param aRect Rectangle defining the size of the clock.
- *
* @param aDateTime Time to be used for drawing.
*/
void DrawHandsL( CWindowGc& aGc, const TRect& aRect,