idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/inc/xnclockadapter.h
changeset 0 f72a12da539e
child 47 7be2816dbabd
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Wrapper class for CAknSkinnableClock
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef _XNCLOCKADAPTER_H
       
    21 #define _XNCLOCKADAPTER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "xncontroladapter.h"
       
    25 #include <e32base.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CXnNodePluginIf;
       
    29 class CXnClockControl;
       
    30 class CAknLayoutFont;
       
    31 class CFont;
       
    32 class TRgb;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36 *  @ingroup group_xnclockfactory
       
    37 *  @lib xnclockfactory.lib
       
    38 *  @since S60
       
    39 */
       
    40 class CXnClockAdapter : public CXnControlAdapter, 
       
    41                         public MCoeMessageMonitorObserver
       
    42     {
       
    43 public:
       
    44     enum TClockFont
       
    45         {
       
    46         EDigitalFont,
       
    47         EAmPmFont,
       
    48         EDateFont
       
    49         };
       
    50     
       
    51 public: // constructor and destructor
       
    52 	/**
       
    53 	 * 2 phase construction.
       
    54 	 */
       
    55 	static CXnClockAdapter* NewL( CXnControlAdapter* aParent, CXnNodePluginIf& aNode );
       
    56 
       
    57 	/**
       
    58 	 * Destructor.
       
    59 	 */
       
    60 	~CXnClockAdapter();
       
    61 
       
    62 public: // New functions
       
    63 
       
    64     /** 
       
    65     * Gets font based on type
       
    66     * 
       
    67     * @return Font based on aType, NULL if not found
       
    68     */    
       
    69     const CAknLayoutFont* FontL( const TInt aType );
       
    70         
       
    71     /**
       
    72     * Gets text color
       
    73     * 
       
    74     * @return Text color
       
    75     */
       
    76     const TRgb& TextColorL();
       
    77 
       
    78     /**
       
    79     * Gets date information
       
    80     * 
       
    81     * @return A node which holds date information
       
    82     */    
       
    83     CXnNodePluginIf* Date() const;
       
    84 
       
    85     /**
       
    86     * Gets day information
       
    87     * 
       
    88     * @return A node which holds day information
       
    89     */    
       
    90     CXnNodePluginIf* Day() const;
       
    91 
       
    92     /**
       
    93     * Calls DrawNow, if node is laidout
       
    94     */        
       
    95     void UpdateDisplay() const;
       
    96 
       
    97 public: // from base classes
       
    98 
       
    99     /**
       
   100     * @see CXnControlAdapter documentation
       
   101     */    	
       
   102     void DoHandlePropertyChangeL( CXnProperty* aProperty = NULL ); 
       
   103 
       
   104     /*
       
   105      * @see CXnControlAdapter documentation
       
   106      */  
       
   107     void SkinChanged();
       
   108 
       
   109     /*     
       
   110      * @see CXnControlAdapter documentation
       
   111      */  
       
   112     void HandleScreenDeviceChangedL();
       
   113 
       
   114     /*     
       
   115      * @see CCoeControl documentation
       
   116      */      
       
   117     void SizeChanged();
       
   118     
       
   119     /**
       
   120     * @see CCoeControl documentation
       
   121     */    	            
       
   122     void Draw( const TRect& aRect ) const;
       
   123 
       
   124     /**
       
   125     * @see CCoeControl documentation
       
   126     */    	            
       
   127     void MakeVisible( TBool aVisible );
       
   128 
       
   129 private: // from MCoeMessageMonitorObserver
       
   130     /**
       
   131     * @see MCoeMessageMonitorObserver documentation
       
   132     */
       
   133     void MonitorWsMessage( const TWsEvent& aEvent );
       
   134     
       
   135 private: // constructors
       
   136 
       
   137     /**
       
   138     * C++ default constructor.
       
   139     */
       
   140 	CXnClockAdapter( CXnControlAdapter* aParent, CXnNodePluginIf& aNode );
       
   141 
       
   142     /**
       
   143     * By default Symbian 2nd phase constructor is private.
       
   144     */	
       
   145 	void ConstructL();
       
   146 
       
   147 private: // New functions
       
   148 
       
   149     /*
       
   150      * Create font
       
   151      */    
       
   152     void CreateFontL( const TInt aType );
       
   153 
       
   154     /*
       
   155      * Create color
       
   156      */        
       
   157     void CreateColorL();
       
   158         
       
   159 private:
       
   160     // Parent control, not owned
       
   161     CXnControlAdapter*  		iParent;        
       
   162     // UI node, not owned
       
   163     CXnNodePluginIf&    		iNode;
       
   164     // Digital clock date information, not owned
       
   165     CXnNodePluginIf*            iDate;
       
   166     // Analog clock day information, not owned
       
   167     CXnNodePluginIf*            iDay;
       
   168     // Clock control, owned    
       
   169     CXnClockControl*            iClockControl;  
       
   170     // Digital clock font, not owned
       
   171     CFont*                      iDigitalFont;   
       
   172     // AmPm font, not owned
       
   173     CFont*                      iAmPmFont;      
       
   174     // Date font, not owned
       
   175     CFont*                      iDateFont;      
       
   176     // Font color
       
   177     TRgb                        iColor;
       
   178     // Flag for initializing font color
       
   179     TBool                       iColorSet;
       
   180     // Flag indicating foreground state
       
   181     TBool                       iForeground;
       
   182     };
       
   183 
       
   184 #endif      // _XNCLOCKADAPTER_H
       
   185             
       
   186 // End of File