diff -r 5456b4e8b3a8 -r 3321d3e205b6 idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockadapter.h --- a/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockadapter.h Wed Sep 01 12:32:46 2010 +0100 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockadapter.h Tue Sep 14 20:58:58 2010 +0300 @@ -30,6 +30,7 @@ // Forward declarations class CXnNodePluginIf; class CXnClockControl; +class CXnDateControl; class CAknLayoutFont; class CFont; class TRgb; @@ -42,22 +43,20 @@ */ NONSHARABLE_CLASS( CXnClockAdapter ) : public CXnControlAdapter, public MCoeMessageMonitorObserver, public MHWRMLightObserver - { -public: - enum TClockFont - { - EDigitalFont, - EAmPmFont, - EDateFont - }; - + { public: // constructor and destructor /** * 2 phase construction. + * + * @param aParent Parent control + * @param aNode clock node + * + * @return Newly constructed object */ - static CXnClockAdapter* NewL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); + static CXnClockAdapter* NewL( CXnControlAdapter* aParent, + CXnNodePluginIf& aNode ); /** * Destructor. @@ -66,39 +65,46 @@ public: // New functions - - /** - * Gets font based on type - * - * @return Font based on aType, NULL if not found - */ - const CAknLayoutFont* FontL( const TInt aType ); - - /** - * Gets text color - * - * @return Text color - */ - const TRgb& TextColorL(); - - /** - * Gets date information - * - * @return A node which holds date information - */ - CXnNodePluginIf* Date() const; - - /** - * Gets day information - * - * @return A node which holds day information - */ - CXnNodePluginIf* Day() const; + + /* + * Create font + * + * @param aNode Node which contains info of font + * @param aFontName Font name + * @param aFont On return points to a created font + */ + void CreateFontL( CXnNodePluginIf& aNode, + const TDesC& aFontName, + CFont*& aFont ); + + /* + * Create color + * + * @param aNode Node which contains color info + * @param aColor On return points to a created color + */ + void CreateColorL( CXnNodePluginIf& aNode, TRgb& aColor ); /** * Calls DrawNow, if node is laidout */ void UpdateDisplay() const; + + /** + * Sets clock format + * + * @param aFormat format of clock to set + */ + void SetClockFormatL( TClockFormat aFormat ); + + /** + * Gets text align from text-align property + * + * @param aNode Node which contains property + * + * @return Text align or CGraphicsContext::ECenter if property is not set + */ + CGraphicsContext::TTextAlign GetTextAlignL( CXnNodePluginIf& aNode ); public: // from base classes @@ -164,16 +170,6 @@ void ConstructL(); private: // New functions - - /* - * Create font - */ - void CreateFontL( const TInt aType ); - - /* - * Create color - */ - void CreateColorL(); /** * Starts clock @@ -185,29 +181,47 @@ */ void StopClock(); + /** + * Sets display property of node to block or none + * + * @param aNode Node which display property is set + * @param aBlock Value of display property to set + */ + void SetDisplayToBlockL( CXnNodePluginIf& aNode, TBool aBlock ); + private: // Parent control, not owned CXnControlAdapter* iParent; // UI node, not owned CXnNodePluginIf& iNode; - // Digital clock date information, not owned + // Digital clock element, not owned + CXnNodePluginIf* iDigital; + // Analog clock element, not owned + CXnNodePluginIf* iAnalog; + // Day number element, not owned + CXnNodePluginIf* iDay; + // Am\Pm element, not owned + CXnNodePluginIf* iAmpm; + // Digital face 12h element, not owned + CXnNodePluginIf* iDigitalFace12; + // Digital face 24h element, not owned + CXnNodePluginIf* iDigitalFace24; + // Analog face element, not owned + CXnNodePluginIf* iAnalogFace; + // Date element, not owned CXnNodePluginIf* iDate; - // Analog clock day information, not owned - CXnNodePluginIf* iDay; + // Digital clock date element, not owned + CXnNodePluginIf* iDigitalDate; + // Analog clock date element, not owned + CXnNodePluginIf* iAnalogDate; // Light observer, owned CHWRMLight* iLightObserver; - // Clock control, owned - CXnClockControl* iClockControl; - // Digital clock font, not owned - CFont* iDigitalFont; - // AmPm font, not owned - CFont* iAmPmFont; - // Date font, not owned - CFont* iDateFont; - // Font color - TRgb iColor; - // Flag for initializing font color - TBool iColorSet; + // Clock control, owned + CXnClockControl* iClockControl; + // Date control, owned + CXnDateControl* iDateControl; + // Day number control, owned + CXnDateControl* iDayControl; // Flag indicating foreground state TBool iForeground; // Flag indicating lights status