idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockadapter.h
branchRCL_3
changeset 23 7be2816dbabd
parent 0 f72a12da539e
equal deleted inserted replaced
19:79311d856354 23:7be2816dbabd
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  Wrapper class for CAknSkinnableClock
    14 * Description:  Clock rendering plugin
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 
    19 
    20 #ifndef _XNCLOCKADAPTER_H
    20 #ifndef _XNCLOCKADAPTER_H
    21 #define _XNCLOCKADAPTER_H
    21 #define _XNCLOCKADAPTER_H
    22 
    22 
    23 //  INCLUDES
    23 // System includes
       
    24 #include <e32base.h>
       
    25 #include <hwrmlight.h>
       
    26 
       
    27 // User includes
    24 #include "xncontroladapter.h"
    28 #include "xncontroladapter.h"
    25 #include <e32base.h>
    29 
    26 
    30 // Forward declarations
    27 // FORWARD DECLARATIONS
       
    28 class CXnNodePluginIf;
    31 class CXnNodePluginIf;
    29 class CXnClockControl;
    32 class CXnClockControl;
    30 class CAknLayoutFont;
    33 class CAknLayoutFont;
    31 class CFont;
    34 class CFont;
    32 class TRgb;
    35 class TRgb;
    33 
    36 
    34 // CLASS DECLARATION
    37 // Class declaration
    35 /**
    38 /**
    36 *  @ingroup group_xnclockfactory
    39 *  @ingroup group_xnclockfactory
    37 *  @lib xnclockfactory.lib
    40 *  @lib xnclockfactory.lib
    38 *  @since S60
    41 *  @since S60 5.0
    39 */
    42 */
    40 class CXnClockAdapter : public CXnControlAdapter, 
    43 NONSHARABLE_CLASS( CXnClockAdapter ) : public CXnControlAdapter, 
    41                         public MCoeMessageMonitorObserver
    44     public MCoeMessageMonitorObserver, public MHWRMLightObserver
    42     {
    45     {
    43 public:
    46 public:
    44     enum TClockFont
    47     enum TClockFont
    45         {
    48         {
    46         EDigitalFont,
    49         EDigitalFont,
    47         EAmPmFont,
    50         EAmPmFont,
    48         EDateFont
    51         EDateFont
    49         };
    52         };
    50     
    53     
    51 public: // constructor and destructor
    54 public: 
       
    55     // constructor and destructor
       
    56     
    52 	/**
    57 	/**
    53 	 * 2 phase construction.
    58 	 * 2 phase construction.
    54 	 */
    59 	 */
    55 	static CXnClockAdapter* NewL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode );
    60 	static CXnClockAdapter* NewL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode );
    56 
    61 
    57 	/**
    62 	/**
    58 	 * Destructor.
    63 	 * Destructor.
    59 	 */
    64 	 */
    60 	~CXnClockAdapter();
    65 	~CXnClockAdapter();
    61 
    66 
    62 public: // New functions
    67 public: 
       
    68 	// New functions
    63 
    69 
    64     /** 
    70     /** 
    65     * Gets font based on type
    71     * Gets font based on type
    66     * 
    72     * 
    67     * @return Font based on aType, NULL if not found
    73     * @return Font based on aType, NULL if not found
    92     /**
    98     /**
    93     * Calls DrawNow, if node is laidout
    99     * Calls DrawNow, if node is laidout
    94     */        
   100     */        
    95     void UpdateDisplay() const;
   101     void UpdateDisplay() const;
    96 
   102 
    97 public: // from base classes
   103 public: 
       
   104     // from base classes
    98 
   105 
    99     /**
   106     /**
   100     * @see CXnControlAdapter documentation
   107     * @see CXnControlAdapter documentation
   101     */    	
   108     */    	
   102     void DoHandlePropertyChangeL( CXnProperty* aProperty = NULL ); 
   109     void DoHandlePropertyChangeL( CXnProperty* aProperty = NULL ); 
   124     /**
   131     /**
   125     * @see CCoeControl documentation
   132     * @see CCoeControl documentation
   126     */    	            
   133     */    	            
   127     void MakeVisible( TBool aVisible );
   134     void MakeVisible( TBool aVisible );
   128 
   135 
   129 private: // from MCoeMessageMonitorObserver
   136 private: 
       
   137     // from MCoeMessageMonitorObserver
       
   138     
   130     /**
   139     /**
   131     * @see MCoeMessageMonitorObserver documentation
   140     * @see MCoeMessageMonitorObserver documentation
   132     */
   141     */
   133     void MonitorWsMessage( const TWsEvent& aEvent );
   142     void MonitorWsMessage( const TWsEvent& aEvent );
   134     
   143     
   135 private: // constructors
   144 private:
       
   145     // from MHWRMLightObserver
       
   146     
       
   147     /**
       
   148      * @see MHWRMLightObserver     
       
   149      */    
       
   150     void LightStatusChanged( TInt aTarget, 
       
   151         CHWRMLight::TLightStatus aStatus );
       
   152     
       
   153 private: 
       
   154     // constructors
   136 
   155 
   137     /**
   156     /**
   138     * C++ default constructor.
   157     * C++ default constructor.
   139     */
   158     */
   140 	CXnClockAdapter( CXnControlAdapter* aParent, CXnNodePluginIf& aNode );
   159 	CXnClockAdapter( CXnControlAdapter* aParent, CXnNodePluginIf& aNode );
   154     /*
   173     /*
   155      * Create color
   174      * Create color
   156      */        
   175      */        
   157     void CreateColorL();
   176     void CreateColorL();
   158         
   177         
       
   178     /**
       
   179      * Starts clock
       
   180      */
       
   181     void StartClock();
       
   182     
       
   183     /**
       
   184      * Stops clock
       
   185      */
       
   186     void StopClock();
       
   187     
   159 private:
   188 private:
   160     // Parent control, not owned
   189     // Parent control, not owned
   161     CXnControlAdapter*  		iParent;        
   190     CXnControlAdapter*  		iParent;        
   162     // UI node, not owned
   191     // UI node, not owned
   163     CXnNodePluginIf&    		iNode;
   192     CXnNodePluginIf&    		iNode;
   164     // Digital clock date information, not owned
   193     // Digital clock date information, not owned
   165     CXnNodePluginIf*            iDate;
   194     CXnNodePluginIf*            iDate;
   166     // Analog clock day information, not owned
   195     // Analog clock day information, not owned
   167     CXnNodePluginIf*            iDay;
   196     CXnNodePluginIf*            iDay;
       
   197     // Light observer, owned
       
   198     CHWRMLight*                 iLightObserver;
   168     // Clock control, owned    
   199     // Clock control, owned    
   169     CXnClockControl*            iClockControl;  
   200     CXnClockControl*            iClockControl;  
   170     // Digital clock font, not owned
   201     // Digital clock font, not owned
   171     CFont*                      iDigitalFont;   
   202     CFont*                      iDigitalFont;   
   172     // AmPm font, not owned
   203     // AmPm font, not owned
   177     TRgb                        iColor;
   208     TRgb                        iColor;
   178     // Flag for initializing font color
   209     // Flag for initializing font color
   179     TBool                       iColorSet;
   210     TBool                       iColorSet;
   180     // Flag indicating foreground state
   211     // Flag indicating foreground state
   181     TBool                       iForeground;
   212     TBool                       iForeground;
       
   213     // Flag indicating lights status
       
   214     TBool                       iLightsOn;
   182     };
   215     };
   183 
   216 
   184 #endif      // _XNCLOCKADAPTER_H
   217 #endif      // _XNCLOCKADAPTER_H
   185             
   218             
   186 // End of File
   219 // End of File