1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VBAHELPER_VBAWINDOWBASE_HXX
21 #define INCLUDED_VBAHELPER_VBAWINDOWBASE_HXX
25 #include <cppuhelper/weakref.hxx>
26 #include <com/sun/star/uno/Any.hxx>
27 #include <com/sun/star/uno/Reference.hxx>
28 #include <com/sun/star/uno/RuntimeException.hpp>
29 #include <com/sun/star/uno/Sequence.hxx>
30 #include <ooo/vba/XWindowBase.hpp>
31 #include <rtl/ustring.hxx>
32 #include <sal/types.h>
33 #include <vbahelper/vbadllapi.h>
34 #include <vbahelper/vbahelper.hxx>
35 #include <vbahelper/vbahelperinterface.hxx>
37 namespace com::sun::star
{
38 namespace awt
{ class XWindow2
; }
39 namespace awt
{ class XWindow
; }
40 namespace frame
{ class XController
; }
41 namespace frame
{ class XModel
; }
42 namespace uno
{ class XComponentContext
; }
46 class XHelperInterface
;
49 typedef InheritedHelperInterfaceWeakImpl
< ov::XWindowBase
> WindowBaseImpl_BASE
;
51 class VBAHELPER_DLLPUBLIC VbaWindowBase
: public WindowBaseImpl_BASE
54 /// @throws css::uno::RuntimeException
56 const css::uno::Reference
< ov::XHelperInterface
>& xParent
,
57 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
,
58 const css::uno::Reference
< css::frame::XModel
>& xModel
,
59 const css::uno::Reference
< css::frame::XController
>& xController
);
60 /// @throws css::uno::RuntimeException
62 css::uno::Sequence
< css::uno::Any
> const& aArgs
,
63 css::uno::Reference
< css::uno::XComponentContext
> const& xContext
);
66 virtual sal_Int32 SAL_CALL
getHeight() override
;
67 virtual void SAL_CALL
setHeight( sal_Int32 _height
) override
;
68 virtual sal_Int32 SAL_CALL
getLeft() override
;
69 virtual void SAL_CALL
setLeft( sal_Int32 _left
) override
;
70 virtual sal_Int32 SAL_CALL
getTop() override
;
71 virtual void SAL_CALL
setTop( sal_Int32 _top
) override
;
72 virtual sal_Bool SAL_CALL
getVisible() override
;
73 virtual void SAL_CALL
setVisible( sal_Bool _visible
) override
;
74 virtual sal_Int32 SAL_CALL
getWidth() override
;
75 virtual void SAL_CALL
setWidth( sal_Int32 _width
) override
;
78 virtual OUString
getServiceImplName() override
;
79 virtual css::uno::Sequence
<OUString
> getServiceNames() override
;
82 /// @throws css::uno::RuntimeException
83 css::uno::Reference
< css::frame::XController
> getController() const;
84 /// @throws css::uno::RuntimeException
85 css::uno::Reference
< css::awt::XWindow
> getWindow() const;
86 /// @throws css::uno::RuntimeException
87 css::uno::Reference
< css::awt::XWindow2
> getWindow2() const;
89 css::uno::Reference
< css::frame::XModel
> m_xModel
;
92 /// @throws css::uno::RuntimeException
93 void construct( const css::uno::Reference
< css::frame::XController
>& xController
);
95 css::uno::WeakReference
< css::frame::XController
> m_xController
;
96 css::uno::WeakReference
< css::awt::XWindow
> m_xWindow
;
99 #endif // INCLUDED_VBAHELPER_VBAWINDOWBASE_HXX
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */