idlehomescreen/xmluirendering/renderingplugins/xnpopupfactory/inc/xnpopupadapter.h
changeset 0 f72a12da539e
child 15 ff572dfe6d86
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:  Control adapter class for tooltips and other popups
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef _XNPOPUPADAPTER_H
       
    21 #define _XNPOPUPADAPTER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "xncontroladapter.h"
       
    25 #include <e32base.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CXnNodePluginIf;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 /**
       
    32 *  @ingroup group_xnpopupfactory
       
    33 *  @lib NONE
       
    34 *  @since Series 60 3.1
       
    35 */
       
    36 class CXnPopupAdapter : public CXnControlAdapter
       
    37     {
       
    38 public:
       
    39     enum TPositionHint
       
    40         {
       
    41         ENone,
       
    42         EAboveLeft,
       
    43         EAboveRight,
       
    44         EBelowLeft,
       
    45         EBelowRight,
       
    46         ELeft,
       
    47         ERight
       
    48         };
       
    49         
       
    50 public:
       
    51 	/**
       
    52 	 * 2 phase construction.
       
    53 	 */
       
    54 	static CXnPopupAdapter* NewL(CXnNodePluginIf& aNode, CXnControlAdapter* aParent);
       
    55 
       
    56 	/**
       
    57 	 * Destructor.
       
    58 	 */
       
    59 	virtual ~CXnPopupAdapter();
       
    60 
       
    61 public: // New functions
       
    62   /**
       
    63    *  Shows the popup
       
    64    * @param aContainerRect Rectangle containing the control that has a popup. 
       
    65    * The popup will not overlap with this rect.
       
    66    */
       
    67 	void ShowPopupL(const TRect& aContainerRect);
       
    68     void ShowPopupL(const TRect& aContainerRect, 
       
    69     				TTimeIntervalMicroSeconds32 aShowDelay, 
       
    70     				TTimeIntervalMicroSeconds32 aDisplayTime);
       
    71 	/**
       
    72 	 * Hides the popup
       
    73 	 */
       
    74 	void HidePopupL();
       
    75 	
       
    76 	/**
       
    77 	* @see CXnControlAdapter
       
    78 	*/
       
    79 	void DoEnterPowerSaveModeL( TModeEvent aEvent );
       
    80 	
       
    81 	/**
       
    82 	* @see CXnControlAdapter
       
    83 	*/
       
    84     void HandleScreenDeviceChangedL();	
       
    85 
       
    86 	/**
       
    87 	* @see CXnControlAdapter
       
    88 	*/
       
    89     void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); 
       
    90    
       
    91 private:
       
    92     void Draw(const TRect& aRect) const;
       
    93 
       
    94 	CXnPopupAdapter();
       
    95 	void ConstructL(CXnNodePluginIf& aNode, CXnControlAdapter* aParent);
       
    96 	
       
    97     void CalculatePosition( TRect aPopupRect );
       
    98 
       
    99 private:
       
   100 	mutable CXnNodePluginIf* iNode;
       
   101 	CActive* iActiveObject;
       
   102 	CCoeAppUi* iAppUi;
       
   103 	TRect iContainerRect;
       
   104 	TRect iPopupRect;
       
   105     TPositionHint iPositionHint;
       
   106     };
       
   107 #endif      // _XNPOPUPADAPTER_H
       
   108             
       
   109 // End of File