harvesterplugins/tsrc/harvesterplugintester/inc/harvesterobserver.h
changeset 0 ccd0fd43f247
child 5 3bc31ad99ee7
equal deleted inserted replaced
-1:000000000000 0:ccd0fd43f247
       
     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 "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 #ifndef HARVESTEROBSERVER_H_
       
    19 #define HARVESTEROBSERVER_H_
       
    20 
       
    21 #include <mindexingpluginobserver.h>
       
    22 #include "rsearchserversession.h"
       
    23 #include <cindexingplugin.h>
       
    24 #include "delayedcallback.h"
       
    25 
       
    26 class CHarvesterObserver: public CBase, public MIndexingService,
       
    27                           public MDelayedCallbackObserver
       
    28     {
       
    29 public:
       
    30     //Does not take ownership of aPluginToObserve
       
    31     static CHarvesterObserver* NewL( CIndexingPlugin* aPluginToObserve );
       
    32     static CHarvesterObserver* NewLC( CIndexingPlugin* aPluginToObserve );
       
    33     void ConstructL();
       
    34     ~CHarvesterObserver();
       
    35     
       
    36     void SetWaitTime(TTimeIntervalMicroSeconds32 aTimetoWait);
       
    37     
       
    38     void DelayedCallbackL(TInt aCode);
       
    39     void DelayedError(TInt aErrorCode);
       
    40     
       
    41 //from MIndexingService
       
    42     void AddHarvestingQueue(CIndexingPlugin* aPlugin, const TDesC& aQualifiedBaseAppClass, TBool aForceReharvest = EFalse);
       
    43     void RemoveHarvestingQueue(CIndexingPlugin* /*aPlugin*/, const TDesC& /*aQualifiedBaseAppClass*/) {};
       
    44     void HarvestingCompleted(CIndexingPlugin* aPlugin, const TDesC& aQualifiedBaseAppClass, TInt aError);
       
    45 
       
    46 private:
       
    47     CHarvesterObserver( CIndexingPlugin* aPluginToObserve );
       
    48     
       
    49 private:
       
    50     CIndexingPlugin* iObservedPlugin;
       
    51     RSearchServerSession iSearchSession;
       
    52 
       
    53 public:
       
    54     CActiveSchedulerWait* iWaitForHarvester; //Needed public for finer grained control. 
       
    55     TTimeIntervalMicroSeconds32 iWaitTime;
       
    56     CDelayedCallback* iCallback;
       
    57     };
       
    58 
       
    59 
       
    60 #endif /* HARVESTEROBSERVER_H_ */