|
1 /* |
|
2 * Copyright (c) 2002-2006 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 AO is signaled when directory entry is added or removed |
|
15 * from file system |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CFILEMANAGERFILESYSTEMEVENT_H |
|
21 #define CFILEMANAGERFILESYSTEMEVENT_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <f32file.h> |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CFileManagerEngine; |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * This class listens file system events |
|
37 * |
|
38 * @lib FileManagerEngine.lib |
|
39 * @since 2.0 |
|
40 */ |
|
41 NONSHARABLE_CLASS(CFileManagerFileSystemEvent) : public CActive |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 */ |
|
48 static CFileManagerFileSystemEvent* NewL( RFs& aFs, |
|
49 CFileManagerEngine& aEngine, |
|
50 TNotifyType aNotifyType, |
|
51 const TDesC& aFullPath = KNullDesC ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CFileManagerFileSystemEvent(); |
|
57 |
|
58 public: |
|
59 |
|
60 /** |
|
61 * Sets file system event |
|
62 * @since 2.0 |
|
63 */ |
|
64 void Setup(); |
|
65 |
|
66 /** |
|
67 * This calls refresh if file system event has happened |
|
68 * @since 2.0 |
|
69 */ |
|
70 void CheckFileSystemEvent(); |
|
71 |
|
72 |
|
73 protected: // Functions from base classes |
|
74 |
|
75 /** |
|
76 * From CActive Called when asynchronous request has completed |
|
77 * @since 2.0 |
|
78 */ |
|
79 void RunL(); |
|
80 |
|
81 /** |
|
82 * From CActive Called when asynchronous request has failed |
|
83 * @since 2.0 |
|
84 */ |
|
85 TInt RunError( TInt aError ); |
|
86 |
|
87 /** |
|
88 * From CActive Called when asynchronous request was cancelled |
|
89 * @since 2.0 |
|
90 */ |
|
91 void DoCancel(); |
|
92 |
|
93 private: |
|
94 /** |
|
95 * By default Symbian 2nd phase constructor is private. |
|
96 */ |
|
97 void ConstructL( const TDesC& aFullPath ); |
|
98 |
|
99 /** |
|
100 * C++ default constructor. |
|
101 */ |
|
102 CFileManagerFileSystemEvent( |
|
103 RFs& aFs, |
|
104 CFileManagerEngine& aEngine, |
|
105 TNotifyType aNotifyType ); |
|
106 |
|
107 private: // Data |
|
108 // Ref: Reference to opened File System session |
|
109 RFs& iFs; |
|
110 |
|
111 // Ref: This object is called when RunL occurs |
|
112 CFileManagerEngine& iEngine; |
|
113 |
|
114 // Type of the notify, entry or disk. |
|
115 TNotifyType iNotifyType; |
|
116 |
|
117 // Full path of folder from where notification is needed |
|
118 HBufC* iFullPath; |
|
119 |
|
120 // Indicates if the event has been received |
|
121 TBool iIsReceived; |
|
122 |
|
123 }; |
|
124 |
|
125 #endif // CFILEMANAGERFILESYSTEMEVENT_H |
|
126 |
|
127 // End of File |