|
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 @publishedPartner |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef CMTPSTORAGEMETADATA_H |
|
23 #define CMTPSTORAGEMETADATA_H |
|
24 |
|
25 #include <mtp/cmtpmetadata.h> |
|
26 |
|
27 /** |
|
28 Defines the MTP storage meta-data. |
|
29 @publishedPartner |
|
30 @released |
|
31 */ |
|
32 class CMTPStorageMetaData : public CMTPMetaData |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 Defines the MTP storage meta-data element identifiers. |
|
38 */ |
|
39 enum TElementId |
|
40 { |
|
41 /** |
|
42 The storage attribute flags (@see TStorageAttribute). This element is of type |
|
43 @see TUint. |
|
44 */ |
|
45 EAttributes = 0, |
|
46 |
|
47 /** |
|
48 The list of areas on the storage which contain data objects which must |
|
49 not be exposed by the MTP protocol and which must be excluded during |
|
50 data provider object enumeration. If @see EStorageSystemType is |
|
51 specified as @see ESystemTypeGenericHierachal then entries in this list |
|
52 are interpreted and validated as Symbian OS folder pathnames (e.g. |
|
53 "C:\Private", or "Z:\System"). This element is of type @see CDesCArray. |
|
54 */ |
|
55 EExcludedAreas = 1, |
|
56 |
|
57 /** |
|
58 The MTP StorageID. This element is of type @see TUint. |
|
59 */ |
|
60 EStorageId = 2, |
|
61 |
|
62 /** |
|
63 The MTP set of logical MTP StorageIDs associated with this storage. |
|
64 This set will always be empty if @see EStorageID is a logical MTP |
|
65 StorageID. This element is of type @see RArray<TUint>. |
|
66 */ |
|
67 EStorageLogicalIds = 3, |
|
68 |
|
69 /** |
|
70 The storage System Unique IDentifier (SUID). If @see EStorageSystemType |
|
71 is specified as @see ESystemTypeGenericHierachal then this value is |
|
72 interpreted and validated as a Symbian OS folder pathname (e.g. |
|
73 C:\Media", or "E:\") representing the root point of the MTP storage. |
|
74 This element is of type @see TDesC. |
|
75 */ |
|
76 EStorageSuid = 4, |
|
77 |
|
78 /** |
|
79 The storage system (@see TStorageSystemType). This element is of type |
|
80 @see TUint. |
|
81 */ |
|
82 EStorageSystemType = 5, |
|
83 |
|
84 /** |
|
85 The number of elements. |
|
86 */ |
|
87 ENumElements, |
|
88 }; |
|
89 |
|
90 /** |
|
91 Defines the MTP storage attribute bit flags. These are encoded as |
|
92 @see TUint. Flags in the least significant 16-bit range are reserved, |
|
93 those in the most significant 16-bit range are available for use as |
|
94 extension values by storage owners. |
|
95 */ |
|
96 enum TStorageAttribute |
|
97 { |
|
98 /** |
|
99 The null attribute. |
|
100 */ |
|
101 EAttrNone = 0x00000000, |
|
102 |
|
103 /** |
|
104 The extension attribute flags mask. |
|
105 */ |
|
106 EAttrMaskExtensions = 0xFFFF0000, |
|
107 |
|
108 /** |
|
109 The reserved attribute flags mask. |
|
110 */ |
|
111 EAttrMaskReserved = 0x0000FFFF, |
|
112 }; |
|
113 |
|
114 /** |
|
115 Defines the storage system type identifier code space. This 16-bit code |
|
116 space is partitioned and encoded identically to the MTP "Filesystem Type", |
|
117 as described in the "Media Transfer Protocol Enhanced" specification. |
|
118 */ |
|
119 enum TStorageSystemType |
|
120 { |
|
121 /** |
|
122 The undefined storage system type identifier code. |
|
123 */ |
|
124 ESystemTypeUndefined = 0x00000000, |
|
125 |
|
126 /** |
|
127 The generic flat storage system type identifier code. |
|
128 */ |
|
129 ESystemTypeGenericFlat = 0x00000001, |
|
130 |
|
131 /** |
|
132 The generic hierachal storage system type identifier code. |
|
133 */ |
|
134 |
|
135 ESystemTypeGenericHierachal = 0x00000002, |
|
136 |
|
137 /** |
|
138 The DRM Content Format (DCF) storage system type identifier code. |
|
139 */ |
|
140 ESystemTypeDCF = 0x00000003, |
|
141 |
|
142 /** |
|
143 The start of the reserved storage system type identifier code space. |
|
144 */ |
|
145 ESystemTypeMaskReservedStart = 0x00000004, |
|
146 |
|
147 /** |
|
148 The end of the reserved storage system type identifier code space. |
|
149 */ |
|
150 ESystemTypeMaskReservedEnd = 0x00007FFF, |
|
151 |
|
152 /** |
|
153 The MTP vendor extension storage system type identifier code flags. |
|
154 */ |
|
155 ESystemTypeMTPVendorExtension = 0x00008000, |
|
156 |
|
157 /** |
|
158 The MTP defined storage system type identifier code flags. |
|
159 */ |
|
160 ESystemTypeMTPDefined = 0x0000C000, |
|
161 |
|
162 /** |
|
163 The 16-bit storage system type identifier code mask. |
|
164 */ |
|
165 ESystemTypeMask = 0x0000FFFF, |
|
166 |
|
167 /** |
|
168 The default hierachal file system (@see RFs) based storage type |
|
169 identifier. If this storage type is specified then: |
|
170 |
|
171 1. The storage is assumed to reside on the file system. |
|
172 2. The @see EStorageSuid is interpreted and validated as a Symbian |
|
173 OS folder pathname (e.g. C:\Media", or "E:\") representing the |
|
174 root point of the MTP storage. |
|
175 3. Entries in the @see EExcludedAreas are interpreted and |
|
176 validated as Symbian OS folder pathnames (e.g. "C:\Private", or |
|
177 "Z:\System"). |
|
178 */ |
|
179 ESystemTypeDefaultFileSystem = ESystemTypeGenericHierachal, |
|
180 }; |
|
181 |
|
182 public: |
|
183 |
|
184 IMPORT_C static CMTPStorageMetaData* NewL(); |
|
185 IMPORT_C static CMTPStorageMetaData* NewLC(); |
|
186 IMPORT_C static CMTPStorageMetaData* NewL(TUint aStorageSystemType, const TDesC& aStorageSuid); |
|
187 IMPORT_C static CMTPStorageMetaData* NewLC(TUint aStorageSystemType, const TDesC& aStorageSuid); |
|
188 IMPORT_C static CMTPStorageMetaData* NewL(const CMTPStorageMetaData& aStorage); |
|
189 IMPORT_C static CMTPStorageMetaData* NewLC(const CMTPStorageMetaData& aStorage); |
|
190 IMPORT_C ~CMTPStorageMetaData(); |
|
191 |
|
192 private: |
|
193 |
|
194 CMTPStorageMetaData(); |
|
195 void ConstructL(TUint aStorageSystemType, const TDesC& aStorageSuid); |
|
196 |
|
197 private: // Owned |
|
198 |
|
199 /** |
|
200 The element meta-data. |
|
201 */ |
|
202 static const TElementMetaData KElements[]; |
|
203 }; |
|
204 |
|
205 #endif // CMTPSTORAGEMETADATA_H |