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 VBA_WINDOWBASE_HXX 25 #define VBA_WINDOWBASE_HXX 26 27 #include <ooo/vba/XWindowBase.hpp> 28 #include <com/sun/star/awt/XWindow2.hpp> 29 #include <com/sun/star/frame/XController.hpp> 30 #include <vbahelper/vbahelperinterface.hxx> 31 32 typedef InheritedHelperInterfaceImpl1< ov::XWindowBase > WindowBaseImpl_BASE; 33 34 class VBAHELPER_DLLPUBLIC VbaWindowBase : public WindowBaseImpl_BASE 35 { 36 public: 37 VbaWindowBase( 38 const css::uno::Reference< ov::XHelperInterface >& xParent, 39 const css::uno::Reference< css::uno::XComponentContext >& xContext, 40 const css::uno::Reference< css::frame::XModel >& xModel, 41 const css::uno::Reference< css::frame::XController >& xController ) 42 throw (css::uno::RuntimeException); 43 VbaWindowBase( 44 css::uno::Sequence< css::uno::Any > const& aArgs, 45 css::uno::Reference< css::uno::XComponentContext > const& xContext ) 46 throw (css::uno::RuntimeException); 47 48 // XWindowBase 49 virtual sal_Int32 SAL_CALL getHeight() throw (css::uno::RuntimeException) ; 50 virtual void SAL_CALL setHeight( sal_Int32 _height ) throw (css::uno::RuntimeException) ; 51 virtual sal_Int32 SAL_CALL getLeft() throw (css::uno::RuntimeException) ; 52 virtual void SAL_CALL setLeft( sal_Int32 _left ) throw (css::uno::RuntimeException) ; 53 virtual sal_Int32 SAL_CALL getTop() throw (css::uno::RuntimeException) ; 54 virtual void SAL_CALL setTop( sal_Int32 _top ) throw (css::uno::RuntimeException) ; 55 virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); 56 virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException); 57 virtual sal_Int32 SAL_CALL getWidth() throw (css::uno::RuntimeException) ; 58 virtual void SAL_CALL setWidth( sal_Int32 _width ) throw (css::uno::RuntimeException) ; 59 60 // XHelperInterface 61 virtual rtl::OUString& getServiceImplName(); 62 virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 63 64 protected: 65 css::uno::Reference< css::frame::XController > getController() throw (css::uno::RuntimeException); 66 css::uno::Reference< css::awt::XWindow > getWindow() throw (css::uno::RuntimeException); 67 css::uno::Reference< css::awt::XWindow2 > getWindow2() throw (css::uno::RuntimeException); 68 69 css::uno::Reference< css::frame::XModel > m_xModel; 70 71 private: 72 void construct( const css::uno::Reference< css::frame::XController >& xController ) throw (css::uno::RuntimeException); 73 74 css::uno::WeakReference< css::frame::XController > m_xController; 75 css::uno::WeakReference< css::awt::XWindow > m_xWindow; 76 }; 77 78 #endif //VBA_WINDOWBASE_HXX 79