harvesterplugins/file/fastfindfileserverplugin/inc/fastfindfileserverplugin.h
changeset 0 ccd0fd43f247
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:  Monitors file creations, modifications and deletions.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef FASTFINDFILESERVERPLUGIN_H
       
    19 #define FASTFINDFILESERVERPLUGIN_H
       
    20 
       
    21 #include <f32plugin.h>
       
    22 #include "fastfindfileserverpluginclient.h"
       
    23 
       
    24 /**
       
    25 * File server plug-in.
       
    26 */
       
    27 class CFastFindFileServerPlugin : public CFsPlugin
       
    28 	{
       
    29     public:
       
    30 
       
    31         /**
       
    32          * Standard NewL()
       
    33          * From CActive.
       
    34          */
       
    35         static CFastFindFileServerPlugin* NewL();
       
    36 
       
    37         /**
       
    38          * Virtual destructor.
       
    39          */
       
    40         virtual ~CFastFindFileServerPlugin();
       
    41 
       
    42         /**
       
    43          * Initialize plugin.
       
    44          */
       
    45         virtual void InitialiseL();
       
    46 
       
    47         /**
       
    48          * 
       
    49          */
       
    50         virtual TInt DoRequestL( TFsPluginRequest& aRequest );
       
    51 
       
    52         /**
       
    53          * 
       
    54          */
       
    55         virtual CFsPluginConn* NewPluginConnL();
       
    56 
       
    57         /**
       
    58          * 
       
    59          */
       
    60         TInt RegisterNotification( CFsPluginConnRequest& aRequest );
       
    61 
       
    62         /**
       
    63          * Add a new notification path.
       
    64          */
       
    65         TInt AddNotificationPath( CFsPluginConnRequest& aRequest );
       
    66 
       
    67         /**
       
    68          * Remove notification path.
       
    69          */
       
    70         TInt RemoveNotificationPath( CFsPluginConnRequest& aRequest );
       
    71 
       
    72         /**
       
    73          * Add a new path to ignore.
       
    74          */
       
    75         TInt AddIgnorePath( CFsPluginConnRequest& aRequest );
       
    76 
       
    77         /**
       
    78          * Remove a path from the ignore list.
       
    79          */
       
    80         TInt RemoveIgnorePath( CFsPluginConnRequest& aRequest );
       
    81 
       
    82         /**
       
    83          * 
       
    84          */
       
    85         void EnableL();
       
    86 
       
    87         /**
       
    88          * 
       
    89          */
       
    90         void DisableL();
       
    91 
       
    92         /**
       
    93          * Add CFastFindFileServerPluginConn connection to this file server plugin
       
    94          */
       
    95         void AddConnection();
       
    96 
       
    97         /**
       
    98          * Remove CFastFindFileServerPluginConn connection from this file server
       
    99          * plugin
       
   100          */
       
   101         void RemoveConnection();
       
   102 
       
   103     private:
       
   104 
       
   105         /**
       
   106          * Private constructor.
       
   107          */
       
   108         CFastFindFileServerPlugin();
       
   109 
       
   110         /**
       
   111          * Check if a path is listed.
       
   112          * @param aFileName  Path to check.
       
   113          * @return EFalse, if path is ignored.
       
   114          *         ETrue, if the path is on the notification path list or
       
   115          *         if there is no notification paths set.
       
   116          *         Else EFalse.
       
   117          */
       
   118         TBool CheckPath( TFileName& aFileName );
       
   119 
       
   120         /**
       
   121          * Check if path/file hass hidden or system attribute.
       
   122          * @param aFileName  Filename to check.
       
   123          * @return ETrue, if path or file has a hidden or system attribute set.
       
   124          */
       
   125         TBool CheckAttribs( TFileName& aFileName );
       
   126 
       
   127 #ifdef _DEBUG_EVENTS
       
   128         void RegisterDebugEventsL();
       
   129         void UnregisterDebugEventsL();
       
   130         void PrintDebugEvents( TInt aFunction );
       
   131 #endif
       
   132     	
       
   133     private:
       
   134 
       
   135         /**
       
   136          * 
       
   137          */
       
   138         CFsPluginConnRequest* iNotification;
       
   139 
       
   140         /**
       
   141          * An array of notification paths.
       
   142          */
       
   143         RPointerArray<TFileName> iPaths;
       
   144 
       
   145         /**
       
   146          * A queue of file server events.
       
   147          */
       
   148         RPointerArray<TFastFindFSPStatus> iQueue;
       
   149 
       
   150         /**
       
   151          * 
       
   152          */
       
   153         RPointerArray<TFileName> iIgnorePaths;
       
   154 
       
   155         /**
       
   156          * File system client session.
       
   157          */
       
   158         RFs iFsSession;
       
   159 
       
   160         /**
       
   161          * 
       
   162          */
       
   163         RPointerArray<TFileName> iCreatedFiles;
       
   164         TInt iFormatDriveNumber;
       
   165 
       
   166         TInt iConnectionCount;
       
   167     };
       
   168 
       
   169 #endif // FASTFINDILESERVERPLUGIN_H