|
1 /* |
|
2 * Copyright (c) 2007 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: Class for notify disk watcher |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_DISK_WATCHER_H |
|
21 #define C_DISK_WATCHER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <f32file.h> |
|
26 #include "diskwatcherbase.h" |
|
27 #include "disknotifyhandler.h" |
|
28 |
|
29 // CLASS DECLARATION |
|
30 /** |
|
31 * Class provides functionality of notify disk watcher. |
|
32 * |
|
33 * @since S60 5.0 |
|
34 */ |
|
35 NONSHARABLE_CLASS(CDiskWatcher) : public CDiskWatcherBase |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * This is a two-phase constructor method to create a new watcher instance. |
|
40 * |
|
41 * @since S60 5.0 |
|
42 * @param aCallback Reference to callback |
|
43 * @param aFs Reference to open file server session |
|
44 * @return A pointer to a new watcher instance. |
|
45 */ |
|
46 static CDiskWatcher* NewL( |
|
47 MDiskNotifyHandlerCallback& aCallback, |
|
48 RFs& aFs ); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 ~CDiskWatcher(); |
|
54 |
|
55 /** |
|
56 * Activates watcher |
|
57 * |
|
58 * @since S60 5.0 |
|
59 */ |
|
60 void Activate(); |
|
61 |
|
62 private: // From CDiskWatcherBase |
|
63 void WatcherError( TInt aError, const TBool& aKilled ); |
|
64 void ReactivateWatcher(); |
|
65 void RunWatcher( const TBool& aKilled ); |
|
66 void CancelWatcher(); |
|
67 |
|
68 private: |
|
69 CDiskWatcher( |
|
70 MDiskNotifyHandlerCallback& aCallback, |
|
71 RFs& aFs ); |
|
72 void ConstructL(); |
|
73 |
|
74 NONSHARABLE_CLASS( TWatcherInfo ) |
|
75 { |
|
76 public: |
|
77 void Read( RFs& aFs, TInt aDrive ); |
|
78 TBool IsChanged( const TWatcherInfo& aNewInfo ) const; |
|
79 void Reset(); |
|
80 public: |
|
81 TDriveInfo iDriveInfo; |
|
82 TUint iDriveStatus; |
|
83 }; |
|
84 |
|
85 private: |
|
86 TFixedArray< TWatcherInfo, KMaxDrives > iInfoList; |
|
87 }; |
|
88 |
|
89 |
|
90 #endif // C_DISK_WATCHER_H |
|
91 |
|
92 // End of File |