Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / toolkit / source / controls / dialogcontrol.cxx
blob6861e8732ecfba32b66016043458d1991ff5f37b
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/resource/XStringResourceResolver.hpp>
32 #include <com/sun/star/uno/XComponentContext.hpp>
33 #include <com/sun/star/graphic/XGraphicProvider.hpp>
34 #include <cppuhelper/supportsservice.hxx>
35 #include <cppuhelper/typeprovider.hxx>
36 #include <cppuhelper/queryinterface.hxx>
37 #include <tools/debug.hxx>
38 #include <tools/diagnose_ex.h>
39 #include <comphelper/sequence.hxx>
40 #include <vcl/outdev.hxx>
42 #include <toolkit/helper/vclunohelper.hxx>
43 #include <unotools/ucbstreamhelper.hxx>
44 #include <vcl/graph.hxx>
45 #include <vcl/image.hxx>
46 #include <cppuhelper/implbase.hxx>
47 #include <algorithm>
48 #include <functional>
49 #include <map>
50 #include <unordered_map>
51 #include "osl/file.hxx"
53 #include <vcl/tabctrl.hxx>
54 #include <toolkit/awt/vclxwindows.hxx>
55 #include "toolkit/controls/unocontrols.hxx"
57 #include "helper/unopropertyarrayhelper.hxx"
58 #include "controlmodelcontainerbase_internal.hxx"
60 using namespace ::com::sun::star;
61 using namespace ::com::sun::star::uno;
62 using namespace ::com::sun::star::awt;
63 using namespace ::com::sun::star::lang;
64 using namespace ::com::sun::star::container;
65 using namespace ::com::sun::star::beans;
66 using namespace ::com::sun::star::util;
68 #define PROPERTY_DIALOGSOURCEURL "DialogSourceURL"
69 #define PROPERTY_IMAGEURL "ImageURL"
70 #define PROPERTY_GRAPHIC "Graphic"
73 // we probably will need both a hash of control models and hash of controls
74 // => use some template magic
76 template< typename T >
77 class SimpleNamedThingContainer : public ::cppu::WeakImplHelper< container::XNameContainer >
79 typedef std::unordered_map< OUString, Reference< T >, OUStringHash > NamedThingsHash;
80 NamedThingsHash things;
81 ::osl::Mutex m_aMutex;
82 public:
83 // css::container::XNameContainer, XNameReplace, XNameAccess
84 virtual void SAL_CALL replaceByName( const OUString& aName, const Any& aElement ) override
86 ::osl::MutexGuard aGuard( m_aMutex );
87 if ( !hasByName( aName ) )
88 throw NoSuchElementException();
89 Reference< T > xElement;
90 if ( ! ( aElement >>= xElement ) )
91 throw IllegalArgumentException();
92 things[ aName ] = xElement;
94 virtual Any SAL_CALL getByName( const OUString& aName ) override
96 ::osl::MutexGuard aGuard( m_aMutex );
97 if ( !hasByName( aName ) )
98 throw NoSuchElementException();
99 return uno::makeAny( things[ aName ] );
101 virtual Sequence< OUString > SAL_CALL getElementNames( ) override
103 ::osl::MutexGuard aGuard( m_aMutex );
104 return comphelper::mapKeysToSequence( things );
106 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override
108 ::osl::MutexGuard aGuard( m_aMutex );
109 return ( things.find( aName ) != things.end() );
111 virtual void SAL_CALL insertByName( const OUString& aName, const Any& aElement ) override
113 ::osl::MutexGuard aGuard( m_aMutex );
114 if ( hasByName( aName ) )
115 throw ElementExistException();
116 Reference< T > xElement;
117 if ( ! ( aElement >>= xElement ) )
118 throw IllegalArgumentException();
119 things[ aName ] = xElement;
121 virtual void SAL_CALL removeByName( const OUString& aName ) override
123 ::osl::MutexGuard aGuard( m_aMutex );
124 if ( !hasByName( aName ) )
125 throw NoSuchElementException();
126 things.erase( things.find( aName ) );
128 virtual Type SAL_CALL getElementType( ) override
130 return cppu::UnoType<T>::get();
132 virtual sal_Bool SAL_CALL hasElements( ) override
134 ::osl::MutexGuard aGuard( m_aMutex );
135 return ( !things.empty() );
139 namespace {
141 class UnoControlDialogModel : public ControlModelContainerBase
143 protected:
144 css::uno::Reference< css::graphic::XGraphicObject > mxGrfObj;
145 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
146 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
147 // ::cppu::OPropertySetHelper
148 void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) override;
149 public:
150 explicit UnoControlDialogModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
151 UnoControlDialogModel( const UnoControlDialogModel& rModel );
153 UnoControlModel* Clone() const override;
154 // css::beans::XMultiPropertySet
155 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
157 // css::io::XPersistObject
158 OUString SAL_CALL getServiceName() override;
160 // XServiceInfo
161 OUString SAL_CALL getImplementationName() override
162 { return OUString("stardiv.Toolkit.UnoControlDialogModel"); }
164 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
166 auto s(ControlModelContainerBase::getSupportedServiceNames());
167 s.realloc(s.getLength() + 2);
168 s[s.getLength() - 2] = "com.sun.star.awt.UnoControlDialogModel";
169 s[s.getLength() - 1] = "stardiv.vcl.controlmodel.Dialog";
170 return s;
174 UnoControlDialogModel::UnoControlDialogModel( const Reference< XComponentContext >& rxContext )
175 :ControlModelContainerBase( rxContext )
177 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
178 // ImplRegisterProperty( BASEPROPERTY_BORDER );
179 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
180 ImplRegisterProperty( BASEPROPERTY_ENABLED );
181 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
182 // ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
183 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
184 ImplRegisterProperty( BASEPROPERTY_HELPURL );
185 ImplRegisterProperty( BASEPROPERTY_TITLE );
186 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
187 ImplRegisterProperty( BASEPROPERTY_DESKTOP_AS_PARENT );
188 ImplRegisterProperty( BASEPROPERTY_DECORATION );
189 ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
190 ImplRegisterProperty( BASEPROPERTY_GRAPHIC );
191 ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
192 ImplRegisterProperty( BASEPROPERTY_HSCROLL );
193 ImplRegisterProperty( BASEPROPERTY_VSCROLL );
194 ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH );
195 ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT );
196 ImplRegisterProperty( BASEPROPERTY_SCROLLTOP );
197 ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT );
199 Any aBool;
200 aBool <<= true;
201 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
202 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
203 // #TODO separate class for 'UserForm' ( instead of re-using Dialog ? )
204 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
205 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
208 UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rModel )
209 : ControlModelContainerBase( rModel )
211 // need to clone BASEPROPERTY_USERFORMCONTAINEES too
212 Reference< XNameContainer > xSrcNameCont( const_cast< UnoControlDialogModel& >(rModel).getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY );
213 Reference<XNameContainer > xNameCont( new SimpleNamedThingContainer< XControlModel > );
215 uno::Sequence< OUString > sNames = xSrcNameCont->getElementNames();
216 OUString* pName = sNames.getArray();
217 OUString* pNamesEnd = pName + sNames.getLength();
218 for ( ; pName != pNamesEnd; ++pName )
220 if ( xSrcNameCont->hasByName( *pName ) )
221 xNameCont->insertByName( *pName, xSrcNameCont->getByName( *pName ) );
223 setFastPropertyValue_NoBroadcast( BASEPROPERTY_USERFORMCONTAINEES, makeAny( xNameCont ) );
226 UnoControlModel* UnoControlDialogModel::Clone() const
228 // clone the container itself
229 UnoControlDialogModel* pClone = new UnoControlDialogModel( *this );
231 Clone_Impl(*pClone);
233 return pClone;
237 OUString UnoControlDialogModel::getServiceName( )
239 return OUString("stardiv.vcl.controlmodel.Dialog");
242 Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
244 Any aAny;
246 switch ( nPropId )
248 case BASEPROPERTY_DEFAULTCONTROL:
249 aAny <<= OUString::createFromAscii( szServiceName_UnoControlDialog );
250 break;
251 case BASEPROPERTY_SCROLLWIDTH:
252 case BASEPROPERTY_SCROLLHEIGHT:
253 case BASEPROPERTY_SCROLLTOP:
254 case BASEPROPERTY_SCROLLLEFT:
255 aAny <<= sal_Int32(0);
256 break;
257 default:
258 aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
261 return aAny;
264 ::cppu::IPropertyArrayHelper& UnoControlDialogModel::getInfoHelper()
266 static UnoPropertyArrayHelper* pHelper = nullptr;
267 if ( !pHelper )
269 Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
270 pHelper = new UnoPropertyArrayHelper( aIDs );
272 return *pHelper;
275 // XMultiPropertySet
276 Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( )
278 static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
279 return xInfo;
282 void SAL_CALL UnoControlDialogModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue )
284 ControlModelContainerBase::setFastPropertyValue_NoBroadcast( nHandle, rValue );
287 if ( nHandle == BASEPROPERTY_IMAGEURL && ImplHasProperty( BASEPROPERTY_GRAPHIC ) )
289 OUString sImageURL;
290 OSL_VERIFY( rValue >>= sImageURL );
291 setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( mxGrfObj, sImageURL ) ) );
294 catch( const css::uno::Exception& )
296 OSL_ENSURE( false, "UnoControlDialogModel::setFastPropertyValue_NoBroadcast: caught an exception while setting ImageURL properties!" );
303 // = class UnoDialogControl
306 UnoDialogControl::UnoDialogControl( const uno::Reference< uno::XComponentContext >& rxContext )
307 :UnoDialogControl_Base( rxContext )
308 ,maTopWindowListeners( *this )
309 ,mbWindowListener(false)
311 maComponentInfos.nWidth = 300;
312 maComponentInfos.nHeight = 450;
315 UnoDialogControl::~UnoDialogControl()
319 OUString UnoDialogControl::GetComponentServiceName()
322 bool bDecoration( true );
323 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
324 if ( bDecoration )
325 return OUString("Dialog");
326 else
327 return OUString("TabPage");
330 void UnoDialogControl::dispose()
332 SolarMutexGuard aGuard;
334 EventObject aEvt;
335 aEvt.Source = static_cast< ::cppu::OWeakObject* >( this );
336 maTopWindowListeners.disposeAndClear( aEvt );
337 ControlContainerBase::dispose();
340 void SAL_CALL UnoDialogControl::disposing(
341 const EventObject& Source )
343 ControlContainerBase::disposing( Source );
346 sal_Bool UnoDialogControl::setModel( const Reference< XControlModel >& rxModel )
348 // #Can we move all the Resource stuff to the ControlContainerBase ?
349 SolarMutexGuard aGuard;
350 bool bRet = ControlContainerBase::setModel( rxModel );
351 ImplStartListingForResourceEvents();
352 return bRet;
355 void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer )
357 SolarMutexGuard aGuard;
359 UnoControlContainer::createPeer( rxToolkit, rParentPeer );
361 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
362 if ( xTW.is() )
364 xTW->setMenuBar( mxMenuBar );
366 if ( !mbWindowListener )
368 Reference< XWindowListener > xWL( static_cast< cppu::OWeakObject*>( this ), UNO_QUERY );
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 ) ) );
384 OUString UnoDialogControl::getImplementationName()
386 return OUString("stardiv.Toolkit.UnoDialogControl");
389 sal_Bool UnoDialogControl::supportsService(OUString const & ServiceName)
391 return cppu::supportsService(this, ServiceName);
394 css::uno::Sequence<OUString> UnoDialogControl::getSupportedServiceNames()
396 return css::uno::Sequence<OUString>{
397 OUString::createFromAscii(szServiceName2_UnoControlDialog),
398 "stardiv.vcl.control.Dialog"};
401 void UnoDialogControl::PrepareWindowDescriptor( css::awt::WindowDescriptor& rDesc )
403 UnoControlContainer::PrepareWindowDescriptor( rDesc );
404 bool bDecoration( true );
405 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
406 if ( !bDecoration )
408 // Now we have to manipulate the WindowDescriptor
409 rDesc.WindowAttributes = rDesc.WindowAttributes | css::awt::WindowAttribute::NODECORATION;
412 // We have to set the graphic property before the peer
413 // will be created. Otherwise the properties will be copied
414 // into the peer via propertiesChangeEvents. As the order of
415 // can lead to overwrites we have to set the graphic property
416 // before the propertiesChangeEvents are sent!
417 OUString aImageURL;
418 Reference< graphic::XGraphic > xGraphic;
419 if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
420 ( !aImageURL.isEmpty() ))
422 OUString absoluteUrl = aImageURL;
423 if ( !aImageURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
424 absoluteUrl = getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
425 uno::makeAny( aImageURL ) );
427 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
428 ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::makeAny( xGraphic ), true );
432 void UnoDialogControl::addTopWindowListener( const Reference< XTopWindowListener >& rxListener )
434 maTopWindowListeners.addInterface( rxListener );
435 if( getPeer().is() && maTopWindowListeners.getLength() == 1 )
437 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
438 xTW->addTopWindowListener( &maTopWindowListeners );
442 void UnoDialogControl::removeTopWindowListener( const Reference< XTopWindowListener >& rxListener )
444 if( getPeer().is() && maTopWindowListeners.getLength() == 1 )
446 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
447 xTW->removeTopWindowListener( &maTopWindowListeners );
449 maTopWindowListeners.removeInterface( rxListener );
452 void UnoDialogControl::toFront( )
454 SolarMutexGuard aGuard;
455 if ( getPeer().is() )
457 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
458 if( xTW.is() )
459 xTW->toFront();
463 void UnoDialogControl::toBack( )
465 SolarMutexGuard aGuard;
466 if ( getPeer().is() )
468 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
469 if( xTW.is() )
470 xTW->toBack();
474 void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar )
476 SolarMutexGuard aGuard;
477 mxMenuBar = rxMenuBar;
478 if ( getPeer().is() )
480 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
481 if( xTW.is() )
482 xTW->setMenuBar( mxMenuBar );
485 static ::Size ImplMapPixelToAppFont( OutputDevice* pOutDev, const ::Size& aSize )
487 ::Size aTmp = pOutDev->PixelToLogic( aSize, MapUnit::MapAppFont );
488 return aTmp;
490 // css::awt::XWindowListener
491 void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e )
493 OutputDevice*pOutDev = Application::GetDefaultDevice();
494 DBG_ASSERT( pOutDev, "Missing Default Device!" );
495 if ( pOutDev && !mbSizeModified )
497 // Currentley we are simply using MapUnit::MapAppFont
498 ::Size aAppFontSize( e.Width, e.Height );
500 Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
501 Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
502 OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
504 // #i87592 In design mode the drawing layer works with sizes with decoration.
505 // Therefore we have to subtract them before writing back to the properties (model).
506 if ( xDialogDevice.is() && mbDesignMode )
508 DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
509 aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
510 aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
513 aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
515 // Remember that changes have been done by listener. No need to
516 // update the position because of property change event.
517 mbSizeModified = true;
518 Sequence< OUString > aProps( 2 );
519 Sequence< Any > aValues( 2 );
520 // Properties in a sequence must be sorted!
521 aProps[0] = "Height";
522 aProps[1] = "Width";
523 aValues[0] <<= aAppFontSize.Height();
524 aValues[1] <<= aAppFontSize.Width();
526 ImplSetPropertyValues( aProps, aValues, true );
527 mbSizeModified = false;
531 void SAL_CALL UnoDialogControl::windowMoved( const css::awt::WindowEvent& e )
533 OutputDevice*pOutDev = Application::GetDefaultDevice();
534 DBG_ASSERT( pOutDev, "Missing Default Device!" );
535 if ( pOutDev && !mbPosModified )
537 // Currentley we are simply using MapUnit::MapAppFont
538 ::Size aTmp( e.X, e.Y );
539 aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
541 // Remember that changes have been done by listener. No need to
542 // update the position because of property change event.
543 mbPosModified = true;
544 Sequence< OUString > aProps( 2 );
545 Sequence< Any > aValues( 2 );
546 aProps[0] = "PositionX";
547 aProps[1] = "PositionY";
548 aValues[0] <<= aTmp.Width();
549 aValues[1] <<= aTmp.Height();
551 ImplSetPropertyValues( aProps, aValues, true );
552 mbPosModified = false;
556 void SAL_CALL UnoDialogControl::windowShown( const EventObject& e )
558 (void)e;
561 void SAL_CALL UnoDialogControl::windowHidden( const EventObject& e )
563 (void)e;
566 void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result )
568 Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
569 if ( xPeerDialog.is() )
570 xPeerDialog->endDialog( i_result );
573 void SAL_CALL UnoDialogControl::setHelpId( const OUString& i_id )
575 Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
576 if ( xPeerDialog.is() )
577 xPeerDialog->setHelpId( i_id );
580 void UnoDialogControl::setTitle( const OUString& Title )
582 SolarMutexGuard aGuard;
583 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ), uno::Any(Title), true );
586 OUString UnoDialogControl::getTitle()
588 SolarMutexGuard aGuard;
589 return ImplGetPropertyValue_UString( BASEPROPERTY_TITLE );
592 sal_Int16 UnoDialogControl::execute()
594 SolarMutexGuard aGuard;
595 sal_Int16 nDone = -1;
596 if ( getPeer().is() )
598 Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
599 if( xDlg.is() )
601 GetComponentInfos().bVisible = true;
602 nDone = xDlg->execute();
603 GetComponentInfos().bVisible = false;
606 return nDone;
609 void UnoDialogControl::endExecute()
611 SolarMutexGuard aGuard;
612 if ( getPeer().is() )
614 Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
615 if( xDlg.is() )
617 xDlg->endExecute();
618 GetComponentInfos().bVisible = false;
623 // XModifyListener
624 void SAL_CALL UnoDialogControl::modified(
625 const lang::EventObject& /*rEvent*/ )
627 ImplUpdateResourceResolver();
630 void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents )
632 sal_Int32 nLen = rEvents.getLength();
633 for( sal_Int32 i = 0; i < nLen; i++ )
635 const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
636 Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
637 bool bOwnModel = xModel.get() == getModel().get();
638 if ( bOwnModel && rEvt.PropertyName == "ImageURL" )
640 OUString aImageURL;
641 Reference< graphic::XGraphic > xGraphic;
642 if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ) >>= aImageURL ) &&
643 ( !aImageURL.isEmpty() ))
645 OUString absoluteUrl = aImageURL;
646 if ( !aImageURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
648 absoluteUrl = getPhysicalLocation( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL )),
649 uno::makeAny(aImageURL));
651 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
653 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC), uno::makeAny( xGraphic ), true );
654 break;
657 ControlContainerBase::ImplModelPropertiesChanged(rEvents);
661 // class MultiPageControl
663 UnoMultiPageControl::UnoMultiPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext), maTabListeners( *this )
665 maComponentInfos.nWidth = 280;
666 maComponentInfos.nHeight = 400;
669 UnoMultiPageControl::~UnoMultiPageControl()
672 // XTabListener
674 void SAL_CALL UnoMultiPageControl::inserted( SAL_UNUSED_PARAMETER ::sal_Int32 )
677 void SAL_CALL UnoMultiPageControl::removed( SAL_UNUSED_PARAMETER ::sal_Int32 )
680 void SAL_CALL UnoMultiPageControl::changed( SAL_UNUSED_PARAMETER ::sal_Int32,
681 SAL_UNUSED_PARAMETER const Sequence< NamedValue >& )
684 void SAL_CALL UnoMultiPageControl::activated( ::sal_Int32 ID )
686 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( ID ), false );
689 void SAL_CALL UnoMultiPageControl::deactivated( SAL_UNUSED_PARAMETER ::sal_Int32 )
692 void SAL_CALL UnoMultiPageControl::disposing(const EventObject&)
696 void SAL_CALL UnoMultiPageControl::dispose()
698 lang::EventObject aEvt;
699 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
700 maTabListeners.disposeAndClear( aEvt );
701 ControlContainerBase::dispose();
704 // css::awt::XSimpleTabController
705 ::sal_Int32 SAL_CALL UnoMultiPageControl::insertTab()
707 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
708 return xMultiPage->insertTab();
711 void SAL_CALL UnoMultiPageControl::removeTab( ::sal_Int32 ID )
713 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
714 xMultiPage->removeTab( ID );
717 void SAL_CALL UnoMultiPageControl::setTabProps( ::sal_Int32 ID, const Sequence< NamedValue >& Properties )
719 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
720 xMultiPage->setTabProps( ID, Properties );
723 Sequence< NamedValue > SAL_CALL UnoMultiPageControl::getTabProps( ::sal_Int32 ID )
725 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
726 return xMultiPage->getTabProps( ID );
729 void SAL_CALL UnoMultiPageControl::activateTab( ::sal_Int32 ID )
731 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
732 xMultiPage->activateTab( ID );
733 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( ID ), true );
737 ::sal_Int32 SAL_CALL UnoMultiPageControl::getActiveTabID()
739 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
740 return xMultiPage->getActiveTabID();
743 void SAL_CALL UnoMultiPageControl::addTabListener( const Reference< XTabListener >& Listener )
745 maTabListeners.addInterface( Listener );
746 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
747 if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
748 xMultiPage->addTabListener( &maTabListeners );
751 void SAL_CALL UnoMultiPageControl::removeTabListener( const Reference< XTabListener >& Listener )
753 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
754 if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
755 xMultiPage->removeTabListener( &maTabListeners );
756 maTabListeners.removeInterface( Listener );
760 // lang::XTypeProvider
761 IMPL_XTYPEPROVIDER_START( UnoMultiPageControl )
762 cppu::UnoType<awt::XSimpleTabController>::get(),
763 cppu::UnoType<awt::XTabListener>::get(),
764 ControlContainerBase::getTypes()
765 IMPL_XTYPEPROVIDER_END
767 // uno::XInterface
768 uno::Any UnoMultiPageControl::queryAggregation( const uno::Type & rType )
770 uno::Any aRet = ::cppu::queryInterface( rType,
771 (static_cast< awt::XTabListener* >(this)), (static_cast< awt::XSimpleTabController* >(this)) );
772 return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType ));
775 OUString UnoMultiPageControl::GetComponentServiceName()
777 bool bDecoration( true );
778 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
779 if ( bDecoration )
780 return OUString("tabcontrol");
781 // Hopefully we can tweak the tabcontrol to display without tabs
782 return OUString("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 uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
813 sal_uInt32 nCtrls = aCtrls.getLength();
814 for( sal_uInt32 n = 0; n < nCtrls; n++ )
815 bindPage( aCtrls[ n ] );
816 sal_Int32 nActiveTab(0);
817 Reference< XPropertySet > xMultiProps( getModel(), UNO_QUERY );
818 xMultiProps->getPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ) ) >>= nActiveTab;
820 uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY );
821 if ( xTabCntrl.is() )
823 xTabCntrl->addTabListener( this );
824 if ( nActiveTab && nCtrls ) // Ensure peer is initialise with correct activated tab
826 xTabCntrl->activateTab( nActiveTab );
827 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( nActiveTab ), true );
832 void UnoMultiPageControl::impl_createControlPeerIfNecessary( const uno::Reference< awt::XControl >& _rxControl)
834 OSL_PRECOND( _rxControl.is(), "UnoMultiPageControl::impl_createControlPeerIfNecessary: invalid control, this will crash!" );
836 // if the container already has a peer, then also create a peer for the control
837 uno::Reference< awt::XWindowPeer > xMyPeer( getPeer() );
839 if( xMyPeer.is() )
841 _rxControl->createPeer( nullptr, xMyPeer );
842 bindPage( _rxControl );
843 ImplActivateTabControllers();
848 // ------------- UnoMultiPageModel -----------------
850 UnoMultiPageModel::UnoMultiPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
852 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
853 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
854 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
855 ImplRegisterProperty( BASEPROPERTY_ENABLED );
857 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
858 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
859 ImplRegisterProperty( BASEPROPERTY_HELPURL );
860 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
861 //ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
862 ImplRegisterProperty( BASEPROPERTY_MULTIPAGEVALUE );
863 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
864 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
866 Any aBool;
867 aBool <<= true;
868 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
869 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
870 ImplRegisterProperty( BASEPROPERTY_DECORATION, aBool );
871 // MultiPage Control has the tab stop property. And the default value is True.
872 ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
874 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
875 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
878 UnoMultiPageModel::UnoMultiPageModel( const UnoMultiPageModel& rModel )
879 : ControlModelContainerBase( rModel )
883 UnoMultiPageModel::~UnoMultiPageModel()
887 UnoControlModel*
888 UnoMultiPageModel::Clone() const
890 // clone the container itself
891 UnoMultiPageModel* pClone = new UnoMultiPageModel( *this );
892 Clone_Impl( *pClone );
893 return pClone;
896 OUString UnoMultiPageModel::getServiceName()
898 return OUString( "com.sun.star.awt.UnoMultiPageModel" );
901 uno::Any UnoMultiPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
903 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
905 return uno::Any( OUString( "com.sun.star.awt.UnoControlMultiPage" ) );
907 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
910 ::cppu::IPropertyArrayHelper& UnoMultiPageModel::getInfoHelper()
912 static UnoPropertyArrayHelper* pHelper = nullptr;
913 if ( !pHelper )
915 uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
916 pHelper = new UnoPropertyArrayHelper( aIDs );
918 return *pHelper;
921 // beans::XMultiPropertySet
922 uno::Reference< beans::XPropertySetInfo > UnoMultiPageModel::getPropertySetInfo( )
924 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
925 return xInfo;
928 void UnoMultiPageModel::insertByName( const OUString& aName, const Any& aElement )
930 Reference< XServiceInfo > xInfo;
931 aElement >>= xInfo;
933 if ( !xInfo.is() )
934 throw IllegalArgumentException();
936 // Only a Page model can be inserted into the multipage
937 if ( !xInfo->supportsService( "com.sun.star.awt.UnoPageModel" ) )
938 throw IllegalArgumentException();
940 return ControlModelContainerBase::insertByName( aName, aElement );
944 sal_Bool SAL_CALL UnoMultiPageModel::getGroupControl( )
946 return true;
950 // class UnoPageControl
952 UnoPageControl::UnoPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext)
954 maComponentInfos.nWidth = 280;
955 maComponentInfos.nHeight = 400;
958 UnoPageControl::~UnoPageControl()
962 OUString UnoPageControl::GetComponentServiceName()
964 return OUString("tabpage");
968 // ------------- UnoPageModel -----------------
970 UnoPageModel::UnoPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
972 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
973 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
974 ImplRegisterProperty( BASEPROPERTY_ENABLED );
975 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
977 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
978 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
979 ImplRegisterProperty( BASEPROPERTY_HELPURL );
980 ImplRegisterProperty( BASEPROPERTY_TITLE );
981 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
982 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
983 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
984 // ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
986 Any aBool;
987 aBool <<= true;
988 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
989 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
990 //ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
992 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
993 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
996 UnoPageModel::UnoPageModel( const UnoPageModel& rModel )
997 : ControlModelContainerBase( rModel )
1001 UnoPageModel::~UnoPageModel()
1005 UnoControlModel*
1006 UnoPageModel::Clone() const
1008 // clone the container itself
1009 UnoPageModel* pClone = new UnoPageModel( *this );
1010 Clone_Impl( *pClone );
1011 return pClone;
1014 OUString UnoPageModel::getServiceName()
1016 return OUString( "com.sun.star.awt.UnoPageModel" );
1019 uno::Any UnoPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
1021 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
1023 return uno::Any( OUString( "com.sun.star.awt.UnoControlPage" ) );
1025 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
1028 ::cppu::IPropertyArrayHelper& UnoPageModel::getInfoHelper()
1030 static UnoPropertyArrayHelper* pHelper = nullptr;
1031 if ( !pHelper )
1033 uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
1034 pHelper = new UnoPropertyArrayHelper( aIDs );
1036 return *pHelper;
1039 // beans::XMultiPropertySet
1040 uno::Reference< beans::XPropertySetInfo > UnoPageModel::getPropertySetInfo( )
1042 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1043 return xInfo;
1047 sal_Bool SAL_CALL UnoPageModel::getGroupControl( )
1049 return false;
1052 // Frame control
1055 // class UnoFrameControl
1057 UnoFrameControl::UnoFrameControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext)
1059 maComponentInfos.nWidth = 280;
1060 maComponentInfos.nHeight = 400;
1063 UnoFrameControl::~UnoFrameControl()
1067 OUString UnoFrameControl::GetComponentServiceName()
1069 return OUString("frame");
1072 void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
1074 bool bOwnCtrl = false;
1075 OUString sTitle;
1076 if ( rxCtrl.get() == Reference<XControl>( this ).get() )
1077 bOwnCtrl = true;
1078 Reference< XPropertySet > xProps( getModel(), UNO_QUERY );
1079 //xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
1080 xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_LABEL ) ) >>= sTitle;
1082 ControlContainerBase::ImplSetPosSize( rxCtrl );
1083 Reference < XWindow > xW( rxCtrl, UNO_QUERY );
1084 if ( !bOwnCtrl && xW.is() && !sTitle.isEmpty() )
1086 awt::Rectangle aSizePos = xW->getPosSize();
1088 sal_Int32 nX = aSizePos.X, nY = aSizePos.Y, nWidth = aSizePos.Width, nHeight = aSizePos.Height;
1089 // Retrieve the values set by the base class
1090 OutputDevice*pOutDev = Application::GetDefaultDevice();
1091 if ( pOutDev )
1093 if ( !bOwnCtrl && !sTitle.isEmpty() )
1095 // Adjust Y based on height of Title
1096 ::tools::Rectangle aRect;
1097 aRect = pOutDev->GetTextRect( aRect, sTitle );
1098 nY = nY + ( aRect.GetHeight() / 2 );
1101 else
1103 Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer();
1104 Reference< XDevice > xD( xPeer, UNO_QUERY );
1106 SimpleFontMetric aFM;
1107 FontDescriptor aFD;
1108 Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
1110 aVal >>= aFD;
1111 if ( !aFD.StyleName.isEmpty() )
1113 Reference< XFont > xFont = xD->getFont( aFD );
1114 aFM = xFont->getFontMetric();
1116 else
1118 Reference< XGraphics > xG = xD->createGraphics();
1119 aFM = xG->getFontMetric();
1122 sal_Int16 nH = aFM.Ascent + aFM.Descent;
1123 if ( !bOwnCtrl && !sTitle.isEmpty() )
1124 // offset y based on height of font ( not sure if my guess at the correct calculation is correct here )
1125 nY = nY + ( nH / 8); // how do I test this
1127 xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
1131 // ------------- UnoFrameModel -----------------
1133 UnoFrameModel::UnoFrameModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
1135 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
1136 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
1137 ImplRegisterProperty( BASEPROPERTY_ENABLED );
1138 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
1139 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
1140 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
1141 ImplRegisterProperty( BASEPROPERTY_HELPURL );
1142 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
1143 ImplRegisterProperty( BASEPROPERTY_LABEL );
1144 ImplRegisterProperty( BASEPROPERTY_WRITING_MODE );
1145 ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE );
1146 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
1147 ImplRegisterProperty( BASEPROPERTY_HSCROLL );
1148 ImplRegisterProperty( BASEPROPERTY_VSCROLL );
1149 ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH );
1150 ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT );
1151 ImplRegisterProperty( BASEPROPERTY_SCROLLTOP );
1152 ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT );
1155 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
1156 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
1159 UnoFrameModel::UnoFrameModel( const UnoFrameModel& rModel )
1160 : ControlModelContainerBase( rModel )
1164 UnoFrameModel::~UnoFrameModel()
1168 UnoControlModel*
1169 UnoFrameModel::Clone() const
1171 // clone the container itself
1172 UnoFrameModel* pClone = new UnoFrameModel( *this );
1173 Clone_Impl( *pClone );
1174 return pClone;
1177 OUString UnoFrameModel::getServiceName()
1179 return OUString( "com.sun.star.awt.UnoFrameModel" );
1182 uno::Any UnoFrameModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
1184 switch ( nPropId )
1186 case BASEPROPERTY_DEFAULTCONTROL:
1188 return uno::Any( OUString( "com.sun.star.awt.UnoControlFrame" ) );
1190 case BASEPROPERTY_SCROLLWIDTH:
1191 case BASEPROPERTY_SCROLLHEIGHT:
1192 case BASEPROPERTY_SCROLLTOP:
1193 case BASEPROPERTY_SCROLLLEFT:
1194 return uno::Any( sal_Int32(0) );
1195 case BASEPROPERTY_USERFORMCONTAINEES:
1197 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
1198 return makeAny( xNameCont );
1201 return ControlModelContainerBase::ImplGetDefaultValue( nPropId );
1204 ::cppu::IPropertyArrayHelper& UnoFrameModel::getInfoHelper()
1206 static UnoPropertyArrayHelper* pHelper = nullptr;
1207 if ( !pHelper )
1209 uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
1210 pHelper = new UnoPropertyArrayHelper( aIDs );
1212 return *pHelper;
1215 // beans::XMultiPropertySet
1216 uno::Reference< beans::XPropertySetInfo > UnoFrameModel::getPropertySetInfo( )
1218 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1219 return xInfo;
1222 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
1223 stardiv_Toolkit_UnoControlDialogModel_get_implementation(
1224 css::uno::XComponentContext *context,
1225 css::uno::Sequence<css::uno::Any> const &)
1227 return cppu::acquire(new OGeometryControlModel<UnoControlDialogModel>(context));
1230 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
1231 stardiv_Toolkit_UnoDialogControl_get_implementation(
1232 css::uno::XComponentContext *context,
1233 css::uno::Sequence<css::uno::Any> const &)
1235 return cppu::acquire(new UnoDialogControl(context));
1238 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
1239 stardiv_Toolkit_UnoMultiPageControl_get_implementation(
1240 css::uno::XComponentContext *context,
1241 css::uno::Sequence<css::uno::Any> const &)
1243 return cppu::acquire(new UnoMultiPageControl(context));
1246 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
1247 stardiv_Toolkit_UnoMultiPageModel_get_implementation(
1248 css::uno::XComponentContext *context,
1249 css::uno::Sequence<css::uno::Any> const &)
1251 return cppu::acquire(new UnoMultiPageModel(context));
1254 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
1255 stardiv_Toolkit_UnoPageControl_get_implementation(
1256 css::uno::XComponentContext *context,
1257 css::uno::Sequence<css::uno::Any> const &)
1259 return cppu::acquire(new UnoPageControl(context));
1262 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
1263 stardiv_Toolkit_UnoPageModel_get_implementation(
1264 css::uno::XComponentContext *context,
1265 css::uno::Sequence<css::uno::Any> const &)
1267 return cppu::acquire(new UnoPageModel(context));
1270 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
1271 stardiv_Toolkit_UnoFrameControl_get_implementation(
1272 css::uno::XComponentContext *context,
1273 css::uno::Sequence<css::uno::Any> const &)
1275 return cppu::acquire(new UnoFrameControl(context));
1278 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
1279 stardiv_Toolkit_UnoFrameModel_get_implementation(
1280 css::uno::XComponentContext *context,
1281 css::uno::Sequence<css::uno::Any> const &)
1283 return cppu::acquire(new UnoFrameModel(context));
1286 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */