mds_plat/harvester_framework_api/tsrc/MonitorPluginTest/inc/MonitorPluginTest.h
changeset 58 fe894bb075c2
parent 51 87e65c44ff3a
child 60 79f826a55db2
equal deleted inserted replaced
51:87e65c44ff3a 58:fe894bb075c2
     1 /*
       
     2 * Copyright (c) 2002-2009 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 "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 #ifndef MONITORPLUGINTEST_H
       
    21 #define MONITORPLUGINTEST_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <StifLogger.h>
       
    25 #include <TestScripterInternal.h>
       
    26 #include <StifTestModule.h>
       
    27 
       
    28 //#include <f32file.h>
       
    29 #include <monitorplugin.h>
       
    30 #include "mdeharvestersession.h"
       
    31 #include <harvesterdata.h>
       
    32 
       
    33 // CONSTANTS
       
    34 // Logging path
       
    35 _LIT( KMonitorPluginTestLogPath, "\\logs\\testframework\\MonitorPluginTest\\" ); 
       
    36 // Log file
       
    37 _LIT( KMonitorPluginTestLogFile, "MonitorPluginTest.txt" ); 
       
    38 _LIT( KMonitorPluginTestLogFileWithTitle, "MonitorPluginTest_[%S].txt" );
       
    39 
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 class CMonitorPluginTest;
       
    43 
       
    44 // CLASS DECLARATION
       
    45 NONSHARABLE_CLASS(CMonitorPluginTest) : public CScriptBase,
       
    46 										public MMonitorPluginObserver,
       
    47 										public MMdESessionObserver
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50 
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         */
       
    54         static CMonitorPluginTest* NewL( CTestModuleIf& aTestModuleIf );
       
    55 
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         virtual ~CMonitorPluginTest();
       
    60 
       
    61     public: // Functions from base classes
       
    62 
       
    63         /**
       
    64         * From CScriptBase Runs a script line.
       
    65         * @since ?Series60_version
       
    66         * @param aItem Script line containing method name and parameters
       
    67         * @return Symbian OS error code
       
    68         */
       
    69         virtual TInt RunMethodL( CStifItemParser& aItem );
       
    70         
       
    71     private: // Functions from base classes        
       
    72         
       
    73         void MonitorEvent( CHarvesterData* aHarvesterData );
       
    74         void MonitorEvent( RPointerArray<CHarvesterData>& aHDArray );
       
    75         
       
    76     	void HandleSessionOpened(CMdESession& aClient, TInt aError);
       
    77     	void HandleSessionError(CMdESession& aClient, TInt aError);
       
    78 
       
    79     private:
       
    80 
       
    81         /**
       
    82         * C++ default constructor.
       
    83         */
       
    84         CMonitorPluginTest( CTestModuleIf& aTestModuleIf );
       
    85 
       
    86         /**
       
    87         * By default Symbian 2nd phase constructor is private.
       
    88         */
       
    89         void ConstructL();
       
    90 
       
    91         /**
       
    92         * Frees all resources allocated from test methods.
       
    93         * @since ?Series60_version
       
    94         */
       
    95         void Delete();
       
    96         
       
    97         void ActiveWait2();
       
    98 
       
    99         /**
       
   100         * Test methods are listed below. 
       
   101         */
       
   102 
       
   103         virtual TInt ActiveWait( CStifItemParser& aItem );
       
   104         virtual TInt BeginMonitorSessionL( CStifItemParser& aItem );
       
   105         virtual TInt EndMonitorSession( CStifItemParser& aItem );
       
   106         virtual TInt LoadPluginsL( CStifItemParser& aItem );
       
   107         virtual TInt StartMonitoring( CStifItemParser& aItem );
       
   108         virtual TInt PauseMonitoring( CStifItemParser& aItem );
       
   109         virtual TInt ResumeMonitoring( CStifItemParser& aItem );
       
   110         virtual TInt StopMonitoring( CStifItemParser& aItem );
       
   111         virtual TInt CreateEventsL( CStifItemParser& aItem );
       
   112         virtual TInt CreateEventsDeleteL( CStifItemParser& aItem );
       
   113 
       
   114         //[TestMethods] - Do not remove
       
   115 
       
   116     private:    // Data
       
   117         
       
   118         RPointerArray<CMonitorPlugin> iPluginArray;
       
   119         CMdESession* iMdEClient;
       
   120     };
       
   121 
       
   122 #endif      // MONITORPLUGINTEST_H
       
   123 
       
   124 // End of File