|
1 /* |
|
2 * Copyright (c) 2008 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: This class implements MMcsGetListCreatorInterface. It builds tree |
|
15 * output list for getlist operation |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef CMCSMMCOBSERVER_H |
|
21 #define CMCSMMCOBSERVER_H |
|
22 |
|
23 #include <e32base.h> // For CActive, link against: euser.lib |
|
24 #include <f32file.h> |
|
25 |
|
26 /** |
|
27 * Interface for handling Mmc inserrtion / removal. |
|
28 * |
|
29 * @since S60 v5.0 |
|
30 */ |
|
31 class MMcsMmcObserver |
|
32 { |
|
33 public: |
|
34 virtual void HandleMmcEventL(TInt aEvent) = 0; |
|
35 enum TInstOp |
|
36 { |
|
37 EMmcInsert = 0x00000001, |
|
38 EMmcRemove = 0x00000002, |
|
39 }; |
|
40 }; |
|
41 |
|
42 |
|
43 /** |
|
44 * Mmc Observer Interface. |
|
45 * @lib mcsmenu.lib |
|
46 * @since S60 v5.0 |
|
47 */ |
|
48 NONSHARABLE_CLASS(CMcsMmcObserver) : public CActive |
|
49 { |
|
50 public: |
|
51 // Cancel and destroy |
|
52 ~CMcsMmcObserver(); |
|
53 |
|
54 // Two-phased constructor. |
|
55 static CMcsMmcObserver* NewL(MMcsMmcObserver& aCallback); |
|
56 |
|
57 // Two-phased constructor. |
|
58 static CMcsMmcObserver* NewLC(MMcsMmcObserver& aCallback); |
|
59 |
|
60 private: |
|
61 // C++ constructor |
|
62 CMcsMmcObserver(MMcsMmcObserver& aCallback); |
|
63 |
|
64 // Second-phase constructor |
|
65 void ConstructL(); |
|
66 |
|
67 private: |
|
68 // From CActive |
|
69 // Handle completion |
|
70 void RunL(); |
|
71 |
|
72 // How to cancel me |
|
73 void DoCancel(); |
|
74 |
|
75 |
|
76 TInt RunError(TInt aError); |
|
77 |
|
78 // Count acvtive drives |
|
79 TInt DriveCount(TDriveList& aDriveList); |
|
80 |
|
81 private: |
|
82 |
|
83 |
|
84 TDriveList iDriveList; |
|
85 |
|
86 TInt iDriveCount; |
|
87 RFs iFs; |
|
88 MMcsMmcObserver& iCallback; |
|
89 |
|
90 }; |
|
91 |
|
92 #endif // CMCSMMCOBSERVER_H |