1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _INETTYPE_HXX 25 #define _INETTYPE_HXX 26 27 #include "svl/svldllapi.h" 28 #include <tools/inetmime.hxx> 29 #include <com/sun/star/lang/Locale.hpp> 30 31 //============================================================================ 32 /** Definitions for frequently used media type names. 33 */ 34 #define CONTENT_TYPE_STR_APP_OCTSTREAM "application/octet-stream" 35 #define CONTENT_TYPE_STR_APP_PDF "application/pdf" 36 #define CONTENT_TYPE_STR_APP_RTF "application/rtf" 37 #define CONTENT_TYPE_STR_APP_VND_CALC "application/vnd.stardivision.calc" 38 #define CONTENT_TYPE_STR_APP_VND_CHART "application/vnd.stardivision.chart" 39 #define CONTENT_TYPE_STR_APP_VND_DRAW "application/vnd.stardivision.draw" 40 #define CONTENT_TYPE_STR_APP_VND_IMAGE "application/vnd.stardivision.image" 41 #define CONTENT_TYPE_STR_APP_VND_IMPRESSPACKED \ 42 "application/vnd.stardivision.impress-packed" 43 #define CONTENT_TYPE_STR_APP_VND_IMPRESS \ 44 "application/vnd.stardivision.impress" 45 #define CONTENT_TYPE_STR_APP_VND_MAIL "application/vnd.stardivision.mail" 46 #define CONTENT_TYPE_STR_APP_VND_MATH "application/vnd.stardivision.math" 47 #define CONTENT_TYPE_STR_APP_VND_NEWS "application/vnd.stardivision.news" 48 #define CONTENT_TYPE_STR_APP_VND_OUTTRAY \ 49 "application/vnd.stardivision.outtray" 50 #define CONTENT_TYPE_STR_APP_VND_TEMPLATE \ 51 "application/vnd.stardivision.template" 52 #define CONTENT_TYPE_STR_APP_VND_WRITER_GLOBAL \ 53 "application/vnd.stardivision.writer-global" 54 #define CONTENT_TYPE_STR_APP_VND_WRITER_WEB \ 55 "application/vnd.stardivision.writer-web" 56 #define CONTENT_TYPE_STR_APP_VND_WRITER "application/vnd.stardivision.writer" 57 #define CONTENT_TYPE_STR_APP_FRAMESET "application/x-frameset" 58 #define CONTENT_TYPE_STR_APP_GALLERY_THEME "application/x-gallery-theme" 59 #define CONTENT_TYPE_STR_APP_GALLERY "application/x-gallery" 60 #define CONTENT_TYPE_STR_APP_JAR "application/x-jar" 61 #define CONTENT_TYPE_STR_APP_MACRO "application/x-macro" 62 #define CONTENT_TYPE_STR_APP_MSEXCEL_TEMPL "application/x-msexcel-template" 63 #define CONTENT_TYPE_STR_APP_MSEXCEL "application/x-msexcel" 64 #define CONTENT_TYPE_STR_APP_MSPPOINT_TEMPL "application/x-mspowerpoint-template" 65 #define CONTENT_TYPE_STR_APP_MSPPOINT "application/x-mspowerpoint" 66 #define CONTENT_TYPE_STR_APP_MSWORD_TEMPL "application/x-msword-template" 67 #define CONTENT_TYPE_STR_APP_MSWORD "application/x-msword" 68 #define CONTENT_TYPE_STR_APP_SCHEDULE_EVT "application/x-schedule-event" 69 #define CONTENT_TYPE_STR_APP_SCHEDULE_FEVT "application/x-schedule-form-event" 70 #define CONTENT_TYPE_STR_APP_SCHEDULE_FTASK "application/x-schedule-form-task" 71 #define CONTENT_TYPE_STR_APP_SCHEDULE_TASK "application/x-schedule-task" 72 #define CONTENT_TYPE_STR_APP_SCHEDULE_CMB "application/x-schedule" 73 #define CONTENT_TYPE_STR_APP_STARCALC "application/x-starcalc" 74 #define CONTENT_TYPE_STR_APP_STARCHART "application/x-starchart" 75 #define CONTENT_TYPE_STR_APP_STARDRAW "application/x-stardraw" 76 #define CONTENT_TYPE_STR_APP_STARHELP "application/x-starhelp" 77 #define CONTENT_TYPE_STR_APP_STARIMAGE "application/x-starimage" 78 #define CONTENT_TYPE_STR_APP_STARIMPRESS "application/x-starimpress" 79 #define CONTENT_TYPE_STR_APP_STARMAIL_SDM "application/x-starmail-sdm" 80 #define CONTENT_TYPE_STR_APP_STARMAIL_SMD "application/x-starmail-smd" 81 #define CONTENT_TYPE_STR_APP_STARMATH "application/x-starmath" 82 #define CONTENT_TYPE_STR_APP_STARWRITER_GLOB "application/x-starwriter-global" 83 #define CONTENT_TYPE_STR_APP_STARWRITER "application/x-starwriter" 84 #define CONTENT_TYPE_STR_APP_CDE_CALENDAR_APP "application/x-sun-ae-file" 85 #define CONTENT_TYPE_STR_APP_ZIP "application/x-zip-compressed" 86 #define CONTENT_TYPE_STR_AUDIO_AIFF "audio/aiff" 87 #define CONTENT_TYPE_STR_AUDIO_BASIC "audio/basic" 88 #define CONTENT_TYPE_STR_AUDIO_MIDI "audio/midi" 89 #define CONTENT_TYPE_STR_AUDIO_WAV "audio/wav" 90 #define CONTENT_TYPE_STR_X_CNT_DOCUMENT ".chaos/document" 91 #define CONTENT_TYPE_STR_X_CNT_FSYSBOX ".chaos/fsys-box" 92 #define CONTENT_TYPE_STR_X_CNT_CDROM_VOLUME ".chaos/fsys-cdrom-volume" 93 #define CONTENT_TYPE_STR_X_CNT_DISK_35 ".chaos/fsys-disk-35" 94 #define CONTENT_TYPE_STR_X_CNT_DISK_525 ".chaos/fsys-disk-525" 95 #define CONTENT_TYPE_STR_X_CNT_FSYSFILE ".chaos/fsys-file" 96 #define CONTENT_TYPE_STR_X_CNT_FIXED_VOLUME ".chaos/fsys-fixed-volume" 97 #define CONTENT_TYPE_STR_X_CNT_FSYSFOLDER ".chaos/fsys-folder" 98 #define CONTENT_TYPE_STR_X_CNT_RAM_VOLUME ".chaos/fsys-ram-volume" 99 #define CONTENT_TYPE_STR_X_CNT_REMOTE_VOLUME ".chaos/fsys-remote-volume" 100 #define CONTENT_TYPE_STR_X_CNT_REMOVEABLE_VOLUME \ 101 ".chaos/fsys-removeable-volume" 102 #define CONTENT_TYPE_STR_X_CNT_FSYSSPECIALFILE ".chaos/fsys-special-file" 103 #define CONTENT_TYPE_STR_X_CNT_FSYSSPECIALFOLDER ".chaos/fsys-special-folder" 104 #define CONTENT_TYPE_STR_X_CNT_TAPEDRIVE ".chaos/fsys-tapedrive" 105 #define CONTENT_TYPE_STR_X_CNT_FSYSURLFILE ".chaos/fsys-urlfile" 106 #define CONTENT_TYPE_STR_X_CNT_FTPBOX ".chaos/ftp-box" 107 #define CONTENT_TYPE_STR_X_CNT_FTPFILE ".chaos/ftp-file" 108 #define CONTENT_TYPE_STR_X_CNT_FTPFOLDER ".chaos/ftp-folder" 109 #define CONTENT_TYPE_STR_X_CNT_FTPLINK ".chaos/ftp-link" 110 #define CONTENT_TYPE_STR_X_CNT_HTTPBOX ".chaos/http-box" 111 #define CONTENT_TYPE_STR_X_CNT_HTTPFILE ".chaos/http-file" 112 #define CONTENT_TYPE_STR_X_CNT_IMAPBOX ".chaos/imap-box" 113 #define CONTENT_TYPE_STR_X_CNT_IMAPFOLDER ".chaos/imap-folder" 114 #define CONTENT_TYPE_STR_X_CNT_MESSAGE ".chaos/message" 115 #define CONTENT_TYPE_STR_X_CNT_NEWSBOX ".chaos/news-box" 116 #define CONTENT_TYPE_STR_X_CNT_NEWSGROUP ".chaos/news-group" 117 #define CONTENT_TYPE_STR_X_CNT_OUTBOX ".chaos/out-box" 118 #define CONTENT_TYPE_STR_X_CNT_POP3BOX ".chaos/pop3-box" 119 #define CONTENT_TYPE_STR_X_CNT_PUBLISHBOX ".chaos/publish-box" 120 #define CONTENT_TYPE_STR_X_CNT_SEARCHBOX ".chaos/search-box" 121 #define CONTENT_TYPE_STR_X_CNT_SEPARATOR ".chaos/separator" 122 #define CONTENT_TYPE_STR_X_CNT_BOOKMARK ".chaos/subscribe-bookmark" 123 #define CONTENT_TYPE_STR_X_CNT_SUBSCRIBEBOX ".chaos/subscribe-box" 124 #define CONTENT_TYPE_STR_X_CNT_CDFITEM ".chaos/subscribe-cdf-item" 125 #define CONTENT_TYPE_STR_X_CNT_CDFSUB ".chaos/subscribe-cdf-sub" 126 #define CONTENT_TYPE_STR_X_CNT_CDF ".chaos/subscribe-cdf" 127 #define CONTENT_TYPE_STR_X_CNT_STARCHANNEL ".chaos/subscribe-sdc" 128 #define CONTENT_TYPE_STR_X_CNT_TRASHBOX ".chaos/trash-box" 129 #define CONTENT_TYPE_STR_X_CNT_TRASH ".chaos/trash-item" 130 #define CONTENT_TYPE_STR_X_CNT_VIMBBOARDBOX ".chaos/vim-bboardbox" 131 #define CONTENT_TYPE_STR_X_CNT_VIMBBOARD ".chaos/vim-bboard" 132 #define CONTENT_TYPE_STR_X_CNT_VIMBOX ".chaos/vim-box" 133 #define CONTENT_TYPE_STR_X_CNT_VIMINBOX ".chaos/vim-inbox" 134 #define CONTENT_TYPE_STR_IMAGE_GENERIC "image/generic" 135 #define CONTENT_TYPE_STR_IMAGE_GIF "image/gif" 136 #define CONTENT_TYPE_STR_IMAGE_JPEG "image/jpeg" 137 #define CONTENT_TYPE_STR_IMAGE_PCX "image/pcx" 138 #define CONTENT_TYPE_STR_IMAGE_PNG "image/png" 139 #define CONTENT_TYPE_STR_IMAGE_TIFF "image/tiff" 140 #define CONTENT_TYPE_STR_IMAGE_BMP "image/x-MS-bmp" 141 #define CONTENT_TYPE_STR_INET_MSG_RFC822 "message/rfc822" 142 #define CONTENT_TYPE_STR_INET_MULTI_ALTERNATIVE "multipart/alternative" 143 #define CONTENT_TYPE_STR_INET_MULTI_DIGEST "multipart/digest" 144 #define CONTENT_TYPE_STR_INET_MULTI_MIXED "multipart/mixed" 145 #define CONTENT_TYPE_STR_INET_MULTI_PARALLEL "multipart/parallel" 146 #define CONTENT_TYPE_STR_INET_MULTI_RELATED "multipart/related" 147 #define CONTENT_TYPE_STR_TEXT_ICALENDAR "text/calendar" 148 #define CONTENT_TYPE_STR_TEXT_HTML "text/html" 149 #define CONTENT_TYPE_STR_TEXT_PLAIN "text/plain" 150 #define CONTENT_TYPE_STR_TEXT_XMLICALENDAR "text/x-icalxml" 151 #define CONTENT_TYPE_STR_TEXT_URL "text/x-url" 152 #define CONTENT_TYPE_STR_TEXT_VCALENDAR "text/x-vCalendar" 153 #define CONTENT_TYPE_STR_TEXT_VCARD "text/x-vCard" 154 #define CONTENT_TYPE_STR_VIDEO_VDO "video/vdo" 155 #define CONTENT_TYPE_STR_VIDEO_MSVIDEO "video/x-msvideo" 156 #define CONTENT_TYPE_STR_X_STARMAIL "x-starmail" 157 #define CONTENT_TYPE_STR_X_VRML "x-world/x-vrml" 158 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER "application/vnd.sun.xml.writer" 159 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_CALC "application/vnd.sun.xml.calc" 160 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESS "application/vnd.sun.xml.impress" 161 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_DRAW "application/vnd.sun.xml.draw" 162 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_CHART "application/vnd.sun.xml.chart" 163 164 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_MATH "application/vnd.sun.xml.math" 165 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER_GLOBAL "application/vnd.sun.xml.writer-global" 166 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESSPACKED "application/vnd.sun.xml.impress-packed" 167 168 //============================================================================ 169 /** Definitions for frequently used media type parameter names. 170 */ 171 #define INET_CONTENT_TYPE_PARAMETER_CHARSET "charset" 172 173 //============================================================================ 174 /** Definitions for matching parts of URIs. 175 */ 176 #define INETTYPE_URL_PROT_COMPONENT ".component" 177 #define INETTYPE_URL_PROT_DATA "data" 178 #define INETTYPE_URL_PROT_FILE "file" 179 #define INETTYPE_URL_PROT_HTTP "http" 180 #define INETTYPE_URL_PROT_HTTPS "https" 181 #define INETTYPE_URL_PROT_MACRO "macro" 182 #define INETTYPE_URL_PROT_MAILTO "mailto" 183 #define INETTYPE_URL_PROT_PRIVATE "private" 184 185 #define INETTYPE_URL_SUB_FACTORY "factory" 186 #define INETTYPE_URL_SUB_HELPID "helpid" 187 188 #define INETTYPE_URL_SSUB_FRAMESET "frameset" 189 #define INETTYPE_URL_SSUB_SCALC "scalc" 190 #define INETTYPE_URL_SSUB_SCHART "schart" 191 #define INETTYPE_URL_SSUB_SDRAW "sdraw" 192 #define INETTYPE_URL_SSUB_SIMAGE "simage" 193 #define INETTYPE_URL_SSUB_SIMPRESS "simpress" 194 #define INETTYPE_URL_SSUB_SMATH "smath" 195 #define INETTYPE_URL_SSUB_SS "ss" 196 #define INETTYPE_URL_SSUB_SWRITER "swriter" 197 198 #define INETTYPE_URL_SSSUB_GLOB "GlobalDocument" 199 #define INETTYPE_URL_SSSUB_WEB "web" 200 201 #define INETTYPE_URL_SCHED_CMB "cmbview" 202 #define INETTYPE_URL_SCHED_FORM "formular" 203 #define INETTYPE_URL_SCHED_EVENT "type=event" 204 #define INETTYPE_URL_SCHED_TASK "type=task" 205 206 //============================================================================ 207 enum INetContentType 208 { 209 CONTENT_TYPE_UNKNOWN, 210 CONTENT_TYPE_APP_OCTSTREAM, 211 CONTENT_TYPE_APP_PDF, 212 CONTENT_TYPE_APP_RTF, 213 CONTENT_TYPE_APP_MSWORD, 214 CONTENT_TYPE_APP_MSWORD_TEMPL, 215 CONTENT_TYPE_APP_STARCALC, 216 CONTENT_TYPE_APP_STARCHART, 217 CONTENT_TYPE_APP_STARDRAW, 218 CONTENT_TYPE_APP_STARHELP, 219 CONTENT_TYPE_APP_STARIMAGE, 220 CONTENT_TYPE_APP_STARIMPRESS, 221 CONTENT_TYPE_APP_STARMATH, 222 CONTENT_TYPE_APP_STARWRITER, 223 CONTENT_TYPE_APP_ZIP, 224 CONTENT_TYPE_AUDIO_AIFF, 225 CONTENT_TYPE_AUDIO_BASIC, 226 CONTENT_TYPE_AUDIO_MIDI, 227 CONTENT_TYPE_AUDIO_WAV, 228 CONTENT_TYPE_IMAGE_GIF, 229 CONTENT_TYPE_IMAGE_JPEG, 230 CONTENT_TYPE_IMAGE_PCX, 231 CONTENT_TYPE_IMAGE_PNG, 232 CONTENT_TYPE_IMAGE_TIFF, 233 CONTENT_TYPE_IMAGE_BMP, 234 CONTENT_TYPE_TEXT_HTML, 235 CONTENT_TYPE_TEXT_PLAIN, 236 CONTENT_TYPE_TEXT_URL, 237 CONTENT_TYPE_TEXT_VCARD, 238 CONTENT_TYPE_VIDEO_VDO, 239 CONTENT_TYPE_VIDEO_MSVIDEO, 240 CONTENT_TYPE_X_CNT_MESSAGE, 241 CONTENT_TYPE_X_CNT_DOCUMENT, 242 CONTENT_TYPE_X_CNT_POP3BOX, 243 CONTENT_TYPE_X_CNT_IMAPBOX, 244 CONTENT_TYPE_X_CNT_IMAPFOLDER, 245 CONTENT_TYPE_X_CNT_VIMBOX, 246 CONTENT_TYPE_X_CNT_VIMINBOX, 247 CONTENT_TYPE_X_CNT_VIMBBOARDBOX, 248 CONTENT_TYPE_X_CNT_VIMBBOARD, 249 CONTENT_TYPE_X_CNT_NEWSBOX, 250 CONTENT_TYPE_X_CNT_NEWSGROUP, 251 CONTENT_TYPE_X_CNT_OUTBOX, 252 CONTENT_TYPE_X_CNT_FTPBOX, 253 CONTENT_TYPE_X_CNT_FTPFOLDER, 254 CONTENT_TYPE_X_CNT_FTPFILE, 255 CONTENT_TYPE_X_CNT_FTPLINK, 256 CONTENT_TYPE_X_CNT_HTTPBOX, 257 CONTENT_TYPE_X_CNT_FSYSBOX, 258 CONTENT_TYPE_X_CNT_FSYSFOLDER, 259 CONTENT_TYPE_X_CNT_FSYSFILE, 260 CONTENT_TYPE_X_CNT_FSYSURLFILE, 261 CONTENT_TYPE_X_CNT_PUBLISHBOX, 262 CONTENT_TYPE_X_CNT_SEARCHBOX, 263 CONTENT_TYPE_X_CNT_SUBSCRIBEBOX, 264 CONTENT_TYPE_X_CNT_BOOKMARK, 265 CONTENT_TYPE_X_CNT_CDF, 266 CONTENT_TYPE_X_CNT_CDFSUB, 267 CONTENT_TYPE_X_CNT_CDFITEM, 268 CONTENT_TYPE_X_CNT_TRASHBOX, 269 CONTENT_TYPE_X_CNT_TRASH, 270 CONTENT_TYPE_X_STARMAIL, 271 CONTENT_TYPE_X_VRML, 272 CONTENT_TYPE_X_CNT_REMOVEABLE_VOLUME, 273 CONTENT_TYPE_X_CNT_FIXED_VOLUME, 274 CONTENT_TYPE_X_CNT_REMOTE_VOLUME, 275 CONTENT_TYPE_X_CNT_RAM_VOLUME, 276 CONTENT_TYPE_X_CNT_CDROM_VOLUME, 277 CONTENT_TYPE_X_CNT_DISK_35, 278 CONTENT_TYPE_X_CNT_DISK_525, 279 CONTENT_TYPE_X_CNT_TAPEDRIVE, 280 CONTENT_TYPE_APP_GALLERY, 281 CONTENT_TYPE_APP_GALLERY_THEME, 282 CONTENT_TYPE_X_CNT_STARCHANNEL, 283 CONTENT_TYPE_X_CNT_SEPARATOR, 284 CONTENT_TYPE_APP_STARWRITER_GLOB, 285 CONTENT_TYPE_APP_STARMAIL_SDM, 286 CONTENT_TYPE_APP_STARMAIL_SMD, 287 CONTENT_TYPE_APP_VND_CALC, 288 CONTENT_TYPE_APP_VND_CHART, 289 CONTENT_TYPE_APP_VND_DRAW, 290 CONTENT_TYPE_APP_VND_IMAGE, 291 CONTENT_TYPE_APP_VND_IMPRESS, 292 CONTENT_TYPE_APP_VND_MAIL, 293 CONTENT_TYPE_APP_VND_MATH, 294 CONTENT_TYPE_APP_VND_WRITER, 295 CONTENT_TYPE_APP_VND_WRITER_GLOBAL, 296 CONTENT_TYPE_APP_VND_WRITER_WEB, 297 CONTENT_TYPE_APP_SCHEDULE, 298 CONTENT_TYPE_APP_SCHEDULE_EVT, 299 CONTENT_TYPE_APP_SCHEDULE_TASK, 300 CONTENT_TYPE_APP_SCHEDULE_FORM_EVT, 301 CONTENT_TYPE_APP_SCHEDULE_FORM_TASK, 302 CONTENT_TYPE_APP_FRAMESET, 303 CONTENT_TYPE_APP_MACRO, 304 CONTENT_TYPE_X_CNT_FSYSSPECIALFOLDER, 305 CONTENT_TYPE_X_CNT_FSYSSPECIALFILE, 306 CONTENT_TYPE_APP_VND_TEMPLATE, 307 CONTENT_TYPE_IMAGE_GENERIC, 308 CONTENT_TYPE_APP_VND_NEWS, 309 CONTENT_TYPE_APP_VND_OUTTRAY, 310 CONTENT_TYPE_X_CNT_HTTPFILE, 311 CONTENT_TYPE_APP_MSEXCEL, 312 CONTENT_TYPE_APP_MSEXCEL_TEMPL, 313 CONTENT_TYPE_APP_MSPPOINT, 314 CONTENT_TYPE_APP_MSPPOINT_TEMPL, 315 CONTENT_TYPE_TEXT_VCALENDAR, 316 CONTENT_TYPE_TEXT_ICALENDAR, 317 CONTENT_TYPE_TEXT_XMLICALENDAR, 318 CONTENT_TYPE_APP_CDE_CALENDAR_APP, 319 CONTENT_TYPE_INET_MESSAGE_RFC822, 320 CONTENT_TYPE_INET_MULTIPART_ALTERNATIVE, 321 CONTENT_TYPE_INET_MULTIPART_DIGEST, 322 CONTENT_TYPE_INET_MULTIPART_PARALLEL, 323 CONTENT_TYPE_INET_MULTIPART_RELATED, 324 CONTENT_TYPE_INET_MULTIPART_MIXED, 325 CONTENT_TYPE_APP_VND_IMPRESSPACKED, 326 CONTENT_TYPE_APP_JAR, 327 CONTENT_TYPE_APP_VND_SUN_XML_WRITER, 328 CONTENT_TYPE_APP_VND_SUN_XML_CALC, 329 CONTENT_TYPE_APP_VND_SUN_XML_IMPRESS, 330 CONTENT_TYPE_APP_VND_SUN_XML_DRAW, 331 CONTENT_TYPE_APP_VND_SUN_XML_CHART, 332 CONTENT_TYPE_APP_VND_SUN_XML_MATH, 333 CONTENT_TYPE_APP_VND_SUN_XML_WRITER_GLOBAL, 334 CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED, 335 CONTENT_TYPE_LAST = CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED 336 }; 337 338 //============================================================================ 339 class SVL_DLLPUBLIC INetContentTypes 340 { 341 public: 342 static void Uninitialize(); 343 344 static INetContentType RegisterContentType(UniString const & rTypeName, 345 UniString const & 346 rPresentation, 347 UniString const * pExtension 348 = 0, 349 UniString const * 350 pSystemFileType = 0); 351 352 static INetContentType GetContentType(UniString const & rTypeName); 353 354 static UniString GetContentType(INetContentType eTypeID); 355 356 static UniString GetPresentation(INetContentType eTypeID, 357 const ::com::sun::star::lang::Locale& aLocale); 358 359 static UniString GetExtension(UniString const & rTypeName); 360 361 static INetContentType GetContentType4Extension(UniString const & 362 rExtension); 363 364 static INetContentType GetContentTypeFromURL(UniString const & rURL); 365 366 static bool GetExtensionFromURL(UniString const & rURL, 367 UniString & rExtension); 368 369 static INetContentType MapStringToContentType(UniString const & 370 rPresentation); 371 372 /** Parse the body of an RFC 2045 Content-Type header field. 373 374 @param rMediaType The body of the Content-Type header field. It must 375 be of the form 376 377 token "/" token *(";" token "=" (token / quoted-string)) 378 379 with intervening linear white space and comments (cf. RFCs 822, 2045). 380 The RFC 2231 extension are supported. The encoding of rMediaType 381 should be US-ASCII, but any values in the range 0x80--0xFF are 382 interpretet 'as appropriate.' 383 384 @param rType Returns the type (the first of the above tokens), in US- 385 ASCII encoding and converted to lower case. 386 387 @param rSubType Returns the sub type (the second of the above 388 tokens), in US-ASCII encoding and converted to lower case. 389 390 @param rParameters If not null, returns the parameters as a list of 391 INetContentTypeParameters (the attributes are in US-ASCII encoding and 392 converted to lower case, the values are in Unicode encoding). If 393 null, only the syntax of the parameters is checked, but they are not 394 returned. 395 396 @return True if the syntax of the field body is correct. If false is 397 returned, none of the output parameters will be modified! 398 */ 399 static bool parse(ByteString const & rMediaType, ByteString & rType, 400 ByteString & rSubType, 401 INetContentTypeParameterList * pParameters = 0); 402 403 /** Parse the body of an RFC 2045 Content-Type header field. 404 405 @param rMediaType The body of the Content-Type header field. It must 406 be of the form 407 408 token "/" token *(";" token "=" (token / quoted-string)) 409 410 with intervening linear white space and comments (cf. RFCs 822, 2045). 411 The RFC 2231 extension are supported. The encoding of rMediaType 412 should be US-ASCII, but any Unicode values in the range U+0080..U+FFFF 413 are interpretet 'as appropriate.' 414 415 @param rType Returns the type (the first of the above tokens), in US- 416 ASCII encoding and converted to lower case. 417 418 @param rSubType Returns the sub type (the second of the above 419 tokens), in US-ASCII encoding and converted to lower case. 420 421 @param rParameters If not null, returns the parameters as a list of 422 INetContentTypeParameters (the attributes are in US-ASCII encoding and 423 converted to lower case, the values are in Unicode encoding). If 424 null, only the syntax of the parameters is checked, but they are not 425 returned. 426 427 @return True if the syntax of the field body is correct. If false is 428 returned, none of the output parameters will be modified! 429 */ 430 static bool parse(UniString const & rMediaType, UniString & rType, 431 UniString & rSubType, 432 INetContentTypeParameterList * pParameters = 0); 433 434 /** Append a parameter to the string representation of a MIME media type. 435 436 @param rMediaType The string representation of a MIME media type. 437 438 @param rAttribute The name of the parameter. Must be a valid RFC 439 2045 token. 440 441 @param rValue The value of the paramter. Must only consist of US- 442 ASCII characters. 443 444 @return The string representation of rMediaType with the new 445 parameter appended. It is not checked whether a parameter with that 446 name already existed in rMediaType. 447 */ 448 static ByteString appendUSASCIIParameter(ByteString const & rMediaType, 449 ByteString const & rAttribute, 450 ByteString const & rValue); 451 452 /** Append a parameter to the string representation of a MIME media type. 453 454 @param rMediaType The string representation of a MIME media type. 455 456 @param rAttribute The name of the parameter. Must be a valid RFC 457 2045 token. 458 459 @param rValue The value of the paramter. Must only consist of US- 460 ASCII characters. 461 462 @return The string representation of rMediaType with the new 463 parameter appended. It is not checked whether a parameter with that 464 name already existed in rMediaType. 465 */ 466 static UniString appendUSASCIIParameter(UniString const & rMediaType, 467 UniString const & rAttribute, 468 UniString const & rValue); 469 }; 470 471 #endif // _INETTYPE_HXX 472 473