sysstatemgmt/systemstatemgr/test/tcmn/inc/t_stateawaresession2.h
changeset 76 cb32bcc88bad
equal deleted inserted replaced
73:d38941471f1c 76:cb32bcc88bad
       
     1 // Copyright (c) 2010 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 CStateAwareSession2 class.
       
    14 //
       
    15 //
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @test
       
    21  @internalComponent - Internal Symbian test code
       
    22 */
       
    23 
       
    24 
       
    25 #ifndef __T_STATEAWARESESSIONWRAPPER2_H__
       
    26 #define __T_STATEAWARESESSIONWRAPPER2_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 // This structure is used to hold data read from the test ini file for CTestCStateAwareSession
       
    35 struct TIniData3
       
    36     {
       
    37     TBool iAcknowledge;
       
    38     TInt iAsyncIndex;
       
    39     TIniData3();
       
    40     };
       
    41 
       
    42 class CTestCStateAwareSession : public CDataWrapper, public MStateChangeNotificationSubscriber2
       
    43     {
       
    44 public:
       
    45     CTestCStateAwareSession();
       
    46     ~CTestCStateAwareSession();
       
    47 
       
    48     TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/);
       
    49 
       
    50     TAny* GetObject();
       
    51     void  SetObjectL(TAny* aAny);
       
    52     void  DisownObjectL();
       
    53     
       
    54     void DoCmdNew();
       
    55     void DoCmdDestructor();
       
    56     void DoCmdRequestStateNotification();
       
    57     void DoCmdAcknowledgeStateNotification(const TDesC& aSection);
       
    58     void DoCmdAcknowledgeAndRequestStateNotification(const TDesC& aSection);
       
    59     void DoCmdRequestStateNotificationCancel();
       
    60     void DoCmdReturnCount(const TDesC& aSection);
       
    61     void DoCmdReadIniData(const TDesC& aSection);
       
    62     
       
    63     //helper
       
    64     void DoCleanup();
       
    65     
       
    66     //from MStateChangeNotificationSubscriber2
       
    67     void HandleTransition(TInt aError);
       
    68     TInt HandleDeferralError(TInt aError);
       
    69     
       
    70 private:
       
    71     CSsmStateAwareSession2* iSsmStateAwareSession;
       
    72     TIniData3 iIniData;
       
    73     };
       
    74 
       
    75 #endif // __T_STATEAWARESESSIONWRAPPER_H__