xref: /AOO42X/main/test/source/java/org/openoffice/test/tools/DocumentType.java (revision b0efeae40e43e6d4ccd561d22ec612d42773857b)
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 package org.openoffice.test.tools;
24 
25 /** a helper "enumeration class" for classifying a document type
26 */
27 public class DocumentType extends com.sun.star.uno.Enum
28 {
DocumentType( int value )29     private DocumentType( int value )
30     {
31         super( value );
32     }
33 
getDefault()34     public static DocumentType getDefault()
35     {
36         return WRITER;
37     }
38 
39     public static final DocumentType WRITER = new DocumentType(0);
40     public static final DocumentType CALC = new DocumentType(1);
41     public static final DocumentType DRAWING = new DocumentType(2);
42     public static final DocumentType XMLFORM = new DocumentType(3);
43     public static final DocumentType PRESENTATION = new DocumentType(4);
44     public static final DocumentType FORMULA = new DocumentType(5);
45     public static final DocumentType UNKNOWN = new DocumentType(-1);
46 
fromInt(int value)47     public static DocumentType fromInt(int value)
48     {
49         switch(value)
50         {
51             case 0: return WRITER;
52             case 1: return CALC;
53             case 2: return DRAWING;
54             case 3: return XMLFORM;
55             case 4: return PRESENTATION;
56             case 5: return FORMULA;
57             default: return UNKNOWN;
58         }
59     }
60 };
61