commonuisupport/uikon/test/tspane/tspane.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 // Tests CEikStatusPane APIs.\n
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent - Internal Symbian test code
       
    21 */
       
    22 
       
    23 #ifndef __TSPANE_H
       
    24 #define __TSPANE_H
       
    25 
       
    26 #include <coecntrl.h>
       
    27 #include <coeccntx.h>
       
    28 
       
    29 #include <eikappui.h>
       
    30 #include <eikapp.h>
       
    31 #include <eikdoc.h>
       
    32 #include <e32std.h>
       
    33 #include <eikspane.h>
       
    34 #include <techview/eikcmbut.h>
       
    35 #include <techview/eikgted.h>
       
    36 
       
    37 
       
    38 #include "appfwk_test_AppUi.h"
       
    39 
       
    40 //const TUid KUidTspaneApp={ 0x0000012b };
       
    41 
       
    42 _LIT(KTestSpaneStep, "TSpane");
       
    43 
       
    44 //! CTspaneContainer
       
    45 /**
       
    46 Container control for test step.
       
    47 */
       
    48 class CTspaneContainer : public CCoeControl, public MEikStatusPaneObserver
       
    49     {
       
    50 public:
       
    51 	enum TAutoTest
       
    52 		{
       
    53 		ETotal=-3,
       
    54 		EOOM,
       
    55 		EAllNormal,
       
    56 		EObserver,
       
    57 			EBackground,
       
    58 		ENew,
       
    59 		EReduceRect,
       
    60 		ESwitchLayout,
       
    61 		ECaps,
       
    62 	 
       
    63 		ERect,
       
    64 		EControl,
       
    65 		ESwap,
       
    66 		EContainer,
       
    67 		ENumNormalTests
       
    68 		};
       
    69 public:
       
    70     void ConstructL(const TRect& aRect);
       
    71     ~CTspaneContainer();
       
    72 	
       
    73 	void AutoTestL(TAutoTest aTestId);
       
    74 	void ReportState();
       
    75 	void SwitchVis();
       
    76 	void SwitchDim();
       
    77 	void SwitchFade();
       
    78 	void SwitchLayoutL();
       
    79 	void BoundingRectOfRegionL();
       
    80 	void SwitchControlL(TBool aFocus=ETrue);
       
    81 
       
    82 private:
       
    83 	void Draw(const TRect& aRect) const;
       
    84 	void HandleStatusPaneSizeChange();
       
    85 
       
    86 private:
       
    87 	void AutoTestOom();
       
    88 	void AutoTestObserverL();
       
    89 	void AutoTestReduceL();
       
    90 	void AutoTestSwitchL();
       
    91 	void AutoTestCapsL();
       
    92 	void AutoTestRectL();
       
    93 	void AutoTestControlL();
       
    94 	void AutoTestSwapL();
       
    95 	void AutoTestContainerL();
       
    96 //FC
       
    97 void AutoTestBackgroundL();
       
    98 void SwapBackgroundTestControlL(TInt aControlType);
       
    99 	void AutoTestNewL();
       
   100 	void AutoTestAppOverridesL();
       
   101 	void AutoTestBadDefaultLayoutL();
       
   102 	void AutoTestBadOverrideLayoutL();
       
   103 	void AutoTestBadOverridePaneL();
       
   104 
       
   105 	void CreateStatusPaneL();
       
   106 
       
   107 private:
       
   108 	class TSpaneObserver : public MEikStatusPaneObserver
       
   109 		{
       
   110 	public:
       
   111 		TSpaneObserver() : iState(EFalse) {}
       
   112 		void Reset() { iState = EFalse; }
       
   113 		TBool Test() { return iState; }
       
   114 	private:
       
   115 		void HandleStatusPaneSizeChange() { iState = ETrue; }
       
   116 	private:
       
   117 		TBool iState;
       
   118 		};
       
   119 
       
   120 private:
       
   121 	CEikStatusPane* iStatusPane;
       
   122 	TSpaneObserver iObs1;
       
   123 	TSpaneObserver iObs2;
       
   124 	TInt iLayoutNum;
       
   125 	TInt iControlNum;
       
   126     };
       
   127 
       
   128 
       
   129 
       
   130 
       
   131 //! CTspaneEikDocument
       
   132 /**
       
   133 Document class for test step.
       
   134 */
       
   135 class CTspaneEikDocument : public CEikDocument
       
   136 	{
       
   137 public:
       
   138 	void ConstructL();
       
   139 	CTspaneEikDocument(CEikApplication& aApp): CEikDocument(aApp) { }
       
   140 	~CTspaneEikDocument() {}
       
   141 	// Stop doc file being created
       
   142 	CFileStore* OpenFileL(TBool /*aDoOpen*/,const TDesC& /*aFilename*/,RFs& /*aFs*/) {return NULL;}
       
   143 private:
       
   144 	// from CEikDocument
       
   145 	CEikAppUi* CreateAppUiL();
       
   146 	};
       
   147 
       
   148 //! CFloatingSpaneKiller
       
   149 /**
       
   150 Floating status pane control.
       
   151 */
       
   152 class CFloatingSpaneKiller : public CEikTextButton, public MCoeControlObserver
       
   153 	{
       
   154 public:
       
   155 	~CFloatingSpaneKiller();
       
   156 	static CFloatingSpaneKiller* NewL(CEikStatusPane* aSpane, RWindowGroup* aWg);
       
   157 	void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
       
   158 private:
       
   159 	CFloatingSpaneKiller(CEikStatusPane* aSpane, RWindowGroup* aWg);
       
   160 	void ConstructL();
       
   161 private:
       
   162 	CEikStatusPane* iSpane;
       
   163 	RWindowGroup* iWg;
       
   164 	};
       
   165 
       
   166 
       
   167 //! CTspaneAppUi
       
   168 /**
       
   169 UI class for test step.
       
   170 */
       
   171 class CTspaneAppUi : public CTestAppUi
       
   172     {
       
   173 public:
       
   174 	CTspaneAppUi(CTmsTestStep*		aStep);
       
   175     void ConstructL();
       
   176 	~CTspaneAppUi();
       
   177 private: // from CEikAppUi
       
   178 	void HandleCommandL(TInt aCommand);
       
   179 	void CreateNewWindowGroupL();
       
   180 	void RunTestStepL(TInt aNumStep);
       
   181 private:
       
   182     CTspaneContainer* iAppView;
       
   183 	CFloatingSpaneKiller*	iFloatingPanel;
       
   184 
       
   185     };
       
   186 
       
   187 
       
   188 
       
   189 
       
   190 //! CTestSpaneStep
       
   191 /**
       
   192 Class tests status pane.
       
   193 */
       
   194 class CTestSpaneStep : public CTmsTestStep
       
   195 	{
       
   196 public:
       
   197 	CTestSpaneStep();
       
   198 	~CTestSpaneStep();
       
   199 	//virtual TVerdict doTestStepPreambleL();
       
   200 	virtual TVerdict doTestStepL();
       
   201 	void ConstructAppL(CEikonEnv* aCoe);
       
   202 private:
       
   203 	};
       
   204 
       
   205 
       
   206 //! CControlStackedGlobalTextEditor
       
   207 /**
       
   208 Global text editor control.
       
   209 */
       
   210 class CControlStackedGlobalTextEditor : public CEikGlobalTextEditor
       
   211 	{
       
   212 public:
       
   213 	inline CControlStackedGlobalTextEditor(const TGulBorder& aBorder) :CEikGlobalTextEditor(aBorder) {}
       
   214 	virtual ~CControlStackedGlobalTextEditor();
       
   215 	};
       
   216 
       
   217 
       
   218 #endif