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