idlehomescreen/xmluirendering/uiengine/inc/xnfocuscontrol.h
branchRCL_3
changeset 34 5456b4e8b3a8
child 35 3321d3e205b6
equal deleted inserted replaced
33:5f0182e07bfb 34:5456b4e8b3a8
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Focus appearance drawer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _XNFOCUSCONTROL_H
       
    20 #define _XNFOCUSCONTROL_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 
       
    25 // Forward declarations
       
    26 class CXnAppUiAdapter;
       
    27 class CWindowGc;
       
    28 
       
    29 /**
       
    30  * Focus appearance drawer
       
    31  * 
       
    32  * @ingroup group_xnlayoutengine
       
    33  * @lib xn3layoutengine.lib
       
    34  * @since S60 5.0
       
    35  */
       
    36 NONSHARABLE_CLASS( CXnFocusControl ) : public CBase
       
    37     {
       
    38 public:    
       
    39     // Constructors and destructor
       
    40     
       
    41     /**
       
    42      * Two-phased constructor.
       
    43      */
       
    44     static CXnFocusControl* NewL( CXnAppUiAdapter& aAppUiAdapter );
       
    45 
       
    46     /**
       
    47      * Two-phased constructor. Leaving on stack
       
    48      */
       
    49     static CXnFocusControl* NewLC( CXnAppUiAdapter& aAppUiAdapter );
       
    50 
       
    51     /**
       
    52      * Destructor
       
    53      */
       
    54     ~CXnFocusControl();
       
    55 
       
    56 private:
       
    57     // private constructors
       
    58 
       
    59     /**
       
    60      * Leaving constructor
       
    61      */
       
    62     void ConstructL();
       
    63     
       
    64     /**
       
    65      * C++ default constructor
       
    66      */
       
    67     CXnFocusControl( CXnAppUiAdapter& aAppUiAdapter );
       
    68     
       
    69 public: 
       
    70     // new functions
       
    71     
       
    72     /**
       
    73      * Makes focus viisble
       
    74      * 
       
    75      * @since S60 5.0     
       
    76      * @param aVisible, ETrue visible, EFalse invisible
       
    77      */
       
    78     void MakeVisible( TBool aVisible );
       
    79 
       
    80     /**
       
    81      * Queries whether focus is visible
       
    82      * 
       
    83      * @since S60 5.0     
       
    84      * @return ETrue if focus visible, EFalse otherwise
       
    85      */    
       
    86     TBool IsVisible() const;
       
    87     
       
    88     /**
       
    89      * Draws the 1st state and 2nd state focus appearenace
       
    90      * 
       
    91      * @since S60 5.0
       
    92      * @param aRect Rect where to draw
       
    93      * @param aGc Context
       
    94      */
       
    95     void Draw( const TRect& aRect, CWindowGc& aGc ) const;
       
    96 
       
    97 private:
       
    98     // new functions
       
    99     
       
   100     void DoMakeVisibleL( TBool aVisible );
       
   101     
       
   102 private:
       
   103     // data
       
   104     
       
   105     /** AppUiAdapter, Not owned */
       
   106     CXnAppUiAdapter& iAppUiAdapter;
       
   107     /** Flag to indicate whether it is allowed to show focus */
       
   108     TBool iVisible;
       
   109     /** Flag to indicate refusal */
       
   110     TBool iRefused;
       
   111     };
       
   112 
       
   113 #endif // _XNFOCUSCONTROL_H