1*f8e07b45SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*f8e07b45SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*f8e07b45SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*f8e07b45SAndrew Rist * distributed with this work for additional information 6*f8e07b45SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*f8e07b45SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*f8e07b45SAndrew Rist * "License"); you may not use this file except in compliance 9*f8e07b45SAndrew Rist * with the License. You may obtain a copy of the License at 10*f8e07b45SAndrew Rist * 11*f8e07b45SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*f8e07b45SAndrew Rist * 13*f8e07b45SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*f8e07b45SAndrew Rist * software distributed under the License is distributed on an 15*f8e07b45SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*f8e07b45SAndrew Rist * KIND, either express or implied. See the License for the 17*f8e07b45SAndrew Rist * specific language governing permissions and limitations 18*f8e07b45SAndrew Rist * under the License. 19*f8e07b45SAndrew Rist * 20*f8e07b45SAndrew Rist *************************************************************/ 21*f8e07b45SAndrew Rist 22*f8e07b45SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef __FRAMEWORK_SERVICES_BACKINGCOMP_HXX_ 25cdf0e10cSrcweir #define __FRAMEWORK_SERVICES_BACKINGCOMP_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir //__________________________________________ 28cdf0e10cSrcweir // own includes 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx> 31cdf0e10cSrcweir #include <general.h> 32cdf0e10cSrcweir #include <stdtypes.h> 33cdf0e10cSrcweir 34cdf0e10cSrcweir //__________________________________________ 35cdf0e10cSrcweir // interface includes 36cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp> 37cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 38cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 39cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 40cdf0e10cSrcweir #include <com/sun/star/lang/XSingleServiceFactory.hpp> 41cdf0e10cSrcweir #include <com/sun/star/awt/XWindow.hpp> 42cdf0e10cSrcweir #include <com/sun/star/awt/XKeyListener.hpp> 43cdf0e10cSrcweir 44cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FAME_XFRAME_HPP_ 45cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp> 46cdf0e10cSrcweir #endif 47cdf0e10cSrcweir 48cdf0e10cSrcweir #ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDROPTARGETELISTENER_HPP_ 49cdf0e10cSrcweir #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp> 50cdf0e10cSrcweir #endif 51cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp> 52cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp> 53cdf0e10cSrcweir 54cdf0e10cSrcweir //__________________________________________ 55cdf0e10cSrcweir // other includes 56cdf0e10cSrcweir #include <cppuhelper/weak.hxx> 57cdf0e10cSrcweir 58cdf0e10cSrcweir //__________________________________________ 59cdf0e10cSrcweir // definition 60cdf0e10cSrcweir 61cdf0e10cSrcweir namespace framework 62cdf0e10cSrcweir { 63cdf0e10cSrcweir 64cdf0e10cSrcweir //__________________________________________ 65cdf0e10cSrcweir /** 66cdf0e10cSrcweir implements the backing component. 67cdf0e10cSrcweir 68cdf0e10cSrcweir This component is a special one, which doesn't provide a controller 69cdf0e10cSrcweir nor a model. It supports the following features: 70cdf0e10cSrcweir - Drag & Drop 71cdf0e10cSrcweir - Key Accelerators 72cdf0e10cSrcweir - Simple Menu 73cdf0e10cSrcweir - Progress Bar 74cdf0e10cSrcweir - Background 75cdf0e10cSrcweir */ 76cdf0e10cSrcweir class BackingComp : public css::lang::XTypeProvider 77cdf0e10cSrcweir , public css::lang::XServiceInfo 78cdf0e10cSrcweir , public css::lang::XInitialization 79cdf0e10cSrcweir , public css::frame::XController // => XComponent 80cdf0e10cSrcweir , public css::awt::XKeyListener // => XEventListener 81cdf0e10cSrcweir // attention! Must be the first base class to guarentee right initialize lock ... 82cdf0e10cSrcweir , private ThreadHelpBase 83cdf0e10cSrcweir , public ::cppu::OWeakObject 84cdf0e10cSrcweir { 85cdf0e10cSrcweir //______________________________________ 86cdf0e10cSrcweir // member 87cdf0e10cSrcweir 88cdf0e10cSrcweir private: 89cdf0e10cSrcweir 90cdf0e10cSrcweir /** the global uno service manager. 91cdf0e10cSrcweir Must be used to create own needed services. */ 92cdf0e10cSrcweir css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; 93cdf0e10cSrcweir 94cdf0e10cSrcweir /** reference to the component window. */ 95cdf0e10cSrcweir css::uno::Reference< css::awt::XWindow > m_xWindow; 96cdf0e10cSrcweir 97cdf0e10cSrcweir /** the owner frame of this component. */ 98cdf0e10cSrcweir css::uno::Reference< css::frame::XFrame > m_xFrame; 99cdf0e10cSrcweir 100cdf0e10cSrcweir /** helper for drag&drop. */ 101cdf0e10cSrcweir css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > m_xDropTargetListener; 102cdf0e10cSrcweir 103cdf0e10cSrcweir //______________________________________ 104cdf0e10cSrcweir // interface 105cdf0e10cSrcweir 106cdf0e10cSrcweir public: 107cdf0e10cSrcweir 108cdf0e10cSrcweir BackingComp( const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR ); 109cdf0e10cSrcweir virtual ~BackingComp( ); 110cdf0e10cSrcweir 111cdf0e10cSrcweir // XInterface 112cdf0e10cSrcweir virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw(css::uno::RuntimeException); 113cdf0e10cSrcweir virtual void SAL_CALL acquire ( ) throw( ); 114cdf0e10cSrcweir virtual void SAL_CALL release ( ) throw( ); 115cdf0e10cSrcweir 116cdf0e10cSrcweir // XTypeProvide 117cdf0e10cSrcweir virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () throw(css::uno::RuntimeException); 118cdf0e10cSrcweir virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(css::uno::RuntimeException); 119cdf0e10cSrcweir 120cdf0e10cSrcweir // XServiceInfo 121cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName ( ) throw(css::uno::RuntimeException); 122cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService ( const ::rtl::OUString& sServiceName ) throw(css::uno::RuntimeException); 123cdf0e10cSrcweir virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(css::uno::RuntimeException); 124cdf0e10cSrcweir 125cdf0e10cSrcweir // XInitialization 126cdf0e10cSrcweir virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& lArgs ) throw(css::uno::Exception, css::uno::RuntimeException); 127cdf0e10cSrcweir 128cdf0e10cSrcweir // XController 129cdf0e10cSrcweir virtual void SAL_CALL attachFrame ( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw(css::uno::RuntimeException); 130cdf0e10cSrcweir virtual sal_Bool SAL_CALL attachModel ( const css::uno::Reference< css::frame::XModel >& xModel ) throw(css::uno::RuntimeException); 131cdf0e10cSrcweir virtual sal_Bool SAL_CALL suspend ( sal_Bool bSuspend ) throw(css::uno::RuntimeException); 132cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getViewData ( ) throw(css::uno::RuntimeException); 133cdf0e10cSrcweir virtual void SAL_CALL restoreViewData( const css::uno::Any& aData ) throw(css::uno::RuntimeException); 134cdf0e10cSrcweir virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel ( ) throw(css::uno::RuntimeException); 135cdf0e10cSrcweir virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getFrame ( ) throw(css::uno::RuntimeException); 136cdf0e10cSrcweir 137cdf0e10cSrcweir // XKeyListener 138cdf0e10cSrcweir virtual void SAL_CALL keyPressed ( const css::awt::KeyEvent& aEvent ) throw(css::uno::RuntimeException); 139cdf0e10cSrcweir virtual void SAL_CALL keyReleased( const css::awt::KeyEvent& aEvent ) throw(css::uno::RuntimeException); 140cdf0e10cSrcweir 141cdf0e10cSrcweir // XEventListener 142cdf0e10cSrcweir virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw(css::uno::RuntimeException); 143cdf0e10cSrcweir 144cdf0e10cSrcweir // XComponent 145cdf0e10cSrcweir virtual void SAL_CALL dispose ( ) throw(css::uno::RuntimeException); 146cdf0e10cSrcweir virtual void SAL_CALL addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw(css::uno::RuntimeException); 147cdf0e10cSrcweir virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw(css::uno::RuntimeException); 148cdf0e10cSrcweir 149cdf0e10cSrcweir //______________________________________ 150cdf0e10cSrcweir // helper 151cdf0e10cSrcweir 152cdf0e10cSrcweir public: 153cdf0e10cSrcweir 154cdf0e10cSrcweir static css::uno::Sequence< ::rtl::OUString > SAL_CALL impl_getStaticSupportedServiceNames( ); 155cdf0e10cSrcweir static ::rtl::OUString SAL_CALL impl_getStaticImplementationName ( ); 156cdf0e10cSrcweir static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ) throw( css::uno::Exception ); 157cdf0e10cSrcweir static css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ); 158cdf0e10cSrcweir }; 159cdf0e10cSrcweir 160cdf0e10cSrcweir } // namespace framework 161cdf0e10cSrcweir 162cdf0e10cSrcweir #endif // __FRAMEWORK_SERVICES_BACKINGCOMP_HXX_ 163