mmappcomponents/harvester/filehandler/inc/mpxfoldermonitor.h
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2006 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 for new or deleted files
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMPXFOLDERMONITOR_H
       
    20 #define CMPXFOLDERMONITOR_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 
       
    25 class MMPXFileAdditionObserver;
       
    26 class MMPXFolderMonitorObserver;
       
    27 
       
    28 /**
       
    29  *  Folder monitor class
       
    30  *
       
    31  *  @lib mpxfilehandler
       
    32  *  @since S60 3.0
       
    33  */
       
    34 NONSHARABLE_CLASS( CMPXFolderMonitor ) : public CActive
       
    35     {
       
    36 
       
    37 public:
       
    38 
       
    39     /**
       
    40     * Two-phased constructor
       
    41     */
       
    42     static CMPXFolderMonitor* NewL( MMPXFolderMonitorObserver& aObserver, 
       
    43                                     RFs& aFs );
       
    44 
       
    45     /**
       
    46     * Virtual destructor
       
    47     */
       
    48     virtual ~CMPXFolderMonitor();
       
    49 
       
    50     /**
       
    51     * Start monitoring a particular drive
       
    52     * @param aDrive drive to monitor
       
    53     */
       
    54     void StartL( TDriveNumber aDrive );
       
    55 
       
    56     /**
       
    57     * Start monitoring a particular folder
       
    58     * @param aFolder folder to monitor
       
    59     */
       
    60     void StartL( const TDesC& aFolder );
       
    61     
       
    62 protected:
       
    63         
       
    64     /**
       
    65     * From CActive
       
    66     */
       
    67     void RunL();
       
    68     
       
    69     /**
       
    70     * From CActive
       
    71     */
       
    72     void DoCancel();
       
    73 
       
    74     /**
       
    75     *  From CActive
       
    76     */
       
    77     TInt RunError(TInt aError);    
       
    78             
       
    79 private:
       
    80     
       
    81     /**
       
    82     * Private constructor
       
    83     */
       
    84     CMPXFolderMonitor( MMPXFolderMonitorObserver& aObserver, 
       
    85                        RFs& aFs );
       
    86 
       
    87     /**
       
    88     * 2nd phased constructor
       
    89     */
       
    90     void ConstructL();
       
    91 
       
    92 private: // data
       
    93     MMPXFolderMonitorObserver&  iObserver;
       
    94     RFs& iFs; 
       
    95     HBufC* iFolderName;   // drive name, always "?:\\"
       
    96     };
       
    97 
       
    98 #endif // CMPXFOLDERMONITOR_H