|
1 /* |
|
2 * Copyright (c) 2006-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: UPnP Object-related constant definitions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 // System includes |
|
24 #include <e32base.h> |
|
25 |
|
26 // *************************************************** |
|
27 // * Upnp interface is full of constants that come |
|
28 // * directly from upnp specifications. This file |
|
29 // * contains some most commonly used definitions |
|
30 // * for your comfort. |
|
31 // *************************************************** |
|
32 |
|
33 |
|
34 |
|
35 // *************************************************** |
|
36 // * Classes |
|
37 // * |
|
38 // * Note: when comparing object class, the class |
|
39 // * constant MUST be found in beginning: |
|
40 // * |
|
41 // * if ( object.ObjectClass().Find( KClassContainer ) == 0 ) |
|
42 // * { ... |
|
43 // * |
|
44 // * |
|
45 // *************************************************** |
|
46 |
|
47 // item. This means the object represents something |
|
48 // rather than containing child objects |
|
49 _LIT8( KClassItem, "object.item" ); |
|
50 |
|
51 // the item represents an image media |
|
52 _LIT8( KClassImage, "object.item.imageItem" ); |
|
53 |
|
54 // the item represents a video media |
|
55 _LIT8( KClassVideo, "object.item.videoItem" ); |
|
56 |
|
57 // the item represents an audio media |
|
58 _LIT8( KClassAudio, "object.item.audioItem" ); |
|
59 |
|
60 // the item represents a music track |
|
61 _LIT8( KClassAudioMusicTrack, "object.item.audioItem.musicTrack" ); |
|
62 |
|
63 // the object is a container that can contain child objects |
|
64 _LIT8( KClassContainer, "object.container" ); |
|
65 |
|
66 // container that represents a playlist |
|
67 _LIT8( KClassPlaylist, "object.container.playlistContainer" ); |
|
68 |
|
69 // container that represents an album of music tracks |
|
70 _LIT8( KClassAlbum, "object.container.album.musicAlbum" ); |
|
71 |
|
72 // container that represents a generic media storage |
|
73 _LIT8( KClassStorage, "object.container.storageFolder" ); |
|
74 |
|
75 |
|
76 |
|
77 // *************************************************** |
|
78 // * Elements |
|
79 // * |
|
80 // * Use these when finding an apropriate element |
|
81 // * within an object. Useful with 2 helper utility |
|
82 // * functions: |
|
83 // * |
|
84 // * const CUpnpElement* e = UPnPCommonUtils:: |
|
85 // * FindElementByName( object, KElementDate ); |
|
86 // * if ( e ) { |
|
87 // * const TDesC& d = e->Value(); |
|
88 // * ... |
|
89 // * |
|
90 // * const TDesC8& d = UPnPCommonUtils:: |
|
91 // * FindElementByNameL( object, KElementDate ).Value(); |
|
92 // * |
|
93 // * The former is useful if we are not sure if the |
|
94 // * element exists, the latter if the element MUST |
|
95 // * exist to proceed. |
|
96 // * |
|
97 // *************************************************** |
|
98 |
|
99 // The title. Mandatory for all objects. |
|
100 _LIT8( KElementTitle, "dc:title" ); |
|
101 |
|
102 // The class. Mandatory for all objects. |
|
103 _LIT8( KElementClass, "upnp:class" ); |
|
104 |
|
105 // media timestamp. In DLNA mandatory for images and videos |
|
106 _LIT8( KElementDate, "dc:date" ); |
|
107 |
|
108 // Creator of the media. In DLNA mandatory for music tracks and albums |
|
109 _LIT8( KElementCreator, "dc:creator" ); |
|
110 |
|
111 // The artist. De facto standard in upnp, but not mandatory. |
|
112 // could be understood as an alias to dc:creator |
|
113 _LIT8( KElementArtist, "upnp:artist"); |
|
114 |
|
115 // Album this media belongs to. in DLNA mandatory for audio tracks |
|
116 _LIT8( KElementAlbum, "upnp:album"); |
|
117 |
|
118 // Genre. in DLNA mandatory for audio and video |
|
119 _LIT8( KElementGenre, "upnp:genre"); |
|
120 |
|
121 // The res element. Defines the resource of the item. |
|
122 _LIT8( KElementRes, "res"); |
|
123 |
|
124 // The SortCriteria, Search by default |
|
125 _LIT8( KSortCriteria, "+dc:title"); |
|
126 |
|
127 // The albumArtURI |
|
128 _LIT8( KElementAlbumArtUri, "upnp:albumArtURI"); |
|
129 |
|
130 // Song track number |
|
131 _LIT8( KElementTrackNumber, "upnp:originalTrackNumber"); |
|
132 |
|
133 |
|
134 // *************************************************** |
|
135 // * Element attributes |
|
136 // * |
|
137 // * Use these when finding an attribute within an |
|
138 // * element. |
|
139 // * |
|
140 // * const CUpnpElement& resource = UPnPCommonUtils |
|
141 // * ::ResourceFromItemL( object ); |
|
142 // * const TDesC8& size = UPnPCommonUtils |
|
143 // * ::FindAttributeByNameL( resource, KAttributeSize ) |
|
144 // * .Value(); |
|
145 // * const TDesC8& duration = UPnPCommonUtils |
|
146 // * ::FindAttributeByNameL( resource, KAttributeDuration ) |
|
147 // * .Value(); |
|
148 // * |
|
149 // *************************************************** |
|
150 |
|
151 // attribute of RES element |
|
152 // media size in bytes. Used for all media. |
|
153 _LIT8( KAttributeSize, "size" ); |
|
154 |
|
155 // attribute of RES element |
|
156 // image resolution: "<XDIM>x<YDIM>", example "1024x768" |
|
157 // used for images and video. |
|
158 _LIT8( KAttributeResolution, "resolution" ); |
|
159 |
|
160 // attribute of RES element |
|
161 // song duration, "hh:mm:ss.yyy", example "00:03:15.000" |
|
162 // used for audio and video |
|
163 _LIT8( KAttributeDuration, "duration" ); |
|
164 |
|
165 // attribute of RES element |
|
166 // UPNP and DLNA specific technical data |
|
167 _LIT8( KAttributeProtocolInfo, "protocolInfo" ); |
|
168 |
|
169 // attribute of RES element |
|
170 // bitrate. used in |
|
171 _LIT8( KAttributeBitrate, "bitrate" ); |
|
172 |
|
173 |
|
174 |
|
175 // *************************************************** |
|
176 // * Filters and sorting |
|
177 // * |
|
178 // * Pre-defined constants for browse or search. |
|
179 // * The filters determine which elements the remote |
|
180 // * server is adding into the response. Querying |
|
181 // * only the required elements will speed up the |
|
182 // * application. |
|
183 // * |
|
184 // * Sort criteria defines the order of returned |
|
185 // * elements. |
|
186 // * |
|
187 // * iBs->BrowseL( _L("0"), KFilterFull, |
|
188 // * MUPnPAVBrowsingSession::EDirectChildren, |
|
189 // * 0, 100, KSortNone ); |
|
190 // * |
|
191 // *************************************************** |
|
192 |
|
193 // full filter, returns everything |
|
194 _LIT8( KFilterFull, "*" ); |
|
195 |
|
196 // filter only minimum data (object id) |
|
197 _LIT8( KFilterMin, "" ); |
|
198 |
|
199 // filter only object key data and title |
|
200 _LIT8( KFilterTitle, "dc:title" ); |
|
201 |
|
202 // Filter most commonly used and mandatory DLNA field |
|
203 _LIT8( KFilterCommon, "dc:title,dc:date,dc:creator," |
|
204 "upnp:originalTrackNumber," |
|
205 "upnp:album,upnp:artist,upnp:genre,upnp:albumArtURI," |
|
206 "res,res@size,res@duration" ); |
|
207 |
|
208 // sort criteria: let server decide |
|
209 _LIT8( KSortNone, "" ); |
|
210 |
|
211 // sort criteria: sort by object title |
|
212 _LIT8( KSortTitle, "dc:title" ); |
|
213 |
|
214 |
|
215 |
|
216 |
|
217 // *************************************************** |
|
218 // * Constant container ID's |
|
219 // * |
|
220 // * Some container ID's are defined as constants |
|
221 // * and have special meaning. |
|
222 // * |
|
223 // * Root container: the container that recursively |
|
224 // * contains all other containers. This container |
|
225 // * is not contained in any other container. |
|
226 // * |
|
227 // * Any container: used when addressing a remote |
|
228 // * container. Lets the remote mediaserver decide |
|
229 // * an apropriate container. |
|
230 // * |
|
231 // *************************************************** |
|
232 |
|
233 // the root container |
|
234 _LIT8( KContainerIdRoot, "0" ); |
|
235 |
|
236 // Anycontainer |
|
237 _LIT8( KContainerIdAny, "DLNA.ORG_AnyContainer" ); |
|
238 |
|
239 |
|
240 |
|
241 // *************************************************** |
|
242 // * Constructing search criteria |
|
243 // * |
|
244 // * Some useful constants that are used in generating |
|
245 // * search criteria fields |
|
246 // * |
|
247 // * Please see UPnP specifications for more details |
|
248 // * |
|
249 // *************************************************** |
|
250 |
|
251 // searches for elements that contain given partial string |
|
252 _LIT8( KCriteriaContains, "contains" ); |
|
253 |
|
254 // searches for classes or any child classes of given class |
|
255 _LIT8( KCriteriaDerivedFrom, "derivedfrom" ); |
|
256 |
|
257 // searches for classes where an element exists |
|
258 _LIT8( KCriteriaExists, "exists" ); |
|
259 |
|
260 // negates the boolean operator |
|
261 _LIT8( KCriteriaFalse, "false" ); |
|
262 |
|
263 // logical AND |
|
264 _LIT8( KCriteriaAnd, "and" ); |
|
265 |
|
266 // logical OR |
|
267 _LIT8( KCriteriaOr, "or" ); |
|
268 |
|
269 // logical comparision |
|
270 _LIT8( KCriteriaEQ, "=" ); |
|
271 _LIT8( KCriteriaNEQ, "!=" ); |
|
272 _LIT8( KCriteriaGT, ">" ); |
|
273 _LIT8( KCriteriaLT, "<" ); |
|
274 _LIT8( KCriteriaGTE, ">=" ); |
|
275 _LIT8( KCriteriaLTE, "<=" ); |
|
276 _LIT8( KCriteriaOB, "(" ); |
|
277 _LIT8( KCriteriaCB, ")" ); |
|
278 |
|
279 // other useful for filling up the strings |
|
280 _LIT8( KCriteriaQuot, "\"" ); |
|
281 _LIT8( KCriteriaSpace, " " ); |
|
282 |
|
283 |
|
284 |
|
285 // *************************************************** |
|
286 // * DLNA Transfer modes |
|
287 // * |
|
288 // * Please see DLNA specifications for more details |
|
289 // *************************************************** |
|
290 _LIT8( KTransferMode, "transferMode.dlna.org" ); |
|
291 _LIT8( KBackgroundMode, "Background" ); |
|
292 _LIT8( KStreamingMode, "Streaming" ); |
|
293 _LIT8( KInteractiveMode, "Interactive" ); |
|
294 |
|
295 |
|
296 // *************************************************** |
|
297 // * DLNA Content headers |
|
298 // * |
|
299 // * Please see DLNA specifications for more details |
|
300 // *************************************************** |
|
301 _LIT8( KContentType, "Content-Type" ); |
|
302 _LIT8( KContentFeatures, "contentFeatures.dlna.org" ); |
|
303 |
|
304 |
|
305 // *************************************************** |
|
306 // * DLNA headers misc. |
|
307 // * |
|
308 // * Please see DLNA specifications for more details |
|
309 // *************************************************** |
|
310 _LIT8( KExpectHeader, "Expect" ); |
|
311 _LIT8( K100Continue, "100-continue" ); |
|
312 |
|
313 |
|
314 // *************************************************** |
|
315 // * Misc |
|
316 // * |
|
317 // *************************************************** |
|
318 |
|
319 // attribute value - not implemented or not supported |
|
320 _LIT8( KValueNotImplemented, "NOT_IMPLEMENTED" ); |
|
321 |