idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockadapter.h
branchRCL_3
changeset 35 3321d3e205b6
parent 34 5456b4e8b3a8
equal deleted inserted replaced
34:5456b4e8b3a8 35:3321d3e205b6
    28 #include "xncontroladapter.h"
    28 #include "xncontroladapter.h"
    29 
    29 
    30 // Forward declarations
    30 // Forward declarations
    31 class CXnNodePluginIf;
    31 class CXnNodePluginIf;
    32 class CXnClockControl;
    32 class CXnClockControl;
       
    33 class CXnDateControl;
    33 class CAknLayoutFont;
    34 class CAknLayoutFont;
    34 class CFont;
    35 class CFont;
    35 class TRgb;
    36 class TRgb;
    36 
    37 
    37 // Class declaration
    38 // Class declaration
    40 *  @lib xnclockfactory.lib
    41 *  @lib xnclockfactory.lib
    41 *  @since S60 5.0
    42 *  @since S60 5.0
    42 */
    43 */
    43 NONSHARABLE_CLASS( CXnClockAdapter ) : public CXnControlAdapter, 
    44 NONSHARABLE_CLASS( CXnClockAdapter ) : public CXnControlAdapter, 
    44     public MCoeMessageMonitorObserver, public MHWRMLightObserver
    45     public MCoeMessageMonitorObserver, public MHWRMLightObserver
    45     {
    46     {    
    46 public:
       
    47     enum TClockFont
       
    48         {
       
    49         EDigitalFont,
       
    50         EAmPmFont,
       
    51         EDateFont
       
    52         };
       
    53     
       
    54 public: 
    47 public: 
    55     // constructor and destructor
    48     // constructor and destructor
    56     
    49     
    57 	/**
    50 	/**
    58 	 * 2 phase construction.
    51 	 * 2 phase construction.
       
    52 	 * 
       
    53 	 * @param aParent Parent control
       
    54 	 * @param aNode clock node
       
    55 	 * 
       
    56 	 * @return Newly constructed object
    59 	 */
    57 	 */
    60 	static CXnClockAdapter* NewL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode );
    58 	static CXnClockAdapter* NewL( CXnControlAdapter* aParent,
       
    59                                   CXnNodePluginIf& aNode );
    61 
    60 
    62 	/**
    61 	/**
    63 	 * Destructor.
    62 	 * Destructor.
    64 	 */
    63 	 */
    65 	~CXnClockAdapter();
    64 	~CXnClockAdapter();
    66 
    65 
    67 public: 
    66 public: 
    68 	// New functions
    67 	// New functions
    69 
    68     
    70     /** 
    69     /*
    71     * Gets font based on type
    70      * Create font
    72     * 
    71      * 
    73     * @return Font based on aType, NULL if not found
    72      * @param aNode Node which contains info of font
    74     */    
    73      * @param aFontName Font name
    75     const CAknLayoutFont* FontL( const TInt aType );
    74      * @param aFont On return points to a created font
    76         
    75      */    
    77     /**
    76     void CreateFontL( CXnNodePluginIf& aNode,
    78     * Gets text color
    77                       const TDesC& aFontName,
    79     * 
    78                       CFont*& aFont );
    80     * @return Text color
    79     
    81     */
    80     /*
    82     const TRgb& TextColorL();
    81      * Create color
    83 
    82      * 
    84     /**
    83      * @param aNode Node which contains color info
    85     * Gets date information
    84      * @param aColor On return points to a created color
    86     * 
    85      */        
    87     * @return A node which holds date information
    86     void CreateColorL( CXnNodePluginIf& aNode, TRgb& aColor );
    88     */    
       
    89     CXnNodePluginIf* Date() const;
       
    90 
       
    91     /**
       
    92     * Gets day information
       
    93     * 
       
    94     * @return A node which holds day information
       
    95     */    
       
    96     CXnNodePluginIf* Day() const;
       
    97 
    87 
    98     /**
    88     /**
    99     * Calls DrawNow, if node is laidout
    89     * Calls DrawNow, if node is laidout
   100     */        
    90     */        
   101     void UpdateDisplay() const;
    91     void UpdateDisplay() const;
       
    92     
       
    93     /**
       
    94     * Sets clock format
       
    95     * 
       
    96     * @param aFormat format of clock to set
       
    97     */
       
    98     void SetClockFormatL( TClockFormat aFormat );
       
    99     
       
   100     /**
       
   101     * Gets text align from text-align property
       
   102     * 
       
   103     * @param aNode Node which contains property
       
   104     * 
       
   105     * @return Text align or CGraphicsContext::ECenter if property is not set
       
   106     */
       
   107     CGraphicsContext::TTextAlign GetTextAlignL( CXnNodePluginIf& aNode );
   102 
   108 
   103 public: 
   109 public: 
   104     // from base classes
   110     // from base classes
   105 
   111 
   106     /**
   112     /**
   162     * By default Symbian 2nd phase constructor is private.
   168     * By default Symbian 2nd phase constructor is private.
   163     */	
   169     */	
   164 	void ConstructL();
   170 	void ConstructL();
   165 
   171 
   166 private: // New functions
   172 private: // New functions
   167 
       
   168     /*
       
   169      * Create font
       
   170      */    
       
   171     void CreateFontL( const TInt aType );
       
   172 
       
   173     /*
       
   174      * Create color
       
   175      */        
       
   176     void CreateColorL();
       
   177         
   173         
   178     /**
   174     /**
   179      * Starts clock
   175      * Starts clock
   180      */
   176      */
   181     void StartClock();
   177     void StartClock();
   182     
   178     
   183     /**
   179     /**
   184      * Stops clock
   180      * Stops clock
   185      */
   181      */
   186     void StopClock();
   182     void StopClock();
       
   183     
       
   184     /**
       
   185     * Sets display property of node to block or none
       
   186     * 
       
   187     * @param aNode Node which display property is set
       
   188     * @param aBlock Value of display property to set
       
   189     */
       
   190     void SetDisplayToBlockL( CXnNodePluginIf& aNode, TBool aBlock );
   187     
   191     
   188 private:
   192 private:
   189     // Parent control, not owned
   193     // Parent control, not owned
   190     CXnControlAdapter*  		iParent;        
   194     CXnControlAdapter*  		iParent;        
   191     // UI node, not owned
   195     // UI node, not owned
   192     CXnNodePluginIf&    		iNode;
   196     CXnNodePluginIf&    		iNode;
   193     // Digital clock date information, not owned
   197     // Digital clock element, not owned    
       
   198     CXnNodePluginIf*            iDigital;
       
   199     // Analog clock element, not owned
       
   200     CXnNodePluginIf*            iAnalog;
       
   201     // Day number element, not owned
       
   202     CXnNodePluginIf*            iDay;
       
   203     // Am\Pm element, not owned
       
   204     CXnNodePluginIf*            iAmpm;
       
   205     // Digital face 12h element, not owned
       
   206     CXnNodePluginIf*            iDigitalFace12;
       
   207     // Digital face 24h element, not owned
       
   208     CXnNodePluginIf*            iDigitalFace24;
       
   209     // Analog face element, not owned
       
   210     CXnNodePluginIf*            iAnalogFace;
       
   211     // Date element, not owned
   194     CXnNodePluginIf*            iDate;
   212     CXnNodePluginIf*            iDate;
   195     // Analog clock day information, not owned
   213     // Digital clock date element, not owned
   196     CXnNodePluginIf*            iDay;
   214     CXnNodePluginIf*            iDigitalDate;
       
   215     // Analog clock date element, not owned
       
   216     CXnNodePluginIf*            iAnalogDate;    
   197     // Light observer, owned
   217     // Light observer, owned
   198     CHWRMLight*                 iLightObserver;
   218     CHWRMLight*                 iLightObserver;
   199     // Clock control, owned    
   219     // Clock control, owned
   200     CXnClockControl*            iClockControl;  
   220     CXnClockControl*            iClockControl;
   201     // Digital clock font, not owned
   221     // Date control, owned
   202     CFont*                      iDigitalFont;   
   222     CXnDateControl*             iDateControl;
   203     // AmPm font, not owned
   223     // Day number control, owned
   204     CFont*                      iAmPmFont;      
   224     CXnDateControl*             iDayControl;
   205     // Date font, not owned
       
   206     CFont*                      iDateFont;      
       
   207     // Font color
       
   208     TRgb                        iColor;
       
   209     // Flag for initializing font color
       
   210     TBool                       iColorSet;
       
   211     // Flag indicating foreground state
   225     // Flag indicating foreground state
   212     TBool                       iForeground;
   226     TBool                       iForeground;
   213     // Flag indicating lights status
   227     // Flag indicating lights status
   214     TBool                       iLightsOn;
   228     TBool                       iLightsOn;
   215     };
   229     };