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 void DoCancel(); |
|
57 |
|
58 private: // New functions. |
|
59 |
|
60 void ConstructL(); |
|
61 CMusUiMmcMonitor( MMusUiMmcObserver& aObserver ); |
|
62 |
|
63 void MonitorMmc(); |
|
64 TBool DriveRemoved(); |
|
65 TBool IsRemovableDrive( TDriveNumber aDriveNumber ); |
|
66 |
|
67 private: // Data |
|
68 |
|
69 RFs iFs; |
|
70 TDriveNumber iDriveNumber; |
|
71 TBool iRemovableDrive; |
|
72 TBool iDriveRemoved; |
|
73 MMusUiMmcObserver& iObserver; |
|
74 }; |
|
75 |
|
76 #endif // MUSUIMMCMONITOR_H |
|
77 |
|
78 // End of File |
|
79 |
|