|
1 /** @file |
|
2 * Copyright (c) 2005-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: Detects remove disk event. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CUPNPDISKREMOVEDETECTOR_H |
|
20 #define C_CUPNPDISKREMOVEDETECTOR_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <e32base.h> |
|
24 #include <f32file.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CUpnpMediaServer; |
|
28 |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * Class is responsible for detecting removal/unmounting of a disk from file system |
|
33 * @since S60 v3.2 |
|
34 */ |
|
35 class CUpnpDiskRemoveDetector : public CActive |
|
36 { |
|
37 public: // New methods |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 * @param aObserver callback interface |
|
42 */ |
|
43 static CUpnpDiskRemoveDetector* NewLC( CUpnpMediaServer* aObserver ); |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 * @param aObserver callback interface |
|
48 */ |
|
49 static CUpnpDiskRemoveDetector* NewL( CUpnpMediaServer* aObserver ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 ~CUpnpDiskRemoveDetector(); |
|
55 |
|
56 /** |
|
57 * Start watching for events - asynchronous method |
|
58 */ |
|
59 void StartL(); |
|
60 |
|
61 protected: // From CActive |
|
62 |
|
63 /** |
|
64 * From CActive, called when event occur. |
|
65 */ |
|
66 void RunL(); |
|
67 |
|
68 /** |
|
69 * From CActive, cancel watching for incoming events. |
|
70 */ |
|
71 void DoCancel(); |
|
72 |
|
73 /** |
|
74 * From CActive, called when RunL leaves. |
|
75 * @param aError error code |
|
76 */ |
|
77 TInt RunError( TInt aError ); |
|
78 |
|
79 private: // New methods |
|
80 /** |
|
81 * C++ default constructor. |
|
82 * @param aObserver callback interface |
|
83 */ |
|
84 CUpnpDiskRemoveDetector( CUpnpMediaServer* aObserver ); |
|
85 |
|
86 /** |
|
87 * Second phase constructor |
|
88 */ |
|
89 void ConstructL(); |
|
90 |
|
91 /** |
|
92 * Check if the upload direcotory is valid |
|
93 */ |
|
94 void CheckUploadDirectoryL(); |
|
95 |
|
96 /** |
|
97 * Subscribe this object for file system disk event |
|
98 */ |
|
99 void SubscribeForDiskEvent(); |
|
100 |
|
101 private: // Data |
|
102 |
|
103 // Interface monitor |
|
104 RFs iFs; |
|
105 |
|
106 //Callback interface |
|
107 CUpnpMediaServer* iObserver; |
|
108 |
|
109 }; |
|
110 |
|
111 #endif // C_CUPNPDISKREMOVEDETECTOR_H |