filemanager/src/inc/fmdrivewatcher/private/symbian/fmdriveevent.h
branchRCL_3
changeset 20 491b3ed49290
equal deleted inserted replaced
19:95243422089a 20:491b3ed49290
       
     1 /*
       
     2 * Copyright (c) 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 * 
       
    15 * Description:
       
    16 *     The header file of drive event watcher
       
    17 */
       
    18 
       
    19 #ifndef CFMDRIVEEVENT_H
       
    20 #define CFMDRIVEEVENT_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <f32file.h>
       
    26 
       
    27 class MFmDriveEventObserver
       
    28 	{
       
    29 	public:
       
    30 		virtual void OnDriveAddedOrChangedL() = 0;
       
    31 	};
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  This class listens file system events
       
    36 *
       
    37 *  @lib FileManagerEngine.lib
       
    38 *  @since 2.0
       
    39 */
       
    40 NONSHARABLE_CLASS(CFmDriveEvent) : public CActive
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43 
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         */
       
    47         static CFmDriveEvent* NewL( RFs& aFs, MFmDriveEventObserver* aObserver );
       
    48 
       
    49         /**
       
    50         * Destructor.
       
    51         */
       
    52         virtual ~CFmDriveEvent();
       
    53 
       
    54     public:
       
    55 
       
    56         /**
       
    57         * Sets file system event
       
    58         * @since 2.0
       
    59         */
       
    60         void Setup();
       
    61 
       
    62     protected:  // Functions from base classes
       
    63 
       
    64         /**
       
    65         * From CActive Called when asynchronous request has completed
       
    66         * @since 2.0
       
    67         */
       
    68         void RunL();
       
    69 
       
    70         /**
       
    71         * From CActive Called when asynchronous request has failed
       
    72         * @since 2.0
       
    73         */
       
    74         TInt RunError( TInt aError );
       
    75 
       
    76         /**
       
    77         * From CActive Called when asynchronous request was cancelled
       
    78         * @since 2.0
       
    79         */
       
    80         void DoCancel();
       
    81 
       
    82     private:
       
    83         /**
       
    84         * By default Symbian 2nd phase constructor is private.
       
    85         */
       
    86         void ConstructL();
       
    87 
       
    88         /**
       
    89         * C++ default constructor.
       
    90         */
       
    91         CFmDriveEvent( RFs& aFs, MFmDriveEventObserver* aObserver );
       
    92 
       
    93     private:    // Data
       
    94         // Ref: Reference to opened File System session
       
    95         RFs& iFs;
       
    96 
       
    97         // Ref: This object is called when RunL occurs
       
    98         MFmDriveEventObserver *iObserver;
       
    99     };
       
   100 
       
   101 #endif // CFMDRIVEEVENT_H
       
   102 
       
   103 // End of File