Bump version to 6.0-36
[LibreOffice.git] / UnoControls / source / inc / framecontrol.hxx
blob204d04d94e9bafaa10a457a2ef64f8a814f2d123
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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"
33 // namespaces
35 namespace unocontrols{
37 // class
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
46 // public methods
48 public:
50 // construct/destruct
52 FrameControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
54 virtual ~FrameControl() override;
56 // XInterface
58 virtual css::uno::Any SAL_CALL queryInterface(
59 const css::uno::Type& aType
60 ) override;
62 /**_______________________________________________________________________________________________________
63 @short increment refcount
64 @seealso XInterface
65 @seealso release()
66 @onerror A RuntimeException is thrown.
69 virtual void SAL_CALL acquire() throw() override;
71 /**_______________________________________________________________________________________________________
72 @short decrement refcount
73 @seealso XInterface
74 @seealso acquire()
75 @onerror A RuntimeException is thrown.
78 virtual void SAL_CALL release() throw() override;
80 // XTypeProvider
82 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
84 // XAggregation
86 css::uno::Any SAL_CALL queryAggregation(
87 const css::uno::Type& aType
88 ) override;
90 OUString SAL_CALL getImplementationName() override;
92 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
94 // XControl
96 virtual void SAL_CALL createPeer(
97 const css::uno::Reference< css::awt::XToolkit >& xToolkit ,
98 const css::uno::Reference< css::awt::XWindowPeer >& xParent
99 ) override;
101 virtual sal_Bool SAL_CALL setModel(
102 const css::uno::Reference< css::awt::XControlModel >& xModel
103 ) override;
105 virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override;
107 // XComponent
109 virtual void SAL_CALL dispose() override;
111 // XView
113 virtual sal_Bool SAL_CALL setGraphics(
114 const css::uno::Reference< css::awt::XGraphics >& xDevice
115 ) override;
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
125 ) override;
127 virtual void SAL_CALL advise(
128 const css::uno::Type& aType ,
129 const css::uno::Reference< css::uno::XInterface >& xListener
130 ) override;
132 virtual void SAL_CALL unadvise(
133 const css::uno::Type& aType ,
134 const css::uno::Reference< css::uno::XInterface >& xListener
135 ) override;
137 // impl but public methods to register service!
139 static const css::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
141 static const OUString impl_getStaticImplementationName();
143 // protected methods
145 protected:
146 using OPropertySetHelper::getFastPropertyValue;
148 // OPropertySetHelper
150 virtual sal_Bool SAL_CALL convertFastPropertyValue(
151 css::uno::Any& rConvertedValue ,
152 css::uno::Any& rOldValue ,
153 sal_Int32 nHandle ,
154 const css::uno::Any& rValue
155 ) override;
157 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
158 sal_Int32 nHandle ,
159 const css::uno::Any& rValue
160 ) override;
162 virtual void SAL_CALL getFastPropertyValue( css::uno::Any& rValue ,
163 sal_Int32 nHandle ) const override;
165 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
167 // XPropertySet
169 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
171 // BaseControl
173 virtual css::awt::WindowDescriptor* impl_getWindowDescriptor(
174 const css::uno::Reference< css::awt::XWindowPeer >& xParentPeer
175 ) override;
177 // private methods
179 private:
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();
187 // private variables
189 private:
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: */