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 SUBCOMPONENTLOADER_HXX 25 #define SUBCOMPONENTLOADER_HXX 26 27 #include "dbaccessdllapi.h" 28 29 /** === begin UNO includes === **/ 30 #include <com/sun/star/awt/XWindowListener.hpp> 31 #include <com/sun/star/frame/XController.hpp> 32 #include <com/sun/star/lang/XComponent.hpp> 33 #include <com/sun/star/ucb/XCommandProcessor.hpp> 34 /** === end UNO includes === **/ 35 36 #include <cppuhelper/implbase1.hxx> 37 38 //........................................................................ 39 namespace dbaccess 40 { 41 //........................................................................ 42 43 //==================================================================== 44 //= SubComponentLoader 45 //==================================================================== 46 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XWindowListener 47 > SubComponentLoader_Base; 48 struct SubComponentLoader_Data; 49 /** is a helper class which loads/opens a given sub component as soon as the main application 50 window becomes visible. 51 */ 52 class DBACCESS_DLLPRIVATE SubComponentLoader : public SubComponentLoader_Base 53 { 54 public: 55 SubComponentLoader( 56 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& i_rApplicationController, 57 const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandProcessor >& i_rSubDocumentDefinition 58 ); 59 60 SubComponentLoader( 61 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& i_rApplicationController, 62 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& i_rNonDocumentComponent 63 ); 64 65 // XWindowListener 66 virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException); 67 virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException); 68 virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); 69 virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); 70 71 // XEventListener 72 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); 73 74 protected: 75 virtual ~SubComponentLoader(); 76 77 private: 78 SubComponentLoader_Data* m_pData; 79 }; 80 81 //........................................................................ 82 } // namespace dbaccess 83 //........................................................................ 84 85 #endif // SUBCOMPONENTLOADER_HXX 86