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