|
1 // Copyright (c) 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: Wrapper for Testing RStateAwareSession class. |
|
14 // |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @test |
|
21 @internalComponent - Internal Symbian test code |
|
22 */ |
|
23 |
|
24 |
|
25 #ifndef __T_STATEAWARESESSION_H__ |
|
26 #define __T_STATEAWARESESSION_H__ |
|
27 |
|
28 #include <ssm/ssmstatemanager.h> |
|
29 #include <ssm/ssmstateawaresession.h> |
|
30 |
|
31 #include <test/testexecutestepbase.h> |
|
32 #include <test/datawrapper.h> |
|
33 |
|
34 class CTestRStateAwareSession : public CDataWrapper |
|
35 { |
|
36 public: |
|
37 static CTestRStateAwareSession* NewL(); |
|
38 ~CTestRStateAwareSession(); |
|
39 |
|
40 TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); |
|
41 |
|
42 TAny* GetObject(); |
|
43 void SetObjectL(TAny* aAny); |
|
44 void DisownObjectL(); |
|
45 |
|
46 |
|
47 void DoCmdNew(); |
|
48 void DoCmdDestructor(); |
|
49 void DoCmdConnect(const TDesC& aSection); |
|
50 void DoCmdClose(); |
|
51 void DoCmdRequestStateNotification(const TInt aAsyncErrorIndex); |
|
52 void DoCmdAcknowledgeStateNotification(const TDesC& aSection); |
|
53 void DoCmdAcknowledgeAndRequestStateNotification(const TDesC& aSection, const TInt aAsyncErrorIndex); |
|
54 void DoCmdRequestStateNotificationCancel(); |
|
55 void DoCmdState(const TDesC& aSection); |
|
56 |
|
57 //helper |
|
58 void DoCleanup(); |
|
59 TBool MapToDomainId(TPtrC& aDomainIdName, TDmDomainId& aDomainId ); |
|
60 TBool MapToMainState( TPtrC& aGetMainState, TUint16& aMainState ); |
|
61 |
|
62 protected: |
|
63 CTestRStateAwareSession(); |
|
64 void ConstructL(); |
|
65 |
|
66 void RunL(CActive* aActive, TInt aIndex); |
|
67 void DoCancel(CActive* aActive, TInt aIndex); |
|
68 |
|
69 |
|
70 private: |
|
71 RSsmStateAwareSession* iSsmStateAwareSession; |
|
72 CActiveCallback* iActiveNotifyOnChange; |
|
73 }; |
|
74 |
|
75 #endif // __T_STATEAWARESESSION_H__ |