|
1 /* |
|
2 * Copyright (c) 2007-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 * Description: Drive eject handler implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SYSAPDRIVEEJECTHANDLER_H |
|
20 #define SYSAPDRIVEEJECTHANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <disknotifyhandler.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CSysApDriveList; |
|
28 class CSysApAppUi; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 class CSysApDriveEjectHandler : public CBase, |
|
32 public MDiskNotifyHandlerCallback |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Two-phased constructor. |
|
37 */ |
|
38 static CSysApDriveEjectHandler* NewL( |
|
39 CSysApDriveList& aSysApDriveList, |
|
40 CSysApAppUi& aSysApAppUi, |
|
41 RFs& aFs ); |
|
42 |
|
43 /** |
|
44 * Destructor |
|
45 */ |
|
46 ~CSysApDriveEjectHandler(); |
|
47 |
|
48 public: // New methods |
|
49 |
|
50 /** |
|
51 * Starts eject if not already ongoing |
|
52 */ |
|
53 void StartEject(); |
|
54 |
|
55 /** |
|
56 * Completes drive's dismount. |
|
57 * Note that this must be called when the dialog launched from |
|
58 * CSysApAppUi::ShowMMCDismountedDialogL has been closed. |
|
59 * |
|
60 * @param aDrive Drive to be dismounted |
|
61 * @return ETrue if drives left waiting to be dismounted, otherwise EFalse. |
|
62 */ |
|
63 TBool CompleteDismount( TInt aDrive ); |
|
64 |
|
65 private: |
|
66 /** |
|
67 * Constructors. |
|
68 */ |
|
69 CSysApDriveEjectHandler( |
|
70 CSysApDriveList& aSysApDriveList, |
|
71 CSysApAppUi& aSysApAppUi ); |
|
72 |
|
73 void ConstructL( RFs& aFs ); |
|
74 |
|
75 /** |
|
76 * Starts eject. |
|
77 */ |
|
78 TBool DoStartEjectL(); |
|
79 |
|
80 /** |
|
81 * Stops eject. |
|
82 */ |
|
83 void StopEject( TInt aError ); |
|
84 |
|
85 private: // From MDiskNotifyHandlerCallback |
|
86 void HandleNotifyDismountFinished( |
|
87 TInt aError, |
|
88 const TDismountFinishedEvent& aEvent ); |
|
89 |
|
90 private: // Data |
|
91 // Reference to the drive list |
|
92 CSysApDriveList& iSysApDriveList; |
|
93 |
|
94 // Reference to the app ui |
|
95 CSysApAppUi& iSysApAppUi; |
|
96 |
|
97 // Current drive to be ejected |
|
98 TInt iDriveToEject; |
|
99 |
|
100 // For controlled dismount with timeout. Owned. |
|
101 CDiskNotifyHandler* iDiskNotifyHandler; |
|
102 |
|
103 }; |
|
104 |
|
105 #endif // SYSAPDRIVEEJECTHANDLER_H |
|
106 |
|
107 // End of File |