harvesterplugins/file/inc/cfileplugin.h
changeset 0 ccd0fd43f247
child 2 208a4ba3894c
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 CFILEPLUGIN_H
       
    20 #define CFILEPLUGIN_H
       
    21 
       
    22 #include <f32file.h> // TDriveNumber
       
    23 
       
    24 #include <cindexingplugin.h>
       
    25 #include <common.h>
       
    26 #include <rsearchserversession.h>
       
    27 
       
    28 class CFileHarvester;
       
    29 class CFileMonitor;
       
    30 class CMMCMonitor;
       
    31 class CCPixIndexer;
       
    32 
       
    33 // CONSTANTS
       
    34 _LIT( KExcludePathSystem, ":\\System\\" );
       
    35 _LIT( KExcludePathPrivate, ":\\Private\\" );
       
    36 _LIT( KExcludePathMapsCities, ":\\cities\\" );
       
    37 
       
    38 _LIT( KFastFindFSPluginFile, "cpixfileserverplugin" );
       
    39 _LIT( KFastFindFSPluginName, "CPixFileServerPlugin" );
       
    40 
       
    41 // maximum length that the fully qualified File Plugin base app class descriptor can be
       
    42 // e.g. "@c:root file"
       
    43 const TInt KFilePluginBaseAppClassMaxLen = 64;
       
    44 
       
    45 class CFilePlugin : public CIndexingPlugin
       
    46 {
       
    47 public:
       
    48 	static CFilePlugin* NewL();
       
    49 	static CFilePlugin* NewLC();
       
    50 	virtual ~CFilePlugin();
       
    51 	
       
    52 	/**
       
    53 	 * From CIndexingPlugin
       
    54 	 */
       
    55 	void StartPluginL();
       
    56 	void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
       
    57 
       
    58 	/**
       
    59 	 * CreateFileIndexItemL sends a file for indexing
       
    60 	 * @aFilename full path and filename of the file to be indexed
       
    61 	 * @aActionType action to be taken on the file
       
    62 	 */
       
    63 	void CreateFileIndexItemL(const TDesC& aFilename, TCPixActionType aActionType);
       
    64 
       
    65 public:
       
    66 	// 
       
    67 	// New Functions
       
    68 	//
       
    69 
       
    70 	/*
       
    71 	 * Notifies the indexing manager of completed harvesting, called by CMessageHarvester
       
    72 	 */
       
    73 	void HarvestingCompleted(TDriveNumber aDriveNumber, TInt aError);
       
    74 
       
    75     /**
       
    76      * Register notification paths to file observer
       
    77      * @aDriveNumber drive to add notification paths
       
    78      */
       
    79     void AddNotificationPathsL(const TDriveNumber aDriveNumber);
       
    80 
       
    81     /**
       
    82      * Unregister notification paths to file observer
       
    83      * @aDriveNumber drive to remove notification paths from
       
    84      */
       
    85     void RemoveNotificationPaths(const TDriveNumber aDriveNumber);
       
    86 
       
    87 	/**
       
    88 	 * MountL - Mount an IndexDB.
       
    89 	 * @aMedia drive to mount.
       
    90 	 * @aForceReharvest force a re-harvest of aMedia
       
    91 	 */
       
    92 	void MountL(TDriveNumber aMedia, TBool aForceReharvest = EFalse);
       
    93 
       
    94 	/**
       
    95 	 * UnMount - Dismount a IndexDB for drive aMedia.
       
    96 	 * @aMedia drive to unmount.
       
    97 	 * @aUndefineAsWell if ETrue then undefine the volume as well
       
    98 	 * 
       
    99 	 */
       
   100 	void UnMount(TDriveNumber aMedia, TBool aUndefineAsWell);
       
   101 
       
   102 	/**
       
   103 	 * FormBaseAppClass - constructs a baseAppClass for the given drive.
       
   104 	 * @aMedia drive to form the baseAppClass for.
       
   105 	 * @aBaseAppClass return descriptor containing the baseAppClass
       
   106 	 * returns KErrNone on success or a standard error code
       
   107 	 */
       
   108 	static TInt FormBaseAppClass(TDriveNumber aMedia, TDes& aBaseAppClass);
       
   109 	
       
   110 	
       
   111 	/**
       
   112 	 * DatabasePathL - Forms IndexDb path.
       
   113 	 * @param aMedia - The drive for which the path should be constructed.
       
   114 	 * returns pointer to the IndexDb path.
       
   115 	 */
       
   116 	HBufC* DatabasePathLC(TDriveNumber aMedia);
       
   117 
       
   118 protected:
       
   119 	CFilePlugin();
       
   120 	void ConstructL();
       
   121 
       
   122 private:
       
   123     // CPix database 
       
   124     CCPixIndexer* iIndexer[EDriveZ+1]; // EDriveZ enum value is 25, so add 1.
       
   125 
       
   126     // File system session
       
   127     RFs iFs;
       
   128 
       
   129     // Harvester
       
   130     CFileHarvester* iHarvester;
       
   131 
       
   132     // Monitor
       
   133     TBool iIsMonitorInit;
       
   134     CFileMonitor* iMonitor;
       
   135 
       
   136     // MMC monitor
       
   137     CMMCMonitor* iMmcMonitor;
       
   138 
       
   139 #ifdef __PERFORMANCE_DATA
       
   140     TTime iStartTime[26];// for the all drives
       
   141     TTime iCompleteTime;
       
   142     void UpdatePerformaceDataL(TDriveNumber aMedia);
       
   143 	TInt i;
       
   144 #endif
       
   145 };
       
   146 
       
   147 #endif // CFILEPLUGIN_H