LibreOffice Module UnoControls (master) 1
framecontrol.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <com/sun/star/lang/XConnectionPointContainer.hpp>
24#include <rtl/ref.hxx>
25
26#include <basecontrol.hxx>
27
28namespace com::sun::star::beans { struct PropertyValue; }
29namespace com::sun::star::frame { class XFrame2; }
30namespace unocontrols { class OConnectionPointContainerHelper; }
31
32namespace unocontrols {
33
34class FrameControl final : public css::awt::XControlModel
35 , public css::lang::XConnectionPointContainer
36 , public BaseControl // This order is necessary for right initialization of m_aMutex!
39{
40public:
41
42 FrameControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
43
44 virtual ~FrameControl() override;
45
46 // XInterface
47
48 virtual css::uno::Any SAL_CALL queryInterface(
49 const css::uno::Type& aType
50 ) override;
51
59 virtual void SAL_CALL acquire() noexcept override;
60
68 virtual void SAL_CALL release() noexcept override;
69
70 // XTypeProvider
71
72 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
73
74 OUString SAL_CALL getImplementationName() override;
75
76 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
77
78 // XControl
79
80 virtual void SAL_CALL createPeer(
81 const css::uno::Reference< css::awt::XToolkit >& xToolkit ,
82 const css::uno::Reference< css::awt::XWindowPeer >& xParent
83 ) override;
84
85 virtual sal_Bool SAL_CALL setModel(
86 const css::uno::Reference< css::awt::XControlModel >& xModel
87 ) override;
88
89 virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override;
90
91 // XComponent
92
93 virtual void SAL_CALL dispose() override;
94
95 // XView
96
97 virtual sal_Bool SAL_CALL setGraphics(
98 const css::uno::Reference< css::awt::XGraphics >& xDevice
99 ) override;
100
101 virtual css::uno::Reference< css::awt::XGraphics > SAL_CALL getGraphics() override;
102
103 // XConnectionPointContainer
104
105 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getConnectionPointTypes() override;
106
107 virtual css::uno::Reference< css::lang::XConnectionPoint > SAL_CALL queryConnectionPoint(
108 const css::uno::Type& aType
109 ) override;
110
111 virtual void SAL_CALL advise(
112 const css::uno::Type& aType ,
113 const css::uno::Reference< css::uno::XInterface >& xListener
114 ) override;
115
116 virtual void SAL_CALL unadvise(
117 const css::uno::Type& aType ,
118 const css::uno::Reference< css::uno::XInterface >& xListener
119 ) override;
120
121private:
122
123 using OPropertySetHelper::getFastPropertyValue;
124
125 // OPropertySetHelper
126
127 virtual sal_Bool SAL_CALL convertFastPropertyValue(
128 css::uno::Any& rConvertedValue ,
129 css::uno::Any& rOldValue ,
130 sal_Int32 nHandle ,
131 const css::uno::Any& rValue
132 ) override;
133
134 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
135 sal_Int32 nHandle ,
136 const css::uno::Any& rValue
137 ) override;
138
139 virtual void SAL_CALL getFastPropertyValue( css::uno::Any& rValue ,
140 sal_Int32 nHandle ) const override;
141
142 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
143
144 // XPropertySet
145
146 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
147
148 // BaseControl
149
150 virtual css::awt::WindowDescriptor impl_getWindowDescriptor(
151 const css::uno::Reference< css::awt::XWindowPeer >& xParentPeer
152 ) override;
153
154 void impl_createFrame( const css::uno::Reference< css::awt::XWindowPeer >& xPeer ,
155 const OUString& sURL ,
156 const css::uno::Sequence< css::beans::PropertyValue >& seqArguments );
157
158 void impl_deleteFrame();
159
160 css::uno::Reference< css::frame::XFrame2 > m_xFrame;
162 css::uno::Sequence< css::beans::PropertyValue > m_seqLoaderArguments;
164
165};
166
167}
168
169
170/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl::Reference< OConnectionPointContainerHelper > m_aConnectionPointContainer
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &xToolkit, const css::uno::Reference< css::awt::XWindowPeer > &xParent) override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
get information about supported interfaces @seealso XTypeProvider
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual void SAL_CALL dispose() override
virtual void SAL_CALL unadvise(const css::uno::Type &aType, const css::uno::Reference< css::uno::XInterface > &xListener) override
virtual void SAL_CALL acquire() noexcept override
increment refcount @seealso XInterface @seealso release() @onerror A RuntimeException is thrown.
OUString SAL_CALL getImplementationName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
FrameControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual sal_Bool SAL_CALL setGraphics(const css::uno::Reference< css::awt::XGraphics > &xDevice) override
virtual ~FrameControl() override
virtual css::uno::Reference< css::lang::XConnectionPoint > SAL_CALL queryConnectionPoint(const css::uno::Type &aType) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getConnectionPointTypes() override
virtual css::awt::WindowDescriptor impl_getWindowDescriptor(const css::uno::Reference< css::awt::XWindowPeer > &xParentPeer) override
virtual void SAL_CALL advise(const css::uno::Type &aType, const css::uno::Reference< css::uno::XInterface > &xListener) override
virtual css::uno::Reference< css::awt::XGraphics > SAL_CALL getGraphics() override
virtual void SAL_CALL release() noexcept override
decrement refcount @seealso XInterface @seealso acquire() @onerror A RuntimeException is thrown.
void impl_createFrame(const css::uno::Reference< css::awt::XWindowPeer > &xPeer, const OUString &sURL, const css::uno::Sequence< css::beans::PropertyValue > &seqArguments)
css::uno::Reference< css::frame::XFrame2 > m_xFrame
css::uno::Sequence< css::beans::PropertyValue > m_seqLoaderArguments
virtual sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &xModel) override
virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override
sal_Int32 nHandle
Reference< XModel > xModel
unsigned char sal_Bool