mmappcomponents/harvester/server/inc/mpxmediaremovalmonitor.h
changeset 0 a2952bb97e68
child 19 51035f0751c2
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2007 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 media removal events
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMPXMEDIAREMOVALMONITOR_H
       
    20 #define CMPXMEDIAREMOVALMONITOR_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "mpxsystemeventobserver.h"
       
    24 
       
    25 /**
       
    26  *  Class to monitors for File System dismount events
       
    27  *  @lib Harvester
       
    28  *  @since S60 3.0
       
    29  */
       
    30 class CMPXMediaRemovalMonitor : public CActive
       
    31     {
       
    32 
       
    33 public:
       
    34 
       
    35     /**
       
    36     * Two-phase constructor
       
    37     * @param aDrive drive to monitor
       
    38     * @param aFs file server session
       
    39     * @param aObserver observer to the event
       
    40     */
       
    41     static CMPXMediaRemovalMonitor* NewL( TInt aDrive, 
       
    42                                           RFs& aFs,
       
    43                                           MMPXSystemEventObserver& aObserver );
       
    44     /**
       
    45     * Two-phase constructor
       
    46     * @param aDrive drive to monitor
       
    47     * @param aFs file server session
       
    48     * @param aObserver observer to the event
       
    49     */
       
    50     static CMPXMediaRemovalMonitor* NewLC( TInt aDrive, 
       
    51                                            RFs& aFs,
       
    52                                            MMPXSystemEventObserver& aObserver );
       
    53 
       
    54     /**
       
    55     * Virtual destructor
       
    56     */
       
    57     virtual ~CMPXMediaRemovalMonitor();
       
    58 
       
    59 protected: // From base class 
       
    60     
       
    61     /*
       
    62     * From CActive
       
    63     */
       
    64     void RunL();
       
    65     
       
    66     /*
       
    67     * From CActive
       
    68     */
       
    69     void DoCancel();
       
    70 
       
    71     /**
       
    72     *  From CActive
       
    73     */
       
    74     TInt RunError(TInt aError);    
       
    75         
       
    76 private:
       
    77 
       
    78     /**
       
    79     *  C++ constructor
       
    80     * @param aDrive drive to monitor
       
    81     * @param aFs file server session
       
    82     * @param aObserver observer to the event
       
    83     */
       
    84     CMPXMediaRemovalMonitor( TInt aDrive,
       
    85                              RFs& aFs,  
       
    86                              MMPXSystemEventObserver& aObserver );
       
    87 
       
    88     void ConstructL();
       
    89 
       
    90 private: // data
       
    91     
       
    92     TInt iDrive;        // Drive that is being monitored
       
    93     RFs& iFs;           // File Session, not owned
       
    94     TBool iDiskRemoved; // Is the disk inserted
       
    95     
       
    96     /*
       
    97     * Observer interface to callback to an observer
       
    98     */
       
    99     MMPXSystemEventObserver& iObserver;
       
   100     };
       
   101 
       
   102 #endif // CMPXMEDIAREMOVALMONITOR_H