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 FILEEXTENSIONS_HXX_INCLUDED
25 #define FILEEXTENSIONS_HXX_INCLUDED
26 
27 #include "internal/global.hxx"
28 
29 #include <string>
30 
31 // A simple table with information about the currently used OO file extensions
32 // for instance ".sxw" and information about windows registry keys which are
33 // necessary for properly registering of the shell extensions
34 
35 /** A FileExtensionEntry consists of the extension as ansi and as
36 	unicode string and of the currently used registry forward key
37 	for this extension
38 */
39 struct FileExtensionEntry
40 {
41 	char*    ExtensionAnsi;			// e.g. ".sxw"
42 	wchar_t* ExtensionUnicode;		// e.g. L".sxw"
43 	char*    RegistryForwardKey;	// e.g. "soffice.StarWriterDocument.6"
44 };
45 
46 extern FileExtensionEntry OOFileExtensionTable[];
47 
48 extern size_t OOFileExtensionTableSize;
49 
50 //---------------------------------
51 /** Return the extension of a file
52 	name without the '.'
53 */
54 std::string get_file_name_extension(const std::string& file_name);
55 
56 //---------------------------------
57 /** Return the type of a file
58 */
59 
60 enum File_Type_t { UNKNOWN, WRITER, CALC, DRAW, IMPRESS, MATH, WEB, DATABASE };
61 
62 File_Type_t get_file_type(const std::string& file_name);
63 
64 #endif
65