mds_plat/harvester_framework_api/tsrc/HarvesterPluginTest/inc/HarvesterPluginTest.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     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 #ifndef HARVESTERPLUGINTEST_H
       
    20 #define HARVESTERPLUGINTEST_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <StifLogger.h>
       
    24 #include <TestScripterInternal.h>
       
    25 #include <StifTestModule.h>
       
    26 
       
    27 #include "contextengine.h"
       
    28 #include <mdccommon.h>
       
    29 #include <harvesterdata.h>
       
    30 #include "mdeharvestersession.h"
       
    31 #include <harvesterplugin.h>
       
    32 #include "harvesterplugininfo.h"
       
    33 
       
    34 // CONSTANTS
       
    35 
       
    36 _LIT( KBlacklistDatabaseName, "C:[200009f5]blacklistdb.sq" );
       
    37 
       
    38 // Logging path
       
    39 _LIT( KHarvesterPluginTestLogPath, "\\logs\\testframework\\HarvesterPluginTest\\" ); 
       
    40 // Log file
       
    41 _LIT( KHarvesterPluginTestLogFile, "HarvesterPluginTest.txt" ); 
       
    42 _LIT( KHarvesterPluginTestLogFileWithTitle, "HarvesterPluginTest_[%S].txt" );
       
    43 
       
    44 // FORWARD DECLARATIONS
       
    45 class CHarvesterPluginTest;
       
    46 class CHarvesterBlacklist;
       
    47 class CMdeObjectHandler;
       
    48 
       
    49 // CLASS DECLARATION
       
    50 NONSHARABLE_CLASS(CHarvesterPluginTest) : public CScriptBase,
       
    51 										  MMdESessionObserver,
       
    52 										  MHarvesterPluginObserver
       
    53 									
       
    54     {
       
    55     public:  // Constructors and destructor
       
    56 
       
    57         /**
       
    58         * Two-phased constructor.
       
    59         */
       
    60         static CHarvesterPluginTest* NewL( CTestModuleIf& aTestModuleIf );
       
    61 
       
    62         /**
       
    63         * Destructor.
       
    64         */
       
    65         virtual ~CHarvesterPluginTest();
       
    66 
       
    67     public: // Functions from base classes
       
    68 
       
    69         /**
       
    70         * From CScriptBase Runs a script line.
       
    71         * @since ?Series60_version
       
    72         * @param aItem Script line containing method name and parameters
       
    73         * @return Symbian OS error code
       
    74         */
       
    75         virtual TInt RunMethodL( CStifItemParser& aItem );
       
    76 
       
    77     private: // Functions from base classes
       
    78         	
       
    79         void HandleSessionOpened(CMdESession& aSession, TInt aError);
       
    80         void HandleSessionError(CMdESession& aSession, TInt aError);      
       
    81         void HarvestingCompleted( CHarvesterData* aHarvesterData );
       
    82 
       
    83     private:
       
    84 
       
    85         /**
       
    86         * C++ default constructor.
       
    87         */
       
    88         CHarvesterPluginTest( CTestModuleIf& aTestModuleIf );
       
    89 
       
    90         /**
       
    91         * By default Symbian 2nd phase constructor is private.
       
    92         */
       
    93         void ConstructL();
       
    94 
       
    95         /**
       
    96         * Frees all resources allocated from test methods.
       
    97         * @since ?Series60_version
       
    98         */
       
    99         void Delete();
       
   100 
       
   101         /**
       
   102         * Test methods are listed below. 
       
   103         */
       
   104 
       
   105         virtual TInt BeginTestSessionL( CStifItemParser& aItem );
       
   106         virtual TInt EndTestSession( CStifItemParser& aItem );
       
   107         virtual TInt LoadPluginsL( CStifItemParser& aItem );
       
   108         virtual TInt TestFunctionsL( CStifItemParser& aItem );
       
   109 
       
   110         // helper methods
       
   111         TBool GetObjectDef(const TDesC& aUri, TDes& aObjectDef, TBool aCheck);
       
   112         TInt HarvestL( CHarvesterData* aHD );
       
   113         void AddNewPluginL( const TDesC8& aType, const TDesC8& aOpaque, TUid aPluginUid );
       
   114         CHarvesterPluginInfo* GetHPIFromFileNameL(const TDesC& aFileName);
       
   115         CHarvesterPluginInfo* GetFromNormalFileL( TDesC& aExt );
       
   116         
       
   117     public:     // Data
       
   118         // ?one_line_short_description_of_data
       
   119         //?data_declaration;
       
   120 
       
   121     protected:  // Data
       
   122         // ?one_line_short_description_of_data
       
   123         //?data_declaration;
       
   124 
       
   125     private:    // Data
       
   126         
       
   127     	CMdESession* iMdeSession;
       
   128     	CMdEHarvesterSession* iSession;
       
   129     	
       
   130     	CContextEngine* iCtxEngine;
       
   131     	CHarvesterBlacklist* iBlacklist;
       
   132     	CMdeObjectHandler* iMdeObjectHandler;
       
   133     	
       
   134     	CHarvesterPlugin* iPlugin;
       
   135     	RPointerArray<CHarvesterPluginInfo> iPluginInfoArray;
       
   136 
       
   137     };
       
   138 
       
   139 #endif      // HARVESTERPLUGINTEST_H
       
   140 
       
   141 // End of File