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_UNOCONTROLS_SOURCE_INC_FRAMECONTROL_HXX
21 #define INCLUDED_UNOCONTROLS_SOURCE_INC_FRAMECONTROL_HXX
23 #include <com/sun/star/frame/XFrame2.hpp>
24 #include <com/sun/star/lang/XServiceName.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/lang/XConnectionPointContainer.hpp>
27 #include <cppuhelper/propshlp.hxx>
28 #include <rtl/ref.hxx>
30 #include <basecontrol.hxx>
31 #include "OConnectionPointContainerHelper.hxx"
35 namespace unocontrols
{
39 class FrameControl
: public css::awt::XControlModel
40 , public css::lang::XConnectionPointContainer
41 , public BaseControl
// This order is necessary for right initialization of m_aMutex!
42 , public ::cppu::OBroadcastHelper
43 , public ::cppu::OPropertySetHelper
52 FrameControl( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
54 virtual ~FrameControl() override
;
58 virtual css::uno::Any SAL_CALL
queryInterface(
59 const css::uno::Type
& aType
62 /**_______________________________________________________________________________________________________
63 @short increment refcount
66 @onerror A RuntimeException is thrown.
69 virtual void SAL_CALL
acquire() throw() override
;
71 /**_______________________________________________________________________________________________________
72 @short decrement refcount
75 @onerror A RuntimeException is thrown.
78 virtual void SAL_CALL
release() throw() override
;
82 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
86 css::uno::Any SAL_CALL
queryAggregation(
87 const css::uno::Type
& aType
90 OUString SAL_CALL
getImplementationName() override
;
92 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
96 virtual void SAL_CALL
createPeer(
97 const css::uno::Reference
< css::awt::XToolkit
>& xToolkit
,
98 const css::uno::Reference
< css::awt::XWindowPeer
>& xParent
101 virtual sal_Bool SAL_CALL
setModel(
102 const css::uno::Reference
< css::awt::XControlModel
>& xModel
105 virtual css::uno::Reference
< css::awt::XControlModel
> SAL_CALL
getModel() override
;
109 virtual void SAL_CALL
dispose() override
;
113 virtual sal_Bool SAL_CALL
setGraphics(
114 const css::uno::Reference
< css::awt::XGraphics
>& xDevice
117 virtual css::uno::Reference
< css::awt::XGraphics
> SAL_CALL
getGraphics() override
;
119 // XConnectionPointContainer
121 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getConnectionPointTypes() override
;
123 virtual css::uno::Reference
< css::lang::XConnectionPoint
> SAL_CALL
queryConnectionPoint(
124 const css::uno::Type
& aType
127 virtual void SAL_CALL
advise(
128 const css::uno::Type
& aType
,
129 const css::uno::Reference
< css::uno::XInterface
>& xListener
132 virtual void SAL_CALL
unadvise(
133 const css::uno::Type
& aType
,
134 const css::uno::Reference
< css::uno::XInterface
>& xListener
137 // impl but public methods to register service!
139 static const css::uno::Sequence
< OUString
> impl_getStaticSupportedServiceNames();
141 static const OUString
impl_getStaticImplementationName();
146 using OPropertySetHelper::getFastPropertyValue
;
148 // OPropertySetHelper
150 virtual sal_Bool SAL_CALL
convertFastPropertyValue(
151 css::uno::Any
& rConvertedValue
,
152 css::uno::Any
& rOldValue
,
154 const css::uno::Any
& rValue
157 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast(
159 const css::uno::Any
& rValue
162 virtual void SAL_CALL
getFastPropertyValue( css::uno::Any
& rValue
,
163 sal_Int32 nHandle
) const override
;
165 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
169 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() override
;
173 virtual css::awt::WindowDescriptor
* impl_getWindowDescriptor(
174 const css::uno::Reference
< css::awt::XWindowPeer
>& xParentPeer
181 void impl_createFrame( const css::uno::Reference
< css::awt::XWindowPeer
>& xPeer
,
182 const OUString
& sURL
,
183 const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
);
185 void impl_deleteFrame();
191 css::uno::Reference
< css::frame::XFrame2
> m_xFrame
;
192 OUString m_sComponentURL
;
193 css::uno::Sequence
< css::beans::PropertyValue
> m_seqLoaderArguments
;
194 rtl::Reference
<OConnectionPointContainerHelper
> m_aConnectionPointContainer
;
196 }; // class FrameControl
198 } // namespace unocontrols
200 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_FRAMECONTROL_HXX
202 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */