commonuisupport/uikon/test/tviews/tview3/tview3.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 #ifndef __TVIEW3_H__
       
    23 #define __TVIEW3_H__
       
    24 
       
    25 #include <coecntrl.h>
       
    26 #include <coeccntx.h>
       
    27 #include <coemain.h>
       
    28 
       
    29 #include <eikapp.h>
       
    30 #include <eikdoc.h>
       
    31 #include <eikenv.h>
       
    32 #include <techview/eiklbi.h>
       
    33 #include <techview/eikconso.h>
       
    34 #include <techview/eikdialg.h>
       
    35 
       
    36 #include "tvwview.H"
       
    37 #include "tvwappui.H"
       
    38 
       
    39 //
       
    40 // Constants.
       
    41 //
       
    42 
       
    43 const TInt KMaxCommandLength=256;
       
    44 const TInt KNumViewsToActivate=8;
       
    45 
       
    46 
       
    47 //
       
    48 // Forward declarations.
       
    49 //
       
    50 
       
    51 class CTestDocument;
       
    52 class CTestView;
       
    53 class CTestAppUi;
       
    54 
       
    55 
       
    56 //
       
    57 // Class CTestViewControl
       
    58 //
       
    59 
       
    60 class CTestViewControl : public CCoeControl
       
    61     {
       
    62 public:
       
    63     void ConstructL(const TVwsViewId& aViewId);
       
    64 	~CTestViewControl();
       
    65 private: // framework
       
    66 	void Draw(const TRect& aRect) const;
       
    67 private:
       
    68 	TVwsViewId iViewId;
       
    69     };
       
    70 
       
    71 
       
    72 //
       
    73 // CTestView.
       
    74 //
       
    75 
       
    76 class CTestView : public CTestVwAppView
       
    77 	{
       
    78 public:
       
    79 	~CTestView();
       
    80 	CTestView(const TVwsViewId& aViewId,CTestAppUi& aAppUi);
       
    81 	void ConstructL();
       
    82 	void InitializeAsDefaultL();
       
    83 public:	// from CTestVwAppView
       
    84 	void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC16& aCustomMessage);
       
    85 	void DoDeactivate();
       
    86 	void HandleCommandL(TInt aCommand);
       
    87 	void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis);
       
    88 	void Reset();
       
    89 	void UnrollDoActivate();
       
    90 public:
       
    91 	TBool iDeactivationPanic;
       
    92 	TBool iSlowDeactivation;
       
    93 	TBool iSluggishDeactivation;
       
    94 private:
       
    95 	TBool iActivated;
       
    96 	CTestViewControl* iControl;
       
    97 	};
       
    98 
       
    99 //
       
   100 // CTestSwitchDialog.
       
   101 //
       
   102 
       
   103 class CTestSwitchDialog : public CEikDialog
       
   104 	{
       
   105 public:
       
   106 	~CTestSwitchDialog();
       
   107 	CTestSwitchDialog(CTestAppUi& aAppUi);
       
   108 private: // From CEikDialog.
       
   109 	virtual TBool OkToExitL(TInt aButtonId);
       
   110 private:
       
   111 	CTestAppUi& iAppUi;
       
   112 	};
       
   113 
       
   114 
       
   115 //
       
   116 // CTestAppUi.
       
   117 //
       
   118 
       
   119 class CRichText;
       
   120 class CParaFormatLayer;
       
   121 class CCharFormatLayer;
       
   122 
       
   123 class CTestAppUi : public CTestVwAppUi
       
   124     {
       
   125 public:
       
   126 	CTestAppUi();
       
   127     void ConstructL();
       
   128 	~CTestAppUi();
       
   129 	void DisplayRichTextDialogL();
       
   130 	void StartEnduranceTest();
       
   131 	void DoNextEnduranceTestActivation();
       
   132 	static TInt EnduranceTestCallBack(TAny* aSelf);
       
   133 private: // from CEikAppUi
       
   134 	void HandleCommandL(TInt aCommand);
       
   135 private:
       
   136 	void CreateViewsL();
       
   137 	void DisplaySwitchViewDialogL();
       
   138 	void DoActivationL();
       
   139 	void TestActivationOOML();
       
   140 	void TestSuccesiveAllocFailL();
       
   141 	void TestWaitingActivationL();
       
   142 	void TestPanicedActivationL();
       
   143 	void TestPanicedDeactivationL();
       
   144 	void TestSlowActivationL();
       
   145 	void TestSlowDeactivationL();
       
   146 	void TestStartMissingAppL();
       
   147 	void TestPanic();
       
   148 	void AddViewL(const TVwsViewId& aViewId);
       
   149 private:
       
   150 	friend class CTestSwitchDialog;
       
   151 private:
       
   152 	CRichText* iRichText;
       
   153 	CParaFormatLayer* iRichParaFormatLayer;
       
   154 	CCharFormatLayer* iRichCharFormatLayer;
       
   155 	TVwsViewId iViewToActivate;
       
   156 	TBool iViewsCreated;
       
   157 	HBufC* iCustomMsg;
       
   158 	CPeriodic* iAutoTestTimer;
       
   159 	TInt64 iRandSeed;
       
   160 	};
       
   161 
       
   162 
       
   163 //
       
   164 // CTestDocument.
       
   165 //
       
   166 
       
   167 class CTestDocument : public CEikDocument
       
   168 	{
       
   169 public:
       
   170 	// construct/destruct
       
   171 	CTestDocument(CEikApplication& aApp);
       
   172 private: // from CEikDocument
       
   173 	CEikAppUi* CreateAppUiL();
       
   174 	};
       
   175 
       
   176 
       
   177 //
       
   178 // CTestApplication.
       
   179 //
       
   180 
       
   181 class CTestApplication : public CEikApplication
       
   182 	{
       
   183 private: // from CApaApplication
       
   184 	CApaDocument* CreateDocumentL();
       
   185 	TUid AppDllUid() const;
       
   186 private:
       
   187 	CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); }
       
   188 	};
       
   189 
       
   190 #endif