1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _XMLFILTERCOMMON_HXX_
28 #define _XMLFILTERCOMMON_HXX_
29 
30 #include <com/sun/star/lang/XComponent.hpp>
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <com/sun/star/container/XHierarchicalName.hpp>
33 #include <com/sun/star/container/XNameContainer.hpp>
34 #include <com/sun/star/io/XInputStream.hpp>
35 #include <com/sun/star/io/XOutputStream.hpp>
36 
37 #include <vector>
38 
39 // --------------------------------------------------------------------
40 
41 extern ::rtl::OUString string_encode( const ::rtl::OUString & rText );
42 extern ::rtl::OUString string_decode( const ::rtl::OUString & rText );
43 
44 // --------------------------------------------------------------------
45 
46 extern bool isFileURL( const ::rtl::OUString & rURL );
47 
48 // --------------------------------------------------------------------
49 
50 bool copyStreams( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xIS, ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOS );
51 bool createDirectory( ::rtl::OUString& rURL );
52 
53 // --------------------------------------------------------------------
54 
55 class filter_info_impl
56 {
57 public:
58 	rtl::OUString	maFilterName;
59 	rtl::OUString	maType;
60 	rtl::OUString	maDocumentService;
61 	rtl::OUString	maFilterService;
62 	rtl::OUString	maInterfaceName;
63 	rtl::OUString	maComment;
64 	rtl::OUString	maExtension;
65 	rtl::OUString	maDTD;
66 	rtl::OUString	maExportXSLT;
67 	rtl::OUString	maImportXSLT;
68 	rtl::OUString	maImportTemplate;
69 	rtl::OUString	maDocType;
70     rtl::OUString	maImportService;
71     rtl::OUString	maExportService;
72 
73 	sal_Int32		maFlags;
74 	sal_Int32		maFileFormatVersion;
75 	sal_Int32		mnDocumentIconID;
76 
77     sal_Bool        mbReadonly;
78 	filter_info_impl();
79 	filter_info_impl( const filter_info_impl& rInfo );
80 	int operator==( const filter_info_impl& ) const;
81 
82 	com::sun::star::uno::Sequence< rtl::OUString > getFilterUserData() const;
83 };
84 
85 // --------------------------------------------------------------------
86 
87 struct application_info_impl
88 {
89 	rtl::OUString	maDocumentService;
90 	rtl::OUString	maDocumentUIName;
91 	rtl::OUString	maXMLImporter;
92 	rtl::OUString	maXMLExporter;
93 
94 	application_info_impl( const sal_Char * pDocumentService, ResId& rUINameRes, const sal_Char * mpXMLImporter, const sal_Char * mpXMLExporter );
95 };
96 
97 // --------------------------------------------------------------------
98 
99 extern std::vector< application_info_impl* >& getApplicationInfos();
100 extern rtl::OUString getApplicationUIName( const rtl::OUString& rServiceName );
101 extern const application_info_impl* getApplicationInfo( const rtl::OUString& rServiceName );
102 
103 extern ResMgr* getXSLTDialogResMgr();
104 
105 #define RESID(x) ResId(x, *getXSLTDialogResMgr() )
106 
107 #endif
108