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 #include <sal/config.h>
24 #include <sal/types.h>
25 #include <vcl/svapp.hxx>
26 #include <controls/dialogcontrol.hxx>
27 #include <controls/geometrycontrolmodel.hxx>
28 #include <helper/property.hxx>
29 #include <helper/servicenames.hxx>
30 #include <com/sun/star/awt/PosSize.hpp>
31 #include <com/sun/star/awt/WindowAttribute.hpp>
32 #include <com/sun/star/uno/XComponentContext.hpp>
33 #include <cppuhelper/supportsservice.hxx>
34 #include <cppuhelper/typeprovider.hxx>
35 #include <cppuhelper/queryinterface.hxx>
36 #include <cppuhelper/weak.hxx>
37 #include <tools/debug.hxx>
38 #include <comphelper/sequence.hxx>
39 #include <vcl/outdev.hxx>
41 #include <vcl/image.hxx>
42 #include <cppuhelper/implbase.hxx>
43 #include <unordered_map>
45 #include <vcl/tabctrl.hxx>
46 #include <toolkit/controls/unocontrols.hxx>
48 #include <awt/vclxwindows.hxx>
49 #include <helper/unopropertyarrayhelper.hxx>
50 #include "controlmodelcontainerbase_internal.hxx"
53 using namespace ::com::sun::star
;
54 using namespace ::com::sun::star::uno
;
55 using namespace ::com::sun::star::awt
;
56 using namespace ::com::sun::star::lang
;
57 using namespace ::com::sun::star::container
;
58 using namespace ::com::sun::star::beans
;
60 constexpr OUStringLiteral PROPERTY_DIALOGSOURCEURL
= u
"DialogSourceURL";
61 constexpr OUStringLiteral PROPERTY_IMAGEURL
= u
"ImageURL";
62 constexpr OUStringLiteral PROPERTY_GRAPHIC
= u
"Graphic";
65 // we probably will need both a hash of control models and hash of controls
66 // => use some template magic
70 template< typename T
>
71 class SimpleNamedThingContainer
: public ::cppu::WeakImplHelper
< container::XNameContainer
>
73 std::unordered_map
< OUString
, Reference
< T
> > things
;
76 // css::container::XNameContainer, XNameReplace, XNameAccess
77 virtual void SAL_CALL
replaceByName( const OUString
& aName
, const Any
& aElement
) override
79 std::scoped_lock
aGuard( m_aMutex
);
80 auto it
= things
.find( aName
);
81 if ( it
== things
.end() )
82 throw NoSuchElementException();
83 Reference
< T
> xElement
;
84 if ( ! ( aElement
>>= xElement
) )
85 throw IllegalArgumentException();
86 it
->second
= std::move(xElement
);
88 virtual Any SAL_CALL
getByName( const OUString
& aName
) override
90 std::scoped_lock
aGuard( m_aMutex
);
91 auto it
= things
.find( aName
);
92 if ( it
== things
.end() )
93 throw NoSuchElementException();
94 return uno::Any( it
->second
);
96 virtual Sequence
< OUString
> SAL_CALL
getElementNames( ) override
98 std::scoped_lock
aGuard( m_aMutex
);
99 return comphelper::mapKeysToSequence( things
);
101 virtual sal_Bool SAL_CALL
hasByName( const OUString
& aName
) override
103 std::scoped_lock
aGuard( m_aMutex
);
104 return ( things
.find( aName
) != things
.end() );
106 virtual void SAL_CALL
insertByName( const OUString
& aName
, const Any
& aElement
) override
108 std::scoped_lock
aGuard( m_aMutex
);
109 auto it
= things
.find( aName
);
110 if ( it
!= things
.end() )
111 throw ElementExistException();
112 Reference
< T
> xElement
;
113 if ( ! ( aElement
>>= xElement
) )
114 throw IllegalArgumentException();
115 things
[ aName
] = std::move(xElement
);
117 virtual void SAL_CALL
removeByName( const OUString
& aName
) override
119 std::scoped_lock
aGuard( m_aMutex
);
120 if ( things
.erase( aName
) == 0 )
121 throw NoSuchElementException();
123 virtual Type SAL_CALL
getElementType( ) override
125 return cppu::UnoType
<T
>::get();
127 virtual sal_Bool SAL_CALL
hasElements( ) override
129 std::scoped_lock
aGuard( m_aMutex
);
130 return !things
.empty();
134 class UnoControlDialogModel
: public ControlModelContainerBase
137 css::uno::Reference
< css::graphic::XGraphicObject
> mxGrfObj
;
138 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
139 ::cppu::IPropertyArrayHelper
& getInfoHelper() override
;
140 // ::comphelper::OPropertySetHelper
141 void setFastPropertyValue_NoBroadcast( std::unique_lock
<std::mutex
>& rGuard
, sal_Int32 nHandle
, const css::uno::Any
& rValue
) override
;
143 explicit UnoControlDialogModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
144 UnoControlDialogModel( const UnoControlDialogModel
& rModel
);
146 rtl::Reference
<UnoControlModel
> Clone() const override
;
147 // css::beans::XMultiPropertySet
148 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
150 // css::io::XPersistObject
151 OUString SAL_CALL
getServiceName() override
;
154 OUString SAL_CALL
getImplementationName() override
155 { return u
"stardiv.Toolkit.UnoControlDialogModel"_ustr
; }
157 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
159 auto s(ControlModelContainerBase::getSupportedServiceNames());
160 s
.realloc(s
.getLength() + 2);
161 auto ps
= s
.getArray();
162 ps
[s
.getLength() - 2] = "com.sun.star.awt.UnoControlDialogModel";
163 ps
[s
.getLength() - 1] = "stardiv.vcl.controlmodel.Dialog";
168 UnoControlDialogModel::UnoControlDialogModel( const Reference
< XComponentContext
>& rxContext
)
169 :ControlModelContainerBase( rxContext
)
171 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR
);
172 // ImplRegisterProperty( BASEPROPERTY_BORDER );
173 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL
);
174 ImplRegisterProperty( BASEPROPERTY_ENABLED
);
175 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR
);
176 // ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
177 ImplRegisterProperty( BASEPROPERTY_HELPTEXT
);
178 ImplRegisterProperty( BASEPROPERTY_HELPURL
);
179 ImplRegisterProperty( BASEPROPERTY_TITLE
);
180 ImplRegisterProperty( BASEPROPERTY_SIZEABLE
);
181 ImplRegisterProperty( BASEPROPERTY_DESKTOP_AS_PARENT
);
182 ImplRegisterProperty( BASEPROPERTY_DECORATION
);
183 ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL
);
184 ImplRegisterProperty( BASEPROPERTY_GRAPHIC
);
185 ImplRegisterProperty( BASEPROPERTY_IMAGEURL
);
186 ImplRegisterProperty( BASEPROPERTY_HSCROLL
);
187 ImplRegisterProperty( BASEPROPERTY_VSCROLL
);
188 ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH
);
189 ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT
);
190 ImplRegisterProperty( BASEPROPERTY_SCROLLTOP
);
191 ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT
);
195 ImplRegisterProperty( BASEPROPERTY_MOVEABLE
, aBool
);
196 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE
, aBool
);
197 // #TODO separate class for 'UserForm' ( instead of re-using Dialog ? )
198 uno::Reference
< XNameContainer
> xNameCont
= new SimpleNamedThingContainer
< XControlModel
>;
199 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES
, uno::Any( xNameCont
) );
202 UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel
& rModel
)
203 : ControlModelContainerBase( rModel
)
205 // need to clone BASEPROPERTY_USERFORMCONTAINEES too
206 Reference
< XNameContainer
> xSrcNameCont( const_cast< UnoControlDialogModel
& >(rModel
).getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES
) ), UNO_QUERY
);
207 Reference
<XNameContainer
> xNameCont( new SimpleNamedThingContainer
< XControlModel
> );
209 const uno::Sequence
< OUString
> sNames
= xSrcNameCont
->getElementNames();
210 for ( OUString
const & name
: sNames
)
212 if ( xSrcNameCont
->hasByName( name
) )
213 xNameCont
->insertByName( name
, xSrcNameCont
->getByName( name
) );
215 std::unique_lock
aGuard(m_aMutex
);
216 setFastPropertyValue_NoBroadcast( aGuard
, BASEPROPERTY_USERFORMCONTAINEES
, Any( xNameCont
) );
219 rtl::Reference
<UnoControlModel
> UnoControlDialogModel::Clone() const
221 // clone the container itself
222 rtl::Reference
<UnoControlDialogModel
> pClone
= new UnoControlDialogModel( *this );
230 OUString
UnoControlDialogModel::getServiceName( )
232 return u
"stardiv.vcl.controlmodel.Dialog"_ustr
;
235 Any
UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId
) const
241 case BASEPROPERTY_DEFAULTCONTROL
:
242 aAny
<<= sServiceName_UnoControlDialog
;
244 case BASEPROPERTY_SCROLLWIDTH
:
245 case BASEPROPERTY_SCROLLHEIGHT
:
246 case BASEPROPERTY_SCROLLTOP
:
247 case BASEPROPERTY_SCROLLLEFT
:
248 aAny
<<= sal_Int32(0);
251 aAny
= UnoControlModel::ImplGetDefaultValue( nPropId
);
257 ::cppu::IPropertyArrayHelper
& UnoControlDialogModel::getInfoHelper()
259 static UnoPropertyArrayHelper
aHelper( ImplGetPropertyIds() );
264 Reference
< XPropertySetInfo
> UnoControlDialogModel::getPropertySetInfo( )
266 static Reference
< XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
270 void UnoControlDialogModel::setFastPropertyValue_NoBroadcast( std::unique_lock
<std::mutex
>& rGuard
, sal_Int32 nHandle
, const css::uno::Any
& rValue
)
272 ControlModelContainerBase::setFastPropertyValue_NoBroadcast( rGuard
, nHandle
, rValue
);
275 if ( nHandle
== BASEPROPERTY_IMAGEURL
&& ImplHasProperty( BASEPROPERTY_GRAPHIC
) )
278 uno::Reference
<graphic::XGraphic
> xGraphic
;
279 if (rValue
>>= sImageURL
)
281 setFastPropertyValueImpl(rGuard
,
282 BASEPROPERTY_GRAPHIC
,
283 uno::Any(ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow(
284 mxGrfObj
, sImageURL
)));
286 else if (rValue
>>= xGraphic
)
288 setFastPropertyValueImpl(rGuard
, BASEPROPERTY_GRAPHIC
, uno::Any(xGraphic
));
292 catch( const css::uno::Exception
& )
294 TOOLS_WARN_EXCEPTION( "toolkit", "caught an exception while setting ImageURL properties" );
301 // = class UnoDialogControl
304 UnoDialogControl::UnoDialogControl( const uno::Reference
< uno::XComponentContext
>& rxContext
)
305 :UnoDialogControl_Base( rxContext
)
306 ,maTopWindowListeners( *this )
307 ,mbWindowListener(false)
309 maComponentInfos
.nWidth
= 300;
310 maComponentInfos
.nHeight
= 450;
313 UnoDialogControl::~UnoDialogControl()
317 OUString
UnoDialogControl::GetComponentServiceName() const
320 bool bDecoration( true );
321 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION
)) >>= bDecoration
;
323 return u
"Dialog"_ustr
;
325 return u
"TabPage"_ustr
;
328 void UnoDialogControl::dispose()
330 SolarMutexGuard aGuard
;
333 aEvt
.Source
= getXWeak();
334 maTopWindowListeners
.disposeAndClear( aEvt
);
335 ControlContainerBase::dispose();
338 void SAL_CALL
UnoDialogControl::disposing(
339 const EventObject
& Source
)
341 ControlContainerBase::disposing( Source
);
344 sal_Bool
UnoDialogControl::setModel( const Reference
< XControlModel
>& rxModel
)
346 // #Can we move all the Resource stuff to the ControlContainerBase ?
347 SolarMutexGuard aGuard
;
348 bool bRet
= ControlContainerBase::setModel( rxModel
);
349 ImplStartListingForResourceEvents();
353 void UnoDialogControl::createPeer( const Reference
< XToolkit
> & rxToolkit
, const Reference
< XWindowPeer
> & rParentPeer
)
355 SolarMutexGuard aGuard
;
357 UnoControlContainer::createPeer( rxToolkit
, rParentPeer
);
359 Reference
< XTopWindow
> xTW( getPeer(), UNO_QUERY
);
363 xTW
->setMenuBar( mxMenuBar
);
365 if ( !mbWindowListener
)
367 Reference
< XWindowListener
> xWL(this);
368 addWindowListener( xWL
);
369 mbWindowListener
= true;
372 if ( maTopWindowListeners
.getLength() )
373 xTW
->addTopWindowListener( &maTopWindowListeners
);
374 // there must be a better way than doing this, we can't
375 // process the scrolltop & scrollleft in XDialog because
376 // the children haven't been added when those props are applied
377 ImplSetPeerProperty( GetPropertyName( BASEPROPERTY_SCROLLTOP
), ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_SCROLLTOP
) ) );
378 ImplSetPeerProperty( GetPropertyName( BASEPROPERTY_SCROLLLEFT
), ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_SCROLLLEFT
) ) );
381 OUString
UnoDialogControl::getImplementationName()
383 return u
"stardiv.Toolkit.UnoDialogControl"_ustr
;
386 sal_Bool
UnoDialogControl::supportsService(OUString
const & ServiceName
)
388 return cppu::supportsService(this, ServiceName
);
391 css::uno::Sequence
<OUString
> UnoDialogControl::getSupportedServiceNames()
393 return css::uno::Sequence
<OUString
>{
394 u
"com.sun.star.awt.UnoControlDialog"_ustr
,
395 u
"stardiv.vcl.control.Dialog"_ustr
};
398 void UnoDialogControl::PrepareWindowDescriptor( css::awt::WindowDescriptor
& rDesc
)
400 UnoControlContainer::PrepareWindowDescriptor( rDesc
);
401 bool bDecoration( true );
402 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION
)) >>= bDecoration
;
405 // Now we have to manipulate the WindowDescriptor
406 rDesc
.WindowAttributes
= rDesc
.WindowAttributes
| css::awt::WindowAttribute::NODECORATION
;
409 // We have to set the graphic property before the peer
410 // will be created. Otherwise the properties will be copied
411 // into the peer via propertiesChangeEvents. As the order of
412 // can lead to overwrites we have to set the graphic property
413 // before the propertiesChangeEvents are sent!
415 Reference
< graphic::XGraphic
> xGraphic
;
416 if (( ImplGetPropertyValue( PROPERTY_IMAGEURL
) >>= aImageURL
) &&
417 ( !aImageURL
.isEmpty() ))
419 OUString absoluteUrl
= getPhysicalLocation(ImplGetPropertyValue(PROPERTY_DIALOGSOURCEURL
), uno::Any(aImageURL
));
420 xGraphic
= ImageHelper::getGraphicFromURL_nothrow( absoluteUrl
, u
""_ustr
);
421 ImplSetPropertyValue( PROPERTY_GRAPHIC
, uno::Any( xGraphic
), true );
425 void UnoDialogControl::addTopWindowListener( const Reference
< XTopWindowListener
>& rxListener
)
427 maTopWindowListeners
.addInterface( rxListener
);
428 if( getPeer().is() && maTopWindowListeners
.getLength() == 1 )
430 Reference
< XTopWindow
> xTW( getPeer(), UNO_QUERY
);
431 xTW
->addTopWindowListener( &maTopWindowListeners
);
435 void UnoDialogControl::removeTopWindowListener( const Reference
< XTopWindowListener
>& rxListener
)
437 if( getPeer().is() && maTopWindowListeners
.getLength() == 1 )
439 Reference
< XTopWindow
> xTW( getPeer(), UNO_QUERY
);
440 xTW
->removeTopWindowListener( &maTopWindowListeners
);
442 maTopWindowListeners
.removeInterface( rxListener
);
445 void UnoDialogControl::toFront( )
447 SolarMutexGuard aGuard
;
448 if ( getPeer().is() )
450 Reference
< XTopWindow
> xTW( getPeer(), UNO_QUERY
);
456 void UnoDialogControl::toBack( )
458 SolarMutexGuard aGuard
;
459 if ( getPeer().is() )
461 Reference
< XTopWindow
> xTW( getPeer(), UNO_QUERY
);
467 void UnoDialogControl::setMenuBar( const Reference
< XMenuBar
>& rxMenuBar
)
469 SolarMutexGuard aGuard
;
470 mxMenuBar
= rxMenuBar
;
471 if ( getPeer().is() )
473 Reference
< XTopWindow
> xTW( getPeer(), UNO_QUERY
);
475 xTW
->setMenuBar( mxMenuBar
);
478 static ::Size
ImplMapPixelToAppFont( OutputDevice
const * pOutDev
, const ::Size
& aSize
)
480 ::Size aTmp
= pOutDev
->PixelToLogic(aSize
, MapMode(MapUnit::MapAppFont
));
483 // css::awt::XWindowListener
484 void SAL_CALL
UnoDialogControl::windowResized( const css::awt::WindowEvent
& e
)
486 OutputDevice
*pOutDev
= Application::GetDefaultDevice();
487 DBG_ASSERT( pOutDev
, "Missing Default Device!" );
488 if ( !pOutDev
|| mbSizeModified
)
491 // Currently we are simply using MapUnit::MapAppFont
492 ::Size
aAppFontSize( e
.Width
, e
.Height
);
494 Reference
< XControl
> xDialogControl( *this, UNO_QUERY_THROW
);
495 Reference
< XDevice
> xDialogDevice( xDialogControl
->getPeer(), UNO_QUERY
);
496 OSL_ENSURE( xDialogDevice
.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
498 // #i87592 In design mode the drawing layer works with sizes with decoration.
499 // Therefore we have to subtract them before writing back to the properties (model).
500 if ( xDialogDevice
.is() && mbDesignMode
)
502 DeviceInfo
aDeviceInfo( xDialogDevice
->getInfo() );
503 aAppFontSize
.AdjustWidth( -(aDeviceInfo
.LeftInset
+ aDeviceInfo
.RightInset
) );
504 aAppFontSize
.AdjustHeight( -(aDeviceInfo
.TopInset
+ aDeviceInfo
.BottomInset
) );
507 aAppFontSize
= ImplMapPixelToAppFont( pOutDev
, aAppFontSize
);
509 // Remember that changes have been done by listener. No need to
510 // update the position because of property change event.
511 mbSizeModified
= true;
512 // Properties in a sequence must be sorted!
513 Sequence
< OUString
> aProps
{ u
"Height"_ustr
, u
"Width"_ustr
};
514 Sequence
< Any
> aValues
{
516 std::clamp(aAppFontSize
.Height(), tools::Long(SAL_MIN_INT32
), tools::Long(SAL_MAX_INT32
)))),
518 std::clamp(aAppFontSize
.Width(), tools::Long(SAL_MIN_INT32
), tools::Long(SAL_MAX_INT32
))))
521 ImplSetPropertyValues( aProps
, aValues
, true );
522 mbSizeModified
= false;
526 void SAL_CALL
UnoDialogControl::windowMoved( const css::awt::WindowEvent
& e
)
528 OutputDevice
*pOutDev
= Application::GetDefaultDevice();
529 DBG_ASSERT( pOutDev
, "Missing Default Device!" );
530 if ( !pOutDev
|| mbPosModified
)
533 // Currently we are simply using MapUnit::MapAppFont
534 ::Size
aTmp( e
.X
, e
.Y
);
535 aTmp
= ImplMapPixelToAppFont( pOutDev
, aTmp
);
537 // Remember that changes have been done by listener. No need to
538 // update the position because of property change event.
539 mbPosModified
= true;
540 Sequence
< OUString
> aProps
{ u
"PositionX"_ustr
, u
"PositionY"_ustr
};
541 Sequence
< Any
> aValues
{
543 std::clamp(aTmp
.Width(), tools::Long(SAL_MIN_INT32
), tools::Long(SAL_MAX_INT32
)))),
545 std::clamp(aTmp
.Height(), tools::Long(SAL_MIN_INT32
), tools::Long(SAL_MAX_INT32
))))
548 ImplSetPropertyValues( aProps
, aValues
, true );
549 mbPosModified
= false;
553 void SAL_CALL
UnoDialogControl::windowShown( const EventObject
& ) {}
555 void SAL_CALL
UnoDialogControl::windowHidden( const EventObject
& ) {}
557 void SAL_CALL
UnoDialogControl::endDialog( ::sal_Int32 i_result
)
559 Reference
< XDialog2
> xPeerDialog( getPeer(), UNO_QUERY
);
560 if ( xPeerDialog
.is() )
561 xPeerDialog
->endDialog( i_result
);
564 void SAL_CALL
UnoDialogControl::setHelpId( const OUString
& i_id
)
566 Reference
< XDialog2
> xPeerDialog( getPeer(), UNO_QUERY
);
567 if ( xPeerDialog
.is() )
568 xPeerDialog
->setHelpId( i_id
);
571 void UnoDialogControl::setTitle( const OUString
& Title
)
573 SolarMutexGuard aGuard
;
574 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TITLE
), uno::Any(Title
), true );
577 OUString
UnoDialogControl::getTitle()
579 SolarMutexGuard aGuard
;
580 return ImplGetPropertyValue_UString( BASEPROPERTY_TITLE
);
583 sal_Int16
UnoDialogControl::execute()
585 SolarMutexGuard aGuard
;
586 sal_Int16 nDone
= -1;
587 if ( getPeer().is() )
589 Reference
< XDialog
> xDlg( getPeer(), UNO_QUERY
);
592 GetComponentInfos().bVisible
= true;
593 nDone
= xDlg
->execute();
594 GetComponentInfos().bVisible
= false;
600 void UnoDialogControl::endExecute()
602 SolarMutexGuard aGuard
;
603 if ( getPeer().is() )
605 Reference
< XDialog
> xDlg( getPeer(), UNO_QUERY
);
609 GetComponentInfos().bVisible
= false;
615 void SAL_CALL
UnoDialogControl::modified(
616 const lang::EventObject
& /*rEvent*/ )
618 ImplUpdateResourceResolver();
621 void UnoDialogControl::ImplModelPropertiesChanged( const Sequence
< PropertyChangeEvent
>& rEvents
)
623 for( const PropertyChangeEvent
& rEvt
: rEvents
)
625 Reference
< XControlModel
> xModel( rEvt
.Source
, UNO_QUERY
);
626 bool bOwnModel
= xModel
.get() == getModel().get();
627 if (bOwnModel
&& rEvt
.PropertyName
== "ImageURL" && !ImplHasProperty(BASEPROPERTY_GRAPHIC
))
630 Reference
< graphic::XGraphic
> xGraphic
;
631 if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL
) ) >>= aImageURL
) &&
632 ( !aImageURL
.isEmpty() ))
634 OUString absoluteUrl
= getPhysicalLocation(ImplGetPropertyValue(GetPropertyName(BASEPROPERTY_DIALOGSOURCEURL
)), uno::Any(aImageURL
));
635 xGraphic
= ImageHelper::getGraphicFromURL_nothrow( absoluteUrl
, u
""_ustr
);
637 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC
), uno::Any( xGraphic
), true );
640 else if (bOwnModel
&& rEvt
.PropertyName
== "Graphic")
642 uno::Reference
<graphic::XGraphic
> xGraphic
;
643 if (ImplGetPropertyValue(u
"Graphic"_ustr
) >>= xGraphic
)
645 ImplSetPropertyValue(u
"Graphic"_ustr
, uno::Any(xGraphic
), true);
650 ControlContainerBase::ImplModelPropertiesChanged(rEvents
);
655 UnoMultiPageControl::UnoMultiPageControl( const uno::Reference
< uno::XComponentContext
>& rxContext
) : ControlContainerBase(rxContext
), maTabListeners( *this )
657 maComponentInfos
.nWidth
= 280;
658 maComponentInfos
.nHeight
= 400;
661 UnoMultiPageControl::~UnoMultiPageControl()
666 void SAL_CALL
UnoMultiPageControl::inserted( SAL_UNUSED_PARAMETER ::sal_Int32
)
669 void SAL_CALL
UnoMultiPageControl::removed( SAL_UNUSED_PARAMETER ::sal_Int32
)
672 void SAL_CALL
UnoMultiPageControl::changed( SAL_UNUSED_PARAMETER ::sal_Int32
,
673 SAL_UNUSED_PARAMETER
const Sequence
< NamedValue
>& )
676 void SAL_CALL
UnoMultiPageControl::activated( ::sal_Int32 ID
)
678 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE
), uno::Any( ID
), false );
681 void SAL_CALL
UnoMultiPageControl::deactivated( SAL_UNUSED_PARAMETER ::sal_Int32
)
684 void SAL_CALL
UnoMultiPageControl::disposing(const EventObject
&)
688 void SAL_CALL
UnoMultiPageControl::dispose()
690 lang::EventObject aEvt
;
691 aEvt
.Source
= getXWeak();
692 maTabListeners
.disposeAndClear( aEvt
);
693 ControlContainerBase::dispose();
696 // css::awt::XSimpleTabController
697 ::sal_Int32 SAL_CALL
UnoMultiPageControl::insertTab()
699 Reference
< XSimpleTabController
> xMultiPage( getPeer(), UNO_QUERY_THROW
);
700 return xMultiPage
->insertTab();
703 void SAL_CALL
UnoMultiPageControl::removeTab( ::sal_Int32 ID
)
705 Reference
< XSimpleTabController
> xMultiPage( getPeer(), UNO_QUERY_THROW
);
706 xMultiPage
->removeTab( ID
);
709 void SAL_CALL
UnoMultiPageControl::setTabProps( ::sal_Int32 ID
, const Sequence
< NamedValue
>& Properties
)
711 Reference
< XSimpleTabController
> xMultiPage( getPeer(), UNO_QUERY_THROW
);
712 xMultiPage
->setTabProps( ID
, Properties
);
715 Sequence
< NamedValue
> SAL_CALL
UnoMultiPageControl::getTabProps( ::sal_Int32 ID
)
717 Reference
< XSimpleTabController
> xMultiPage( getPeer(), UNO_QUERY_THROW
);
718 return xMultiPage
->getTabProps( ID
);
721 void SAL_CALL
UnoMultiPageControl::activateTab( ::sal_Int32 ID
)
723 Reference
< XSimpleTabController
> xMultiPage( getPeer(), UNO_QUERY_THROW
);
724 xMultiPage
->activateTab( ID
);
725 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE
), uno::Any( ID
), true );
729 ::sal_Int32 SAL_CALL
UnoMultiPageControl::getActiveTabID()
731 Reference
< XSimpleTabController
> xMultiPage( getPeer(), UNO_QUERY_THROW
);
732 return xMultiPage
->getActiveTabID();
735 void SAL_CALL
UnoMultiPageControl::addTabListener( const Reference
< XTabListener
>& Listener
)
737 maTabListeners
.addInterface( Listener
);
738 Reference
< XSimpleTabController
> xMultiPage( getPeer(), UNO_QUERY
);
739 if ( xMultiPage
.is() && maTabListeners
.getLength() == 1 )
740 xMultiPage
->addTabListener( &maTabListeners
);
743 void SAL_CALL
UnoMultiPageControl::removeTabListener( const Reference
< XTabListener
>& Listener
)
745 Reference
< XSimpleTabController
> xMultiPage( getPeer(), UNO_QUERY
);
746 if ( xMultiPage
.is() && maTabListeners
.getLength() == 1 )
747 xMultiPage
->removeTabListener( &maTabListeners
);
748 maTabListeners
.removeInterface( Listener
);
751 IMPL_IMPLEMENTATION_ID( UnoMultiPageControl
)
753 // lang::XTypeProvider
754 css::uno::Sequence
< css::uno::Type
> UnoMultiPageControl::getTypes()
756 static const ::cppu::OTypeCollection
aTypeList(
757 cppu::UnoType
<css::lang::XTypeProvider
>::get(),
758 cppu::UnoType
<awt::XSimpleTabController
>::get(),
759 cppu::UnoType
<awt::XTabListener
>::get(),
760 ControlContainerBase::getTypes()
762 return aTypeList
.getTypes();
766 uno::Any
UnoMultiPageControl::queryAggregation( const uno::Type
& rType
)
768 uno::Any aRet
= ::cppu::queryInterface( rType
,
769 static_cast< awt::XTabListener
* >(this),
770 static_cast< awt::XSimpleTabController
* >(this) );
771 return (aRet
.hasValue() ? aRet
: ControlContainerBase::queryAggregation( rType
));
774 OUString
UnoMultiPageControl::GetComponentServiceName() const
776 bool bDecoration( true );
777 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION
)) >>= bDecoration
;
779 return u
"tabcontrol"_ustr
;
780 // Hopefully we can tweak the tabcontrol to display without tabs
781 return u
"tabcontrolnotabs"_ustr
;
784 void UnoMultiPageControl::bindPage( const uno::Reference
< awt::XControl
>& _rxControl
)
786 uno::Reference
< awt::XWindowPeer
> xPage( _rxControl
->getPeer() );
787 uno::Reference
< awt::XSimpleTabController
> xTabCntrl( getPeer(), uno::UNO_QUERY
);
788 uno::Reference
< beans::XPropertySet
> xProps( _rxControl
->getModel(), uno::UNO_QUERY
);
790 VCLXTabPage
* pXPage
= dynamic_cast< VCLXTabPage
* >( xPage
.get() );
791 TabPage
* pPage
= pXPage
? pXPage
->getTabPage() : nullptr;
792 if ( xTabCntrl
.is() && pPage
)
794 VCLXMultiPage
* pXTab
= dynamic_cast< VCLXMultiPage
* >( xTabCntrl
.get() );
798 xProps
->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE
) ) >>= sTitle
;
799 pXTab
->insertTab( pPage
, sTitle
);
805 void UnoMultiPageControl::createPeer( const Reference
< XToolkit
> & rxToolkit
, const Reference
< XWindowPeer
> & rParentPeer
)
807 SolarMutexGuard aSolarGuard
;
809 UnoControlContainer::createPeer( rxToolkit
, rParentPeer
);
811 const uno::Sequence
< uno::Reference
< awt::XControl
> > aCtrls
= getControls();
812 for( const auto& rCtrl
: aCtrls
)
814 sal_Int32
nActiveTab(0);
815 Reference
< XPropertySet
> xMultiProps( getModel(), UNO_QUERY
);
816 xMultiProps
->getPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE
) ) >>= nActiveTab
;
818 uno::Reference
< awt::XSimpleTabController
> xTabCntrl( getPeer(), uno::UNO_QUERY
);
819 if ( xTabCntrl
.is() )
821 xTabCntrl
->addTabListener( this );
822 if ( nActiveTab
&& aCtrls
.hasElements() ) // Ensure peer is initialise with correct activated tab
824 xTabCntrl
->activateTab( nActiveTab
);
825 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE
), uno::Any( nActiveTab
), true );
830 void UnoMultiPageControl::impl_createControlPeerIfNecessary( const uno::Reference
< awt::XControl
>& _rxControl
)
832 OSL_PRECOND( _rxControl
.is(), "UnoMultiPageControl::impl_createControlPeerIfNecessary: invalid control, this will crash!" );
834 // if the container already has a peer, then also create a peer for the control
835 uno::Reference
< awt::XWindowPeer
> xMyPeer( getPeer() );
839 _rxControl
->createPeer( nullptr, xMyPeer
);
840 bindPage( _rxControl
);
841 ImplActivateTabControllers();
846 // ------------- UnoMultiPageModel -----------------
848 UnoMultiPageModel::UnoMultiPageModel( const Reference
< XComponentContext
>& rxContext
) : ControlModelContainerBase( rxContext
)
850 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL
);
851 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR
);
852 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE
);
853 ImplRegisterProperty( BASEPROPERTY_ENABLED
);
855 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR
);
856 ImplRegisterProperty( BASEPROPERTY_HELPTEXT
);
857 ImplRegisterProperty( BASEPROPERTY_HELPURL
);
858 ImplRegisterProperty( BASEPROPERTY_SIZEABLE
);
859 //ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
860 ImplRegisterProperty( BASEPROPERTY_MULTIPAGEVALUE
);
861 ImplRegisterProperty( BASEPROPERTY_PRINTABLE
);
862 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES
);
866 ImplRegisterProperty( BASEPROPERTY_MOVEABLE
, aBool
);
867 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE
, aBool
);
868 ImplRegisterProperty( BASEPROPERTY_DECORATION
, aBool
);
869 // MultiPage Control has the tab stop property. And the default value is True.
870 ImplRegisterProperty( BASEPROPERTY_TABSTOP
, aBool
);
872 uno::Reference
< XNameContainer
> xNameCont
= new SimpleNamedThingContainer
< XControlModel
>;
873 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES
, uno::Any( xNameCont
) );
876 UnoMultiPageModel::~UnoMultiPageModel()
880 rtl::Reference
<UnoControlModel
> UnoMultiPageModel::Clone() const
882 // clone the container itself
883 rtl::Reference
<UnoMultiPageModel
> pClone
= new UnoMultiPageModel( *this );
884 Clone_Impl( *pClone
);
888 OUString
UnoMultiPageModel::getServiceName()
890 return u
"com.sun.star.awt.UnoMultiPageModel"_ustr
;
893 uno::Any
UnoMultiPageModel::ImplGetDefaultValue( sal_uInt16 nPropId
) const
895 if ( nPropId
== BASEPROPERTY_DEFAULTCONTROL
)
897 return uno::Any( u
"com.sun.star.awt.UnoControlMultiPage"_ustr
);
899 return ControlModelContainerBase::ImplGetDefaultValue( nPropId
);
902 ::cppu::IPropertyArrayHelper
& UnoMultiPageModel::getInfoHelper()
904 static UnoPropertyArrayHelper
aHelper( ImplGetPropertyIds() );
908 // beans::XMultiPropertySet
909 uno::Reference
< beans::XPropertySetInfo
> UnoMultiPageModel::getPropertySetInfo( )
911 static uno::Reference
< beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
915 void UnoMultiPageModel::insertByName( const OUString
& aName
, const Any
& aElement
)
917 Reference
< XServiceInfo
> xInfo
;
921 throw IllegalArgumentException();
923 // Only a Page model can be inserted into the multipage
924 if ( !xInfo
->supportsService( u
"com.sun.star.awt.UnoPageModel"_ustr
) )
925 throw IllegalArgumentException();
927 return ControlModelContainerBase::insertByName( aName
, aElement
);
931 sal_Bool SAL_CALL
UnoMultiPageModel::getGroupControl( )
938 UnoPageControl::UnoPageControl( const uno::Reference
< uno::XComponentContext
>& rxContext
) : ControlContainerBase(rxContext
)
940 maComponentInfos
.nWidth
= 280;
941 maComponentInfos
.nHeight
= 400;
944 UnoPageControl::~UnoPageControl()
948 OUString
UnoPageControl::GetComponentServiceName() const
950 return u
"tabpage"_ustr
;
954 // ------------- UnoPageModel -----------------
956 UnoPageModel::UnoPageModel( const Reference
< XComponentContext
>& rxContext
) : ControlModelContainerBase( rxContext
)
958 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL
);
959 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR
);
960 ImplRegisterProperty( BASEPROPERTY_ENABLED
);
961 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE
);
963 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR
);
964 ImplRegisterProperty( BASEPROPERTY_HELPTEXT
);
965 ImplRegisterProperty( BASEPROPERTY_HELPURL
);
966 ImplRegisterProperty( BASEPROPERTY_TITLE
);
967 ImplRegisterProperty( BASEPROPERTY_SIZEABLE
);
968 ImplRegisterProperty( BASEPROPERTY_PRINTABLE
);
969 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES
);
970 // ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
974 ImplRegisterProperty( BASEPROPERTY_MOVEABLE
, aBool
);
975 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE
, aBool
);
976 //ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
978 uno::Reference
< XNameContainer
> xNameCont
= new SimpleNamedThingContainer
< XControlModel
>;
979 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES
, uno::Any( xNameCont
) );
982 UnoPageModel::~UnoPageModel()
986 rtl::Reference
<UnoControlModel
> UnoPageModel::Clone() const
988 // clone the container itself
989 rtl::Reference
<UnoPageModel
> pClone
= new UnoPageModel( *this );
990 Clone_Impl( *pClone
);
994 OUString
UnoPageModel::getServiceName()
996 return u
"com.sun.star.awt.UnoPageModel"_ustr
;
999 uno::Any
UnoPageModel::ImplGetDefaultValue( sal_uInt16 nPropId
) const
1001 if ( nPropId
== BASEPROPERTY_DEFAULTCONTROL
)
1003 return uno::Any( u
"com.sun.star.awt.UnoControlPage"_ustr
);
1005 return ControlModelContainerBase::ImplGetDefaultValue( nPropId
);
1008 ::cppu::IPropertyArrayHelper
& UnoPageModel::getInfoHelper()
1010 static UnoPropertyArrayHelper
aHelper( ImplGetPropertyIds() );
1014 // beans::XMultiPropertySet
1015 uno::Reference
< beans::XPropertySetInfo
> UnoPageModel::getPropertySetInfo( )
1017 static uno::Reference
< beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
1022 sal_Bool SAL_CALL
UnoPageModel::getGroupControl( )
1031 UnoFrameControl::UnoFrameControl( const uno::Reference
< uno::XComponentContext
>& rxContext
) : ControlContainerBase(rxContext
)
1033 maComponentInfos
.nWidth
= 280;
1034 maComponentInfos
.nHeight
= 400;
1037 UnoFrameControl::~UnoFrameControl()
1041 OUString
UnoFrameControl::GetComponentServiceName() const
1043 return u
"frame"_ustr
;
1046 void UnoFrameControl::ImplSetPosSize( Reference
< XControl
>& rxCtrl
)
1048 bool bOwnCtrl
= false;
1050 if ( rxCtrl
.get() == Reference
<XControl
>( this ).get() )
1052 Reference
< XPropertySet
> xProps( getModel(), UNO_QUERY
);
1053 //xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
1054 xProps
->getPropertyValue( GetPropertyName( BASEPROPERTY_LABEL
) ) >>= sTitle
;
1056 ControlContainerBase::ImplSetPosSize( rxCtrl
);
1057 Reference
< XWindow
> xW( rxCtrl
, UNO_QUERY
);
1058 if ( bOwnCtrl
|| !xW
.is() || sTitle
.isEmpty() )
1061 awt::Rectangle aSizePos
= xW
->getPosSize();
1063 sal_Int32 nX
= aSizePos
.X
, nY
= aSizePos
.Y
, nWidth
= aSizePos
.Width
, nHeight
= aSizePos
.Height
;
1064 // Retrieve the values set by the base class
1065 OutputDevice
*pOutDev
= Application::GetDefaultDevice();
1068 // Adjust Y based on height of Title
1069 ::tools::Rectangle aRect
= pOutDev
->GetTextRect( {}, sTitle
);
1070 nY
= nY
+ ( aRect
.GetHeight() / 2 );
1074 Reference
< XWindowPeer
> xPeer
= ImplGetCompatiblePeer();
1075 Reference
< XDevice
> xD( xPeer
, UNO_QUERY
);
1077 SimpleFontMetric aFM
;
1079 Any aVal
= ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR
) );
1082 if ( !aFD
.StyleName
.isEmpty() )
1084 Reference
< XFont
> xFont
= xD
->getFont( aFD
);
1085 aFM
= xFont
->getFontMetric();
1089 Reference
< XGraphics
> xG
= xD
->createGraphics();
1090 aFM
= xG
->getFontMetric();
1093 sal_Int16 nH
= aFM
.Ascent
+ aFM
.Descent
;
1094 // offset y based on height of font ( not sure if my guess at the correct calculation is correct here )
1095 nY
= nY
+ ( nH
/ 8); // how do I test this
1097 xW
->setPosSize( nX
, nY
, nWidth
, nHeight
, PosSize::POSSIZE
);
1100 // ------------- UnoFrameModel -----------------
1102 UnoFrameModel::UnoFrameModel( const Reference
< XComponentContext
>& rxContext
) : ControlModelContainerBase( rxContext
)
1104 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL
);
1105 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR
);
1106 ImplRegisterProperty( BASEPROPERTY_ENABLED
);
1107 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE
);
1108 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR
);
1109 ImplRegisterProperty( BASEPROPERTY_HELPTEXT
);
1110 ImplRegisterProperty( BASEPROPERTY_HELPURL
);
1111 ImplRegisterProperty( BASEPROPERTY_PRINTABLE
);
1112 ImplRegisterProperty( BASEPROPERTY_LABEL
);
1113 ImplRegisterProperty( BASEPROPERTY_WRITING_MODE
);
1114 ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE
);
1115 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES
);
1116 ImplRegisterProperty( BASEPROPERTY_HSCROLL
);
1117 ImplRegisterProperty( BASEPROPERTY_VSCROLL
);
1118 ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH
);
1119 ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT
);
1120 ImplRegisterProperty( BASEPROPERTY_SCROLLTOP
);
1121 ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT
);
1124 uno::Reference
< XNameContainer
> xNameCont
= new SimpleNamedThingContainer
< XControlModel
>;
1125 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES
, uno::Any( xNameCont
) );
1128 UnoFrameModel::~UnoFrameModel()
1132 rtl::Reference
<UnoControlModel
> UnoFrameModel::Clone() const
1134 // clone the container itself
1135 rtl::Reference
<UnoFrameModel
> pClone
= new UnoFrameModel( *this );
1136 Clone_Impl( *pClone
);
1140 OUString
UnoFrameModel::getServiceName()
1142 return u
"com.sun.star.awt.UnoFrameModel"_ustr
;
1145 uno::Any
UnoFrameModel::ImplGetDefaultValue( sal_uInt16 nPropId
) const
1149 case BASEPROPERTY_DEFAULTCONTROL
:
1151 return uno::Any( u
"com.sun.star.awt.UnoControlFrame"_ustr
);
1153 case BASEPROPERTY_SCROLLWIDTH
:
1154 case BASEPROPERTY_SCROLLHEIGHT
:
1155 case BASEPROPERTY_SCROLLTOP
:
1156 case BASEPROPERTY_SCROLLLEFT
:
1157 return uno::Any( sal_Int32(0) );
1158 case BASEPROPERTY_USERFORMCONTAINEES
:
1160 uno::Reference
< XNameContainer
> xNameCont
= new SimpleNamedThingContainer
< XControlModel
>;
1161 return Any( xNameCont
);
1164 return ControlModelContainerBase::ImplGetDefaultValue( nPropId
);
1167 ::cppu::IPropertyArrayHelper
& UnoFrameModel::getInfoHelper()
1169 static UnoPropertyArrayHelper
aHelper( ImplGetPropertyIds() );
1173 // beans::XMultiPropertySet
1174 uno::Reference
< beans::XPropertySetInfo
> UnoFrameModel::getPropertySetInfo( )
1176 static uno::Reference
< beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
1180 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
1181 stardiv_Toolkit_UnoControlDialogModel_get_implementation(
1182 css::uno::XComponentContext
*context
,
1183 css::uno::Sequence
<css::uno::Any
> const &)
1185 return cppu::acquire(new OGeometryControlModel
<UnoControlDialogModel
>(context
));
1188 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
1189 stardiv_Toolkit_UnoDialogControl_get_implementation(
1190 css::uno::XComponentContext
*context
,
1191 css::uno::Sequence
<css::uno::Any
> const &)
1193 return cppu::acquire(new UnoDialogControl(context
));
1196 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
1197 stardiv_Toolkit_UnoMultiPageControl_get_implementation(
1198 css::uno::XComponentContext
*context
,
1199 css::uno::Sequence
<css::uno::Any
> const &)
1201 return cppu::acquire(new UnoMultiPageControl(context
));
1204 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
1205 stardiv_Toolkit_UnoMultiPageModel_get_implementation(
1206 css::uno::XComponentContext
*context
,
1207 css::uno::Sequence
<css::uno::Any
> const &)
1209 return cppu::acquire(new UnoMultiPageModel(context
));
1212 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
1213 stardiv_Toolkit_UnoPageControl_get_implementation(
1214 css::uno::XComponentContext
*context
,
1215 css::uno::Sequence
<css::uno::Any
> const &)
1217 return cppu::acquire(new UnoPageControl(context
));
1220 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
1221 stardiv_Toolkit_UnoPageModel_get_implementation(
1222 css::uno::XComponentContext
*context
,
1223 css::uno::Sequence
<css::uno::Any
> const &)
1225 return cppu::acquire(new UnoPageModel(context
));
1228 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
1229 stardiv_Toolkit_UnoFrameControl_get_implementation(
1230 css::uno::XComponentContext
*context
,
1231 css::uno::Sequence
<css::uno::Any
> const &)
1233 return cppu::acquire(new UnoFrameControl(context
));
1236 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
1237 stardiv_Toolkit_UnoFrameModel_get_implementation(
1238 css::uno::XComponentContext
*context
,
1239 css::uno::Sequence
<css::uno::Any
> const &)
1241 return cppu::acquire(new UnoFrameModel(context
));
1244 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */