mmsharing/mmshui/inc/musuimmcmonitor.h
branchRCL_3
changeset 33 bc78a40cd63c
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
       
     1 /*
       
     2 * Copyright (c) 2005 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 
       
    20 #ifndef MUSUIMMCMONITOR_H
       
    21 #define MUSUIMMCMONITOR_H
       
    22 
       
    23 // INCLUDES
       
    24 #include "musuimmcobserver.h"
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <f32file.h>
       
    28 
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 * Listen changes on the filesystem and notifies observers if 
       
    34 * MMC card has been removed.
       
    35 * Notifies clients only once about MMC removal and only 
       
    36 * in that case that user wanted to listen MMC drive
       
    37 */
       
    38 class CMusUiMmcMonitor : public CActive
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41 
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         * @param aObserver MMC observer pointer.
       
    45         */
       
    46         static CMusUiMmcMonitor* NewL( MMusUiMmcObserver& aObserver );
       
    47 
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         ~CMusUiMmcMonitor();
       
    52        
       
    53     private: // from CActive
       
    54 
       
    55         void RunL();
       
    56         TInt RunError( TInt aError );
       
    57         void DoCancel();
       
    58     
       
    59     private:    // New functions.
       
    60     
       
    61         void ConstructL();
       
    62         CMusUiMmcMonitor( MMusUiMmcObserver& aObserver );
       
    63 
       
    64         void MonitorMmc();
       
    65         TBool DriveRemoved();
       
    66         TBool IsRemovableDrive( TDriveNumber aDriveNumber );
       
    67 
       
    68     private: // Data
       
    69 
       
    70         RFs iFs;
       
    71         TDriveNumber iDriveNumber;
       
    72         TBool iRemovableDrive;
       
    73         TBool iDriveRemoved;
       
    74         MMusUiMmcObserver& iObserver;
       
    75     };
       
    76 
       
    77 #endif  // MUSUIMMCMONITOR_H
       
    78 
       
    79 // End of File
       
    80