|
1 // Copyright (c) 2007-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 @test |
|
20 */ |
|
21 |
|
22 #if !defined(__TCONESTATEOBS_H__) |
|
23 #define __TCONESTATEOBS_H__ |
|
24 |
|
25 #include <test/testexecutestepbase.h> |
|
26 #include "TConeTestServer.h" |
|
27 #include "COECNTRL.H" |
|
28 #include "appfwk_test_AppUi.h" |
|
29 #include "statecon.h" |
|
30 |
|
31 _LIT(KTConeStateObs,"TConeStateObs"); |
|
32 |
|
33 |
|
34 /** |
|
35 Control Enviroment class for the TConeStateObs. |
|
36 */ |
|
37 class CStepStateObsEnv : public CCoeEnv, public MCoeControlStateObserver |
|
38 { |
|
39 public: |
|
40 inline void SetPassOn(MStatePassOn* aPassOn) {iPassOn=aPassOn;} |
|
41 inline void SetReturnObserver(TBool aRetObserver) {iRetObserver=aRetObserver;} |
|
42 //Pure virtual function from MCoeControlStateObserver |
|
43 TInt HandleControlStateChange(CCoeControl* aControl,MCoeControlStateObserver::TCoeState aState); |
|
44 //Pure virtual function from MObjectProvider overridden in CCoeEnv |
|
45 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
46 private: |
|
47 MStatePassOn* iPassOn; //An object to pass calls from the Mop interface to |
|
48 TBool iRetObserver; //If a control observer should be returned |
|
49 }; |
|
50 |
|
51 class CTConeStateObs : public CTmsTestStep |
|
52 { |
|
53 public: |
|
54 CTConeStateObs(); |
|
55 void ConstructL(); |
|
56 //Pure virtual function form CTestStep |
|
57 TVerdict doTestStepL(); |
|
58 private: |
|
59 CStepStateObsEnv* iCoe; //The control enviroment |
|
60 }; |
|
61 |
|
62 /** |
|
63 App Ui class for the TCone8Step. |
|
64 */ |
|
65 class CConeStateObsAppUi : public CTestCoeAppUi |
|
66 { |
|
67 public: |
|
68 CConeStateObsAppUi(CTmsTestStep* aStep,CStepStateObsEnv* aCoe); |
|
69 ~CConeStateObsAppUi(); |
|
70 void ConstructL(); |
|
71 void StateObserverTestEnvOnly(); |
|
72 void StateObserverTestBoth(); |
|
73 void StateObserverTestBothAtEnv(); |
|
74 protected: |
|
75 //Pure virtual function from MAutoTestApp |
|
76 void RunTestStepL(TInt aStepNum); |
|
77 private: |
|
78 void DoStateObserverTest(); |
|
79 private: |
|
80 CStepStateObsEnv* iCoe; //The control enviroment |
|
81 CStateObserverControl* iStateObCnt; //The control used for testing |
|
82 }; |
|
83 |
|
84 #endif //__TCONESTATEOBS_H__ |