nss: upgrade to release 3.73
[LibreOffice.git] / toolkit / source / controls / dialogcontrol.cxx
blobbf035e3bcfa6ea34815a54a3dc5d44a6653860a8
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 .
21 #include <vcl/svapp.hxx>
22 #include <osl/mutex.hxx>
23 #include <controls/dialogcontrol.hxx>
24 #include <controls/geometrycontrolmodel.hxx>
25 #include <toolkit/helper/property.hxx>
26 #include <helper/servicenames.hxx>
27 #include <com/sun/star/awt/PosSize.hpp>
28 #include <com/sun/star/awt/WindowAttribute.hpp>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <cppuhelper/supportsservice.hxx>
31 #include <cppuhelper/typeprovider.hxx>
32 #include <cppuhelper/queryinterface.hxx>
33 #include <cppuhelper/weak.hxx>
34 #include <tools/debug.hxx>
35 #include <comphelper/sequence.hxx>
36 #include <vcl/outdev.hxx>
38 #include <vcl/image.hxx>
39 #include <cppuhelper/implbase.hxx>
40 #include <unordered_map>
42 #include <vcl/tabctrl.hxx>
43 #include <toolkit/awt/vclxwindows.hxx>
44 #include <toolkit/controls/unocontrols.hxx>
46 #include <helper/unopropertyarrayhelper.hxx>
47 #include "controlmodelcontainerbase_internal.hxx"
49 using namespace ::com::sun::star;
50 using namespace ::com::sun::star::uno;
51 using namespace ::com::sun::star::awt;
52 using namespace ::com::sun::star::lang;
53 using namespace ::com::sun::star::container;
54 using namespace ::com::sun::star::beans;
55 using namespace ::com::sun::star::util;
57 #define PROPERTY_DIALOGSOURCEURL "DialogSourceURL"
58 #define PROPERTY_IMAGEURL "ImageURL"
59 #define PROPERTY_GRAPHIC "Graphic"
62 // we probably will need both a hash of control models and hash of controls
63 // => use some template magic
65 namespace {
67 template< typename T >
68 class SimpleNamedThingContainer : public ::cppu::WeakImplHelper< container::XNameContainer >
70 std::unordered_map< OUString, Reference< T > > things;
71 ::osl::Mutex m_aMutex;
72 public:
73 // css::container::XNameContainer, XNameReplace, XNameAccess
74 virtual void SAL_CALL replaceByName( const OUString& aName, const Any& aElement ) override
76 ::osl::MutexGuard aGuard( m_aMutex );
77 if ( !hasByName( aName ) )
78 throw NoSuchElementException();
79 Reference< T > xElement;
80 if ( ! ( aElement >>= xElement ) )
81 throw IllegalArgumentException();
82 things[ aName ] = xElement;
84 virtual Any SAL_CALL getByName( const OUString& aName ) override
86 ::osl::MutexGuard aGuard( m_aMutex );
87 if ( !hasByName( aName ) )
88 throw NoSuchElementException();
89 return uno::makeAny( things[ aName ] );
91 virtual Sequence< OUString > SAL_CALL getElementNames( ) override
93 ::osl::MutexGuard aGuard( m_aMutex );
94 return comphelper::mapKeysToSequence( things );
96 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override
98 ::osl::MutexGuard aGuard( m_aMutex );
99 return ( things.find( aName ) != things.end() );
101 virtual void SAL_CALL insertByName( const OUString& aName, const Any& aElement ) override
103 ::osl::MutexGuard aGuard( m_aMutex );
104 if ( hasByName( aName ) )
105 throw ElementExistException();
106 Reference< T > xElement;
107 if ( ! ( aElement >>= xElement ) )
108 throw IllegalArgumentException();
109 things[ aName ] = xElement;
111 virtual void SAL_CALL removeByName( const OUString& aName ) override
113 ::osl::MutexGuard aGuard( m_aMutex );
114 if ( things.erase( aName ) == 0 )
115 throw NoSuchElementException();
117 virtual Type SAL_CALL getElementType( ) override
119 return cppu::UnoType<T>::get();
121 virtual sal_Bool SAL_CALL hasElements( ) override
123 ::osl::MutexGuard aGuard( m_aMutex );
124 return ( !things.empty() );
128 class UnoControlDialogModel : public ControlModelContainerBase
130 protected:
131 css::uno::Reference< css::graphic::XGraphicObject > mxGrfObj;
132 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
133 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
134 // ::cppu::OPropertySetHelper
135 void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) override;
136 public:
137 explicit UnoControlDialogModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
138 UnoControlDialogModel( const UnoControlDialogModel& rModel );
140 rtl::Reference<UnoControlModel> Clone() const override;
141 // css::beans::XMultiPropertySet
142 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
144 // css::io::XPersistObject
145 OUString SAL_CALL getServiceName() override;
147 // XServiceInfo
148 OUString SAL_CALL getImplementationName() override
149 { return "stardiv.Toolkit.UnoControlDialogModel"; }
151 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
153 auto s(ControlModelContainerBase::getSupportedServiceNames());
154 s.realloc(s.getLength() + 2);
155 s[s.getLength() - 2] = "com.sun.star.awt.UnoControlDialogModel";
156 s[s.getLength() - 1] = "stardiv.vcl.controlmodel.Dialog";
157 return s;
161 UnoControlDialogModel::UnoControlDialogModel( const Reference< XComponentContext >& rxContext )
162 :ControlModelContainerBase( rxContext )
164 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
165 // ImplRegisterProperty( BASEPROPERTY_BORDER );
166 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
167 ImplRegisterProperty( BASEPROPERTY_ENABLED );
168 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
169 // ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
170 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
171 ImplRegisterProperty( BASEPROPERTY_HELPURL );
172 ImplRegisterProperty( BASEPROPERTY_TITLE );
173 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
174 ImplRegisterProperty( BASEPROPERTY_DESKTOP_AS_PARENT );
175 ImplRegisterProperty( BASEPROPERTY_DECORATION );
176 ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
177 ImplRegisterProperty( BASEPROPERTY_GRAPHIC );
178 ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
179 ImplRegisterProperty( BASEPROPERTY_HSCROLL );
180 ImplRegisterProperty( BASEPROPERTY_VSCROLL );
181 ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH );
182 ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT );
183 ImplRegisterProperty( BASEPROPERTY_SCROLLTOP );
184 ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT );
186 Any aBool;
187 aBool <<= true;
188 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
189 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
190 // #TODO separate class for 'UserForm' ( instead of re-using Dialog ? )
191 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
192 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
195 UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rModel )
196 : ControlModelContainerBase( rModel )
198 // need to clone BASEPROPERTY_USERFORMCONTAINEES too
199 Reference< XNameContainer > xSrcNameCont( const_cast< UnoControlDialogModel& >(rModel).getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY );
200 Reference<XNameContainer > xNameCont( new SimpleNamedThingContainer< XControlModel > );
202 const uno::Sequence< OUString > sNames = xSrcNameCont->getElementNames();
203 for ( OUString const & name : sNames )
205 if ( xSrcNameCont->hasByName( name ) )
206 xNameCont->insertByName( name, xSrcNameCont->getByName( name ) );
208 setFastPropertyValue_NoBroadcast( BASEPROPERTY_USERFORMCONTAINEES, makeAny( xNameCont ) );
211 rtl::Reference<UnoControlModel> UnoControlDialogModel::Clone() const
213 // clone the container itself
214 UnoControlDialogModel* pClone = new UnoControlDialogModel( *this );
216 Clone_Impl(*pClone);
218 return pClone;
222 OUString UnoControlDialogModel::getServiceName( )
224 return "stardiv.vcl.controlmodel.Dialog";
227 Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
229 Any aAny;
231 switch ( nPropId )
233 case BASEPROPERTY_DEFAULTCONTROL:
234 aAny <<= OUString::createFromAscii( szServiceName_UnoControlDialog );
235 break;
236 case BASEPROPERTY_SCROLLWIDTH:
237 case BASEPROPERTY_SCROLLHEIGHT:
238 case BASEPROPERTY_SCROLLTOP:
239 case BASEPROPERTY_SCROLLLEFT:
240 aAny <<= sal_Int32(0);
241 break;
242 default:
243 aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
246 return aAny;
249 ::cppu::IPropertyArrayHelper& UnoControlDialogModel::getInfoHelper()
251 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
252 return aHelper;
255 // XMultiPropertySet
256 Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( )
258 static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
259 return xInfo;
262 void SAL_CALL UnoControlDialogModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue )
264 ControlModelContainerBase::setFastPropertyValue_NoBroadcast( nHandle, rValue );
267 if ( nHandle == BASEPROPERTY_IMAGEURL && ImplHasProperty( BASEPROPERTY_GRAPHIC ) )
269 OUString sImageURL;
270 uno::Reference<graphic::XGraphic> xGraphic;
271 if (rValue >>= sImageURL)
273 setPropertyValue(
274 GetPropertyName(BASEPROPERTY_GRAPHIC),
275 uno::makeAny(ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow(
276 mxGrfObj, sImageURL)));
278 else if (rValue >>= xGraphic)
280 setPropertyValue("Graphic", uno::makeAny(xGraphic));
284 catch( const css::uno::Exception& )
286 OSL_ENSURE( false, "UnoControlDialogModel::setFastPropertyValue_NoBroadcast: caught an exception while setting ImageURL properties!" );
293 // = class UnoDialogControl
296 UnoDialogControl::UnoDialogControl( const uno::Reference< uno::XComponentContext >& rxContext )
297 :UnoDialogControl_Base( rxContext )
298 ,maTopWindowListeners( *this )
299 ,mbWindowListener(false)
301 maComponentInfos.nWidth = 300;
302 maComponentInfos.nHeight = 450;
305 UnoDialogControl::~UnoDialogControl()
309 OUString UnoDialogControl::GetComponentServiceName()
312 bool bDecoration( true );
313 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
314 if ( bDecoration )
315 return "Dialog";
316 else
317 return "TabPage";
320 void UnoDialogControl::dispose()
322 SolarMutexGuard aGuard;
324 EventObject aEvt;
325 aEvt.Source = static_cast< ::cppu::OWeakObject* >( this );
326 maTopWindowListeners.disposeAndClear( aEvt );
327 ControlContainerBase::dispose();
330 void SAL_CALL UnoDialogControl::disposing(
331 const EventObject& Source )
333 ControlContainerBase::disposing( Source );
336 sal_Bool UnoDialogControl::setModel( const Reference< XControlModel >& rxModel )
338 // #Can we move all the Resource stuff to the ControlContainerBase ?
339 SolarMutexGuard aGuard;
340 bool bRet = ControlContainerBase::setModel( rxModel );
341 ImplStartListingForResourceEvents();
342 return bRet;
345 void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer )
347 SolarMutexGuard aGuard;
349 UnoControlContainer::createPeer( rxToolkit, rParentPeer );
351 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
352 if ( !xTW.is() )
353 return;
355 xTW->setMenuBar( mxMenuBar );
357 if ( !mbWindowListener )
359 Reference< XWindowListener > xWL( static_cast< cppu::OWeakObject*>( this ), UNO_QUERY );
360 addWindowListener( xWL );
361 mbWindowListener = true;
364 if ( maTopWindowListeners.getLength() )
365 xTW->addTopWindowListener( &maTopWindowListeners );
366 // there must be a better way than doing this, we can't
367 // process the scrolltop & scrollleft in XDialog because
368 // the children haven't been added when those props are applied
369 ImplSetPeerProperty( GetPropertyName( BASEPROPERTY_SCROLLTOP ), ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_SCROLLTOP ) ) );
370 ImplSetPeerProperty( GetPropertyName( BASEPROPERTY_SCROLLLEFT ), ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_SCROLLLEFT ) ) );
373 OUString UnoDialogControl::getImplementationName()
375 return "stardiv.Toolkit.UnoDialogControl";
378 sal_Bool UnoDialogControl::supportsService(OUString const & ServiceName)
380 return cppu::supportsService(this, ServiceName);
383 css::uno::Sequence<OUString> UnoDialogControl::getSupportedServiceNames()
385 return css::uno::Sequence<OUString>{
386 "com.sun.star.awt.UnoControlDialog",
387 "stardiv.vcl.control.Dialog"};
390 void UnoDialogControl::PrepareWindowDescriptor( css::awt::WindowDescriptor& rDesc )
392 UnoControlContainer::PrepareWindowDescriptor( rDesc );
393 bool bDecoration( true );
394 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
395 if ( !bDecoration )
397 // Now we have to manipulate the WindowDescriptor
398 rDesc.WindowAttributes = rDesc.WindowAttributes | css::awt::WindowAttribute::NODECORATION;
401 // We have to set the graphic property before the peer
402 // will be created. Otherwise the properties will be copied
403 // into the peer via propertiesChangeEvents. As the order of
404 // can lead to overwrites we have to set the graphic property
405 // before the propertiesChangeEvents are sent!
406 OUString aImageURL;
407 Reference< graphic::XGraphic > xGraphic;
408 if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
409 ( !aImageURL.isEmpty() ))
411 OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(PROPERTY_DIALOGSOURCEURL), uno::makeAny(aImageURL));
412 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
413 ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::makeAny( xGraphic ), true );
417 void UnoDialogControl::addTopWindowListener( const Reference< XTopWindowListener >& rxListener )
419 maTopWindowListeners.addInterface( rxListener );
420 if( getPeer().is() && maTopWindowListeners.getLength() == 1 )
422 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
423 xTW->addTopWindowListener( &maTopWindowListeners );
427 void UnoDialogControl::removeTopWindowListener( const Reference< XTopWindowListener >& rxListener )
429 if( getPeer().is() && maTopWindowListeners.getLength() == 1 )
431 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
432 xTW->removeTopWindowListener( &maTopWindowListeners );
434 maTopWindowListeners.removeInterface( rxListener );
437 void UnoDialogControl::toFront( )
439 SolarMutexGuard aGuard;
440 if ( getPeer().is() )
442 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
443 if( xTW.is() )
444 xTW->toFront();
448 void UnoDialogControl::toBack( )
450 SolarMutexGuard aGuard;
451 if ( getPeer().is() )
453 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
454 if( xTW.is() )
455 xTW->toBack();
459 void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar )
461 SolarMutexGuard aGuard;
462 mxMenuBar = rxMenuBar;
463 if ( getPeer().is() )
465 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
466 if( xTW.is() )
467 xTW->setMenuBar( mxMenuBar );
470 static ::Size ImplMapPixelToAppFont( OutputDevice const * pOutDev, const ::Size& aSize )
472 ::Size aTmp = pOutDev->PixelToLogic(aSize, MapMode(MapUnit::MapAppFont));
473 return aTmp;
475 // css::awt::XWindowListener
476 void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e )
478 OutputDevice*pOutDev = Application::GetDefaultDevice();
479 DBG_ASSERT( pOutDev, "Missing Default Device!" );
480 if ( !pOutDev || mbSizeModified )
481 return;
483 // Currently we are simply using MapUnit::MapAppFont
484 ::Size aAppFontSize( e.Width, e.Height );
486 Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
487 Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
488 OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
490 // #i87592 In design mode the drawing layer works with sizes with decoration.
491 // Therefore we have to subtract them before writing back to the properties (model).
492 if ( xDialogDevice.is() && mbDesignMode )
494 DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
495 aAppFontSize.AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
496 aAppFontSize.AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
499 aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
501 // Remember that changes have been done by listener. No need to
502 // update the position because of property change event.
503 mbSizeModified = true;
504 Sequence< OUString > aProps( 2 );
505 Sequence< Any > aValues( 2 );
506 // Properties in a sequence must be sorted!
507 aProps[0] = "Height";
508 aProps[1] = "Width";
509 aValues[0] <<= aAppFontSize.Height();
510 aValues[1] <<= aAppFontSize.Width();
512 ImplSetPropertyValues( aProps, aValues, true );
513 mbSizeModified = false;
517 void SAL_CALL UnoDialogControl::windowMoved( const css::awt::WindowEvent& e )
519 OutputDevice*pOutDev = Application::GetDefaultDevice();
520 DBG_ASSERT( pOutDev, "Missing Default Device!" );
521 if ( !pOutDev || mbPosModified )
522 return;
524 // Currently we are simply using MapUnit::MapAppFont
525 ::Size aTmp( e.X, e.Y );
526 aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
528 // Remember that changes have been done by listener. No need to
529 // update the position because of property change event.
530 mbPosModified = true;
531 Sequence< OUString > aProps( 2 );
532 Sequence< Any > aValues( 2 );
533 aProps[0] = "PositionX";
534 aProps[1] = "PositionY";
535 aValues[0] <<= aTmp.Width();
536 aValues[1] <<= aTmp.Height();
538 ImplSetPropertyValues( aProps, aValues, true );
539 mbPosModified = false;
543 void SAL_CALL UnoDialogControl::windowShown( const EventObject& ) {}
545 void SAL_CALL UnoDialogControl::windowHidden( const EventObject& ) {}
547 void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result )
549 Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
550 if ( xPeerDialog.is() )
551 xPeerDialog->endDialog( i_result );
554 void SAL_CALL UnoDialogControl::setHelpId( const OUString& i_id )
556 Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
557 if ( xPeerDialog.is() )
558 xPeerDialog->setHelpId( i_id );
561 void UnoDialogControl::setTitle( const OUString& Title )
563 SolarMutexGuard aGuard;
564 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ), uno::Any(Title), true );
567 OUString UnoDialogControl::getTitle()
569 SolarMutexGuard aGuard;
570 return ImplGetPropertyValue_UString( BASEPROPERTY_TITLE );
573 sal_Int16 UnoDialogControl::execute()
575 SolarMutexGuard aGuard;
576 sal_Int16 nDone = -1;
577 if ( getPeer().is() )
579 Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
580 if( xDlg.is() )
582 GetComponentInfos().bVisible = true;
583 nDone = xDlg->execute();
584 GetComponentInfos().bVisible = false;
587 return nDone;
590 void UnoDialogControl::endExecute()
592 SolarMutexGuard aGuard;
593 if ( getPeer().is() )
595 Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
596 if( xDlg.is() )
598 xDlg->endExecute();
599 GetComponentInfos().bVisible = false;
604 // XModifyListener
605 void SAL_CALL UnoDialogControl::modified(
606 const lang::EventObject& /*rEvent*/ )
608 ImplUpdateResourceResolver();
611 void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents )
613 for( const PropertyChangeEvent& rEvt : rEvents )
615 Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
616 bool bOwnModel = xModel.get() == getModel().get();
617 if (bOwnModel && rEvt.PropertyName == "ImageURL" && !ImplHasProperty(BASEPROPERTY_GRAPHIC))
619 OUString aImageURL;
620 Reference< graphic::XGraphic > xGraphic;
621 if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ) >>= aImageURL ) &&
622 ( !aImageURL.isEmpty() ))
624 OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(GetPropertyName(BASEPROPERTY_DIALOGSOURCEURL)), uno::makeAny(aImageURL));
625 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
627 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC), uno::makeAny( xGraphic ), true );
628 break;
630 else if (bOwnModel && rEvt.PropertyName == "Graphic")
632 uno::Reference<graphic::XGraphic> xGraphic;
633 if (ImplGetPropertyValue("Graphic") >>= xGraphic)
635 ImplSetPropertyValue("Graphic", uno::makeAny(xGraphic), true);
637 break;
640 ControlContainerBase::ImplModelPropertiesChanged(rEvents);
645 UnoMultiPageControl::UnoMultiPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext), maTabListeners( *this )
647 maComponentInfos.nWidth = 280;
648 maComponentInfos.nHeight = 400;
651 UnoMultiPageControl::~UnoMultiPageControl()
654 // XTabListener
656 void SAL_CALL UnoMultiPageControl::inserted( SAL_UNUSED_PARAMETER ::sal_Int32 )
659 void SAL_CALL UnoMultiPageControl::removed( SAL_UNUSED_PARAMETER ::sal_Int32 )
662 void SAL_CALL UnoMultiPageControl::changed( SAL_UNUSED_PARAMETER ::sal_Int32,
663 SAL_UNUSED_PARAMETER const Sequence< NamedValue >& )
666 void SAL_CALL UnoMultiPageControl::activated( ::sal_Int32 ID )
668 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( ID ), false );
671 void SAL_CALL UnoMultiPageControl::deactivated( SAL_UNUSED_PARAMETER ::sal_Int32 )
674 void SAL_CALL UnoMultiPageControl::disposing(const EventObject&)
678 void SAL_CALL UnoMultiPageControl::dispose()
680 lang::EventObject aEvt;
681 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
682 maTabListeners.disposeAndClear( aEvt );
683 ControlContainerBase::dispose();
686 // css::awt::XSimpleTabController
687 ::sal_Int32 SAL_CALL UnoMultiPageControl::insertTab()
689 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
690 return xMultiPage->insertTab();
693 void SAL_CALL UnoMultiPageControl::removeTab( ::sal_Int32 ID )
695 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
696 xMultiPage->removeTab( ID );
699 void SAL_CALL UnoMultiPageControl::setTabProps( ::sal_Int32 ID, const Sequence< NamedValue >& Properties )
701 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
702 xMultiPage->setTabProps( ID, Properties );
705 Sequence< NamedValue > SAL_CALL UnoMultiPageControl::getTabProps( ::sal_Int32 ID )
707 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
708 return xMultiPage->getTabProps( ID );
711 void SAL_CALL UnoMultiPageControl::activateTab( ::sal_Int32 ID )
713 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
714 xMultiPage->activateTab( ID );
715 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( ID ), true );
719 ::sal_Int32 SAL_CALL UnoMultiPageControl::getActiveTabID()
721 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
722 return xMultiPage->getActiveTabID();
725 void SAL_CALL UnoMultiPageControl::addTabListener( const Reference< XTabListener >& Listener )
727 maTabListeners.addInterface( Listener );
728 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
729 if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
730 xMultiPage->addTabListener( &maTabListeners );
733 void SAL_CALL UnoMultiPageControl::removeTabListener( const Reference< XTabListener >& Listener )
735 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
736 if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
737 xMultiPage->removeTabListener( &maTabListeners );
738 maTabListeners.removeInterface( Listener );
741 IMPL_IMPLEMENTATION_ID( UnoMultiPageControl )
743 // lang::XTypeProvider
744 css::uno::Sequence< css::uno::Type > UnoMultiPageControl::getTypes()
746 static const ::cppu::OTypeCollection aTypeList(
747 cppu::UnoType<css::lang::XTypeProvider>::get(),
748 cppu::UnoType<awt::XSimpleTabController>::get(),
749 cppu::UnoType<awt::XTabListener>::get(),
750 ControlContainerBase::getTypes()
752 return aTypeList.getTypes();
755 // uno::XInterface
756 uno::Any UnoMultiPageControl::queryAggregation( const uno::Type & rType )
758 uno::Any aRet = ::cppu::queryInterface( rType,
759 static_cast< awt::XTabListener* >(this),
760 static_cast< awt::XSimpleTabController* >(this) );
761 return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType ));
764 OUString UnoMultiPageControl::GetComponentServiceName()
766 bool bDecoration( true );
767 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
768 if ( bDecoration )
769 return "tabcontrol";
770 // Hopefully we can tweak the tabcontrol to display without tabs
771 return "tabcontrolnotabs";
774 void UnoMultiPageControl::bindPage( const uno::Reference< awt::XControl >& _rxControl )
776 uno::Reference< awt::XWindowPeer > xPage( _rxControl->getPeer() );
777 uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY );
778 uno::Reference< beans::XPropertySet > xProps( _rxControl->getModel(), uno::UNO_QUERY );
780 VCLXTabPage* pXPage = dynamic_cast< VCLXTabPage* >( xPage.get() );
781 TabPage* pPage = pXPage ? pXPage->getTabPage() : nullptr;
782 if ( xTabCntrl.is() && pPage )
784 VCLXMultiPage* pXTab = dynamic_cast< VCLXMultiPage* >( xTabCntrl.get() );
785 if ( pXTab )
787 OUString sTitle;
788 xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
789 pXTab->insertTab( pPage, sTitle);
795 void UnoMultiPageControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer )
797 SolarMutexGuard aSolarGuard;
799 UnoControlContainer::createPeer( rxToolkit, rParentPeer );
801 const uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
802 for( const auto& rCtrl : aCtrls )
803 bindPage( rCtrl );
804 sal_Int32 nActiveTab(0);
805 Reference< XPropertySet > xMultiProps( getModel(), UNO_QUERY );
806 xMultiProps->getPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ) ) >>= nActiveTab;
808 uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY );
809 if ( xTabCntrl.is() )
811 xTabCntrl->addTabListener( this );
812 if ( nActiveTab && aCtrls.hasElements() ) // Ensure peer is initialise with correct activated tab
814 xTabCntrl->activateTab( nActiveTab );
815 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( nActiveTab ), true );
820 void UnoMultiPageControl::impl_createControlPeerIfNecessary( const uno::Reference< awt::XControl >& _rxControl)
822 OSL_PRECOND( _rxControl.is(), "UnoMultiPageControl::impl_createControlPeerIfNecessary: invalid control, this will crash!" );
824 // if the container already has a peer, then also create a peer for the control
825 uno::Reference< awt::XWindowPeer > xMyPeer( getPeer() );
827 if( xMyPeer.is() )
829 _rxControl->createPeer( nullptr, xMyPeer );
830 bindPage( _rxControl );
831 ImplActivateTabControllers();
836 // ------------- UnoMultiPageModel -----------------
838 UnoMultiPageModel::UnoMultiPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
840 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
841 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
842 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
843 ImplRegisterProperty( BASEPROPERTY_ENABLED );
845 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
846 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
847 ImplRegisterProperty( BASEPROPERTY_HELPURL );
848 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
849 //ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
850 ImplRegisterProperty( BASEPROPERTY_MULTIPAGEVALUE );
851 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
852 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
854 Any aBool;
855 aBool <<= true;
856 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
857 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
858 ImplRegisterProperty( BASEPROPERTY_DECORATION, aBool );
859 // MultiPage Control has the tab stop property. And the default value is True.
860 ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
862 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
863 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
866 UnoMultiPageModel::~UnoMultiPageModel()
870 rtl::Reference<UnoControlModel> UnoMultiPageModel::Clone() const
872 // clone the container itself
873 UnoMultiPageModel* pClone = new UnoMultiPageModel( *this );
874 Clone_Impl( *pClone );
875 return pClone;
878 OUString UnoMultiPageModel::getServiceName()
880 return "com.sun.star.awt.UnoMultiPageModel";
883 uno::Any UnoMultiPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
885 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
887 return uno::Any( OUString( "com.sun.star.awt.UnoControlMultiPage" ) );
889 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
892 ::cppu::IPropertyArrayHelper& UnoMultiPageModel::getInfoHelper()
894 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
895 return aHelper;
898 // beans::XMultiPropertySet
899 uno::Reference< beans::XPropertySetInfo > UnoMultiPageModel::getPropertySetInfo( )
901 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
902 return xInfo;
905 void UnoMultiPageModel::insertByName( const OUString& aName, const Any& aElement )
907 Reference< XServiceInfo > xInfo;
908 aElement >>= xInfo;
910 if ( !xInfo.is() )
911 throw IllegalArgumentException();
913 // Only a Page model can be inserted into the multipage
914 if ( !xInfo->supportsService( "com.sun.star.awt.UnoPageModel" ) )
915 throw IllegalArgumentException();
917 return ControlModelContainerBase::insertByName( aName, aElement );
921 sal_Bool SAL_CALL UnoMultiPageModel::getGroupControl( )
923 return true;
928 UnoPageControl::UnoPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext)
930 maComponentInfos.nWidth = 280;
931 maComponentInfos.nHeight = 400;
934 UnoPageControl::~UnoPageControl()
938 OUString UnoPageControl::GetComponentServiceName()
940 return "tabpage";
944 // ------------- UnoPageModel -----------------
946 UnoPageModel::UnoPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
948 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
949 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
950 ImplRegisterProperty( BASEPROPERTY_ENABLED );
951 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
953 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
954 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
955 ImplRegisterProperty( BASEPROPERTY_HELPURL );
956 ImplRegisterProperty( BASEPROPERTY_TITLE );
957 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
958 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
959 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
960 // ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
962 Any aBool;
963 aBool <<= true;
964 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
965 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
966 //ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
968 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
969 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
972 UnoPageModel::~UnoPageModel()
976 rtl::Reference<UnoControlModel> UnoPageModel::Clone() const
978 // clone the container itself
979 UnoPageModel* pClone = new UnoPageModel( *this );
980 Clone_Impl( *pClone );
981 return pClone;
984 OUString UnoPageModel::getServiceName()
986 return "com.sun.star.awt.UnoPageModel";
989 uno::Any UnoPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
991 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
993 return uno::Any( OUString( "com.sun.star.awt.UnoControlPage" ) );
995 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
998 ::cppu::IPropertyArrayHelper& UnoPageModel::getInfoHelper()
1000 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
1001 return aHelper;
1004 // beans::XMultiPropertySet
1005 uno::Reference< beans::XPropertySetInfo > UnoPageModel::getPropertySetInfo( )
1007 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1008 return xInfo;
1012 sal_Bool SAL_CALL UnoPageModel::getGroupControl( )
1014 return false;
1017 // Frame control
1021 UnoFrameControl::UnoFrameControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext)
1023 maComponentInfos.nWidth = 280;
1024 maComponentInfos.nHeight = 400;
1027 UnoFrameControl::~UnoFrameControl()
1031 OUString UnoFrameControl::GetComponentServiceName()
1033 return "frame";
1036 void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
1038 bool bOwnCtrl = false;
1039 OUString sTitle;
1040 if ( rxCtrl.get() == Reference<XControl>( this ).get() )
1041 bOwnCtrl = true;
1042 Reference< XPropertySet > xProps( getModel(), UNO_QUERY );
1043 //xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
1044 xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_LABEL ) ) >>= sTitle;
1046 ControlContainerBase::ImplSetPosSize( rxCtrl );
1047 Reference < XWindow > xW( rxCtrl, UNO_QUERY );
1048 if ( bOwnCtrl || !xW.is() || sTitle.isEmpty() )
1049 return;
1051 awt::Rectangle aSizePos = xW->getPosSize();
1053 sal_Int32 nX = aSizePos.X, nY = aSizePos.Y, nWidth = aSizePos.Width, nHeight = aSizePos.Height;
1054 // Retrieve the values set by the base class
1055 OutputDevice*pOutDev = Application::GetDefaultDevice();
1056 if ( pOutDev )
1058 // Adjust Y based on height of Title
1059 ::tools::Rectangle aRect = pOutDev->GetTextRect( {}, sTitle );
1060 nY = nY + ( aRect.GetHeight() / 2 );
1062 else
1064 Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer();
1065 Reference< XDevice > xD( xPeer, UNO_QUERY );
1067 SimpleFontMetric aFM;
1068 FontDescriptor aFD;
1069 Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
1071 aVal >>= aFD;
1072 if ( !aFD.StyleName.isEmpty() )
1074 Reference< XFont > xFont = xD->getFont( aFD );
1075 aFM = xFont->getFontMetric();
1077 else
1079 Reference< XGraphics > xG = xD->createGraphics();
1080 aFM = xG->getFontMetric();
1083 sal_Int16 nH = aFM.Ascent + aFM.Descent;
1084 // offset y based on height of font ( not sure if my guess at the correct calculation is correct here )
1085 nY = nY + ( nH / 8); // how do I test this
1087 xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
1090 // ------------- UnoFrameModel -----------------
1092 UnoFrameModel::UnoFrameModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
1094 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
1095 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
1096 ImplRegisterProperty( BASEPROPERTY_ENABLED );
1097 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
1098 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
1099 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
1100 ImplRegisterProperty( BASEPROPERTY_HELPURL );
1101 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
1102 ImplRegisterProperty( BASEPROPERTY_LABEL );
1103 ImplRegisterProperty( BASEPROPERTY_WRITING_MODE );
1104 ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE );
1105 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
1106 ImplRegisterProperty( BASEPROPERTY_HSCROLL );
1107 ImplRegisterProperty( BASEPROPERTY_VSCROLL );
1108 ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH );
1109 ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT );
1110 ImplRegisterProperty( BASEPROPERTY_SCROLLTOP );
1111 ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT );
1114 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
1115 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
1118 UnoFrameModel::~UnoFrameModel()
1122 rtl::Reference<UnoControlModel> UnoFrameModel::Clone() const
1124 // clone the container itself
1125 UnoFrameModel* pClone = new UnoFrameModel( *this );
1126 Clone_Impl( *pClone );
1127 return pClone;
1130 OUString UnoFrameModel::getServiceName()
1132 return "com.sun.star.awt.UnoFrameModel";
1135 uno::Any UnoFrameModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
1137 switch ( nPropId )
1139 case BASEPROPERTY_DEFAULTCONTROL:
1141 return uno::Any( OUString( "com.sun.star.awt.UnoControlFrame" ) );
1143 case BASEPROPERTY_SCROLLWIDTH:
1144 case BASEPROPERTY_SCROLLHEIGHT:
1145 case BASEPROPERTY_SCROLLTOP:
1146 case BASEPROPERTY_SCROLLLEFT:
1147 return uno::Any( sal_Int32(0) );
1148 case BASEPROPERTY_USERFORMCONTAINEES:
1150 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
1151 return makeAny( xNameCont );
1154 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
1157 ::cppu::IPropertyArrayHelper& UnoFrameModel::getInfoHelper()
1159 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
1160 return aHelper;
1163 // beans::XMultiPropertySet
1164 uno::Reference< beans::XPropertySetInfo > UnoFrameModel::getPropertySetInfo( )
1166 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1167 return xInfo;
1170 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1171 stardiv_Toolkit_UnoControlDialogModel_get_implementation(
1172 css::uno::XComponentContext *context,
1173 css::uno::Sequence<css::uno::Any> const &)
1175 return cppu::acquire(new OGeometryControlModel<UnoControlDialogModel>(context));
1178 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1179 stardiv_Toolkit_UnoDialogControl_get_implementation(
1180 css::uno::XComponentContext *context,
1181 css::uno::Sequence<css::uno::Any> const &)
1183 return cppu::acquire(new UnoDialogControl(context));
1186 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1187 stardiv_Toolkit_UnoMultiPageControl_get_implementation(
1188 css::uno::XComponentContext *context,
1189 css::uno::Sequence<css::uno::Any> const &)
1191 return cppu::acquire(new UnoMultiPageControl(context));
1194 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1195 stardiv_Toolkit_UnoMultiPageModel_get_implementation(
1196 css::uno::XComponentContext *context,
1197 css::uno::Sequence<css::uno::Any> const &)
1199 return cppu::acquire(new UnoMultiPageModel(context));
1202 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1203 stardiv_Toolkit_UnoPageControl_get_implementation(
1204 css::uno::XComponentContext *context,
1205 css::uno::Sequence<css::uno::Any> const &)
1207 return cppu::acquire(new UnoPageControl(context));
1210 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1211 stardiv_Toolkit_UnoPageModel_get_implementation(
1212 css::uno::XComponentContext *context,
1213 css::uno::Sequence<css::uno::Any> const &)
1215 return cppu::acquire(new UnoPageModel(context));
1218 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1219 stardiv_Toolkit_UnoFrameControl_get_implementation(
1220 css::uno::XComponentContext *context,
1221 css::uno::Sequence<css::uno::Any> const &)
1223 return cppu::acquire(new UnoFrameControl(context));
1226 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1227 stardiv_Toolkit_UnoFrameModel_get_implementation(
1228 css::uno::XComponentContext *context,
1229 css::uno::Sequence<css::uno::Any> const &)
1231 return cppu::acquire(new UnoFrameModel(context));
1234 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */