installationservices/swinstallationfw/test/tusif/source/tsifnotifierteststep.h
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
child 27 e8965914fac7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalTechnology 
       
    22 */
       
    23 
       
    24 #ifndef TSIFNOTIFIERTESTSTEP_H
       
    25 #define TSIFNOTIFIERTESTSTEP_H
       
    26 
       
    27 #include <test/testexecutestepbase.h>
       
    28 #include <usif/sif/sifnotification.h>
       
    29 #include "tsifsuitestepbase.h"
       
    30 
       
    31 namespace Usif
       
    32 	{
       
    33 	
       
    34     class CStopTimer : public CTimer
       
    35         {
       
    36     public:
       
    37         static CStopTimer* NewL(CSifOperationsNotifier* aNotifier, TInt aSeconds);
       
    38         CStopTimer(CSifOperationsNotifier* aNotifier);
       
    39         ~CStopTimer();
       
    40         void ConstructL(TInt aSeconds);
       
    41         void Start();
       
    42     private:
       
    43         void RunL();
       
    44         TInt RunError(TInt aError);
       
    45         TInt iSeconds;
       
    46         CSifOperationsNotifier* iNotifier;
       
    47         };  	
       
    48 
       
    49 	class CSifSubscribeTestStep : public CSifSuiteStepBase, public MSifOperationsHandler
       
    50 		{
       
    51 	public:
       
    52 		virtual ~CSifSubscribeTestStep();
       
    53 		CSifSubscribeTestStep();
       
    54 		virtual void ImplTestStepPreambleL();
       
    55 		virtual void ImplTestStepL();
       
    56 		virtual void ImplTestStepPostambleL();
       
    57 		
       
    58 		//Implementing MSifOperationsHandler
       
    59 		void StartOperationHandler(TUint aKey, const CSifOperationStartData& aStartData);
       
    60 		void EndOperationHandler(const CSifOperationEndData& aEndData);
       
    61 		void ProgressOperationHandler(const CSifOperationProgressData& aProgressData);
       
    62 		
       
    63 	private:
       
    64 	    void GenerateIndexedAttributeNameL(TDes& aInitialAttributeName, TInt aIndex);
       
    65 	private:
       
    66 	    CActiveScheduler* iSched;
       
    67 	    CSifOperationsNotifier* iNotifier;
       
    68 	    TInt iKey;
       
    69 	    TInt iStartMessageCounter;
       
    70 	    TInt iProgressMessageCounter;
       
    71 	    TInt iEndMessageCounter;
       
    72 	    TInt iSubscribeCounter;
       
    73 	    TInt iSubscriberNum;
       
    74 	    CStopTimer * iTimer;
       
    75 		};
       
    76 	
       
    77 	_LIT(KSifSubscribeTestStep,"SifSubscribeStep");
       
    78 		
       
    79 
       
    80 	class CSifPublishTestStep : public CSifSuiteStepBase
       
    81 	    {
       
    82 	public:
       
    83 	    virtual ~CSifPublishTestStep();
       
    84 	    CSifPublishTestStep();
       
    85 	    virtual void ImplTestStepPreambleL();
       
    86 	    virtual void ImplTestStepL();
       
    87 	    virtual void ImplTestStepPostambleL();
       
    88 	    
       
    89 	    void GenerateIndexedAttributeNameL(TDes& aInitialAttributeName, TInt aIndex);
       
    90 	    void PublishDataL(HBufC* aConfigSection);    
       
    91 	private:
       
    92 	    CActiveScheduler* iSched;
       
    93 	    CPublishSifOperationInfo* iPublisher;
       
    94 	    CStopTimer* iTimer;
       
    95 	    };
       
    96 
       
    97 	_LIT(KSifPublishTestStep,"SifPublishStep");
       
    98 	
       
    99 	    
       
   100 	} // namespace Sif
       
   101 
       
   102 #endif // TSIFNOTIFIERTESTSTEP_H