harvesterplugins/media/video/inc/videoplugin.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 09:49:49 +0300
changeset 17 7d8c8d8f5eab
parent 0 ccd0fd43f247
child 26 367228f82b66
permissions -rw-r--r--
Revision: 201031 Kit: 201033

/*
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Media Video harvester plugin header
*
*/


#ifndef CVIDEOPLUGIN_H
#define CVIDEOPLUGIN_H

#include <cindexingplugin.h>
#include <e32base.h>
#include "common.h"
#include "mediaobjecthandler.h"
#include "mmceventobserver.h"

//Forward declaration
class CSearchDocument;
class CCPixIndexer;
class CMdeHarvester;
class CMdeObjectQueueManager;
class CMdsMediaMonitor;
class CMdsSessionObjectUtils;
class CCPIXMediaVideoDoc;
class CCPixIndexerUtils;
class CMMCMonitorUtil;
class CCPIXMDEDbManager;
class CMDSEntity;

class CVideoPlugin : public CIndexingPlugin, public MdeMEdiaObserver,
                     public MMediaObjectHandler, public MMMCEventObserver
    {
public:
    // Constructor and Destructors.
    /*
    * NewL
    * @return instance of Media video plugin
    */
    static CVideoPlugin* NewL();    
    /*
    * Destructor
    */
    ~CVideoPlugin();

public:
    /* 
    * Prepares the plugin for StartHarvesterL
    */
    void StartPluginL();
    
    /*
    * @description Start the harvester.
    * @param aQualifiedBaseAppClass the base app class. In this case
    *        use MEDIA_QBASEAPPCLASS
    * @return void
    * Leaves in case of errors.
    */
    void StartHarvestingL(const TDesC & aQualifiedBaseAppClass);
    /*
    * HandleMdeItemL callback from MMediaObjectHandler
    * @param TItemId aObjId object Id
    * @param TCPixActionType aActionType cpix action type
    */
    void HandleMdeItemL( TItemId aObjId, TCPixActionType aActionType);
#ifdef __PERFORMANCE_DATA
    void UpdateLogL();
#endif
    /*
    * HarvestingCompletedL callback from MdeEventHandler
    */
    void HarvestingCompletedL();
    
    /*
    * HandleMMCEventL callback from MMMCEventObserver
    * @param TDriveNumber aDrive drive number of MMC
    * @param TBool aMMCInsertRemoval ETrue if inserted else EFalse
    */
    void HandleMMCEventL(const TDriveNumber aDrive,const TBool aMMCInsertRemoval);
private:
    //private constructors.
    /*
    * Default constructor
    */
    CVideoPlugin();    

private:
    // data
    CCPixIndexer*           iIndexer; //Indexer
    CMdeHarvester*          iMdeHarvester; //Mde harvester owned
    CMdeObjectQueueManager* iObjectJobQueueManager; //Objectqueue manager owned
    CMdsMediaMonitor*       iMdsMonitor;//MDS monitor owned
    CMdsSessionObjectUtils* iMdsUtils;//Mds utils owned
    CCPIXMediaVideoDoc*     iVideoDocument;//MDS video doc owned
    CCPixIndexerUtils*      iIndexerUtil;//Indexer util owned
    CMMCMonitorUtil*        iMMcMonitor;//MMC monitor owned
    CCPIXMDEDbManager*      iDBManager;
    CMDSEntity*             iMdsItem;

//for helping with testing.
#ifdef HARVESTERPLUGINTESTER_FRIEND
    friend class CHarvesterPluginTester;
#endif
        
#ifdef __PERFORMANCE_DATA
    TTime iStartTime;
    TTime iCompleteTime;
    void UpdatePerformaceDataL();
	TInt count;
#endif	
    };

#endif  // CVIDEOPLUGIN_H