|
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 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef __TVIEW1_H__ |
|
23 #define __TVIEW1_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 // Class CTestViewDeactivationObserver |
|
57 // |
|
58 |
|
59 class CTestViewActivationObserver : public CBase, public MCoeViewActivationObserver |
|
60 { |
|
61 public: |
|
62 CTestViewActivationObserver(CCoeAppUi& aAppUi); |
|
63 void ConstructL(); |
|
64 public: // from MCoeViewActivationObserver |
|
65 void HandleViewActivation(const TVwsViewId& aNewlyActivatedViewId,const TVwsViewId& aViewIdToBeDeactivated); |
|
66 private: |
|
67 CCoeAppUi& iAppUi; |
|
68 TInt iActivationCount; |
|
69 }; |
|
70 |
|
71 |
|
72 // |
|
73 // Class CTestViewControl |
|
74 // |
|
75 |
|
76 class CTestViewControl : public CCoeControl |
|
77 { |
|
78 public: |
|
79 void ConstructL(const TVwsViewId& aViewId); |
|
80 ~CTestViewControl(); |
|
81 private: // framework |
|
82 void Draw(const TRect& aRect) const; |
|
83 private: |
|
84 TVwsViewId iViewId; |
|
85 }; |
|
86 |
|
87 |
|
88 // |
|
89 // CTestView. |
|
90 // |
|
91 |
|
92 class CTestView : public CTestVwAppView |
|
93 { |
|
94 public: |
|
95 ~CTestView(); |
|
96 CTestView(const TVwsViewId& aViewId,CTestAppUi& aAppUi); |
|
97 void ConstructL(); |
|
98 void InitializeAsDefaultL(); |
|
99 public: // from CTestVwAppView |
|
100 void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC16& aCustomMessage); |
|
101 void DoDeactivate(); |
|
102 void HandleCommandL(TInt aCommand); |
|
103 void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis); |
|
104 public: |
|
105 TBool iDeactivationPanic; |
|
106 TBool iSlowDeactivation; |
|
107 TBool iSluggishDeactivation; |
|
108 TBool iExitDeactivation; |
|
109 private: |
|
110 TBool iActivated; |
|
111 CTestViewControl* iControl; |
|
112 }; |
|
113 |
|
114 // |
|
115 // CTestSwitchDialog. |
|
116 // |
|
117 |
|
118 class CTestSwitchDialog : public CEikDialog |
|
119 { |
|
120 public: |
|
121 ~CTestSwitchDialog(); |
|
122 CTestSwitchDialog(CTestAppUi& aAppUi); |
|
123 private: // From CEikDialog. |
|
124 virtual TBool OkToExitL(TInt aButtonId); |
|
125 private: |
|
126 CTestAppUi& iAppUi; |
|
127 }; |
|
128 |
|
129 |
|
130 // |
|
131 // CTestAppUi. |
|
132 // |
|
133 |
|
134 class CRichText; |
|
135 class CParaFormatLayer; |
|
136 class CCharFormatLayer; |
|
137 |
|
138 class CTestAppUi : public CTestVwAppUi |
|
139 { |
|
140 public: |
|
141 CTestAppUi(); |
|
142 void ConstructL(); |
|
143 ~CTestAppUi(); |
|
144 void DoNextEnduranceTestActivation(); |
|
145 static TInt EnduranceTestCallBack(TAny* aSelf); |
|
146 private: // from CEikAppUi |
|
147 void HandleCommandL(TInt aCommand); |
|
148 private: // from MEikMenuObserver |
|
149 void DynInitMenuPaneL(TInt aMenuId,CEikMenuPane* aMenuPane); |
|
150 private: |
|
151 void CreateViewsL(); |
|
152 void DisplaySwitchViewDialogL(); |
|
153 void DisplayRichTextDialogL(); |
|
154 void DoActivationL(); |
|
155 void TestActivationOOML(); |
|
156 void TestSuccesiveAllocFailL(); |
|
157 void TestWaitingActivationL(); |
|
158 void TestPanicedActivationL(); |
|
159 void TestPanicedDeactivationL(); |
|
160 void TestSlowActivationL(); |
|
161 void TestSlowDeactivationL(); |
|
162 void TestStartMissingAppL(); |
|
163 void TestServerEnduranceL(); |
|
164 void TestServerEnduranceWithKillsL(); |
|
165 void TestExitAndDoubleActivationL(); |
|
166 void TestActivateInsideViewActivatedL(); |
|
167 void TestWaitOnAppStartL(); |
|
168 void TestForegroundChangeWhileEventsOnQueueL(); |
|
169 void CheckForegroundChangeWhileEventsOnQueue(); |
|
170 void TestToggleTimeOutEnabledL(); |
|
171 void AddViewL(const TVwsViewId& aViewId); |
|
172 private: |
|
173 friend class CTestSwitchDialog; |
|
174 private: |
|
175 CRichText* iRichText; |
|
176 CParaFormatLayer* iRichParaFormatLayer; |
|
177 CCharFormatLayer* iRichCharFormatLayer; |
|
178 TVwsViewId iViewToActivate; |
|
179 TBool iViewsCreated; |
|
180 HBufC* iCustomMsg; |
|
181 CTestViewActivationObserver* iViewActivationObserver; |
|
182 CPeriodic* iAutoTestTimer; |
|
183 TInt64 iRandSeed; |
|
184 TBool iDoKills; |
|
185 TBool iIsServerEventTimeOutEnabled; |
|
186 }; |
|
187 |
|
188 |
|
189 // |
|
190 // CTestDocument. |
|
191 // |
|
192 |
|
193 class CTestDocument : public CEikDocument |
|
194 { |
|
195 public: |
|
196 // construct/destruct |
|
197 CTestDocument(CEikApplication& aApp); |
|
198 private: // from CEikDocument |
|
199 CEikAppUi* CreateAppUiL(); |
|
200 }; |
|
201 |
|
202 |
|
203 // |
|
204 // CTestApplication. |
|
205 // |
|
206 |
|
207 class CTestApplication : public CEikApplication |
|
208 { |
|
209 private: // from CApaApplication |
|
210 CApaDocument* CreateDocumentL(); |
|
211 TUid AppDllUid() const; |
|
212 private: |
|
213 CApaDocument* CreateDocumentL(CApaProcess* a) { return CEikApplication::CreateDocumentL(a); } |
|
214 }; |
|
215 |
|
216 #endif |