harvester/monitorplugins/fileplugin/inc/filemonitorplugin.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2006-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:  Monitors file creations, modifications and deletions.*
       
    15 */
       
    16 
       
    17 #ifndef __FILEMONITORPLUGIN_H__
       
    18 #define __FILEMONITORPLUGIN_H__
       
    19 
       
    20 #include <e32base.h>
       
    21 
       
    22 #include "monitorplugin.h"
       
    23 #include "filemonitorao.h"
       
    24 #include "processoriginmapperinterface.h"
       
    25 
       
    26 class CFileMonitorPlugin : public CMonitorPlugin,
       
    27                            public MProcessOriginMapperInterface
       
    28   	{
       
    29 	public:
       
    30 		/**
       
    31 		* Creates and constructs a new instance of CFileMonitorPlugin.
       
    32 		*
       
    33 		* @return A pointer to the new instance of CFileMonitorPlugin
       
    34 		*/
       
    35 		static CFileMonitorPlugin* NewL();
       
    36 		
       
    37 		/**
       
    38 		* Destructor
       
    39 		*/
       
    40 		virtual ~CFileMonitorPlugin();
       
    41 		
       
    42 		/**
       
    43 		* Starts monitoring file system for file creations, modifications and deletions
       
    44 		* in the specified path.
       
    45 		*
       
    46 		* @param aObserver  All events are notified via the aObserver.
       
    47 		* @param aMdEClient  A pointer to MdE client.
       
    48 		* @param aCtxEngine  A pointer to context engine.
       
    49 		* @param aPluginFactory  A pointer to harvester plugin factory.
       
    50 		* @return ETrue if success, EFalse if not.
       
    51 		*/
       
    52 		TBool StartMonitoring( MMonitorPluginObserver& aObserver, CMdESession* aMdEClient, 
       
    53 				CContextEngine* aCtxEngine, CHarvesterPluginFactory* aHarvesterPluginFactory );
       
    54 		
       
    55 		/**
       
    56 		* Stops monitoring.
       
    57 		*
       
    58 		* @return ETrue if success, EFalse if not.
       
    59 		*/
       
    60 		TBool StopMonitoring();
       
    61 		
       
    62 		/**
       
    63 		* Resumes paused monitoring.
       
    64 		*
       
    65 		* @param aObserver  All events are notified via the aObserver.
       
    66 		* @param aMdEClient  A pointer to MdE client.
       
    67 		* @param aCtxEngine  A pointer to context engine.
       
    68 		* @param aPluginFactory  A pointer to harvester plugin factory.
       
    69 		* @return ETrue if success, EFalse if not.
       
    70 		*/
       
    71 		TBool ResumeMonitoring( MMonitorPluginObserver& aObserver, CMdESession* aMdEClient,
       
    72 				CContextEngine* aCtxEngine, CHarvesterPluginFactory* aHarvesterPluginFactory );
       
    73 		
       
    74 		/**
       
    75 		* Pauses monitoring.
       
    76 		*
       
    77 		* @return ETrue if success, EFalse if not.
       
    78 		*/
       
    79 		TBool PauseMonitoring();
       
    80 		
       
    81         /**
       
    82          * Add a process to the list.
       
    83          * From MProcessOriginMapperInterface.
       
    84          * @param aProcessUid  Uid of the process to add.
       
    85          * @param aOrigin      Origin to which this process will mapped to.
       
    86          */
       
    87         void RegisterProcessL( const TUid& aProcessId,
       
    88                                const TOrigin& aOrigin );
       
    89         
       
    90         /**
       
    91          * Remove a process from the list.
       
    92          * From MProcessOriginMapperInterface.
       
    93          * @param aProcessId  Uid of the process to remove.
       
    94          */
       
    95         void UnregisterProcessL( const TUid& aProcessId );
       
    96 
       
    97     private:
       
    98 		 
       
    99 		/**
       
   100 		* C++ constructor - not exported;
       
   101 		* implicitly called from NewL()
       
   102 		*/
       
   103 		CFileMonitorPlugin();
       
   104 		
       
   105 		/**
       
   106 		* 2nd phase construction, called by NewL()
       
   107 		*/
       
   108 		void ConstructL();
       
   109 		
       
   110 	private:
       
   111 		
       
   112 		/**
       
   113 		* A pointer to CFileMonitorAO.
       
   114 		*/
       
   115 		CFileMonitorAO* iFileMonitor;
       
   116 	};
       
   117 
       
   118 #endif // __FILEMONITORPLUGIN_H__
       
   119