|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 #ifndef CMTPSTORAGEWATCHER_H |
|
22 #define CMTPSTORAGEWATCHER_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <mtp/tmtptypeevent.h> |
|
26 |
|
27 #include "mtpdebug.h" |
|
28 #include "rmtpframework.h" |
|
29 #include "rmtpdpsingletons.h" |
|
30 |
|
31 class MMTPDataProviderFramework; |
|
32 |
|
33 /** |
|
34 Implements the MTP device data provider system storage watcher. |
|
35 @internalComponent |
|
36 */ |
|
37 class CMTPStorageWatcher : public CActive |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 static CMTPStorageWatcher* NewL(MMTPDataProviderFramework& aFramework); |
|
43 ~CMTPStorageWatcher(); |
|
44 |
|
45 void EnumerateStoragesL(); |
|
46 void Start(); |
|
47 |
|
48 private: // Form CActive |
|
49 |
|
50 void DoCancel(); |
|
51 TInt RunError(TInt aError); |
|
52 void RunL(); |
|
53 |
|
54 private: |
|
55 |
|
56 CMTPStorageWatcher(MMTPDataProviderFramework& aFramework); |
|
57 void ConstructL(); |
|
58 |
|
59 TUint32 DriveConfigurationL(TBool aAllDrives) const; |
|
60 TBool Excluded(TDriveNumber aDriveNumber) const; |
|
61 void RequestNotification(); |
|
62 void SendEventL(TUint16 aEvent, TUint32 aStorageId); |
|
63 void StorageAvailableL(TDriveNumber aDriveNumber); |
|
64 void StorageUnavailableL(TDriveNumber aDriveNumber); |
|
65 void AppendFolderExclusionListL(); |
|
66 |
|
67 private: // Owned |
|
68 |
|
69 enum TState |
|
70 { |
|
71 EUndefined = 0x00000000, |
|
72 EStarted = 0x00000001 |
|
73 }; |
|
74 |
|
75 private: // Owned |
|
76 |
|
77 /** |
|
78 FLOGGER debug trace member variable. |
|
79 */ |
|
80 __FLOG_DECLARATION_MEMBER_MUTABLE; |
|
81 |
|
82 /** |
|
83 The available drives configuration. |
|
84 */ |
|
85 TUint32 iDrivesConfig; |
|
86 |
|
87 /** |
|
88 The drive exclusion list. |
|
89 */ |
|
90 RArray<TUint> iDrivesExcluded; |
|
91 |
|
92 /** |
|
93 The MTP event dataset buffer. |
|
94 */ |
|
95 TMTPTypeEvent iEvent; |
|
96 |
|
97 /** |
|
98 The MTP framework singletons. |
|
99 */ |
|
100 RMTPFramework iFrameworkSingletons; |
|
101 |
|
102 /** |
|
103 The logical storages allocation enable flag. |
|
104 */ |
|
105 TBool iAllocateLogicalStorages; |
|
106 |
|
107 /** |
|
108 The state variable. |
|
109 */ |
|
110 TUint32 iState; |
|
111 |
|
112 /** |
|
113 The folder exclusion list. |
|
114 */ |
|
115 CDesCArray* iFolderExclusionList; |
|
116 |
|
117 /** |
|
118 The DP Singleton. |
|
119 */ |
|
120 RMTPDpSingletons iDpSingletons; |
|
121 |
|
122 private: // Not owned. |
|
123 |
|
124 MMTPDataProviderFramework& iFramework; |
|
125 }; |
|
126 |
|
127 #endif // CMTPSTORAGEWATCHER_H |