lafagnosticuifoundation/cone/tef/TConeVisibility.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2005-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  @file
       
    18  @internalComponent - Internal Symbian test code 
       
    19 */
       
    20 
       
    21 
       
    22 #if !defined(__TCONEVISIBILITY_H__)
       
    23 #define __TCONEVISIBILITY_H__
       
    24 
       
    25 #include <coecntrl.h>
       
    26 #include <coeccntx.h>
       
    27 #include <gulgcmap.h>
       
    28 #include "TConeTestServer.h"
       
    29 #include "appfwk_test_AppUi.h"
       
    30 
       
    31 
       
    32 /** Base control drawing class, with standard rectangle fill draw implementation. It carries a status variable to store
       
    33 	the latest visibility event returned. Note that currently windows server only returns one of EVisible or EHidden.
       
    34 	@test
       
    35 */
       
    36 class CVisibleControl : public CCoeControl
       
    37 {
       
    38 	friend class CVisibilityBackground;	
       
    39 
       
    40 public:	
       
    41 	enum 
       
    42 	{
       
    43 		ENone=0,		
       
    44 		EPartiallyVisible=1,
       
    45 		EHidden=2,
       
    46 		EPartial=3,
       
    47 		EFullyVisible=4
       
    48 	};
       
    49 
       
    50 
       
    51 	TInt iStatus;
       
    52 	
       
    53 	CVisibleControl()
       
    54 	{
       
    55 		iStatus = ENone;
       
    56 	};
       
    57 	
       
    58     void Draw(const TRect& aRect) const;
       
    59     
       
    60 };
       
    61 
       
    62 /** Parent control, which also acts as background, contains two child controls for manipulation
       
    63 	@test
       
    64 */
       
    65 class CVisibilityBackground : public CVisibleControl
       
    66 {
       
    67 public:
       
    68 	CVisibleControl *iControl1;
       
    69 	CVisibleControl *iControl2;
       
    70 	CVisibilityBackground()
       
    71 	{
       
    72 		
       
    73 	};
       
    74 	~CVisibilityBackground();
       
    75 	void ConstructL(void);
       
    76 		
       
    77 };
       
    78 
       
    79 /** Test step class
       
    80 	@test
       
    81 */
       
    82 class CTConeVisibilityStep : public CTmsTestStep
       
    83 	{
       
    84 public:
       
    85 	CTConeVisibilityStep();
       
    86 	~CTConeVisibilityStep();
       
    87 	virtual TVerdict doTestStepL();
       
    88 	void ConstructAppL(CCoeEnv* aCoe);
       
    89 
       
    90 private:
       
    91 	};
       
    92 	
       
    93 /**  Test application derived from the MCoeMessageMonitorObserver mix in class to behave as an observer which
       
    94 	 is implemented as the MonitorWsMessage override
       
    95 	 @test
       
    96 */
       
    97 class CTConeVisibilityAppUi : public CTestCoeAppUi, MCoeMessageMonitorObserver
       
    98     {
       
    99     
       
   100 public:
       
   101 	CTConeVisibilityAppUi(CTmsTestStep* aStep);
       
   102 	~CTConeVisibilityAppUi();
       
   103 	void ConstructL();
       
   104 private: // from CCoeAppUi
       
   105     TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   106     
       
   107 	virtual void MonitorWsMessage(const TWsEvent& aEvent);
       
   108 private: // utility
       
   109 	void RunTestStepL(TInt aStepNum);
       
   110 protected:
       
   111 	CVisibilityBackground* iViewControl;			//The main application control
       
   112 	
       
   113     };
       
   114 
       
   115 _LIT(KTConeVisibilityStep,"TConeVisibility");
       
   116 
       
   117 #endif
       
   118 
       
   119