mds_plat/harvester_framework_api/tsrc/HarvesterDataTest/inc/HarvesterDataTest.h
changeset 60 79f826a55db2
parent 0 c53acadfccc6
equal deleted inserted replaced
58:fe894bb075c2 60:79f826a55db2
       
     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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef HARVESTERDATATEST_H
       
    21 #define HARVESTERDATATEST_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <StifLogger.h>
       
    25 #include <TestScripterInternal.h>
       
    26 #include <StifTestModule.h>
       
    27 
       
    28 #include <harvesterdata.h>
       
    29 #include <mdesession.h>
       
    30 #include <mdccommon.h>
       
    31 
       
    32 // Logging path
       
    33 _LIT( KHarvesterDataTestLogPath, "\\logs\\testframework\\HarvesterDataTest\\" ); 
       
    34 // Log file
       
    35 _LIT( KHarvesterDataTestLogFile, "HarvesterDataTest.txt" ); 
       
    36 _LIT( KHarvesterDataTestLogFileWithTitle, "HarvesterDataTest_[%S].txt" );
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 class CHarvesterDataTest;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 NONSHARABLE_CLASS(CHarvesterDataTest) : public CScriptBase,
       
    43 										public MMdESessionObserver,
       
    44 										public MHarvesterPluginObserver,
       
    45 										public MMonitorPluginObserver
       
    46     {
       
    47     public:  // Constructors and destructor
       
    48 
       
    49         /**
       
    50         * Two-phased constructor.
       
    51         */
       
    52         static CHarvesterDataTest* NewL( CTestModuleIf& aTestModuleIf );
       
    53 
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         virtual ~CHarvesterDataTest();
       
    58 
       
    59     public: // Functions from base classes
       
    60 
       
    61         /**
       
    62         * From CScriptBase Runs a script line.
       
    63         * @since ?Series60_version
       
    64         * @param aItem Script line containing method name and parameters
       
    65         * @return Symbian OS error code
       
    66         */
       
    67         virtual TInt RunMethodL( CStifItemParser& aItem );
       
    68 
       
    69     private: // Functions from base classes
       
    70     	
       
    71     	void HandleSessionOpened(CMdESession& aSession, TInt aError);
       
    72     	void HandleSessionError(CMdESession& aSession, TInt aError);
       
    73     	void HarvestingCompleted( CHarvesterData* aHarvesterData );
       
    74     	void MonitorEvent( CHarvesterData* aHarvesterData );
       
    75     	void MonitorEvent( RPointerArray<CHarvesterData>& aHarvesterDataArray );
       
    76 
       
    77     private:
       
    78 
       
    79         /**
       
    80         * C++ default constructor.
       
    81         */
       
    82         CHarvesterDataTest( CTestModuleIf& aTestModuleIf );
       
    83 
       
    84         /**
       
    85         * By default Symbian 2nd phase constructor is private.
       
    86         */
       
    87         void ConstructL();
       
    88 
       
    89         /**
       
    90         * Frees all resources allocated from test methods.
       
    91         * @since ?Series60_version
       
    92         */
       
    93         void Delete();
       
    94 
       
    95         /**
       
    96         * Test methods are listed below. 
       
    97         */
       
    98 
       
    99         virtual TInt ActiveWait( CStifItemParser& aItem );
       
   100         virtual TInt BeginTestSessionL( CStifItemParser& aItem );
       
   101         virtual TInt EndTestSession( CStifItemParser& aItem );
       
   102         virtual TInt HarvestClientDataTestsL( CStifItemParser& aItem );
       
   103         virtual TInt PlaceholderDataTestsL( CStifItemParser& aItem );
       
   104         virtual TInt HarvesterDataTestsL( CStifItemParser& aItem );
       
   105         
       
   106         //[TestMethods] - Do not remove
       
   107 
       
   108     private:    // Data
       
   109         
       
   110         CMdESession* iMdEClient;
       
   111     	
       
   112     	RArray<TItemId> iAlbumIds;
       
   113     };
       
   114 
       
   115 #endif      // HARVESTERDATATEST_H
       
   116 
       
   117 // End of File