xref: /AOO41X/main/filter/source/xsltdialog/xmlfiltercommon.hxx (revision 22e87013b212da8c80c93e291ad90de8f36964c2)
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 #ifndef _XMLFILTERCOMMON_HXX_
24 #define _XMLFILTERCOMMON_HXX_
25 
26 #include <com/sun/star/lang/XComponent.hpp>
27 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 #include <com/sun/star/container/XHierarchicalName.hpp>
29 #include <com/sun/star/container/XNameContainer.hpp>
30 #include <com/sun/star/io/XInputStream.hpp>
31 #include <com/sun/star/io/XOutputStream.hpp>
32 
33 #include <vector>
34 
35 // --------------------------------------------------------------------
36 
37 extern ::rtl::OUString string_encode( const ::rtl::OUString & rText );
38 extern ::rtl::OUString string_decode( const ::rtl::OUString & rText );
39 
40 // --------------------------------------------------------------------
41 
42 extern bool isFileURL( const ::rtl::OUString & rURL );
43 
44 // --------------------------------------------------------------------
45 
46 bool copyStreams( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xIS, ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOS );
47 bool createDirectory( ::rtl::OUString& rURL );
48 
49 // --------------------------------------------------------------------
50 
51 class filter_info_impl
52 {
53 public:
54     rtl::OUString   maFilterName;
55     rtl::OUString   maType;
56     rtl::OUString   maDocumentService;
57     rtl::OUString   maFilterService;
58     rtl::OUString   maInterfaceName;
59     rtl::OUString   maComment;
60     rtl::OUString   maExtension;
61     rtl::OUString   maDTD;
62     rtl::OUString   maExportXSLT;
63     rtl::OUString   maImportXSLT;
64     rtl::OUString   maImportTemplate;
65     rtl::OUString   maDocType;
66     rtl::OUString   maImportService;
67     rtl::OUString   maExportService;
68 
69     sal_Int32       maFlags;
70     sal_Int32       maFileFormatVersion;
71     sal_Int32       mnDocumentIconID;
72 
73     sal_Bool        mbReadonly;
74     filter_info_impl();
75     filter_info_impl( const filter_info_impl& rInfo );
76     int operator==( const filter_info_impl& ) const;
77 
78     com::sun::star::uno::Sequence< rtl::OUString > getFilterUserData() const;
79 };
80 
81 // --------------------------------------------------------------------
82 
83 struct application_info_impl
84 {
85     rtl::OUString   maDocumentService;
86     rtl::OUString   maDocumentUIName;
87     rtl::OUString   maXMLImporter;
88     rtl::OUString   maXMLExporter;
89 
90     application_info_impl( const sal_Char * pDocumentService, ResId& rUINameRes, const sal_Char * mpXMLImporter, const sal_Char * mpXMLExporter );
91 };
92 
93 // --------------------------------------------------------------------
94 
95 extern std::vector< application_info_impl* >& getApplicationInfos();
96 extern rtl::OUString getApplicationUIName( const rtl::OUString& rServiceName );
97 extern const application_info_impl* getApplicationInfo( const rtl::OUString& rServiceName );
98 
99 extern ResMgr* getXSLTDialogResMgr();
100 
101 #define RESID(x) ResId(x, *getXSLTDialogResMgr() )
102 
103 #endif
104