25#include <com/sun/star/container/ContainerEvent.hpp>
26#include <com/sun/star/container/XContainerListener.hpp>
27#include <com/sun/star/awt/XControlContainer.hpp>
31using namespace ::
cppu;
58 Any aReturn ( ::cppu::queryInterface( rType ,
59 static_cast< XControlModel*
> (
this ) ,
60 static_cast< XControlContainer*
> (
this )
65 if ( aReturn.hasValue() )
81 static OTypeCollection ourTypeCollection(
86 return ourTypeCollection.getTypes();
92 const Reference< XWindowPeer >& xParent )
101 Sequence< Reference< XControl > > seqControlList =
getControls();
103 for (
auto& rxControl : asNonConstRange(seqControlList) )
105 rxControl->createPeer( xToolkit,
getPeer() );
123 return Reference< XControlModel >();
139 aObject.Source.set(
static_cast<XControlContainer*
>(
this), UNO_QUERY );
143 const Sequence< Reference< XControl > > seqCtrls =
getControls();
147 for ( Reference< XControl >
const & control : seqCtrls )
149 control->removeEventListener (
static_cast< XEventListener*
>(
static_cast< XWindowListener*
>(
this ) ) );
150 control->dispose ( );
161 Reference< XControl > xControl( rEvent.Source, UNO_QUERY );
171 if ( !rControl.is () )
181 aNewControl.
sName = rName;
188 aNewControl.
xControl->setContext (getXWeak());
189 aNewControl.
xControl->addEventListener (
static_cast< XEventListener*
>(
static_cast< XWindowListener*
>(
this ) ) );
201 if (!pInterfaceContainer)
208 aEvent.Element <<= rControl;
224 if ( !rControl.is() )
232 for (
size_t n = 0;
n < nControls;
n++ )
236 if ( rControl == pControl->
xControl )
239 pControl->
xControl->removeEventListener (
static_cast< XEventListener*
>(
static_cast< XWindowListener*
>(
this ) ));
240 pControl->
xControl->setContext ( Reference< XInterface > () );
248 if (pInterfaceContainer)
253 aEvent.Element <<= rControl;
273 Reference< XControlContainer > xContainer (
getContext(), UNO_QUERY );
275 if ( xContainer.is () )
277 xContainer->setStatusText ( rStatusText );
286 MutexGuard aGuard ( Mutex::getGlobalMutex() );
291 if ( rSearchControl.sName == rName )
295 return rSearchControl.xControl;
300 return Reference< XControl > ();
308 MutexGuard aGuard ( Mutex::getGlobalMutex() );
312 Sequence< Reference< XControl > > aDescriptor ( nControls );
313 Reference< XControl > * pDestination = aDescriptor.getArray ();
318 pDestination [
nCount++ ] = rCopyControl.xControl;
336 createPeer ( Reference< XToolkit > (), Reference< XWindowPeer > () );
344 WindowDescriptor aDescriptor;
346 aDescriptor.Type = WindowClass_CONTAINER;
347 aDescriptor.WindowServiceName =
"window";
348 aDescriptor.ParentIndex = -1;
349 aDescriptor.Parent = rParentPeer;
351 aDescriptor.WindowAttributes = 0;
css::uno::XInterface * next()
bool hasMoreElements() const
OInterfaceContainerHelper2 * getContainer(const css::uno::Type &rKey) const
void disposeAndClear(const css::lang::EventObject &rEvt)
mutable::osl::Mutex m_aMutex
virtual css::uno::Reference< css::awt::XControl > SAL_CALL getControl(const OUString &sName) override
virtual void SAL_CALL dispose() override
virtual void impl_paint(sal_Int32 nX, sal_Int32 nY, const css::uno::Reference< css::awt::XGraphics > &xGraphics) override
virtual css::awt::WindowDescriptor impl_getWindowDescriptor(const css::uno::Reference< css::awt::XWindowPeer > &xParentPeer) override
comphelper::OMultiTypeInterfaceContainerHelper2 m_aListeners
virtual ~BaseContainerControl() override
BaseContainerControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() 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
give answer, if interface is supported @descr The interfaces are searched by type.
virtual void SAL_CALL disposing(const css::lang::EventObject &rEvent) 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 setModel(const css::uno::Reference< css::awt::XControlModel > &xModel) override
virtual void SAL_CALL setVisible(sal_Bool bVisible) override
::std::vector< IMPL_ControlInfo > maControlInfoList
virtual void SAL_CALL setStatusText(const OUString &sStatusText) override
virtual css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls() override
virtual void SAL_CALL removeControl(const css::uno::Reference< css::awt::XControl > &xControl) override
virtual void SAL_CALL addControl(const OUString &sName, const css::uno::Reference< css::awt::XControl > &xControl) override
virtual void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &xToolkit, const css::uno::Reference< css::awt::XWindowPeer > &xParent) override
virtual void SAL_CALL setVisible(sal_Bool bVisible) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
get information about supported interfaces @seealso XTypeProvider
virtual css::uno::Reference< css::awt::XWindowPeer > SAL_CALL getPeer() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
give answer, if interface is supported @descr The interfaces are searched by type.
virtual void SAL_CALL dispose() override
virtual css::awt::Rectangle SAL_CALL getPosSize() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getContext() override
std::vector< Reference< css::datatransfer::clipboard::XClipboardListener > > m_aListeners
void SAL_CALL elementRemoved(const css::container::ContainerEvent &Event) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL elementInserted(const css::container::ContainerEvent &Event) override
css::uno::Reference< css::awt::XControl > xControl