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 INFORMATIONDIALOG_HXX
25 #define INFORMATIONDIALOG_HXX
26 #include <vector>
27 #include "unodialog.hxx"
28 #include "configurationaccess.hxx"
29 #include "pppoptimizertoken.hxx"
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/awt/XItemListener.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/uno/Sequence.h>
34 #include <com/sun/star/text/XTextRange.hpp>
35 #include <com/sun/star/drawing/XShapes.hpp>
36 #include <com/sun/star/container/XIndexAccess.hpp>
37 #include <com/sun/star/frame/XController.hpp>
38 #include <com/sun/star/view/XSelectionSupplier.hpp>
39 #include <com/sun/star/uno/XComponentContext.hpp>
40 #include <com/sun/star/awt/XItemEventBroadcaster.hpp>
41 #include <com/sun/star/frame/XStorable.hpp>
42 #include <com/sun/star/frame/XDispatch.hpp>
43 #include <com/sun/star/awt/PushButtonType.hpp>
44 #include <com/sun/star/io/XStream.hpp>
45 
46 // ---------------------
47 // - InformationDialog -
48 // ---------------------
49 class InformationDialog : public UnoDialog, public ConfigurationAccess
50 {
51 public :
52 
53 	InformationDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF,
54 			com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rxFrame, const rtl::OUString& rSaveAsURL,
55 				sal_Bool& bOpenNewDocument, const sal_Int64& nSourceSize, const sal_Int64& nDestSize, const sal_Int64& nApproxDest );
56     ~InformationDialog();
57 
58 	sal_Bool				execute();
59 
60 private :
61 
62 	com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >mxMSF;
63 	com::sun::star::uno::Reference< com::sun::star::frame::XFrame >			mxFrame;
64 	com::sun::star::uno::Reference< com::sun::star::io::XStream >			mxTempFile;
65 
66 	com::sun::star::uno::Reference< com::sun::star::awt::XActionListener >	mxActionListener;
67 
68 	void InitDialog();
69 
70 	sal_Int64 mnSourceSize;
71 	sal_Int64 mnDestSize;
72 	sal_Int64 mnApproxSize;
73 	sal_Bool& mrbOpenNewDocument;
74 	const rtl::OUString& maSaveAsURL;
75 
76 public :
77 
78 	com::sun::star::uno::Reference< com::sun::star::frame::XFrame>& GetFrame() { return mxFrame; };
79 	const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& GetComponentContext() { return mxMSF; };
80 };
81 
82 class OKActionListener : public ::cppu::WeakImplHelper1< com::sun::star::awt::XActionListener >
83 {
84 public:
85 	OKActionListener( InformationDialog& rInformationDialog ) : mrInformationDialog( rInformationDialog ){};
86 
87     virtual void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
88 	virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException);
89 private:
90 
91 	InformationDialog& mrInformationDialog;
92 };
93 
94 #endif
95