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 _XMLFILTERTESTDIALOG_HXX_
24 #define _XMLFILTERTESTDIALOG_HXX_
25 
26 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27 #include <com/sun/star/lang/XComponent.hpp>
28 #include <com/sun/star/document/XEventBroadcaster.hpp>
29 #include <vcl/dialog.hxx>
30 
31 #ifndef _SV_BUTTON_HXX
32 #include <vcl/button.hxx>
33 #endif
34 #include <vcl/fixed.hxx>
35 #include <svl/poolitem.hxx>
36 
37 class filter_info_impl;
38 class XMLSourceFileDialog;
39 
40 class XMLFilterTestDialog : public ModalDialog
41 {
42 public:
43 	XMLFilterTestDialog( Window* pParent, ResMgr& rResMgr, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxMSF  );
44 	virtual ~XMLFilterTestDialog();
45 
46 	void test( const filter_info_impl& rFilterInfo );
47 
48 	void updateCurrentDocumentButtonState( com::sun::star::uno::Reference< com::sun::star::lang::XComponent > * pRef = NULL );
49 
50 private:
51 	DECL_LINK(ClickHdl_Impl, PushButton * );
52 
53 	void onExportBrowse();
54 	void onExportCurrentDocument();
55 	void onImportBrowse();
56 	void onImportRecentDocument();
57 	void initDialog();
58 
59 	com::sun::star::uno::Reference< com::sun::star::lang::XComponent > getFrontMostDocument( const rtl::OUString& rServiceName );
60 	void import( const rtl::OUString& rURL );
61 	void displayXMLFile( const rtl::OUString& rURL );
62 	void doExport( com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComp );
63 
64 private:
65 	com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
66 	com::sun::star::uno::Reference< com::sun::star::document::XEventBroadcaster > mxGlobalBroadcaster;
67 	com::sun::star::uno::Reference< com::sun::star::document::XEventListener > mxGlobalEventListener;
68 	com::sun::star::uno::WeakReference< com::sun::star::lang::XComponent > mxLastFocusModel;
69 
70 	ResMgr&				mrResMgr;
71 
72 	rtl::OUString	maImportRecentFile;
73 	rtl::OUString	maExportRecentFile;
74 
75 	FixedLine	maFLExport;
76 	FixedText	maFTExportXSLT;
77 	FixedText	maFTExportXSLTFile;
78 	FixedText	maFTTransformDocument;
79 	PushButton	maPBExportBrowse;
80 	PushButton	maPBCurrentDocument;
81 	FixedText	maFTNameOfCurentFile;
82 	FixedLine	maFLImport;
83 	FixedText	maFTImportXSLT;
84 	FixedText	maFTImportXSLTFile;
85 	FixedText	maFTImportTemplate;
86 	FixedText	maFTImportTemplateFile;
87 	FixedText	maFTTransformFile;
88 	CheckBox	maCBXDisplaySource;
89 	PushButton	maPBImportBrowse;
90 	PushButton	maPBRecentDocument;
91 	FixedText	maFTNameOfRecentFile;
92 	PushButton	maPBClose;
93 	HelpButton	maPBHelp;
94 
95 	XMLSourceFileDialog*	mpSourceDLG;
96 	filter_info_impl*		mpFilterInfo;
97 
98 	String maDialogTitle;
99 
100 	::rtl::OUString sDTDPath;
101 };
102 
103 #endif
104