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 package org.apache.openoffice.ooxml.framework.part;
23 
24 public enum ContentType
25 {
26     ApplicationDrawing  ("application/vnd.openxmlformats-officedocument.vmlDrawing"),
27     ApplicationExcel    ("application/vnd.ms-excel"),
28     ApplicationXML      ("application/xml"),
29     Chart               ("application/vnd.openxmlformats-officedocument.drawingml.chart+xml"),
30     ContentTypes        (""),
31     CoreProperties      ("application/vnd.openxmlformats-package.core-properties+xml"),
32     CustomXMLProperties ("application/vnd.openxmlformats-officedocument.customXmlProperties+xml"),
33     ExtendedProperties  ("application/vnd.openxmlformats-officedocument.extended-properties+xml"),
34     ImageGIF            ("image/gif"),
35     ImageJPG            ("image/png"),
36     ImagePNG            ("image/jpeg"),
37     OleObject           ("application/vnd.openxmlformats-officedocument.oleObject"),
38     PmlDocument         ("application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"),
39     PmlHandoutMaster    ("application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml"),
40     PmlNotesMaster      ("application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml"),
41     PmlNotesSlide       ("application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"),
42     PmlProperties       ("application/vnd.openxmlformats-officedocument.presentationml.presProps+xml"),
43     PmlSlide            ("application/vnd.openxmlformats-officedocument.presentationml.slide+xml"),
44     PmlSlideLayout      ("application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"),
45     PmlSlideMaster      ("application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"),
46     PmlTableStyles      ("application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml"),
47     PmlViewProperties   ("application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml"),
48     Relationships       ("application/vnd.openxmlformats-package.relationships+xml"),
49     SmlSheet            ("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),
50     Theme               ("application/vnd.openxmlformats-officedocument.theme+xml"),
51     ThemeOverride       ("application/vnd.openxmlformats-officedocument.themeOverride+xml"),
52     Thumbnail           ("http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"),
53     WmlDocument         ("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"),
54     WmlEndNotes         ("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"),
55     WmlFontTable        ("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"),
56     WmlFootNotes        ("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml"),
57     WmlFooter           ("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml"),
58     WmlHeader           ("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml"),
59     WmlNumbering        ("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"),
60     WmlSettings         ("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"),
61     WmlStyles           ("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"),
62     WmlWebSettings      ("application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"),
63 
64     Unknown("");
65 
66 
67 
68 
ContentType(final String sMimeType)69     ContentType (final String sMimeType)
70     {
71         msMimeType = sMimeType;
72     }
73 
74 
75 
76 
CreateForString(final String sContentType)77     public static ContentType CreateForString (final String sContentType)
78     {
79         for (final ContentType eType : values())
80             if (eType.msMimeType.equals(sContentType))
81                 return eType;
82         System.err.printf("content type '%s' is not known\n", sContentType);
83         return Unknown;
84     }
85 
86 
87 
88 
GetLongName()89     public String GetLongName ()
90     {
91         return msMimeType;
92     }
93 
94 
95 
96 
97     private final String msMimeType;
98 }
99