1 /************************************************************************* 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * 4 * Copyright 2009 by Sun Microsystems, Inc. 5 * 6 * OpenOffice.org - a multi-platform office productivity suite 7 * 8 * This file is part of OpenOffice.org. 9 * 10 * OpenOffice.org is free software: you can redistribute it and/or modify 11 * it under the terms of the GNU Lesser General Public License version 3 12 * only, as published by the Free Software Foundation. 13 * 14 * OpenOffice.org is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU Lesser General Public License version 3 for more details 18 * (a copy is included in the LICENSE file that accompanied this code). 19 * 20 * You should have received a copy of the GNU Lesser General Public License 21 * version 3 along with OpenOffice.org. If not, see 22 * <http://www.openoffice.org/license.html> 23 * for a copy of the LGPLv3 License. 24 ************************************************************************/ 25 26 #ifndef SUBCOMPONENTLOADER_HXX 27 #define SUBCOMPONENTLOADER_HXX 28 29 #include "dbaccessdllapi.h" 30 31 /** === begin UNO includes === **/ 32 #include <com/sun/star/awt/XWindowListener.hpp> 33 #include <com/sun/star/frame/XController.hpp> 34 #include <com/sun/star/lang/XComponent.hpp> 35 #include <com/sun/star/ucb/XCommandProcessor.hpp> 36 /** === end UNO includes === **/ 37 38 #include <cppuhelper/implbase1.hxx> 39 40 //........................................................................ 41 namespace dbaccess 42 { 43 //........................................................................ 44 45 //==================================================================== 46 //= SubComponentLoader 47 //==================================================================== 48 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XWindowListener 49 > SubComponentLoader_Base; 50 struct SubComponentLoader_Data; 51 /** is a helper class which loads/opens a given sub component as soon as the main application 52 window becomes visible. 53 */ 54 class DBACCESS_DLLPRIVATE SubComponentLoader : public SubComponentLoader_Base 55 { 56 public: 57 SubComponentLoader( 58 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& i_rApplicationController, 59 const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandProcessor >& i_rSubDocumentDefinition 60 ); 61 62 SubComponentLoader( 63 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& i_rApplicationController, 64 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& i_rNonDocumentComponent 65 ); 66 67 // XWindowListener 68 virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException); 69 virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException); 70 virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); 71 virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); 72 73 // XEventListener 74 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); 75 76 protected: 77 virtual ~SubComponentLoader(); 78 79 private: 80 SubComponentLoader_Data* m_pData; 81 }; 82 83 //........................................................................ 84 } // namespace dbaccess 85 //........................................................................ 86 87 #endif // SUBCOMPONENTLOADER_HXX 88