Avoid potential negative array index access to cached text.
[LibreOffice.git] / toolkit / source / controls / dialogcontrol.cxx
blobba954a15412a8350a7d49334856b417297882461
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 #include <sal/config.h>
22 #include <algorithm>
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"
51 #include <mutex>
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;
59 using namespace ::com::sun::star::util;
61 constexpr OUStringLiteral PROPERTY_DIALOGSOURCEURL = u"DialogSourceURL";
62 constexpr OUStringLiteral PROPERTY_IMAGEURL = u"ImageURL";
63 constexpr OUStringLiteral PROPERTY_GRAPHIC = u"Graphic";
66 // we probably will need both a hash of control models and hash of controls
67 // => use some template magic
69 namespace {
71 template< typename T >
72 class SimpleNamedThingContainer : public ::cppu::WeakImplHelper< container::XNameContainer >
74 std::unordered_map< OUString, Reference< T > > things;
75 std::mutex m_aMutex;
76 public:
77 // css::container::XNameContainer, XNameReplace, XNameAccess
78 virtual void SAL_CALL replaceByName( const OUString& aName, const Any& aElement ) override
80 std::scoped_lock aGuard( m_aMutex );
81 auto it = things.find( aName );
82 if ( it == things.end() )
83 throw NoSuchElementException();
84 Reference< T > xElement;
85 if ( ! ( aElement >>= xElement ) )
86 throw IllegalArgumentException();
87 it->second = xElement;
89 virtual Any SAL_CALL getByName( const OUString& aName ) override
91 std::scoped_lock aGuard( m_aMutex );
92 auto it = things.find( aName );
93 if ( it == things.end() )
94 throw NoSuchElementException();
95 return uno::Any( it->second );
97 virtual Sequence< OUString > SAL_CALL getElementNames( ) override
99 std::scoped_lock aGuard( m_aMutex );
100 return comphelper::mapKeysToSequence( things );
102 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override
104 std::scoped_lock aGuard( m_aMutex );
105 return ( things.find( aName ) != things.end() );
107 virtual void SAL_CALL insertByName( const OUString& aName, const Any& aElement ) override
109 std::scoped_lock aGuard( m_aMutex );
110 auto it = things.find( aName );
111 if ( it != things.end() )
112 throw ElementExistException();
113 Reference< T > xElement;
114 if ( ! ( aElement >>= xElement ) )
115 throw IllegalArgumentException();
116 things[ aName ] = xElement;
118 virtual void SAL_CALL removeByName( const OUString& aName ) override
120 std::scoped_lock aGuard( m_aMutex );
121 if ( things.erase( aName ) == 0 )
122 throw NoSuchElementException();
124 virtual Type SAL_CALL getElementType( ) override
126 return cppu::UnoType<T>::get();
128 virtual sal_Bool SAL_CALL hasElements( ) override
130 std::scoped_lock aGuard( m_aMutex );
131 return !things.empty();
135 class UnoControlDialogModel : public ControlModelContainerBase
137 protected:
138 css::uno::Reference< css::graphic::XGraphicObject > mxGrfObj;
139 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
140 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
141 // ::comphelper::OPropertySetHelper
142 void setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override;
143 public:
144 explicit UnoControlDialogModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
145 UnoControlDialogModel( const UnoControlDialogModel& rModel );
147 rtl::Reference<UnoControlModel> Clone() const override;
148 // css::beans::XMultiPropertySet
149 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
151 // css::io::XPersistObject
152 OUString SAL_CALL getServiceName() override;
154 // XServiceInfo
155 OUString SAL_CALL getImplementationName() override
156 { return "stardiv.Toolkit.UnoControlDialogModel"; }
158 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
160 auto s(ControlModelContainerBase::getSupportedServiceNames());
161 s.realloc(s.getLength() + 2);
162 auto ps = s.getArray();
163 ps[s.getLength() - 2] = "com.sun.star.awt.UnoControlDialogModel";
164 ps[s.getLength() - 1] = "stardiv.vcl.controlmodel.Dialog";
165 return s;
169 UnoControlDialogModel::UnoControlDialogModel( const Reference< XComponentContext >& rxContext )
170 :ControlModelContainerBase( rxContext )
172 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
173 // ImplRegisterProperty( BASEPROPERTY_BORDER );
174 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
175 ImplRegisterProperty( BASEPROPERTY_ENABLED );
176 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
177 // ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
178 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
179 ImplRegisterProperty( BASEPROPERTY_HELPURL );
180 ImplRegisterProperty( BASEPROPERTY_TITLE );
181 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
182 ImplRegisterProperty( BASEPROPERTY_DESKTOP_AS_PARENT );
183 ImplRegisterProperty( BASEPROPERTY_DECORATION );
184 ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
185 ImplRegisterProperty( BASEPROPERTY_GRAPHIC );
186 ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
187 ImplRegisterProperty( BASEPROPERTY_HSCROLL );
188 ImplRegisterProperty( BASEPROPERTY_VSCROLL );
189 ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH );
190 ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT );
191 ImplRegisterProperty( BASEPROPERTY_SCROLLTOP );
192 ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT );
194 Any aBool;
195 aBool <<= true;
196 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
197 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
198 // #TODO separate class for 'UserForm' ( instead of re-using Dialog ? )
199 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
200 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::Any( xNameCont ) );
203 UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rModel )
204 : ControlModelContainerBase( rModel )
206 // need to clone BASEPROPERTY_USERFORMCONTAINEES too
207 Reference< XNameContainer > xSrcNameCont( const_cast< UnoControlDialogModel& >(rModel).getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY );
208 Reference<XNameContainer > xNameCont( new SimpleNamedThingContainer< XControlModel > );
210 const uno::Sequence< OUString > sNames = xSrcNameCont->getElementNames();
211 for ( OUString const & name : sNames )
213 if ( xSrcNameCont->hasByName( name ) )
214 xNameCont->insertByName( name, xSrcNameCont->getByName( name ) );
216 std::unique_lock aGuard(m_aMutex);
217 setFastPropertyValue_NoBroadcast( aGuard, BASEPROPERTY_USERFORMCONTAINEES, Any( xNameCont ) );
220 rtl::Reference<UnoControlModel> UnoControlDialogModel::Clone() const
222 // clone the container itself
223 rtl::Reference<UnoControlDialogModel> pClone = new UnoControlDialogModel( *this );
225 Clone_Impl(*pClone);
227 return pClone;
231 OUString UnoControlDialogModel::getServiceName( )
233 return "stardiv.vcl.controlmodel.Dialog";
236 Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
238 Any aAny;
240 switch ( nPropId )
242 case BASEPROPERTY_DEFAULTCONTROL:
243 aAny <<= OUString::createFromAscii( szServiceName_UnoControlDialog );
244 break;
245 case BASEPROPERTY_SCROLLWIDTH:
246 case BASEPROPERTY_SCROLLHEIGHT:
247 case BASEPROPERTY_SCROLLTOP:
248 case BASEPROPERTY_SCROLLLEFT:
249 aAny <<= sal_Int32(0);
250 break;
251 default:
252 aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
255 return aAny;
258 ::cppu::IPropertyArrayHelper& UnoControlDialogModel::getInfoHelper()
260 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
261 return aHelper;
264 // XMultiPropertySet
265 Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( )
267 static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
268 return xInfo;
271 void UnoControlDialogModel::setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue )
273 ControlModelContainerBase::setFastPropertyValue_NoBroadcast( rGuard, nHandle, rValue );
276 if ( nHandle == BASEPROPERTY_IMAGEURL && ImplHasProperty( BASEPROPERTY_GRAPHIC ) )
278 OUString sImageURL;
279 uno::Reference<graphic::XGraphic> xGraphic;
280 if (rValue >>= sImageURL)
282 setFastPropertyValueImpl(rGuard,
283 BASEPROPERTY_GRAPHIC,
284 uno::Any(ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow(
285 mxGrfObj, sImageURL)));
287 else if (rValue >>= xGraphic)
289 setFastPropertyValueImpl(rGuard, BASEPROPERTY_GRAPHIC, uno::Any(xGraphic));
293 catch( const css::uno::Exception& )
295 TOOLS_WARN_EXCEPTION( "toolkit", "caught an exception while setting ImageURL properties" );
302 // = class UnoDialogControl
305 UnoDialogControl::UnoDialogControl( const uno::Reference< uno::XComponentContext >& rxContext )
306 :UnoDialogControl_Base( rxContext )
307 ,maTopWindowListeners( *this )
308 ,mbWindowListener(false)
310 maComponentInfos.nWidth = 300;
311 maComponentInfos.nHeight = 450;
314 UnoDialogControl::~UnoDialogControl()
318 OUString UnoDialogControl::GetComponentServiceName() const
321 bool bDecoration( true );
322 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
323 if ( bDecoration )
324 return "Dialog";
325 else
326 return "TabPage";
329 void UnoDialogControl::dispose()
331 SolarMutexGuard aGuard;
333 EventObject aEvt;
334 aEvt.Source = getXWeak();
335 maTopWindowListeners.disposeAndClear( aEvt );
336 ControlContainerBase::dispose();
339 void SAL_CALL UnoDialogControl::disposing(
340 const EventObject& Source )
342 ControlContainerBase::disposing( Source );
345 sal_Bool UnoDialogControl::setModel( const Reference< XControlModel >& rxModel )
347 // #Can we move all the Resource stuff to the ControlContainerBase ?
348 SolarMutexGuard aGuard;
349 bool bRet = ControlContainerBase::setModel( rxModel );
350 ImplStartListingForResourceEvents();
351 return bRet;
354 void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer )
356 SolarMutexGuard aGuard;
358 UnoControlContainer::createPeer( rxToolkit, rParentPeer );
360 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
361 if ( !xTW.is() )
362 return;
364 xTW->setMenuBar( mxMenuBar );
366 if ( !mbWindowListener )
368 Reference< XWindowListener > xWL(this);
369 addWindowListener( xWL );
370 mbWindowListener = true;
373 if ( maTopWindowListeners.getLength() )
374 xTW->addTopWindowListener( &maTopWindowListeners );
375 // there must be a better way than doing this, we can't
376 // process the scrolltop & scrollleft in XDialog because
377 // the children haven't been added when those props are applied
378 ImplSetPeerProperty( GetPropertyName( BASEPROPERTY_SCROLLTOP ), ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_SCROLLTOP ) ) );
379 ImplSetPeerProperty( GetPropertyName( BASEPROPERTY_SCROLLLEFT ), ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_SCROLLLEFT ) ) );
382 OUString UnoDialogControl::getImplementationName()
384 return "stardiv.Toolkit.UnoDialogControl";
387 sal_Bool UnoDialogControl::supportsService(OUString const & ServiceName)
389 return cppu::supportsService(this, ServiceName);
392 css::uno::Sequence<OUString> UnoDialogControl::getSupportedServiceNames()
394 return css::uno::Sequence<OUString>{
395 "com.sun.star.awt.UnoControlDialog",
396 "stardiv.vcl.control.Dialog"};
399 void UnoDialogControl::PrepareWindowDescriptor( css::awt::WindowDescriptor& rDesc )
401 UnoControlContainer::PrepareWindowDescriptor( rDesc );
402 bool bDecoration( true );
403 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
404 if ( !bDecoration )
406 // Now we have to manipulate the WindowDescriptor
407 rDesc.WindowAttributes = rDesc.WindowAttributes | css::awt::WindowAttribute::NODECORATION;
410 // We have to set the graphic property before the peer
411 // will be created. Otherwise the properties will be copied
412 // into the peer via propertiesChangeEvents. As the order of
413 // can lead to overwrites we have to set the graphic property
414 // before the propertiesChangeEvents are sent!
415 OUString aImageURL;
416 Reference< graphic::XGraphic > xGraphic;
417 if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
418 ( !aImageURL.isEmpty() ))
420 OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(PROPERTY_DIALOGSOURCEURL), uno::Any(aImageURL));
421 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
422 ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::Any( xGraphic ), true );
426 void UnoDialogControl::addTopWindowListener( const Reference< XTopWindowListener >& rxListener )
428 maTopWindowListeners.addInterface( rxListener );
429 if( getPeer().is() && maTopWindowListeners.getLength() == 1 )
431 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
432 xTW->addTopWindowListener( &maTopWindowListeners );
436 void UnoDialogControl::removeTopWindowListener( const Reference< XTopWindowListener >& rxListener )
438 if( getPeer().is() && maTopWindowListeners.getLength() == 1 )
440 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
441 xTW->removeTopWindowListener( &maTopWindowListeners );
443 maTopWindowListeners.removeInterface( rxListener );
446 void UnoDialogControl::toFront( )
448 SolarMutexGuard aGuard;
449 if ( getPeer().is() )
451 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
452 if( xTW.is() )
453 xTW->toFront();
457 void UnoDialogControl::toBack( )
459 SolarMutexGuard aGuard;
460 if ( getPeer().is() )
462 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
463 if( xTW.is() )
464 xTW->toBack();
468 void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar )
470 SolarMutexGuard aGuard;
471 mxMenuBar = rxMenuBar;
472 if ( getPeer().is() )
474 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
475 if( xTW.is() )
476 xTW->setMenuBar( mxMenuBar );
479 static ::Size ImplMapPixelToAppFont( OutputDevice const * pOutDev, const ::Size& aSize )
481 ::Size aTmp = pOutDev->PixelToLogic(aSize, MapMode(MapUnit::MapAppFont));
482 return aTmp;
484 // css::awt::XWindowListener
485 void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e )
487 OutputDevice*pOutDev = Application::GetDefaultDevice();
488 DBG_ASSERT( pOutDev, "Missing Default Device!" );
489 if ( !pOutDev || mbSizeModified )
490 return;
492 // Currently we are simply using MapUnit::MapAppFont
493 ::Size aAppFontSize( e.Width, e.Height );
495 Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
496 Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
497 OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
499 // #i87592 In design mode the drawing layer works with sizes with decoration.
500 // Therefore we have to subtract them before writing back to the properties (model).
501 if ( xDialogDevice.is() && mbDesignMode )
503 DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
504 aAppFontSize.AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
505 aAppFontSize.AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
508 aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
510 // Remember that changes have been done by listener. No need to
511 // update the position because of property change event.
512 mbSizeModified = true;
513 // Properties in a sequence must be sorted!
514 Sequence< OUString > aProps{ "Height", "Width" };
515 Sequence< Any > aValues{
516 Any(sal_Int32(
517 std::clamp(aAppFontSize.Height(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32)))),
518 Any(sal_Int32(
519 std::clamp(aAppFontSize.Width(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))))
522 ImplSetPropertyValues( aProps, aValues, true );
523 mbSizeModified = false;
527 void SAL_CALL UnoDialogControl::windowMoved( const css::awt::WindowEvent& e )
529 OutputDevice*pOutDev = Application::GetDefaultDevice();
530 DBG_ASSERT( pOutDev, "Missing Default Device!" );
531 if ( !pOutDev || mbPosModified )
532 return;
534 // Currently we are simply using MapUnit::MapAppFont
535 ::Size aTmp( e.X, e.Y );
536 aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
538 // Remember that changes have been done by listener. No need to
539 // update the position because of property change event.
540 mbPosModified = true;
541 Sequence< OUString > aProps{ "PositionX", "PositionY" };
542 Sequence< Any > aValues{
543 Any(sal_Int32(
544 std::clamp(aTmp.Width(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32)))),
545 Any(sal_Int32(
546 std::clamp(aTmp.Height(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))))
549 ImplSetPropertyValues( aProps, aValues, true );
550 mbPosModified = false;
554 void SAL_CALL UnoDialogControl::windowShown( const EventObject& ) {}
556 void SAL_CALL UnoDialogControl::windowHidden( const EventObject& ) {}
558 void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result )
560 Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
561 if ( xPeerDialog.is() )
562 xPeerDialog->endDialog( i_result );
565 void SAL_CALL UnoDialogControl::setHelpId( const OUString& i_id )
567 Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
568 if ( xPeerDialog.is() )
569 xPeerDialog->setHelpId( i_id );
572 void UnoDialogControl::setTitle( const OUString& Title )
574 SolarMutexGuard aGuard;
575 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ), uno::Any(Title), true );
578 OUString UnoDialogControl::getTitle()
580 SolarMutexGuard aGuard;
581 return ImplGetPropertyValue_UString( BASEPROPERTY_TITLE );
584 sal_Int16 UnoDialogControl::execute()
586 SolarMutexGuard aGuard;
587 sal_Int16 nDone = -1;
588 if ( getPeer().is() )
590 Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
591 if( xDlg.is() )
593 GetComponentInfos().bVisible = true;
594 nDone = xDlg->execute();
595 GetComponentInfos().bVisible = false;
598 return nDone;
601 void UnoDialogControl::endExecute()
603 SolarMutexGuard aGuard;
604 if ( getPeer().is() )
606 Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
607 if( xDlg.is() )
609 xDlg->endExecute();
610 GetComponentInfos().bVisible = false;
615 // XModifyListener
616 void SAL_CALL UnoDialogControl::modified(
617 const lang::EventObject& /*rEvent*/ )
619 ImplUpdateResourceResolver();
622 void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents )
624 for( const PropertyChangeEvent& rEvt : rEvents )
626 Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
627 bool bOwnModel = xModel.get() == getModel().get();
628 if (bOwnModel && rEvt.PropertyName == "ImageURL" && !ImplHasProperty(BASEPROPERTY_GRAPHIC))
630 OUString aImageURL;
631 Reference< graphic::XGraphic > xGraphic;
632 if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ) >>= aImageURL ) &&
633 ( !aImageURL.isEmpty() ))
635 OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(GetPropertyName(BASEPROPERTY_DIALOGSOURCEURL)), uno::Any(aImageURL));
636 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
638 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC), uno::Any( xGraphic ), true );
639 break;
641 else if (bOwnModel && rEvt.PropertyName == "Graphic")
643 uno::Reference<graphic::XGraphic> xGraphic;
644 if (ImplGetPropertyValue("Graphic") >>= xGraphic)
646 ImplSetPropertyValue("Graphic", uno::Any(xGraphic), true);
648 break;
651 ControlContainerBase::ImplModelPropertiesChanged(rEvents);
656 UnoMultiPageControl::UnoMultiPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext), maTabListeners( *this )
658 maComponentInfos.nWidth = 280;
659 maComponentInfos.nHeight = 400;
662 UnoMultiPageControl::~UnoMultiPageControl()
665 // XTabListener
667 void SAL_CALL UnoMultiPageControl::inserted( SAL_UNUSED_PARAMETER ::sal_Int32 )
670 void SAL_CALL UnoMultiPageControl::removed( SAL_UNUSED_PARAMETER ::sal_Int32 )
673 void SAL_CALL UnoMultiPageControl::changed( SAL_UNUSED_PARAMETER ::sal_Int32,
674 SAL_UNUSED_PARAMETER const Sequence< NamedValue >& )
677 void SAL_CALL UnoMultiPageControl::activated( ::sal_Int32 ID )
679 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::Any( ID ), false );
682 void SAL_CALL UnoMultiPageControl::deactivated( SAL_UNUSED_PARAMETER ::sal_Int32 )
685 void SAL_CALL UnoMultiPageControl::disposing(const EventObject&)
689 void SAL_CALL UnoMultiPageControl::dispose()
691 lang::EventObject aEvt;
692 aEvt.Source = getXWeak();
693 maTabListeners.disposeAndClear( aEvt );
694 ControlContainerBase::dispose();
697 // css::awt::XSimpleTabController
698 ::sal_Int32 SAL_CALL UnoMultiPageControl::insertTab()
700 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
701 return xMultiPage->insertTab();
704 void SAL_CALL UnoMultiPageControl::removeTab( ::sal_Int32 ID )
706 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
707 xMultiPage->removeTab( ID );
710 void SAL_CALL UnoMultiPageControl::setTabProps( ::sal_Int32 ID, const Sequence< NamedValue >& Properties )
712 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
713 xMultiPage->setTabProps( ID, Properties );
716 Sequence< NamedValue > SAL_CALL UnoMultiPageControl::getTabProps( ::sal_Int32 ID )
718 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
719 return xMultiPage->getTabProps( ID );
722 void SAL_CALL UnoMultiPageControl::activateTab( ::sal_Int32 ID )
724 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
725 xMultiPage->activateTab( ID );
726 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::Any( ID ), true );
730 ::sal_Int32 SAL_CALL UnoMultiPageControl::getActiveTabID()
732 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
733 return xMultiPage->getActiveTabID();
736 void SAL_CALL UnoMultiPageControl::addTabListener( const Reference< XTabListener >& Listener )
738 maTabListeners.addInterface( Listener );
739 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
740 if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
741 xMultiPage->addTabListener( &maTabListeners );
744 void SAL_CALL UnoMultiPageControl::removeTabListener( const Reference< XTabListener >& Listener )
746 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
747 if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
748 xMultiPage->removeTabListener( &maTabListeners );
749 maTabListeners.removeInterface( Listener );
752 IMPL_IMPLEMENTATION_ID( UnoMultiPageControl )
754 // lang::XTypeProvider
755 css::uno::Sequence< css::uno::Type > UnoMultiPageControl::getTypes()
757 static const ::cppu::OTypeCollection aTypeList(
758 cppu::UnoType<css::lang::XTypeProvider>::get(),
759 cppu::UnoType<awt::XSimpleTabController>::get(),
760 cppu::UnoType<awt::XTabListener>::get(),
761 ControlContainerBase::getTypes()
763 return aTypeList.getTypes();
766 // uno::XInterface
767 uno::Any UnoMultiPageControl::queryAggregation( const uno::Type & rType )
769 uno::Any aRet = ::cppu::queryInterface( rType,
770 static_cast< awt::XTabListener* >(this),
771 static_cast< awt::XSimpleTabController* >(this) );
772 return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType ));
775 OUString UnoMultiPageControl::GetComponentServiceName() const
777 bool bDecoration( true );
778 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
779 if ( bDecoration )
780 return "tabcontrol";
781 // Hopefully we can tweak the tabcontrol to display without tabs
782 return "tabcontrolnotabs";
785 void UnoMultiPageControl::bindPage( const uno::Reference< awt::XControl >& _rxControl )
787 uno::Reference< awt::XWindowPeer > xPage( _rxControl->getPeer() );
788 uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY );
789 uno::Reference< beans::XPropertySet > xProps( _rxControl->getModel(), uno::UNO_QUERY );
791 VCLXTabPage* pXPage = dynamic_cast< VCLXTabPage* >( xPage.get() );
792 TabPage* pPage = pXPage ? pXPage->getTabPage() : nullptr;
793 if ( xTabCntrl.is() && pPage )
795 VCLXMultiPage* pXTab = dynamic_cast< VCLXMultiPage* >( xTabCntrl.get() );
796 if ( pXTab )
798 OUString sTitle;
799 xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
800 pXTab->insertTab( pPage, sTitle);
806 void UnoMultiPageControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer )
808 SolarMutexGuard aSolarGuard;
810 UnoControlContainer::createPeer( rxToolkit, rParentPeer );
812 const uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
813 for( const auto& rCtrl : aCtrls )
814 bindPage( rCtrl );
815 sal_Int32 nActiveTab(0);
816 Reference< XPropertySet > xMultiProps( getModel(), UNO_QUERY );
817 xMultiProps->getPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ) ) >>= nActiveTab;
819 uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY );
820 if ( xTabCntrl.is() )
822 xTabCntrl->addTabListener( this );
823 if ( nActiveTab && aCtrls.hasElements() ) // Ensure peer is initialise with correct activated tab
825 xTabCntrl->activateTab( nActiveTab );
826 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::Any( nActiveTab ), true );
831 void UnoMultiPageControl::impl_createControlPeerIfNecessary( const uno::Reference< awt::XControl >& _rxControl)
833 OSL_PRECOND( _rxControl.is(), "UnoMultiPageControl::impl_createControlPeerIfNecessary: invalid control, this will crash!" );
835 // if the container already has a peer, then also create a peer for the control
836 uno::Reference< awt::XWindowPeer > xMyPeer( getPeer() );
838 if( xMyPeer.is() )
840 _rxControl->createPeer( nullptr, xMyPeer );
841 bindPage( _rxControl );
842 ImplActivateTabControllers();
847 // ------------- UnoMultiPageModel -----------------
849 UnoMultiPageModel::UnoMultiPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
851 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
852 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
853 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
854 ImplRegisterProperty( BASEPROPERTY_ENABLED );
856 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
857 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
858 ImplRegisterProperty( BASEPROPERTY_HELPURL );
859 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
860 //ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
861 ImplRegisterProperty( BASEPROPERTY_MULTIPAGEVALUE );
862 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
863 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
865 Any aBool;
866 aBool <<= true;
867 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
868 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
869 ImplRegisterProperty( BASEPROPERTY_DECORATION, aBool );
870 // MultiPage Control has the tab stop property. And the default value is True.
871 ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
873 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
874 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::Any( xNameCont ) );
877 UnoMultiPageModel::~UnoMultiPageModel()
881 rtl::Reference<UnoControlModel> UnoMultiPageModel::Clone() const
883 // clone the container itself
884 rtl::Reference<UnoMultiPageModel> pClone = new UnoMultiPageModel( *this );
885 Clone_Impl( *pClone );
886 return pClone;
889 OUString UnoMultiPageModel::getServiceName()
891 return "com.sun.star.awt.UnoMultiPageModel";
894 uno::Any UnoMultiPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
896 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
898 return uno::Any( OUString( "com.sun.star.awt.UnoControlMultiPage" ) );
900 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
903 ::cppu::IPropertyArrayHelper& UnoMultiPageModel::getInfoHelper()
905 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
906 return aHelper;
909 // beans::XMultiPropertySet
910 uno::Reference< beans::XPropertySetInfo > UnoMultiPageModel::getPropertySetInfo( )
912 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
913 return xInfo;
916 void UnoMultiPageModel::insertByName( const OUString& aName, const Any& aElement )
918 Reference< XServiceInfo > xInfo;
919 aElement >>= xInfo;
921 if ( !xInfo.is() )
922 throw IllegalArgumentException();
924 // Only a Page model can be inserted into the multipage
925 if ( !xInfo->supportsService( "com.sun.star.awt.UnoPageModel" ) )
926 throw IllegalArgumentException();
928 return ControlModelContainerBase::insertByName( aName, aElement );
932 sal_Bool SAL_CALL UnoMultiPageModel::getGroupControl( )
934 return true;
939 UnoPageControl::UnoPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext)
941 maComponentInfos.nWidth = 280;
942 maComponentInfos.nHeight = 400;
945 UnoPageControl::~UnoPageControl()
949 OUString UnoPageControl::GetComponentServiceName() const
951 return "tabpage";
955 // ------------- UnoPageModel -----------------
957 UnoPageModel::UnoPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
959 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
960 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
961 ImplRegisterProperty( BASEPROPERTY_ENABLED );
962 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
964 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
965 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
966 ImplRegisterProperty( BASEPROPERTY_HELPURL );
967 ImplRegisterProperty( BASEPROPERTY_TITLE );
968 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
969 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
970 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
971 // ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
973 Any aBool;
974 aBool <<= true;
975 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
976 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
977 //ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
979 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
980 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::Any( xNameCont ) );
983 UnoPageModel::~UnoPageModel()
987 rtl::Reference<UnoControlModel> UnoPageModel::Clone() const
989 // clone the container itself
990 rtl::Reference<UnoPageModel> pClone = new UnoPageModel( *this );
991 Clone_Impl( *pClone );
992 return pClone;
995 OUString UnoPageModel::getServiceName()
997 return "com.sun.star.awt.UnoPageModel";
1000 uno::Any UnoPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
1002 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
1004 return uno::Any( OUString( "com.sun.star.awt.UnoControlPage" ) );
1006 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
1009 ::cppu::IPropertyArrayHelper& UnoPageModel::getInfoHelper()
1011 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
1012 return aHelper;
1015 // beans::XMultiPropertySet
1016 uno::Reference< beans::XPropertySetInfo > UnoPageModel::getPropertySetInfo( )
1018 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1019 return xInfo;
1023 sal_Bool SAL_CALL UnoPageModel::getGroupControl( )
1025 return false;
1028 // Frame control
1032 UnoFrameControl::UnoFrameControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext)
1034 maComponentInfos.nWidth = 280;
1035 maComponentInfos.nHeight = 400;
1038 UnoFrameControl::~UnoFrameControl()
1042 OUString UnoFrameControl::GetComponentServiceName() const
1044 return "frame";
1047 void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
1049 bool bOwnCtrl = false;
1050 OUString sTitle;
1051 if ( rxCtrl.get() == Reference<XControl>( this ).get() )
1052 bOwnCtrl = true;
1053 Reference< XPropertySet > xProps( getModel(), UNO_QUERY );
1054 //xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
1055 xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_LABEL ) ) >>= sTitle;
1057 ControlContainerBase::ImplSetPosSize( rxCtrl );
1058 Reference < XWindow > xW( rxCtrl, UNO_QUERY );
1059 if ( bOwnCtrl || !xW.is() || sTitle.isEmpty() )
1060 return;
1062 awt::Rectangle aSizePos = xW->getPosSize();
1064 sal_Int32 nX = aSizePos.X, nY = aSizePos.Y, nWidth = aSizePos.Width, nHeight = aSizePos.Height;
1065 // Retrieve the values set by the base class
1066 OutputDevice*pOutDev = Application::GetDefaultDevice();
1067 if ( pOutDev )
1069 // Adjust Y based on height of Title
1070 ::tools::Rectangle aRect = pOutDev->GetTextRect( {}, sTitle );
1071 nY = nY + ( aRect.GetHeight() / 2 );
1073 else
1075 Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer();
1076 Reference< XDevice > xD( xPeer, UNO_QUERY );
1078 SimpleFontMetric aFM;
1079 FontDescriptor aFD;
1080 Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
1082 aVal >>= aFD;
1083 if ( !aFD.StyleName.isEmpty() )
1085 Reference< XFont > xFont = xD->getFont( aFD );
1086 aFM = xFont->getFontMetric();
1088 else
1090 Reference< XGraphics > xG = xD->createGraphics();
1091 aFM = xG->getFontMetric();
1094 sal_Int16 nH = aFM.Ascent + aFM.Descent;
1095 // offset y based on height of font ( not sure if my guess at the correct calculation is correct here )
1096 nY = nY + ( nH / 8); // how do I test this
1098 xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
1101 // ------------- UnoFrameModel -----------------
1103 UnoFrameModel::UnoFrameModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
1105 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
1106 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
1107 ImplRegisterProperty( BASEPROPERTY_ENABLED );
1108 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
1109 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
1110 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
1111 ImplRegisterProperty( BASEPROPERTY_HELPURL );
1112 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
1113 ImplRegisterProperty( BASEPROPERTY_LABEL );
1114 ImplRegisterProperty( BASEPROPERTY_WRITING_MODE );
1115 ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE );
1116 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
1117 ImplRegisterProperty( BASEPROPERTY_HSCROLL );
1118 ImplRegisterProperty( BASEPROPERTY_VSCROLL );
1119 ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH );
1120 ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT );
1121 ImplRegisterProperty( BASEPROPERTY_SCROLLTOP );
1122 ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT );
1125 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
1126 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::Any( xNameCont ) );
1129 UnoFrameModel::~UnoFrameModel()
1133 rtl::Reference<UnoControlModel> UnoFrameModel::Clone() const
1135 // clone the container itself
1136 rtl::Reference<UnoFrameModel> pClone = new UnoFrameModel( *this );
1137 Clone_Impl( *pClone );
1138 return pClone;
1141 OUString UnoFrameModel::getServiceName()
1143 return "com.sun.star.awt.UnoFrameModel";
1146 uno::Any UnoFrameModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
1148 switch ( nPropId )
1150 case BASEPROPERTY_DEFAULTCONTROL:
1152 return uno::Any( OUString( "com.sun.star.awt.UnoControlFrame" ) );
1154 case BASEPROPERTY_SCROLLWIDTH:
1155 case BASEPROPERTY_SCROLLHEIGHT:
1156 case BASEPROPERTY_SCROLLTOP:
1157 case BASEPROPERTY_SCROLLLEFT:
1158 return uno::Any( sal_Int32(0) );
1159 case BASEPROPERTY_USERFORMCONTAINEES:
1161 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
1162 return Any( xNameCont );
1165 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
1168 ::cppu::IPropertyArrayHelper& UnoFrameModel::getInfoHelper()
1170 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
1171 return aHelper;
1174 // beans::XMultiPropertySet
1175 uno::Reference< beans::XPropertySetInfo > UnoFrameModel::getPropertySetInfo( )
1177 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1178 return xInfo;
1181 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1182 stardiv_Toolkit_UnoControlDialogModel_get_implementation(
1183 css::uno::XComponentContext *context,
1184 css::uno::Sequence<css::uno::Any> const &)
1186 return cppu::acquire(new OGeometryControlModel<UnoControlDialogModel>(context));
1189 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1190 stardiv_Toolkit_UnoDialogControl_get_implementation(
1191 css::uno::XComponentContext *context,
1192 css::uno::Sequence<css::uno::Any> const &)
1194 return cppu::acquire(new UnoDialogControl(context));
1197 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1198 stardiv_Toolkit_UnoMultiPageControl_get_implementation(
1199 css::uno::XComponentContext *context,
1200 css::uno::Sequence<css::uno::Any> const &)
1202 return cppu::acquire(new UnoMultiPageControl(context));
1205 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1206 stardiv_Toolkit_UnoMultiPageModel_get_implementation(
1207 css::uno::XComponentContext *context,
1208 css::uno::Sequence<css::uno::Any> const &)
1210 return cppu::acquire(new UnoMultiPageModel(context));
1213 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1214 stardiv_Toolkit_UnoPageControl_get_implementation(
1215 css::uno::XComponentContext *context,
1216 css::uno::Sequence<css::uno::Any> const &)
1218 return cppu::acquire(new UnoPageControl(context));
1221 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1222 stardiv_Toolkit_UnoPageModel_get_implementation(
1223 css::uno::XComponentContext *context,
1224 css::uno::Sequence<css::uno::Any> const &)
1226 return cppu::acquire(new UnoPageModel(context));
1229 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1230 stardiv_Toolkit_UnoFrameControl_get_implementation(
1231 css::uno::XComponentContext *context,
1232 css::uno::Sequence<css::uno::Any> const &)
1234 return cppu::acquire(new UnoFrameControl(context));
1237 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1238 stardiv_Toolkit_UnoFrameModel_get_implementation(
1239 css::uno::XComponentContext *context,
1240 css::uno::Sequence<css::uno::Any> const &)
1242 return cppu::acquire(new UnoFrameModel(context));
1245 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */