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