1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlfiltercommon.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _XMLFILTERCOMMON_HXX_
31 #define _XMLFILTERCOMMON_HXX_
33 #include <com/sun/star/lang/XComponent.hpp>
34 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 #include <com/sun/star/container/XHierarchicalName.hpp>
36 #include <com/sun/star/container/XNameContainer.hpp>
37 #include <com/sun/star/io/XInputStream.hpp>
38 #include <com/sun/star/io/XOutputStream.hpp>
42 // --------------------------------------------------------------------
44 extern ::rtl::OUString
string_encode( const ::rtl::OUString
& rText
);
45 extern ::rtl::OUString
string_decode( const ::rtl::OUString
& rText
);
47 // --------------------------------------------------------------------
49 extern bool isFileURL( const ::rtl::OUString
& rURL
);
51 // --------------------------------------------------------------------
53 bool copyStreams( ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> xIS
, ::com::sun::star::uno::Reference
< ::com::sun::star::io::XOutputStream
> xOS
);
54 bool createDirectory( ::rtl::OUString
& rURL
);
56 // --------------------------------------------------------------------
58 class filter_info_impl
61 rtl::OUString maFilterName
;
63 rtl::OUString maDocumentService
;
64 rtl::OUString maFilterService
;
65 rtl::OUString maInterfaceName
;
66 rtl::OUString maComment
;
67 rtl::OUString maExtension
;
69 rtl::OUString maExportXSLT
;
70 rtl::OUString maImportXSLT
;
71 rtl::OUString maImportTemplate
;
72 rtl::OUString maDocType
;
73 rtl::OUString maImportService
;
74 rtl::OUString maExportService
;
77 sal_Int32 maFileFormatVersion
;
78 sal_Int32 mnDocumentIconID
;
82 filter_info_impl( const filter_info_impl
& rInfo
);
83 int operator==( const filter_info_impl
& ) const;
85 com::sun::star::uno::Sequence
< rtl::OUString
> getFilterUserData() const;
88 // --------------------------------------------------------------------
90 struct application_info_impl
92 rtl::OUString maDocumentService
;
93 rtl::OUString maDocumentUIName
;
94 rtl::OUString maXMLImporter
;
95 rtl::OUString maXMLExporter
;
97 application_info_impl( const sal_Char
* pDocumentService
, ResId
& rUINameRes
, const sal_Char
* mpXMLImporter
, const sal_Char
* mpXMLExporter
);
100 // --------------------------------------------------------------------
102 extern std::vector
< application_info_impl
* >& getApplicationInfos();
103 extern rtl::OUString
getApplicationUIName( const rtl::OUString
& rServiceName
);
104 extern const application_info_impl
* getApplicationInfo( const rtl::OUString
& rServiceName
);
106 extern ResMgr
* getXSLTDialogResMgr();
108 #define RESID(x) ResId(x, *getXSLTDialogResMgr() )