|
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 @internalTechnology |
|
19 */ |
|
20 |
|
21 #ifndef CMTPDEVICEDPCONFIGMGR_H |
|
22 #define CMTPDEVICEDPCONFIGMGR_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <badesca.h> |
|
26 |
|
27 #include "mtpdebug.h" |
|
28 #include "mtpdevicedpconst.h" |
|
29 |
|
30 class MMTPDataProviderFramework; |
|
31 |
|
32 class CMTPDeviceDpConfigMgr : |
|
33 public CBase |
|
34 { |
|
35 public: |
|
36 enum TParameter |
|
37 { |
|
38 /** |
|
39 The set of folders containing data objects which are not exposed by the |
|
40 MTP protocol and which are excluded from the file data provider's |
|
41 object enumeration process. Each folder should be specified using format |
|
42 acceptable to the TDesC Match function. To exclude entries on a specific drive |
|
43 use a format prefixed by the drive letter (e.g by specifiying C:\dir\*). |
|
44 |
|
45 Excluded folder specifications do not need to include a trailing backslash |
|
46 ("\"). Any trailing backslash which is present will be ignored. |
|
47 |
|
48 The exclusion list does not prohibit the root folder of a drive from being |
|
49 specified (e.g. by specifying "K:\\*"). If specified this has the effect of |
|
50 excluding all folders and data objects on the specified drive. To prevent |
|
51 objects being added to the device and then not being visible to the MTP |
|
52 initiator that created them, any attempt by an MTP initiator to write |
|
53 data (SendObject) to an excluded root folder will be rejected with an |
|
54 "Access Denied" MTP response code. |
|
55 */ |
|
56 EFolderExclusionList, |
|
57 |
|
58 /** |
|
59 The maximum number of data objects that are enumerated on each |
|
60 iteration of the file data provider's object enumerator. |
|
61 |
|
62 Setting this to an appropriate number will reduce the running time of the |
|
63 enumerator ActiveObject RunL as to allow other ActiveObjects to run. |
|
64 The downside is that the enumerator will take longer to iterate over |
|
65 directory entries due less objects being added in each RunL call. |
|
66 |
|
67 Setting this to a larger number will increase the running time of the |
|
68 enumerator ActiveObject RunL decreasing total enumerator running time but |
|
69 potentially starving out other ActiveObjects. |
|
70 */ |
|
71 EEnumerationIterationLength, |
|
72 }; |
|
73 |
|
74 public: |
|
75 static CMTPDeviceDpConfigMgr* NewL(MMTPDataProviderFramework& aFramework); |
|
76 ~CMTPDeviceDpConfigMgr(); |
|
77 |
|
78 TUint UintValueL(TParameter aParam) const; |
|
79 CDesCArray* GetArrayValueL(TParameter aParam) const; |
|
80 |
|
81 /** |
|
82 *This method is to get friendly name for a particular drive/volume. |
|
83 * |
|
84 *@param aDriveNo : drive in which friendly name is needed. |
|
85 *@param aVolumeName : out param for friendly name, it is read |
|
86 * from mtpdevicedp_config.rss file |
|
87 */ |
|
88 void GetFriendlyVolumeNameL(TInt aDriveNo, TDes& aVolumeName); |
|
89 |
|
90 /** |
|
91 *This method is to get root dir path for a particular drive/volume. |
|
92 * |
|
93 *@param aDriveNo : drive in which root dir path is needed. |
|
94 *@param aRootDirPath : out param for root dir path, it is read |
|
95 * from mtpdevicedp_config.rss file |
|
96 */ |
|
97 void GetRootDirPathL(TInt aDriveNo, TDes& aRootDirPath); |
|
98 |
|
99 /** |
|
100 *This method is to get the ordered format from the rss file |
|
101 * |
|
102 *@param aOrderInfoArray : is an array for storing ordered formats(out param). |
|
103 * |
|
104 */ |
|
105 void GetRssConfigInfoArrayL(RArray<TUint>& aOrderInfoArray, TDevDPConfigRSSParams aParam); |
|
106 |
|
107 private: |
|
108 CMTPDeviceDpConfigMgr(MMTPDataProviderFramework& aFramework); |
|
109 void ConstructL(); |
|
110 |
|
111 CDesCArray* ReadExclusionListL() const; |
|
112 |
|
113 /** |
|
114 *This method is to get drive info for a particular drive/volume. |
|
115 * |
|
116 *@param aDriveNo : drive in which drive info is needed. |
|
117 *@param aVolumeName : out param for friendly name, it is read |
|
118 * from mtpdevicedp_config.rss file |
|
119 *@param aRootDirPath : out param for root dir path, it is read |
|
120 * from mtpdevicedp_config.rss file |
|
121 */ |
|
122 void GetDriveInfoL(TInt aDriveNo, TDes& aVolumeName, TDes& aRootDirPath); |
|
123 |
|
124 private: |
|
125 /** |
|
126 FLOGGER debug trace member variable. |
|
127 */ |
|
128 __FLOG_DECLARATION_MEMBER_MUTABLE; |
|
129 |
|
130 MMTPDataProviderFramework& iFramework; |
|
131 TUint iResourceId; |
|
132 TUint iEnumItrLength; |
|
133 }; |
|
134 |
|
135 #endif // CMTPDEVICEDPCONFIGMGR_H |