Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / include / svl / inettype.hxx
bloba5282a53feea3eaf5cd30a2dba3889e0d14aa13e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVL_INETTYPE_HXX
21 #define INCLUDED_SVL_INETTYPE_HXX
23 #include <svl/svldllapi.h>
24 #include <tools/inetmime.hxx>
25 #include <i18nlangtag/languagetag.hxx>
28 /** Definitions for frequently used media type names.
30 #define CONTENT_TYPE_STR_APP_OCTSTREAM "application/octet-stream"
31 #define CONTENT_TYPE_STR_APP_PDF "application/pdf"
32 #define CONTENT_TYPE_STR_APP_RTF "application/rtf"
33 #define CONTENT_TYPE_STR_APP_VND_CALC "application/vnd.stardivision.calc"
34 #define CONTENT_TYPE_STR_APP_VND_CHART "application/vnd.stardivision.chart"
35 #define CONTENT_TYPE_STR_APP_VND_DRAW "application/vnd.stardivision.draw"
36 #define CONTENT_TYPE_STR_APP_VND_IMAGE "application/vnd.stardivision.image"
37 #define CONTENT_TYPE_STR_APP_VND_IMPRESSPACKED "application/vnd.stardivision.impress-packed"
38 #define CONTENT_TYPE_STR_APP_VND_IMPRESS "application/vnd.stardivision.impress"
39 #define CONTENT_TYPE_STR_APP_VND_MAIL "application/vnd.stardivision.mail"
40 #define CONTENT_TYPE_STR_APP_VND_MATH "application/vnd.stardivision.math"
41 #define CONTENT_TYPE_STR_APP_VND_NEWS "application/vnd.stardivision.news"
42 #define CONTENT_TYPE_STR_APP_VND_OUTTRAY "application/vnd.stardivision.outtray"
43 #define CONTENT_TYPE_STR_APP_VND_TEMPLATE "application/vnd.stardivision.template"
44 #define CONTENT_TYPE_STR_APP_VND_WRITER_GLOBAL "application/vnd.stardivision.writer-global"
45 #define CONTENT_TYPE_STR_APP_VND_WRITER_WEB "application/vnd.stardivision.writer-web"
46 #define CONTENT_TYPE_STR_APP_VND_WRITER "application/vnd.stardivision.writer"
47 #define CONTENT_TYPE_STR_APP_FRAMESET "application/x-frameset"
48 #define CONTENT_TYPE_STR_APP_GALLERY_THEME "application/x-gallery-theme"
49 #define CONTENT_TYPE_STR_APP_GALLERY "application/x-gallery"
50 #define CONTENT_TYPE_STR_APP_JAR "application/x-jar"
51 #define CONTENT_TYPE_STR_APP_MACRO "application/x-macro"
52 #define CONTENT_TYPE_STR_APP_MSEXCEL_TEMPL "application/x-msexcel-template"
53 #define CONTENT_TYPE_STR_APP_MSEXCEL "application/x-msexcel"
54 #define CONTENT_TYPE_STR_APP_MSPPOINT_TEMPL "application/x-mspowerpoint-template"
55 #define CONTENT_TYPE_STR_APP_MSPPOINT "application/x-mspowerpoint"
56 #define CONTENT_TYPE_STR_APP_MSWORD_TEMPL "application/x-msword-template"
57 #define CONTENT_TYPE_STR_APP_MSWORD "application/x-msword"
58 #define CONTENT_TYPE_STR_APP_STARCALC "application/x-starcalc"
59 #define CONTENT_TYPE_STR_APP_STARCHART "application/x-starchart"
60 #define CONTENT_TYPE_STR_APP_STARDRAW "application/x-stardraw"
61 #define CONTENT_TYPE_STR_APP_STARHELP "application/x-starhelp"
62 #define CONTENT_TYPE_STR_APP_STARIMAGE "application/x-starimage"
63 #define CONTENT_TYPE_STR_APP_STARIMPRESS "application/x-starimpress"
64 #define CONTENT_TYPE_STR_APP_STARMAIL_SDM "application/x-starmail-sdm"
65 #define CONTENT_TYPE_STR_APP_STARMAIL_SMD "application/x-starmail-smd"
66 #define CONTENT_TYPE_STR_APP_STARMATH "application/x-starmath"
67 #define CONTENT_TYPE_STR_APP_STARWRITER_GLOB "application/x-starwriter-global"
68 #define CONTENT_TYPE_STR_APP_STARWRITER "application/x-starwriter"
69 #define CONTENT_TYPE_STR_APP_CDE_CALENDAR_APP "application/x-sun-ae-file"
70 #define CONTENT_TYPE_STR_APP_ZIP "application/x-zip-compressed"
71 #define CONTENT_TYPE_STR_AUDIO_AIFF "audio/aiff"
72 #define CONTENT_TYPE_STR_AUDIO_BASIC "audio/basic"
73 #define CONTENT_TYPE_STR_AUDIO_MIDI "audio/midi"
74 #define CONTENT_TYPE_STR_AUDIO_VORBIS "audio/vorbis"
75 #define CONTENT_TYPE_STR_AUDIO_WAV "audio/wav"
76 #define CONTENT_TYPE_STR_AUDIO_WEBM "audio/webm"
77 #define CONTENT_TYPE_STR_X_CNT_FSYSBOX ".chaos/fsys-box"
78 #define CONTENT_TYPE_STR_X_CNT_FSYSFOLDER ".chaos/fsys-folder"
79 #define CONTENT_TYPE_STR_X_CNT_FSYSSPECIALFOLDER ".chaos/fsys-special-folder"
80 #define CONTENT_TYPE_STR_IMAGE_GENERIC "image/generic"
81 #define CONTENT_TYPE_STR_IMAGE_GIF "image/gif"
82 #define CONTENT_TYPE_STR_IMAGE_JPEG "image/jpeg"
83 #define CONTENT_TYPE_STR_IMAGE_PCX "image/pcx"
84 #define CONTENT_TYPE_STR_IMAGE_PNG "image/png"
85 #define CONTENT_TYPE_STR_IMAGE_TIFF "image/tiff"
86 #define CONTENT_TYPE_STR_IMAGE_BMP "image/x-MS-bmp"
87 #define CONTENT_TYPE_STR_INET_MSG_RFC822 "message/rfc822"
88 #define CONTENT_TYPE_STR_INET_MULTI_ALTERNATIVE "multipart/alternative"
89 #define CONTENT_TYPE_STR_INET_MULTI_DIGEST "multipart/digest"
90 #define CONTENT_TYPE_STR_INET_MULTI_MIXED "multipart/mixed"
91 #define CONTENT_TYPE_STR_INET_MULTI_PARALLEL "multipart/parallel"
92 #define CONTENT_TYPE_STR_INET_MULTI_RELATED "multipart/related"
93 #define CONTENT_TYPE_STR_TEXT_ICALENDAR "text/calendar"
94 #define CONTENT_TYPE_STR_TEXT_HTML "text/html"
95 #define CONTENT_TYPE_STR_TEXT_PLAIN "text/plain"
96 #define CONTENT_TYPE_STR_TEXT_XMLICALENDAR "text/x-icalxml"
97 #define CONTENT_TYPE_STR_TEXT_URL "text/x-url"
98 #define CONTENT_TYPE_STR_TEXT_VCALENDAR "text/x-vCalendar"
99 #define CONTENT_TYPE_STR_TEXT_VCARD "text/x-vCard"
100 #define CONTENT_TYPE_STR_VIDEO_MSVIDEO "video/x-msvideo"
101 #define CONTENT_TYPE_STR_VIDEO_THEORA "video/theora"
102 #define CONTENT_TYPE_STR_VIDEO_VDO "video/vdo"
103 #define CONTENT_TYPE_STR_VIDEO_WEBM "audio/webm"
104 #define CONTENT_TYPE_STR_X_STARMAIL "x-starmail"
105 #define CONTENT_TYPE_STR_X_VRML "x-world/x-vrml"
106 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER "application/vnd.sun.xml.writer"
107 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_CALC "application/vnd.sun.xml.calc"
108 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESS "application/vnd.sun.xml.impress"
109 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_DRAW "application/vnd.sun.xml.draw"
110 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_CHART "application/vnd.sun.xml.chart"
111 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_MATH "application/vnd.sun.xml.math"
112 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER_GLOBAL "application/vnd.sun.xml.writer-global"
113 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESSPACKED "application/vnd.sun.xml.impress-packed"
116 /** Definitions for matching parts of URIs.
118 #define INETTYPE_URL_PROT_DATA "data"
119 #define INETTYPE_URL_PROT_FILE "file"
120 #define INETTYPE_URL_PROT_HTTP "http"
121 #define INETTYPE_URL_PROT_HTTPS "https"
122 #define INETTYPE_URL_PROT_MACRO "macro"
123 #define INETTYPE_URL_PROT_MAILTO "mailto"
124 #define INETTYPE_URL_PROT_PRIVATE "private"
126 enum INetContentType
128 CONTENT_TYPE_UNKNOWN,
129 CONTENT_TYPE_APP_OCTSTREAM,
130 CONTENT_TYPE_APP_PDF,
131 CONTENT_TYPE_APP_RTF,
132 CONTENT_TYPE_APP_MSWORD,
133 CONTENT_TYPE_APP_MSWORD_TEMPL,
134 CONTENT_TYPE_APP_STARCALC,
135 CONTENT_TYPE_APP_STARCHART,
136 CONTENT_TYPE_APP_STARDRAW,
137 CONTENT_TYPE_APP_STARHELP,
138 CONTENT_TYPE_APP_STARIMAGE,
139 CONTENT_TYPE_APP_STARIMPRESS,
140 CONTENT_TYPE_APP_STARMATH,
141 CONTENT_TYPE_APP_STARWRITER,
142 CONTENT_TYPE_APP_ZIP,
143 CONTENT_TYPE_AUDIO_AIFF,
144 CONTENT_TYPE_AUDIO_BASIC,
145 CONTENT_TYPE_AUDIO_MIDI,
146 CONTENT_TYPE_AUDIO_VORBIS,
147 CONTENT_TYPE_AUDIO_WAV,
148 CONTENT_TYPE_AUDIO_WEBM,
149 CONTENT_TYPE_IMAGE_GIF,
150 CONTENT_TYPE_IMAGE_JPEG,
151 CONTENT_TYPE_IMAGE_PCX,
152 CONTENT_TYPE_IMAGE_PNG,
153 CONTENT_TYPE_IMAGE_TIFF,
154 CONTENT_TYPE_IMAGE_BMP,
155 CONTENT_TYPE_TEXT_HTML,
156 CONTENT_TYPE_TEXT_PLAIN,
157 CONTENT_TYPE_TEXT_URL,
158 CONTENT_TYPE_TEXT_VCARD,
159 CONTENT_TYPE_VIDEO_MSVIDEO,
160 CONTENT_TYPE_VIDEO_THEORA,
161 CONTENT_TYPE_VIDEO_VDO,
162 CONTENT_TYPE_VIDEO_WEBM,
163 CONTENT_TYPE_X_CNT_FSYSBOX,
164 CONTENT_TYPE_X_CNT_FSYSFOLDER,
165 CONTENT_TYPE_X_STARMAIL,
166 CONTENT_TYPE_X_VRML,
167 CONTENT_TYPE_APP_GALLERY,
168 CONTENT_TYPE_APP_GALLERY_THEME,
169 CONTENT_TYPE_APP_STARWRITER_GLOB,
170 CONTENT_TYPE_APP_STARMAIL_SDM,
171 CONTENT_TYPE_APP_STARMAIL_SMD,
172 CONTENT_TYPE_APP_VND_CALC,
173 CONTENT_TYPE_APP_VND_CHART,
174 CONTENT_TYPE_APP_VND_DRAW,
175 CONTENT_TYPE_APP_VND_IMAGE,
176 CONTENT_TYPE_APP_VND_IMPRESS,
177 CONTENT_TYPE_APP_VND_MAIL,
178 CONTENT_TYPE_APP_VND_MATH,
179 CONTENT_TYPE_APP_VND_WRITER,
180 CONTENT_TYPE_APP_VND_WRITER_GLOBAL,
181 CONTENT_TYPE_APP_VND_WRITER_WEB,
182 CONTENT_TYPE_APP_FRAMESET,
183 CONTENT_TYPE_APP_MACRO,
184 CONTENT_TYPE_X_CNT_FSYSSPECIALFOLDER,
185 CONTENT_TYPE_APP_VND_TEMPLATE,
186 CONTENT_TYPE_IMAGE_GENERIC,
187 CONTENT_TYPE_APP_VND_NEWS,
188 CONTENT_TYPE_APP_VND_OUTTRAY,
189 CONTENT_TYPE_APP_MSEXCEL,
190 CONTENT_TYPE_APP_MSEXCEL_TEMPL,
191 CONTENT_TYPE_APP_MSPPOINT,
192 CONTENT_TYPE_APP_MSPPOINT_TEMPL,
193 CONTENT_TYPE_TEXT_VCALENDAR,
194 CONTENT_TYPE_TEXT_ICALENDAR,
195 CONTENT_TYPE_TEXT_XMLICALENDAR,
196 CONTENT_TYPE_APP_CDE_CALENDAR_APP,
197 CONTENT_TYPE_INET_MESSAGE_RFC822,
198 CONTENT_TYPE_INET_MULTIPART_ALTERNATIVE,
199 CONTENT_TYPE_INET_MULTIPART_DIGEST,
200 CONTENT_TYPE_INET_MULTIPART_PARALLEL,
201 CONTENT_TYPE_INET_MULTIPART_RELATED,
202 CONTENT_TYPE_INET_MULTIPART_MIXED,
203 CONTENT_TYPE_APP_VND_IMPRESSPACKED,
204 CONTENT_TYPE_APP_JAR,
205 CONTENT_TYPE_APP_VND_SUN_XML_WRITER,
206 CONTENT_TYPE_APP_VND_SUN_XML_CALC,
207 CONTENT_TYPE_APP_VND_SUN_XML_IMPRESS,
208 CONTENT_TYPE_APP_VND_SUN_XML_DRAW,
209 CONTENT_TYPE_APP_VND_SUN_XML_CHART,
210 CONTENT_TYPE_APP_VND_SUN_XML_MATH,
211 CONTENT_TYPE_APP_VND_SUN_XML_WRITER_GLOBAL,
212 CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED,
213 CONTENT_TYPE_LAST = CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED
217 class SVL_DLLPUBLIC INetContentTypes
219 public:
220 static INetContentType RegisterContentType(OUString const & rTypeName,
221 OUString const & rPresentation,
222 OUString const * pExtension = nullptr);
224 static INetContentType GetContentType(OUString const & rTypeName);
226 static OUString GetContentType(INetContentType eTypeID);
228 static OUString GetPresentation(INetContentType eTypeID,
229 const LanguageTag& aLocale);
231 static INetContentType GetContentType4Extension(OUString const & rExtension);
233 static INetContentType GetContentTypeFromURL(OUString const & rURL);
235 static bool GetExtensionFromURL(OUString const & rURL, OUString & rExtension);
237 static bool parse(OUString const & rMediaType, OUString & rType,
238 OUString & rSubType,
239 INetContentTypeParameterList * pParameters = nullptr);
242 #endif // INCLUDED_SVL_INETTYPE_HXX
244 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */