harvesterplugins/file/inc/cfilemonitor.h
changeset 0 ccd0fd43f247
child 18 1edf350003c5
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 
       
    19 #ifndef CFILEMONITOR_H
       
    20 #define CFILEMONITOR_H
       
    21 
       
    22 //  INCLUDES 
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 #include "cfileplugin.h"
       
    27 #include "fastfindfileserverpluginclient.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CFolderRenamedHarvester;
       
    31 
       
    32 class CFileMonitor : public CActive
       
    33   	{
       
    34 	public:
       
    35 		/**
       
    36 		* NewL
       
    37 		* @return
       
    38 		*/
       
    39 		static CFileMonitor* NewL(  CFilePlugin& aFilePlugin, RFs* aFsSession );
       
    40 
       
    41 		/**
       
    42 		* Destructor
       
    43 		*/
       
    44 		virtual ~CFileMonitor();
       
    45 		
       
    46 		/**
       
    47 		* From 
       
    48 		*/
       
    49 		TBool StartMonitoring();
       
    50 	
       
    51 		/**
       
    52 		* From 
       
    53 		*/
       
    54 		TInt Initialize();
       
    55     	
       
    56     	/**
       
    57 		* From 
       
    58 		*/
       
    59     	TInt Release();
       
    60     	
       
    61     	/**
       
    62 		* From 
       
    63 		*/
       
    64     	TInt OpenEngine();
       
    65     	
       
    66     	/**
       
    67 		* From 
       
    68 		*/
       
    69     	void AddNotificationPathsL( const TDriveNumber aDriveNumber );
       
    70     	
       
    71     	/**
       
    72 		* From 
       
    73 		*/
       
    74     	void RemoveNotificationPaths( const TDriveNumber aDriveNumber );
       
    75     	
       
    76     	/**
       
    77 		* From 
       
    78 		*/
       
    79     	TInt Enable();
       
    80     	
       
    81     	/**
       
    82 		* From 
       
    83 		*/
       
    84     	TInt Disable();
       
    85     
       
    86     protected: // CActivi
       
    87         /**
       
    88 	     * From CActive.
       
    89 	     */
       
    90         void DoCancel();
       
    91 
       
    92         /**
       
    93 	     * From CActive.
       
    94          */
       
    95         void RunL();
       
    96 
       
    97         /**
       
    98 	     * From CActive.
       
    99 	     * @param aError Leave code from RunL()
       
   100 	     * @return Error code, KErrNone if error was handled successfully.
       
   101          */
       
   102         TInt RunError( TInt aError );
       
   103 
       
   104     protected:
       
   105 		/**
       
   106 		* From ConstructL
       
   107 		*/
       
   108 		void ConstructL( CFilePlugin& aFilePlugin, RFs* aFsSession );
       
   109 		
       
   110 	private:
       
   111 		/**
       
   112 		* From Constructor
       
   113 		*/
       
   114 		CFileMonitor( CFilePlugin& aFilePlugin, RFs* aFsSession );
       
   115 
       
   116 		/**
       
   117 		* Reset status of package
       
   118 		*/
       
   119 		void ResetStatus();
       
   120 
       
   121 	private:
       
   122 	
       
   123 		CFilePlugin&      iFilePlugin;
       
   124 		RFastFindFSPEngine iEngine;
       
   125 	    RFs* iFsSession;
       
   126 	    TFastFindFSPStatusPckg iPckg;
       
   127 	    // If a folder name is changed then files in that folder need to be indexed again as path changed.
       
   128 	    CFolderRenamedHarvester* iFolderRenamedHarvester;
       
   129 	};
       
   130 
       
   131 #endif // CFILEMONITOR_H