lafagnosticuifoundation/cone/tef/tmultiptrtestcontrol.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #ifndef __TMULTIPTRTESTCONTROL_H__
       
    18 #define __TMULTIPTRTESTCONTROL_H__
       
    19 
       
    20 
       
    21 class CConeMultiPtrTestAppUi;
       
    22 class CConeMultiPtrCompoundTestAppUi;
       
    23 class CMultiPtrTestControlBase : public CCoeControl
       
    24     {
       
    25     
       
    26 public:
       
    27 	enum { EEventBufferSize = 256 };
       
    28 	
       
    29     enum
       
    30 	    {
       
    31 	    EMultiPtrTestFailed,
       
    32 	    EmultiPtrNext
       
    33 	    };
       
    34     
       
    35 public:
       
    36     void ConstructL();
       
    37     ~CMultiPtrTestControlBase();
       
    38     TInt EventsLeft();
       
    39     void AddExpectedEvent( TAdvancedPointerEvent& aPointerEvent );
       
    40     void CheckEventL( const TAdvancedPointerEvent& aExpectedEvent, const TAdvancedPointerEvent& aActualEvent );
       
    41     TBool Captures();
       
    42     void SetDrags();
       
    43     void SetGrabs();
       
    44     void SetPassive( TBool aPassive = ETrue );
       
    45     
       
    46     virtual void NotifyControlL( TInt aNotify ) = 0;
       
    47     // From CCoeControl
       
    48     void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
    49 
       
    50 protected:					
       
    51 	// Specialised controls can derive from this class and gain access to these variables
       
    52 	CCirBuf<TAdvancedPointerEvent> iEventBuffer;
       
    53 	
       
    54 private:
       
    55 	TBool iPassive;
       
    56     };
       
    57 
       
    58 
       
    59 class CMultiPtrTestControl : public CMultiPtrTestControlBase
       
    60 	{
       
    61 public:
       
    62 	static CMultiPtrTestControl* NewL( TPoint aOrigin, TSize aSize );
       
    63 	
       
    64 	~CMultiPtrTestControl();
       
    65 	// From CMultiPtrTestControlBase
       
    66 	void NotifyControlL( TInt aNotify );
       
    67 	
       
    68 protected:
       
    69 	CMultiPtrTestControl();
       
    70 	void ConstructL( TPoint aOrigin, TSize aSize );
       
    71 private:
       
    72 	void Draw(const TRect& aRect) const;
       
    73 	
       
    74 private:
       
    75 	CConeMultiPtrTestAppUi* iAppUi;
       
    76 	};
       
    77 
       
    78 
       
    79 /**
       
    80  Differs from CMultiPtrTestControl in the AppUi member.
       
    81 */
       
    82 class CMultiPtrTestCompoundAppUiControl : public CMultiPtrTestControlBase
       
    83 	{
       
    84 public:
       
    85 	static CMultiPtrTestCompoundAppUiControl* NewL( TPoint aOrigin, TSize aSize );
       
    86 	
       
    87 	~CMultiPtrTestCompoundAppUiControl();
       
    88 	// From CMultiPtrTestControlBase
       
    89 	void NotifyControlL( TInt aNotify );
       
    90 	
       
    91 protected:
       
    92 	CMultiPtrTestCompoundAppUiControl();
       
    93 	void ConstructL( TPoint aOrigin, TSize aSize );
       
    94 private:
       
    95 	void Draw(const TRect& aRect) const;
       
    96 	
       
    97 private:
       
    98 	CConeMultiPtrCompoundTestAppUi* iAppUi;
       
    99 	};
       
   100 #endif // __TMULTIPTRTESTCONTROL_H__