Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / toolkit / source / controls / dialogcontrol.cxx
blob2cac7986a5066c5b3c8843c776fd9074b855503a
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 <vcl/window.hxx>
23 #include <vcl/wall.hxx>
24 #include <osl/mutex.hxx>
25 #include <toolkit/controls/dialogcontrol.hxx>
26 #include <toolkit/controls/geometrycontrolmodel.hxx>
27 #include <toolkit/helper/property.hxx>
28 #include <toolkit/controls/stdtabcontroller.hxx>
29 #include <com/sun/star/awt/PosSize.hpp>
30 #include <com/sun/star/awt/WindowAttribute.hpp>
31 #include <com/sun/star/uno/XComponentContext.hpp>
32 #include <com/sun/star/graphic/XGraphicProvider.hpp>
33 #include <cppuhelper/supportsservice.hxx>
34 #include <cppuhelper/typeprovider.hxx>
35 #include <cppuhelper/queryinterface.hxx>
36 #include <tools/debug.hxx>
37 #include <tools/diagnose_ex.h>
38 #include <comphelper/sequence.hxx>
39 #include <vcl/outdev.hxx>
41 #include <vcl/graph.hxx>
42 #include <vcl/image.hxx>
43 #include <cppuhelper/implbase.hxx>
44 #include <algorithm>
45 #include <functional>
46 #include <map>
47 #include <unordered_map>
48 #include <osl/file.hxx>
50 #include <vcl/tabctrl.hxx>
51 #include <toolkit/awt/vclxwindows.hxx>
52 #include <toolkit/controls/unocontrols.hxx>
54 #include <helper/unopropertyarrayhelper.hxx>
55 #include "controlmodelcontainerbase_internal.hxx"
57 using namespace ::com::sun::star;
58 using namespace ::com::sun::star::uno;
59 using namespace ::com::sun::star::awt;
60 using namespace ::com::sun::star::lang;
61 using namespace ::com::sun::star::container;
62 using namespace ::com::sun::star::beans;
63 using namespace ::com::sun::star::util;
65 #define PROPERTY_DIALOGSOURCEURL "DialogSourceURL"
66 #define PROPERTY_IMAGEURL "ImageURL"
67 #define PROPERTY_GRAPHIC "Graphic"
70 // we probably will need both a hash of control models and hash of controls
71 // => use some template magic
73 template< typename T >
74 class SimpleNamedThingContainer : public ::cppu::WeakImplHelper< container::XNameContainer >
76 std::unordered_map< OUString, Reference< T > > things;
77 ::osl::Mutex m_aMutex;
78 public:
79 // css::container::XNameContainer, XNameReplace, XNameAccess
80 virtual void SAL_CALL replaceByName( const OUString& aName, const Any& aElement ) override
82 ::osl::MutexGuard aGuard( m_aMutex );
83 if ( !hasByName( aName ) )
84 throw NoSuchElementException();
85 Reference< T > xElement;
86 if ( ! ( aElement >>= xElement ) )
87 throw IllegalArgumentException();
88 things[ aName ] = xElement;
90 virtual Any SAL_CALL getByName( const OUString& aName ) override
92 ::osl::MutexGuard aGuard( m_aMutex );
93 if ( !hasByName( aName ) )
94 throw NoSuchElementException();
95 return uno::makeAny( things[ aName ] );
97 virtual Sequence< OUString > SAL_CALL getElementNames( ) override
99 ::osl::MutexGuard aGuard( m_aMutex );
100 return comphelper::mapKeysToSequence( things );
102 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override
104 ::osl::MutexGuard aGuard( m_aMutex );
105 return ( things.find( aName ) != things.end() );
107 virtual void SAL_CALL insertByName( const OUString& aName, const Any& aElement ) override
109 ::osl::MutexGuard aGuard( m_aMutex );
110 if ( hasByName( aName ) )
111 throw ElementExistException();
112 Reference< T > xElement;
113 if ( ! ( aElement >>= xElement ) )
114 throw IllegalArgumentException();
115 things[ aName ] = xElement;
117 virtual void SAL_CALL removeByName( const OUString& aName ) override
119 ::osl::MutexGuard 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 ::osl::MutexGuard aGuard( m_aMutex );
130 return ( !things.empty() );
134 namespace {
136 class UnoControlDialogModel : public ControlModelContainerBase
138 protected:
139 css::uno::Reference< css::graphic::XGraphicObject > mxGrfObj;
140 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
141 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
142 // ::cppu::OPropertySetHelper
143 void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) override;
144 public:
145 explicit UnoControlDialogModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
146 UnoControlDialogModel( const UnoControlDialogModel& rModel );
148 rtl::Reference<UnoControlModel> Clone() const override;
149 // css::beans::XMultiPropertySet
150 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
152 // css::io::XPersistObject
153 OUString SAL_CALL getServiceName() override;
155 // XServiceInfo
156 OUString SAL_CALL getImplementationName() override
157 { return OUString("stardiv.Toolkit.UnoControlDialogModel"); }
159 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
161 auto s(ControlModelContainerBase::getSupportedServiceNames());
162 s.realloc(s.getLength() + 2);
163 s[s.getLength() - 2] = "com.sun.star.awt.UnoControlDialogModel";
164 s[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::makeAny( 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 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 setFastPropertyValue_NoBroadcast( BASEPROPERTY_USERFORMCONTAINEES, makeAny( xNameCont ) );
219 rtl::Reference<UnoControlModel> UnoControlDialogModel::Clone() const
221 // clone the container itself
222 UnoControlDialogModel* pClone = new UnoControlDialogModel( *this );
224 Clone_Impl(*pClone);
226 return pClone;
230 OUString UnoControlDialogModel::getServiceName( )
232 return OUString("stardiv.vcl.controlmodel.Dialog");
235 Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
237 Any aAny;
239 switch ( nPropId )
241 case BASEPROPERTY_DEFAULTCONTROL:
242 aAny <<= OUString::createFromAscii( szServiceName_UnoControlDialog );
243 break;
244 case BASEPROPERTY_SCROLLWIDTH:
245 case BASEPROPERTY_SCROLLHEIGHT:
246 case BASEPROPERTY_SCROLLTOP:
247 case BASEPROPERTY_SCROLLLEFT:
248 aAny <<= sal_Int32(0);
249 break;
250 default:
251 aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
254 return aAny;
257 ::cppu::IPropertyArrayHelper& UnoControlDialogModel::getInfoHelper()
259 static UnoPropertyArrayHelper* pHelper = nullptr;
260 if ( !pHelper )
262 Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
263 pHelper = new UnoPropertyArrayHelper( aIDs );
265 return *pHelper;
268 // XMultiPropertySet
269 Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( )
271 static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
272 return xInfo;
275 void SAL_CALL UnoControlDialogModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue )
277 ControlModelContainerBase::setFastPropertyValue_NoBroadcast( nHandle, rValue );
280 if ( nHandle == BASEPROPERTY_IMAGEURL && ImplHasProperty( BASEPROPERTY_GRAPHIC ) )
282 OUString sImageURL;
283 OSL_VERIFY( rValue >>= sImageURL );
284 setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( mxGrfObj, sImageURL ) ) );
287 catch( const css::uno::Exception& )
289 OSL_ENSURE( false, "UnoControlDialogModel::setFastPropertyValue_NoBroadcast: caught an exception while setting ImageURL properties!" );
296 // = class UnoDialogControl
299 UnoDialogControl::UnoDialogControl( const uno::Reference< uno::XComponentContext >& rxContext )
300 :UnoDialogControl_Base( rxContext )
301 ,maTopWindowListeners( *this )
302 ,mbWindowListener(false)
304 maComponentInfos.nWidth = 300;
305 maComponentInfos.nHeight = 450;
308 UnoDialogControl::~UnoDialogControl()
312 OUString UnoDialogControl::GetComponentServiceName()
315 bool bDecoration( true );
316 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
317 if ( bDecoration )
318 return OUString("Dialog");
319 else
320 return OUString("TabPage");
323 void UnoDialogControl::dispose()
325 SolarMutexGuard aGuard;
327 EventObject aEvt;
328 aEvt.Source = static_cast< ::cppu::OWeakObject* >( this );
329 maTopWindowListeners.disposeAndClear( aEvt );
330 ControlContainerBase::dispose();
333 void SAL_CALL UnoDialogControl::disposing(
334 const EventObject& Source )
336 ControlContainerBase::disposing( Source );
339 sal_Bool UnoDialogControl::setModel( const Reference< XControlModel >& rxModel )
341 // #Can we move all the Resource stuff to the ControlContainerBase ?
342 SolarMutexGuard aGuard;
343 bool bRet = ControlContainerBase::setModel( rxModel );
344 ImplStartListingForResourceEvents();
345 return bRet;
348 void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer )
350 SolarMutexGuard aGuard;
352 UnoControlContainer::createPeer( rxToolkit, rParentPeer );
354 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
355 if ( xTW.is() )
357 xTW->setMenuBar( mxMenuBar );
359 if ( !mbWindowListener )
361 Reference< XWindowListener > xWL( static_cast< cppu::OWeakObject*>( this ), UNO_QUERY );
362 addWindowListener( xWL );
363 mbWindowListener = true;
366 if ( maTopWindowListeners.getLength() )
367 xTW->addTopWindowListener( &maTopWindowListeners );
368 // there must be a better way than doing this, we can't
369 // process the scrolltop & scrollleft in XDialog because
370 // the children haven't been added when those props are applied
371 ImplSetPeerProperty( GetPropertyName( BASEPROPERTY_SCROLLTOP ), ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_SCROLLTOP ) ) );
372 ImplSetPeerProperty( GetPropertyName( BASEPROPERTY_SCROLLLEFT ), ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_SCROLLLEFT ) ) );
377 OUString UnoDialogControl::getImplementationName()
379 return OUString("stardiv.Toolkit.UnoDialogControl");
382 sal_Bool UnoDialogControl::supportsService(OUString const & ServiceName)
384 return cppu::supportsService(this, ServiceName);
387 css::uno::Sequence<OUString> UnoDialogControl::getSupportedServiceNames()
389 return css::uno::Sequence<OUString>{
390 OUString::createFromAscii(szServiceName2_UnoControlDialog),
391 "stardiv.vcl.control.Dialog"};
394 void UnoDialogControl::PrepareWindowDescriptor( css::awt::WindowDescriptor& rDesc )
396 UnoControlContainer::PrepareWindowDescriptor( rDesc );
397 bool bDecoration( true );
398 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
399 if ( !bDecoration )
401 // Now we have to manipulate the WindowDescriptor
402 rDesc.WindowAttributes = rDesc.WindowAttributes | css::awt::WindowAttribute::NODECORATION;
405 // We have to set the graphic property before the peer
406 // will be created. Otherwise the properties will be copied
407 // into the peer via propertiesChangeEvents. As the order of
408 // can lead to overwrites we have to set the graphic property
409 // before the propertiesChangeEvents are sent!
410 OUString aImageURL;
411 Reference< graphic::XGraphic > xGraphic;
412 if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
413 ( !aImageURL.isEmpty() ))
415 OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(PROPERTY_DIALOGSOURCEURL), uno::makeAny(aImageURL));
416 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
417 ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::makeAny( xGraphic ), true );
421 void UnoDialogControl::addTopWindowListener( const Reference< XTopWindowListener >& rxListener )
423 maTopWindowListeners.addInterface( rxListener );
424 if( getPeer().is() && maTopWindowListeners.getLength() == 1 )
426 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
427 xTW->addTopWindowListener( &maTopWindowListeners );
431 void UnoDialogControl::removeTopWindowListener( const Reference< XTopWindowListener >& rxListener )
433 if( getPeer().is() && maTopWindowListeners.getLength() == 1 )
435 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
436 xTW->removeTopWindowListener( &maTopWindowListeners );
438 maTopWindowListeners.removeInterface( rxListener );
441 void UnoDialogControl::toFront( )
443 SolarMutexGuard aGuard;
444 if ( getPeer().is() )
446 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
447 if( xTW.is() )
448 xTW->toFront();
452 void UnoDialogControl::toBack( )
454 SolarMutexGuard aGuard;
455 if ( getPeer().is() )
457 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
458 if( xTW.is() )
459 xTW->toBack();
463 void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar )
465 SolarMutexGuard aGuard;
466 mxMenuBar = rxMenuBar;
467 if ( getPeer().is() )
469 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
470 if( xTW.is() )
471 xTW->setMenuBar( mxMenuBar );
474 static ::Size ImplMapPixelToAppFont( OutputDevice const * pOutDev, const ::Size& aSize )
476 ::Size aTmp = pOutDev->PixelToLogic(aSize, MapMode(MapUnit::MapAppFont));
477 return aTmp;
479 // css::awt::XWindowListener
480 void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e )
482 OutputDevice*pOutDev = Application::GetDefaultDevice();
483 DBG_ASSERT( pOutDev, "Missing Default Device!" );
484 if ( !pOutDev || mbSizeModified )
485 return;
487 // Currentley we are simply using MapUnit::MapAppFont
488 ::Size aAppFontSize( e.Width, e.Height );
490 Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
491 Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
492 OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
494 // #i87592 In design mode the drawing layer works with sizes with decoration.
495 // Therefore we have to subtract them before writing back to the properties (model).
496 if ( xDialogDevice.is() && mbDesignMode )
498 DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
499 aAppFontSize.AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
500 aAppFontSize.AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
503 aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
505 // Remember that changes have been done by listener. No need to
506 // update the position because of property change event.
507 mbSizeModified = true;
508 Sequence< OUString > aProps( 2 );
509 Sequence< Any > aValues( 2 );
510 // Properties in a sequence must be sorted!
511 aProps[0] = "Height";
512 aProps[1] = "Width";
513 aValues[0] <<= aAppFontSize.Height();
514 aValues[1] <<= aAppFontSize.Width();
516 ImplSetPropertyValues( aProps, aValues, true );
517 mbSizeModified = false;
521 void SAL_CALL UnoDialogControl::windowMoved( const css::awt::WindowEvent& e )
523 OutputDevice*pOutDev = Application::GetDefaultDevice();
524 DBG_ASSERT( pOutDev, "Missing Default Device!" );
525 if ( !pOutDev || mbPosModified )
526 return;
528 // Currentley we are simply using MapUnit::MapAppFont
529 ::Size aTmp( e.X, e.Y );
530 aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
532 // Remember that changes have been done by listener. No need to
533 // update the position because of property change event.
534 mbPosModified = true;
535 Sequence< OUString > aProps( 2 );
536 Sequence< Any > aValues( 2 );
537 aProps[0] = "PositionX";
538 aProps[1] = "PositionY";
539 aValues[0] <<= aTmp.Width();
540 aValues[1] <<= aTmp.Height();
542 ImplSetPropertyValues( aProps, aValues, true );
543 mbPosModified = false;
547 void SAL_CALL UnoDialogControl::windowShown( const EventObject& ) {}
549 void SAL_CALL UnoDialogControl::windowHidden( const EventObject& ) {}
551 void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result )
553 Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
554 if ( xPeerDialog.is() )
555 xPeerDialog->endDialog( i_result );
558 void SAL_CALL UnoDialogControl::setHelpId( const OUString& i_id )
560 Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
561 if ( xPeerDialog.is() )
562 xPeerDialog->setHelpId( i_id );
565 void UnoDialogControl::setTitle( const OUString& Title )
567 SolarMutexGuard aGuard;
568 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ), uno::Any(Title), true );
571 OUString UnoDialogControl::getTitle()
573 SolarMutexGuard aGuard;
574 return ImplGetPropertyValue_UString( BASEPROPERTY_TITLE );
577 sal_Int16 UnoDialogControl::execute()
579 SolarMutexGuard aGuard;
580 sal_Int16 nDone = -1;
581 if ( getPeer().is() )
583 Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
584 if( xDlg.is() )
586 GetComponentInfos().bVisible = true;
587 nDone = xDlg->execute();
588 GetComponentInfos().bVisible = false;
591 return nDone;
594 void UnoDialogControl::endExecute()
596 SolarMutexGuard aGuard;
597 if ( getPeer().is() )
599 Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
600 if( xDlg.is() )
602 xDlg->endExecute();
603 GetComponentInfos().bVisible = false;
608 // XModifyListener
609 void SAL_CALL UnoDialogControl::modified(
610 const lang::EventObject& /*rEvent*/ )
612 ImplUpdateResourceResolver();
615 void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents )
617 sal_Int32 nLen = rEvents.getLength();
618 for( sal_Int32 i = 0; i < nLen; i++ )
620 const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
621 Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
622 bool bOwnModel = xModel.get() == getModel().get();
623 if ( bOwnModel && rEvt.PropertyName == "ImageURL" )
625 OUString aImageURL;
626 Reference< graphic::XGraphic > xGraphic;
627 if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ) >>= aImageURL ) &&
628 ( !aImageURL.isEmpty() ))
630 OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(GetPropertyName(BASEPROPERTY_DIALOGSOURCEURL)), uno::makeAny(aImageURL));
631 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
633 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC), uno::makeAny( xGraphic ), true );
634 break;
637 ControlContainerBase::ImplModelPropertiesChanged(rEvents);
641 // class MultiPageControl
643 UnoMultiPageControl::UnoMultiPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext), maTabListeners( *this )
645 maComponentInfos.nWidth = 280;
646 maComponentInfos.nHeight = 400;
649 UnoMultiPageControl::~UnoMultiPageControl()
652 // XTabListener
654 void SAL_CALL UnoMultiPageControl::inserted( SAL_UNUSED_PARAMETER ::sal_Int32 )
657 void SAL_CALL UnoMultiPageControl::removed( SAL_UNUSED_PARAMETER ::sal_Int32 )
660 void SAL_CALL UnoMultiPageControl::changed( SAL_UNUSED_PARAMETER ::sal_Int32,
661 SAL_UNUSED_PARAMETER const Sequence< NamedValue >& )
664 void SAL_CALL UnoMultiPageControl::activated( ::sal_Int32 ID )
666 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( ID ), false );
669 void SAL_CALL UnoMultiPageControl::deactivated( SAL_UNUSED_PARAMETER ::sal_Int32 )
672 void SAL_CALL UnoMultiPageControl::disposing(const EventObject&)
676 void SAL_CALL UnoMultiPageControl::dispose()
678 lang::EventObject aEvt;
679 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
680 maTabListeners.disposeAndClear( aEvt );
681 ControlContainerBase::dispose();
684 // css::awt::XSimpleTabController
685 ::sal_Int32 SAL_CALL UnoMultiPageControl::insertTab()
687 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
688 return xMultiPage->insertTab();
691 void SAL_CALL UnoMultiPageControl::removeTab( ::sal_Int32 ID )
693 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
694 xMultiPage->removeTab( ID );
697 void SAL_CALL UnoMultiPageControl::setTabProps( ::sal_Int32 ID, const Sequence< NamedValue >& Properties )
699 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
700 xMultiPage->setTabProps( ID, Properties );
703 Sequence< NamedValue > SAL_CALL UnoMultiPageControl::getTabProps( ::sal_Int32 ID )
705 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
706 return xMultiPage->getTabProps( ID );
709 void SAL_CALL UnoMultiPageControl::activateTab( ::sal_Int32 ID )
711 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
712 xMultiPage->activateTab( ID );
713 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( ID ), true );
717 ::sal_Int32 SAL_CALL UnoMultiPageControl::getActiveTabID()
719 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
720 return xMultiPage->getActiveTabID();
723 void SAL_CALL UnoMultiPageControl::addTabListener( const Reference< XTabListener >& Listener )
725 maTabListeners.addInterface( Listener );
726 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
727 if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
728 xMultiPage->addTabListener( &maTabListeners );
731 void SAL_CALL UnoMultiPageControl::removeTabListener( const Reference< XTabListener >& Listener )
733 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
734 if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
735 xMultiPage->removeTabListener( &maTabListeners );
736 maTabListeners.removeInterface( Listener );
740 // lang::XTypeProvider
741 IMPL_XTYPEPROVIDER_START( UnoMultiPageControl )
742 cppu::UnoType<awt::XSimpleTabController>::get(),
743 cppu::UnoType<awt::XTabListener>::get(),
744 ControlContainerBase::getTypes()
745 IMPL_XTYPEPROVIDER_END
747 // uno::XInterface
748 uno::Any UnoMultiPageControl::queryAggregation( const uno::Type & rType )
750 uno::Any aRet = ::cppu::queryInterface( rType,
751 static_cast< awt::XTabListener* >(this),
752 static_cast< awt::XSimpleTabController* >(this) );
753 return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType ));
756 OUString UnoMultiPageControl::GetComponentServiceName()
758 bool bDecoration( true );
759 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
760 if ( bDecoration )
761 return OUString("tabcontrol");
762 // Hopefully we can tweak the tabcontrol to display without tabs
763 return OUString("tabcontrolnotabs");
766 void UnoMultiPageControl::bindPage( const uno::Reference< awt::XControl >& _rxControl )
768 uno::Reference< awt::XWindowPeer > xPage( _rxControl->getPeer() );
769 uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY );
770 uno::Reference< beans::XPropertySet > xProps( _rxControl->getModel(), uno::UNO_QUERY );
772 VCLXTabPage* pXPage = dynamic_cast< VCLXTabPage* >( xPage.get() );
773 TabPage* pPage = pXPage ? pXPage->getTabPage() : nullptr;
774 if ( xTabCntrl.is() && pPage )
776 VCLXMultiPage* pXTab = dynamic_cast< VCLXMultiPage* >( xTabCntrl.get() );
777 if ( pXTab )
779 OUString sTitle;
780 xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
781 pXTab->insertTab( pPage, sTitle);
787 void UnoMultiPageControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer )
789 SolarMutexGuard aSolarGuard;
791 UnoControlContainer::createPeer( rxToolkit, rParentPeer );
793 uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
794 sal_uInt32 nCtrls = aCtrls.getLength();
795 for( sal_uInt32 n = 0; n < nCtrls; n++ )
796 bindPage( aCtrls[ n ] );
797 sal_Int32 nActiveTab(0);
798 Reference< XPropertySet > xMultiProps( getModel(), UNO_QUERY );
799 xMultiProps->getPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ) ) >>= nActiveTab;
801 uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY );
802 if ( xTabCntrl.is() )
804 xTabCntrl->addTabListener( this );
805 if ( nActiveTab && nCtrls ) // Ensure peer is initialise with correct activated tab
807 xTabCntrl->activateTab( nActiveTab );
808 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( nActiveTab ), true );
813 void UnoMultiPageControl::impl_createControlPeerIfNecessary( const uno::Reference< awt::XControl >& _rxControl)
815 OSL_PRECOND( _rxControl.is(), "UnoMultiPageControl::impl_createControlPeerIfNecessary: invalid control, this will crash!" );
817 // if the container already has a peer, then also create a peer for the control
818 uno::Reference< awt::XWindowPeer > xMyPeer( getPeer() );
820 if( xMyPeer.is() )
822 _rxControl->createPeer( nullptr, xMyPeer );
823 bindPage( _rxControl );
824 ImplActivateTabControllers();
829 // ------------- UnoMultiPageModel -----------------
831 UnoMultiPageModel::UnoMultiPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
833 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
834 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
835 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
836 ImplRegisterProperty( BASEPROPERTY_ENABLED );
838 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
839 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
840 ImplRegisterProperty( BASEPROPERTY_HELPURL );
841 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
842 //ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
843 ImplRegisterProperty( BASEPROPERTY_MULTIPAGEVALUE );
844 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
845 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
847 Any aBool;
848 aBool <<= true;
849 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
850 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
851 ImplRegisterProperty( BASEPROPERTY_DECORATION, aBool );
852 // MultiPage Control has the tab stop property. And the default value is True.
853 ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
855 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
856 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
859 UnoMultiPageModel::~UnoMultiPageModel()
863 rtl::Reference<UnoControlModel> UnoMultiPageModel::Clone() const
865 // clone the container itself
866 UnoMultiPageModel* pClone = new UnoMultiPageModel( *this );
867 Clone_Impl( *pClone );
868 return pClone;
871 OUString UnoMultiPageModel::getServiceName()
873 return OUString( "com.sun.star.awt.UnoMultiPageModel" );
876 uno::Any UnoMultiPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
878 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
880 return uno::Any( OUString( "com.sun.star.awt.UnoControlMultiPage" ) );
882 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
885 ::cppu::IPropertyArrayHelper& UnoMultiPageModel::getInfoHelper()
887 static UnoPropertyArrayHelper* pHelper = nullptr;
888 if ( !pHelper )
890 uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
891 pHelper = new UnoPropertyArrayHelper( aIDs );
893 return *pHelper;
896 // beans::XMultiPropertySet
897 uno::Reference< beans::XPropertySetInfo > UnoMultiPageModel::getPropertySetInfo( )
899 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
900 return xInfo;
903 void UnoMultiPageModel::insertByName( const OUString& aName, const Any& aElement )
905 Reference< XServiceInfo > xInfo;
906 aElement >>= xInfo;
908 if ( !xInfo.is() )
909 throw IllegalArgumentException();
911 // Only a Page model can be inserted into the multipage
912 if ( !xInfo->supportsService( "com.sun.star.awt.UnoPageModel" ) )
913 throw IllegalArgumentException();
915 return ControlModelContainerBase::insertByName( aName, aElement );
919 sal_Bool SAL_CALL UnoMultiPageModel::getGroupControl( )
921 return true;
925 // class UnoPageControl
927 UnoPageControl::UnoPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext)
929 maComponentInfos.nWidth = 280;
930 maComponentInfos.nHeight = 400;
933 UnoPageControl::~UnoPageControl()
937 OUString UnoPageControl::GetComponentServiceName()
939 return OUString("tabpage");
943 // ------------- UnoPageModel -----------------
945 UnoPageModel::UnoPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
947 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
948 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
949 ImplRegisterProperty( BASEPROPERTY_ENABLED );
950 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
952 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
953 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
954 ImplRegisterProperty( BASEPROPERTY_HELPURL );
955 ImplRegisterProperty( BASEPROPERTY_TITLE );
956 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
957 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
958 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
959 // ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
961 Any aBool;
962 aBool <<= true;
963 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
964 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
965 //ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
967 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
968 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
971 UnoPageModel::~UnoPageModel()
975 rtl::Reference<UnoControlModel> UnoPageModel::Clone() const
977 // clone the container itself
978 UnoPageModel* pClone = new UnoPageModel( *this );
979 Clone_Impl( *pClone );
980 return pClone;
983 OUString UnoPageModel::getServiceName()
985 return OUString( "com.sun.star.awt.UnoPageModel" );
988 uno::Any UnoPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
990 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
992 return uno::Any( OUString( "com.sun.star.awt.UnoControlPage" ) );
994 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
997 ::cppu::IPropertyArrayHelper& UnoPageModel::getInfoHelper()
999 static UnoPropertyArrayHelper* pHelper = nullptr;
1000 if ( !pHelper )
1002 uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
1003 pHelper = new UnoPropertyArrayHelper( aIDs );
1005 return *pHelper;
1008 // beans::XMultiPropertySet
1009 uno::Reference< beans::XPropertySetInfo > UnoPageModel::getPropertySetInfo( )
1011 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1012 return xInfo;
1016 sal_Bool SAL_CALL UnoPageModel::getGroupControl( )
1018 return false;
1021 // Frame control
1024 // class UnoFrameControl
1026 UnoFrameControl::UnoFrameControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext)
1028 maComponentInfos.nWidth = 280;
1029 maComponentInfos.nHeight = 400;
1032 UnoFrameControl::~UnoFrameControl()
1036 OUString UnoFrameControl::GetComponentServiceName()
1038 return OUString("frame");
1041 void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
1043 bool bOwnCtrl = false;
1044 OUString sTitle;
1045 if ( rxCtrl.get() == Reference<XControl>( this ).get() )
1046 bOwnCtrl = true;
1047 Reference< XPropertySet > xProps( getModel(), UNO_QUERY );
1048 //xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
1049 xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_LABEL ) ) >>= sTitle;
1051 ControlContainerBase::ImplSetPosSize( rxCtrl );
1052 Reference < XWindow > xW( rxCtrl, UNO_QUERY );
1053 if ( !bOwnCtrl && xW.is() && !sTitle.isEmpty() )
1055 awt::Rectangle aSizePos = xW->getPosSize();
1057 sal_Int32 nX = aSizePos.X, nY = aSizePos.Y, nWidth = aSizePos.Width, nHeight = aSizePos.Height;
1058 // Retrieve the values set by the base class
1059 OutputDevice*pOutDev = Application::GetDefaultDevice();
1060 if ( pOutDev )
1062 // Adjust Y based on height of Title
1063 ::tools::Rectangle aRect;
1064 aRect = pOutDev->GetTextRect( aRect, sTitle );
1065 nY = nY + ( aRect.GetHeight() / 2 );
1067 else
1069 Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer();
1070 Reference< XDevice > xD( xPeer, UNO_QUERY );
1072 SimpleFontMetric aFM;
1073 FontDescriptor aFD;
1074 Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
1076 aVal >>= aFD;
1077 if ( !aFD.StyleName.isEmpty() )
1079 Reference< XFont > xFont = xD->getFont( aFD );
1080 aFM = xFont->getFontMetric();
1082 else
1084 Reference< XGraphics > xG = xD->createGraphics();
1085 aFM = xG->getFontMetric();
1088 sal_Int16 nH = aFM.Ascent + aFM.Descent;
1089 // offset y based on height of font ( not sure if my guess at the correct calculation is correct here )
1090 nY = nY + ( nH / 8); // how do I test this
1092 xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
1096 // ------------- UnoFrameModel -----------------
1098 UnoFrameModel::UnoFrameModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
1100 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
1101 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
1102 ImplRegisterProperty( BASEPROPERTY_ENABLED );
1103 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
1104 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
1105 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
1106 ImplRegisterProperty( BASEPROPERTY_HELPURL );
1107 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
1108 ImplRegisterProperty( BASEPROPERTY_LABEL );
1109 ImplRegisterProperty( BASEPROPERTY_WRITING_MODE );
1110 ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE );
1111 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
1112 ImplRegisterProperty( BASEPROPERTY_HSCROLL );
1113 ImplRegisterProperty( BASEPROPERTY_VSCROLL );
1114 ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH );
1115 ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT );
1116 ImplRegisterProperty( BASEPROPERTY_SCROLLTOP );
1117 ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT );
1120 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
1121 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
1124 UnoFrameModel::~UnoFrameModel()
1128 rtl::Reference<UnoControlModel> UnoFrameModel::Clone() const
1130 // clone the container itself
1131 UnoFrameModel* pClone = new UnoFrameModel( *this );
1132 Clone_Impl( *pClone );
1133 return pClone;
1136 OUString UnoFrameModel::getServiceName()
1138 return OUString( "com.sun.star.awt.UnoFrameModel" );
1141 uno::Any UnoFrameModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
1143 switch ( nPropId )
1145 case BASEPROPERTY_DEFAULTCONTROL:
1147 return uno::Any( OUString( "com.sun.star.awt.UnoControlFrame" ) );
1149 case BASEPROPERTY_SCROLLWIDTH:
1150 case BASEPROPERTY_SCROLLHEIGHT:
1151 case BASEPROPERTY_SCROLLTOP:
1152 case BASEPROPERTY_SCROLLLEFT:
1153 return uno::Any( sal_Int32(0) );
1154 case BASEPROPERTY_USERFORMCONTAINEES:
1156 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
1157 return makeAny( xNameCont );
1160 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
1163 ::cppu::IPropertyArrayHelper& UnoFrameModel::getInfoHelper()
1165 static UnoPropertyArrayHelper* pHelper = nullptr;
1166 if ( !pHelper )
1168 uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
1169 pHelper = new UnoPropertyArrayHelper( aIDs );
1171 return *pHelper;
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: */