LibreOffice Module toolkit (master) 1
dialogcontrol.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <sal/config.h>
21
22#include <algorithm>
23
24#include <sal/types.h>
25#include <vcl/svapp.hxx>
28#include <helper/property.hxx>
30#include <com/sun/star/awt/PosSize.hpp>
31#include <com/sun/star/awt/WindowAttribute.hpp>
32#include <com/sun/star/uno/XComponentContext.hpp>
36#include <cppuhelper/weak.hxx>
37#include <tools/debug.hxx>
39#include <vcl/outdev.hxx>
40
41#include <vcl/image.hxx>
43#include <unordered_map>
44
45#include <vcl/tabctrl.hxx>
47
48#include <awt/vclxwindows.hxx>
51#include <mutex>
52
53using namespace ::com::sun::star;
54using namespace ::com::sun::star::uno;
55using namespace ::com::sun::star::awt;
56using namespace ::com::sun::star::lang;
57using namespace ::com::sun::star::container;
58using namespace ::com::sun::star::beans;
59using namespace ::com::sun::star::util;
60
61constexpr OUStringLiteral PROPERTY_DIALOGSOURCEURL = u"DialogSourceURL";
62constexpr OUStringLiteral PROPERTY_IMAGEURL = u"ImageURL";
63constexpr OUStringLiteral PROPERTY_GRAPHIC = u"Graphic";
64
65
66// we probably will need both a hash of control models and hash of controls
67// => use some template magic
68
69namespace {
70
71template< typename T >
72class SimpleNamedThingContainer : public ::cppu::WeakImplHelper< container::XNameContainer >
73{
74 std::unordered_map< OUString, Reference< T > > things;
75 std::mutex m_aMutex;
76public:
77 // css::container::XNameContainer, XNameReplace, XNameAccess
78 virtual void SAL_CALL replaceByName( const OUString& aName, const Any& aElement ) override
79 {
80 std::scoped_lock aGuard( m_aMutex );
81 auto it = things.find( aName );
82 if ( it == things.end() )
83 throw NoSuchElementException();
84 Reference< T > xElement;
85 if ( ! ( aElement >>= xElement ) )
86 throw IllegalArgumentException();
87 it->second = xElement;
88 }
89 virtual Any SAL_CALL getByName( const OUString& aName ) override
90 {
91 std::scoped_lock aGuard( m_aMutex );
92 auto it = things.find( aName );
93 if ( it == things.end() )
94 throw NoSuchElementException();
95 return uno::Any( it->second );
96 }
97 virtual Sequence< OUString > SAL_CALL getElementNames( ) override
98 {
99 std::scoped_lock aGuard( m_aMutex );
100 return comphelper::mapKeysToSequence( things );
101 }
102 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override
103 {
104 std::scoped_lock aGuard( m_aMutex );
105 return ( things.find( aName ) != things.end() );
106 }
107 virtual void SAL_CALL insertByName( const OUString& aName, const Any& aElement ) override
108 {
109 std::scoped_lock aGuard( m_aMutex );
110 auto it = things.find( aName );
111 if ( it != things.end() )
112 throw ElementExistException();
113 Reference< T > xElement;
114 if ( ! ( aElement >>= xElement ) )
115 throw IllegalArgumentException();
116 things[ aName ] = xElement;
117 }
118 virtual void SAL_CALL removeByName( const OUString& aName ) override
119 {
120 std::scoped_lock aGuard( m_aMutex );
121 if ( things.erase( aName ) == 0 )
122 throw NoSuchElementException();
123 }
124 virtual Type SAL_CALL getElementType( ) override
125 {
126 return cppu::UnoType<T>::get();
127 }
128 virtual sal_Bool SAL_CALL hasElements( ) override
129 {
130 std::scoped_lock aGuard( m_aMutex );
131 return !things.empty();
132 }
133};
134
135class UnoControlDialogModel : public ControlModelContainerBase
136{
137protected:
138 css::uno::Reference< css::graphic::XGraphicObject > mxGrfObj;
139 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
141 // ::comphelper::OPropertySetHelper
142 void setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override;
143public:
144 explicit UnoControlDialogModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
145 UnoControlDialogModel( const UnoControlDialogModel& rModel );
146
147 rtl::Reference<UnoControlModel> Clone() const override;
148 // css::beans::XMultiPropertySet
149 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
150
151 // css::io::XPersistObject
152 OUString SAL_CALL getServiceName() override;
153
154 // XServiceInfo
155 OUString SAL_CALL getImplementationName() override
156 { return "stardiv.Toolkit.UnoControlDialogModel"; }
157
158 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
159 {
160 auto s(ControlModelContainerBase::getSupportedServiceNames());
161 s.realloc(s.getLength() + 2);
162 auto ps = s.getArray();
163 ps[s.getLength() - 2] = "com.sun.star.awt.UnoControlDialogModel";
164 ps[s.getLength() - 1] = "stardiv.vcl.controlmodel.Dialog";
165 return s;
166 }
167};
168
169UnoControlDialogModel::UnoControlDialogModel( const Reference< XComponentContext >& rxContext )
170 :ControlModelContainerBase( rxContext )
171{
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 );
193
194 Any aBool;
195 aBool <<= true;
196 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
197 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
198 // #TODO separate class for 'UserForm' ( instead of re-using Dialog ? )
199 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
200 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::Any( xNameCont ) );
201}
202
203UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rModel )
204 : ControlModelContainerBase( rModel )
205{
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 > );
209
210 const uno::Sequence< OUString > sNames = xSrcNameCont->getElementNames();
211 for ( OUString const & name : sNames )
212 {
213 if ( xSrcNameCont->hasByName( name ) )
214 xNameCont->insertByName( name, xSrcNameCont->getByName( name ) );
215 }
216 std::unique_lock aGuard(m_aMutex);
217 setFastPropertyValue_NoBroadcast( aGuard, BASEPROPERTY_USERFORMCONTAINEES, Any( xNameCont ) );
218}
219
220rtl::Reference<UnoControlModel> UnoControlDialogModel::Clone() const
221{
222 // clone the container itself
223 rtl::Reference<UnoControlDialogModel> pClone = new UnoControlDialogModel( *this );
224
225 Clone_Impl(*pClone);
226
227 return pClone;
228}
229
230
231OUString UnoControlDialogModel::getServiceName( )
232{
233 return "stardiv.vcl.controlmodel.Dialog";
234}
235
236Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
237{
238 Any aAny;
239
240 switch ( nPropId )
241 {
243 aAny <<= OUString::createFromAscii( szServiceName_UnoControlDialog );
244 break;
249 aAny <<= sal_Int32(0);
250 break;
251 default:
252 aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
253 }
254
255 return aAny;
256}
257
258::cppu::IPropertyArrayHelper& UnoControlDialogModel::getInfoHelper()
259{
260 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
261 return aHelper;
262}
263
264// XMultiPropertySet
265Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( )
266{
267 static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
268 return xInfo;
269}
270
271void UnoControlDialogModel::setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue )
272{
273 ControlModelContainerBase::setFastPropertyValue_NoBroadcast( rGuard, nHandle, rValue );
274 try
275 {
276 if ( nHandle == BASEPROPERTY_IMAGEURL && ImplHasProperty( BASEPROPERTY_GRAPHIC ) )
277 {
278 OUString sImageURL;
279 uno::Reference<graphic::XGraphic> xGraphic;
280 if (rValue >>= sImageURL)
281 {
282 setFastPropertyValueImpl(rGuard,
285 mxGrfObj, sImageURL)));
286 }
287 else if (rValue >>= xGraphic)
288 {
289 setFastPropertyValueImpl(rGuard, BASEPROPERTY_GRAPHIC, uno::Any(xGraphic));
290 }
291 }
292 }
293 catch( const css::uno::Exception& )
294 {
295 TOOLS_WARN_EXCEPTION( "toolkit", "caught an exception while setting ImageURL properties" );
296 }
297}
298
299}
300
301
302// = class UnoDialogControl
303
304
305UnoDialogControl::UnoDialogControl( const uno::Reference< uno::XComponentContext >& rxContext )
306 :UnoDialogControl_Base( rxContext )
307 ,maTopWindowListeners( *this )
308 ,mbWindowListener(false)
309{
310 maComponentInfos.nWidth = 300;
311 maComponentInfos.nHeight = 450;
312 }
313
315{
316}
317
319{
320
321 bool bDecoration( true );
322 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
323 if ( bDecoration )
324 return "Dialog";
325 else
326 return "TabPage";
327}
328
330{
331 SolarMutexGuard aGuard;
332
333 EventObject aEvt;
334 aEvt.Source = static_cast< ::cppu::OWeakObject* >( this );
335 maTopWindowListeners.disposeAndClear( aEvt );
337}
338
340 const EventObject& Source )
341{
343}
344
345sal_Bool UnoDialogControl::setModel( const Reference< XControlModel >& rxModel )
346{
347 // #Can we move all the Resource stuff to the ControlContainerBase ?
348 SolarMutexGuard aGuard;
349 bool bRet = ControlContainerBase::setModel( rxModel );
350 ImplStartListingForResourceEvents();
351 return bRet;
352}
353
354void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer )
355{
356 SolarMutexGuard aGuard;
357
358 UnoControlContainer::createPeer( rxToolkit, rParentPeer );
359
360 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
361 if ( !xTW.is() )
362 return;
363
364 xTW->setMenuBar( mxMenuBar );
365
366 if ( !mbWindowListener )
367 {
368 Reference< XWindowListener > xWL(this);
369 addWindowListener( xWL );
370 mbWindowListener = true;
371 }
372
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 ) ) );
380}
381
383{
384 return "stardiv.Toolkit.UnoDialogControl";
385}
386
387sal_Bool UnoDialogControl::supportsService(OUString const & ServiceName)
388{
390}
391
392css::uno::Sequence<OUString> UnoDialogControl::getSupportedServiceNames()
393{
394 return css::uno::Sequence<OUString>{
395 "com.sun.star.awt.UnoControlDialog",
396 "stardiv.vcl.control.Dialog"};
397}
398
399void UnoDialogControl::PrepareWindowDescriptor( css::awt::WindowDescriptor& rDesc )
400{
402 bool bDecoration( true );
403 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
404 if ( !bDecoration )
405 {
406 // Now we have to manipulate the WindowDescriptor
407 rDesc.WindowAttributes = rDesc.WindowAttributes | css::awt::WindowAttribute::NODECORATION;
408 }
409
410 // We have to set the graphic property before the peer
411 // will be created. Otherwise the properties will be copied
412 // into the peer via propertiesChangeEvents. As the order of
413 // can lead to overwrites we have to set the graphic property
414 // before the propertiesChangeEvents are sent!
415 OUString aImageURL;
416 Reference< graphic::XGraphic > xGraphic;
417 if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
418 ( !aImageURL.isEmpty() ))
419 {
420 OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(PROPERTY_DIALOGSOURCEURL), uno::Any(aImageURL));
421 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
422 ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::Any( xGraphic ), true );
423 }
424}
425
426void UnoDialogControl::addTopWindowListener( const Reference< XTopWindowListener >& rxListener )
427{
428 maTopWindowListeners.addInterface( rxListener );
429 if( getPeer().is() && maTopWindowListeners.getLength() == 1 )
430 {
431 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
432 xTW->addTopWindowListener( &maTopWindowListeners );
433 }
434}
435
436void UnoDialogControl::removeTopWindowListener( const Reference< XTopWindowListener >& rxListener )
437{
438 if( getPeer().is() && maTopWindowListeners.getLength() == 1 )
439 {
440 Reference < XTopWindow > xTW( getPeer(), UNO_QUERY );
441 xTW->removeTopWindowListener( &maTopWindowListeners );
442 }
443 maTopWindowListeners.removeInterface( rxListener );
444}
445
447{
448 SolarMutexGuard aGuard;
449 if ( getPeer().is() )
450 {
451 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
452 if( xTW.is() )
453 xTW->toFront();
454 }
455}
456
458{
459 SolarMutexGuard aGuard;
460 if ( getPeer().is() )
461 {
462 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
463 if( xTW.is() )
464 xTW->toBack();
465 }
466}
467
468void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar )
469{
470 SolarMutexGuard aGuard;
471 mxMenuBar = rxMenuBar;
472 if ( getPeer().is() )
473 {
474 Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
475 if( xTW.is() )
476 xTW->setMenuBar( mxMenuBar );
477 }
478}
479static ::Size ImplMapPixelToAppFont( OutputDevice const * pOutDev, const ::Size& aSize )
480{
481 ::Size aTmp = pOutDev->PixelToLogic(aSize, MapMode(MapUnit::MapAppFont));
482 return aTmp;
483}
484// css::awt::XWindowListener
485void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e )
486{
488 DBG_ASSERT( pOutDev, "Missing Default Device!" );
489 if ( !pOutDev || mbSizeModified )
490 return;
491
492 // Currently we are simply using MapUnit::MapAppFont
493 ::Size aAppFontSize( e.Width, e.Height );
494
495 Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
496 Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
497 OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
498
499 // #i87592 In design mode the drawing layer works with sizes with decoration.
500 // Therefore we have to subtract them before writing back to the properties (model).
501 if ( xDialogDevice.is() && mbDesignMode )
502 {
503 DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
504 aAppFontSize.AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
505 aAppFontSize.AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
506 }
507
508 aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
509
510 // Remember that changes have been done by listener. No need to
511 // update the position because of property change event.
512 mbSizeModified = true;
513 // Properties in a sequence must be sorted!
514 Sequence< OUString > aProps{ "Height", "Width" };
515 Sequence< Any > aValues{
516 Any(sal_Int32(
517 std::clamp(aAppFontSize.Height(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32)))),
518 Any(sal_Int32(
519 std::clamp(aAppFontSize.Width(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))))
520 };
521
522 ImplSetPropertyValues( aProps, aValues, true );
523 mbSizeModified = false;
524
525}
526
527void SAL_CALL UnoDialogControl::windowMoved( const css::awt::WindowEvent& e )
528{
530 DBG_ASSERT( pOutDev, "Missing Default Device!" );
531 if ( !pOutDev || mbPosModified )
532 return;
533
534 // Currently we are simply using MapUnit::MapAppFont
535 ::Size aTmp( e.X, e.Y );
536 aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
537
538 // Remember that changes have been done by listener. No need to
539 // update the position because of property change event.
540 mbPosModified = true;
541 Sequence< OUString > aProps{ "PositionX", "PositionY" };
542 Sequence< Any > aValues{
543 Any(sal_Int32(
545 Any(sal_Int32(
547 };
548
549 ImplSetPropertyValues( aProps, aValues, true );
550 mbPosModified = false;
551
552}
553
554void SAL_CALL UnoDialogControl::windowShown( const EventObject& ) {}
555
556void SAL_CALL UnoDialogControl::windowHidden( const EventObject& ) {}
557
558void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result )
559{
560 Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
561 if ( xPeerDialog.is() )
562 xPeerDialog->endDialog( i_result );
563}
564
565void SAL_CALL UnoDialogControl::setHelpId( const OUString& i_id )
566{
567 Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
568 if ( xPeerDialog.is() )
569 xPeerDialog->setHelpId( i_id );
570}
571
572void UnoDialogControl::setTitle( const OUString& Title )
573{
574 SolarMutexGuard aGuard;
575 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ), uno::Any(Title), true );
576}
577
579{
580 SolarMutexGuard aGuard;
581 return ImplGetPropertyValue_UString( BASEPROPERTY_TITLE );
582}
583
585{
586 SolarMutexGuard aGuard;
587 sal_Int16 nDone = -1;
588 if ( getPeer().is() )
589 {
590 Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
591 if( xDlg.is() )
592 {
593 GetComponentInfos().bVisible = true;
594 nDone = xDlg->execute();
595 GetComponentInfos().bVisible = false;
596 }
597 }
598 return nDone;
599}
600
602{
603 SolarMutexGuard aGuard;
604 if ( getPeer().is() )
605 {
606 Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
607 if( xDlg.is() )
608 {
609 xDlg->endExecute();
610 GetComponentInfos().bVisible = false;
611 }
612 }
613}
614
615// XModifyListener
617 const lang::EventObject& /*rEvent*/ )
618{
619 ImplUpdateResourceResolver();
620}
621
622void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents )
623{
624 for( const PropertyChangeEvent& rEvt : rEvents )
625 {
626 Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
627 bool bOwnModel = xModel.get() == getModel().get();
628 if (bOwnModel && rEvt.PropertyName == "ImageURL" && !ImplHasProperty(BASEPROPERTY_GRAPHIC))
629 {
630 OUString aImageURL;
631 Reference< graphic::XGraphic > xGraphic;
632 if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ) >>= aImageURL ) &&
633 ( !aImageURL.isEmpty() ))
634 {
635 OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(GetPropertyName(BASEPROPERTY_DIALOGSOURCEURL)), uno::Any(aImageURL));
636 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
637 }
638 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC), uno::Any( xGraphic ), true );
639 break;
640 }
641 else if (bOwnModel && rEvt.PropertyName == "Graphic")
642 {
643 uno::Reference<graphic::XGraphic> xGraphic;
644 if (ImplGetPropertyValue("Graphic") >>= xGraphic)
645 {
646 ImplSetPropertyValue("Graphic", uno::Any(xGraphic), true);
647 }
648 break;
649 }
650 }
652}
653
654
655
656UnoMultiPageControl::UnoMultiPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext), maTabListeners( *this )
657{
658 maComponentInfos.nWidth = 280;
659 maComponentInfos.nHeight = 400;
660}
661
663{
664}
665// XTabListener
666
667void SAL_CALL UnoMultiPageControl::inserted( SAL_UNUSED_PARAMETER ::sal_Int32 )
668{
669}
670void SAL_CALL UnoMultiPageControl::removed( SAL_UNUSED_PARAMETER ::sal_Int32 )
671{
672}
673void SAL_CALL UnoMultiPageControl::changed( SAL_UNUSED_PARAMETER ::sal_Int32,
674 SAL_UNUSED_PARAMETER const Sequence< NamedValue >& )
675{
676}
677void SAL_CALL UnoMultiPageControl::activated( ::sal_Int32 ID )
678{
679 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::Any( ID ), false );
680
681}
682void SAL_CALL UnoMultiPageControl::deactivated( SAL_UNUSED_PARAMETER ::sal_Int32 )
683{
684}
685void SAL_CALL UnoMultiPageControl::disposing(const EventObject&)
686{
687}
688
690{
691 lang::EventObject aEvt;
692 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
693 maTabListeners.disposeAndClear( aEvt );
695}
696
697// css::awt::XSimpleTabController
698::sal_Int32 SAL_CALL UnoMultiPageControl::insertTab()
699{
700 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
701 return xMultiPage->insertTab();
702}
703
704void SAL_CALL UnoMultiPageControl::removeTab( ::sal_Int32 ID )
705{
706 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
707 xMultiPage->removeTab( ID );
708}
709
710void SAL_CALL UnoMultiPageControl::setTabProps( ::sal_Int32 ID, const Sequence< NamedValue >& Properties )
711{
712 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
713 xMultiPage->setTabProps( ID, Properties );
714}
715
716Sequence< NamedValue > SAL_CALL UnoMultiPageControl::getTabProps( ::sal_Int32 ID )
717{
718 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
719 return xMultiPage->getTabProps( ID );
720}
721
722void SAL_CALL UnoMultiPageControl::activateTab( ::sal_Int32 ID )
723{
724 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
725 xMultiPage->activateTab( ID );
726 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::Any( ID ), true );
727
728}
729
731{
732 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY_THROW );
733 return xMultiPage->getActiveTabID();
734}
735
736void SAL_CALL UnoMultiPageControl::addTabListener( const Reference< XTabListener >& Listener )
737{
738 maTabListeners.addInterface( Listener );
739 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
740 if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
741 xMultiPage->addTabListener( &maTabListeners );
742}
743
744void SAL_CALL UnoMultiPageControl::removeTabListener( const Reference< XTabListener >& Listener )
745{
746 Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
747 if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
748 xMultiPage->removeTabListener( &maTabListeners );
749 maTabListeners.removeInterface( Listener );
750}
751
753
754// lang::XTypeProvider
755css::uno::Sequence< css::uno::Type > UnoMultiPageControl::getTypes()
756{
757 static const ::cppu::OTypeCollection aTypeList(
762 );
763 return aTypeList.getTypes();
764}
765
766// uno::XInterface
768{
769 uno::Any aRet = ::cppu::queryInterface( rType,
770 static_cast< awt::XTabListener* >(this),
771 static_cast< awt::XSimpleTabController* >(this) );
772 return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType ));
773}
774
776{
777 bool bDecoration( true );
778 ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
779 if ( bDecoration )
780 return "tabcontrol";
781 // Hopefully we can tweak the tabcontrol to display without tabs
782 return "tabcontrolnotabs";
783}
784
785void UnoMultiPageControl::bindPage( const uno::Reference< awt::XControl >& _rxControl )
786{
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 );
790
791 VCLXTabPage* pXPage = dynamic_cast< VCLXTabPage* >( xPage.get() );
792 TabPage* pPage = pXPage ? pXPage->getTabPage() : nullptr;
793 if ( xTabCntrl.is() && pPage )
794 {
795 VCLXMultiPage* pXTab = dynamic_cast< VCLXMultiPage* >( xTabCntrl.get() );
796 if ( pXTab )
797 {
798 OUString sTitle;
799 xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
800 pXTab->insertTab( pPage, sTitle);
801 }
802 }
803
804}
805
806void UnoMultiPageControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer )
807{
808 SolarMutexGuard aSolarGuard;
809
810 UnoControlContainer::createPeer( rxToolkit, rParentPeer );
811
812 const uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
813 for( const auto& rCtrl : aCtrls )
814 bindPage( rCtrl );
815 sal_Int32 nActiveTab(0);
816 Reference< XPropertySet > xMultiProps( getModel(), UNO_QUERY );
817 xMultiProps->getPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ) ) >>= nActiveTab;
818
819 uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY );
820 if ( xTabCntrl.is() )
821 {
822 xTabCntrl->addTabListener( this );
823 if ( nActiveTab && aCtrls.hasElements() ) // Ensure peer is initialise with correct activated tab
824 {
825 xTabCntrl->activateTab( nActiveTab );
826 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::Any( nActiveTab ), true );
827 }
828 }
829}
830
831void UnoMultiPageControl::impl_createControlPeerIfNecessary( const uno::Reference< awt::XControl >& _rxControl)
832{
833 OSL_PRECOND( _rxControl.is(), "UnoMultiPageControl::impl_createControlPeerIfNecessary: invalid control, this will crash!" );
834
835 // if the container already has a peer, then also create a peer for the control
836 uno::Reference< awt::XWindowPeer > xMyPeer( getPeer() );
837
838 if( xMyPeer.is() )
839 {
840 _rxControl->createPeer( nullptr, xMyPeer );
841 bindPage( _rxControl );
842 ImplActivateTabControllers();
843 }
844
845}
846
847// ------------- UnoMultiPageModel -----------------
848
849UnoMultiPageModel::UnoMultiPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
850{
851 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
852 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
853 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
854 ImplRegisterProperty( BASEPROPERTY_ENABLED );
855
856 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
857 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
858 ImplRegisterProperty( BASEPROPERTY_HELPURL );
859 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
860 //ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
861 ImplRegisterProperty( BASEPROPERTY_MULTIPAGEVALUE );
862 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
863 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
864
865 Any aBool;
866 aBool <<= true;
867 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
868 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
869 ImplRegisterProperty( BASEPROPERTY_DECORATION, aBool );
870 // MultiPage Control has the tab stop property. And the default value is True.
871 ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
872
873 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
874 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::Any( xNameCont ) );
875}
876
878{
879}
880
882{
883 // clone the container itself
885 Clone_Impl( *pClone );
886 return pClone;
887}
888
890{
891 return "com.sun.star.awt.UnoMultiPageModel";
892}
893
895{
896 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
897 {
898 return uno::Any( OUString( "com.sun.star.awt.UnoControlMultiPage" ) );
899 }
901}
902
904{
905 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
906 return aHelper;
907}
908
909// beans::XMultiPropertySet
910uno::Reference< beans::XPropertySetInfo > UnoMultiPageModel::getPropertySetInfo( )
911{
912 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
913 return xInfo;
914}
915
916void UnoMultiPageModel::insertByName( const OUString& aName, const Any& aElement )
917{
918 Reference< XServiceInfo > xInfo;
919 aElement >>= xInfo;
920
921 if ( !xInfo.is() )
922 throw IllegalArgumentException();
923
924 // Only a Page model can be inserted into the multipage
925 if ( !xInfo->supportsService( "com.sun.star.awt.UnoPageModel" ) )
926 throw IllegalArgumentException();
927
929}
930
931
933{
934 return true;
935}
936
937
938
939UnoPageControl::UnoPageControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext)
940{
941 maComponentInfos.nWidth = 280;
942 maComponentInfos.nHeight = 400;
943}
944
946{
947}
948
950{
951 return "tabpage";
952}
953
954
955// ------------- UnoPageModel -----------------
956
957UnoPageModel::UnoPageModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
958{
959 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
960 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
961 ImplRegisterProperty( BASEPROPERTY_ENABLED );
962 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
963
964 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
965 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
966 ImplRegisterProperty( BASEPROPERTY_HELPURL );
967 ImplRegisterProperty( BASEPROPERTY_TITLE );
968 ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
969 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
970 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
971// ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
972
973 Any aBool;
974 aBool <<= true;
975 ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
976 ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
977 //ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
978
979 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
980 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::Any( xNameCont ) );
981}
982
984{
985}
986
988{
989 // clone the container itself
990 rtl::Reference<UnoPageModel> pClone = new UnoPageModel( *this );
991 Clone_Impl( *pClone );
992 return pClone;
993}
994
996{
997 return "com.sun.star.awt.UnoPageModel";
998}
999
1001{
1002 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
1003 {
1004 return uno::Any( OUString( "com.sun.star.awt.UnoControlPage" ) );
1005 }
1007}
1008
1010{
1011 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
1012 return aHelper;
1013}
1014
1015// beans::XMultiPropertySet
1016uno::Reference< beans::XPropertySetInfo > UnoPageModel::getPropertySetInfo( )
1017{
1018 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1019 return xInfo;
1020}
1021
1022
1024{
1025 return false;
1026}
1027
1028// Frame control
1029
1030
1031
1032UnoFrameControl::UnoFrameControl( const uno::Reference< uno::XComponentContext >& rxContext ) : ControlContainerBase(rxContext)
1033{
1034 maComponentInfos.nWidth = 280;
1035 maComponentInfos.nHeight = 400;
1036}
1037
1039{
1040}
1041
1043{
1044 return "frame";
1045}
1046
1047void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
1048{
1049 bool bOwnCtrl = false;
1050 OUString sTitle;
1051 if ( rxCtrl.get() == Reference<XControl>( this ).get() )
1052 bOwnCtrl = true;
1053 Reference< XPropertySet > xProps( getModel(), UNO_QUERY );
1054 //xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
1055 xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_LABEL ) ) >>= sTitle;
1056
1058 Reference < XWindow > xW( rxCtrl, UNO_QUERY );
1059 if ( bOwnCtrl || !xW.is() || sTitle.isEmpty() )
1060 return;
1061
1062 awt::Rectangle aSizePos = xW->getPosSize();
1063
1064 sal_Int32 nX = aSizePos.X, nY = aSizePos.Y, nWidth = aSizePos.Width, nHeight = aSizePos.Height;
1065 // Retrieve the values set by the base class
1067 if ( pOutDev )
1068 {
1069 // Adjust Y based on height of Title
1070 ::tools::Rectangle aRect = pOutDev->GetTextRect( {}, sTitle );
1071 nY = nY + ( aRect.GetHeight() / 2 );
1072 }
1073 else
1074 {
1075 Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer();
1076 Reference< XDevice > xD( xPeer, UNO_QUERY );
1077
1078 SimpleFontMetric aFM;
1079 FontDescriptor aFD;
1080 Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
1081
1082 aVal >>= aFD;
1083 if ( !aFD.StyleName.isEmpty() )
1084 {
1085 Reference< XFont > xFont = xD->getFont( aFD );
1086 aFM = xFont->getFontMetric();
1087 }
1088 else
1089 {
1090 Reference< XGraphics > xG = xD->createGraphics();
1091 aFM = xG->getFontMetric();
1092 }
1093
1094 sal_Int16 nH = aFM.Ascent + aFM.Descent;
1095 // offset y based on height of font ( not sure if my guess at the correct calculation is correct here )
1096 nY = nY + ( nH / 8); // how do I test this
1097 }
1098 xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
1099}
1100
1101// ------------- UnoFrameModel -----------------
1102
1103UnoFrameModel::UnoFrameModel( const Reference< XComponentContext >& rxContext ) : ControlModelContainerBase( rxContext )
1104{
1105 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
1106 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
1107 ImplRegisterProperty( BASEPROPERTY_ENABLED );
1108 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
1109 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
1110 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
1111 ImplRegisterProperty( BASEPROPERTY_HELPURL );
1112 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
1113 ImplRegisterProperty( BASEPROPERTY_LABEL );
1114 ImplRegisterProperty( BASEPROPERTY_WRITING_MODE );
1115 ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE );
1116 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
1117 ImplRegisterProperty( BASEPROPERTY_HSCROLL );
1118 ImplRegisterProperty( BASEPROPERTY_VSCROLL );
1119 ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH );
1120 ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT );
1121 ImplRegisterProperty( BASEPROPERTY_SCROLLTOP );
1122 ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT );
1123
1124
1125 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
1126 ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::Any( xNameCont ) );
1127}
1128
1130{
1131}
1132
1134{
1135 // clone the container itself
1136 rtl::Reference<UnoFrameModel> pClone = new UnoFrameModel( *this );
1137 Clone_Impl( *pClone );
1138 return pClone;
1139}
1140
1142{
1143 return "com.sun.star.awt.UnoFrameModel";
1144}
1145
1147{
1148 switch ( nPropId )
1149 {
1151 {
1152 return uno::Any( OUString( "com.sun.star.awt.UnoControlFrame" ) );
1153 }
1158 return uno::Any( sal_Int32(0) );
1160 {
1161 uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >;
1162 return Any( xNameCont );
1163 }
1164 }
1166}
1167
1169{
1170 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
1171 return aHelper;
1172}
1173
1174// beans::XMultiPropertySet
1175uno::Reference< beans::XPropertySetInfo > UnoFrameModel::getPropertySetInfo( )
1176{
1177 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1178 return xInfo;
1179}
1180
1181extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1183 css::uno::XComponentContext *context,
1184 css::uno::Sequence<css::uno::Any> const &)
1185{
1186 return cppu::acquire(new OGeometryControlModel<UnoControlDialogModel>(context));
1187}
1188
1189extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1191 css::uno::XComponentContext *context,
1192 css::uno::Sequence<css::uno::Any> const &)
1193{
1194 return cppu::acquire(new UnoDialogControl(context));
1195}
1196
1197extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1199 css::uno::XComponentContext *context,
1200 css::uno::Sequence<css::uno::Any> const &)
1201{
1202 return cppu::acquire(new UnoMultiPageControl(context));
1203}
1204
1205extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1207 css::uno::XComponentContext *context,
1208 css::uno::Sequence<css::uno::Any> const &)
1209{
1210 return cppu::acquire(new UnoMultiPageModel(context));
1211}
1212
1213extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1215 css::uno::XComponentContext *context,
1216 css::uno::Sequence<css::uno::Any> const &)
1217{
1218 return cppu::acquire(new UnoPageControl(context));
1219}
1220
1221extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1223 css::uno::XComponentContext *context,
1224 css::uno::Sequence<css::uno::Any> const &)
1225{
1226 return cppu::acquire(new UnoPageModel(context));
1227}
1228
1229extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1231 css::uno::XComponentContext *context,
1232 css::uno::Sequence<css::uno::Any> const &)
1233{
1234 return cppu::acquire(new UnoFrameControl(context));
1235}
1236
1237extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1239 css::uno::XComponentContext *context,
1240 css::uno::Sequence<css::uno::Any> const &)
1241{
1242 return cppu::acquire(new UnoFrameModel(context));
1243}
1244
1245/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static OutputDevice * GetDefaultDevice()
virtual void ImplSetPosSize(css::uno::Reference< css::awt::XControl > &rxCtrl)
void SAL_CALL dispose() override
virtual void ImplModelPropertiesChanged(const css::uno::Sequence< css::beans::PropertyChangeEvent > &rEvents) override
sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &Model) override
void SAL_CALL disposing(const css::lang::EventObject &Source) override
void SAL_CALL insertByName(const OUString &aName, const css::uno::Any &aElement) override
void Clone_Impl(ControlModelContainerBase &_rClone) const
::cppu::IPropertyArrayHelper & getInfoHelper() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
static css::uno::Reference< css::graphic::XGraphic > getGraphicFromURL_nothrow(const OUString &_rURL)
Definition: unocontrols.cxx:68
static css::uno::Reference< css::graphic::XGraphic > getGraphicAndGraphicObjectFromURL_nothrow(css::uno::Reference< css::graphic::XGraphicObject > &xOutGraphicObject, const OUString &_rURL)
Definition: unocontrols.cxx:61
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
virtual void PrepareWindowDescriptor(css::awt::WindowDescriptor &rDesc) override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
virtual css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const
virtual void SAL_CALL setHelpId(const OUString &Id) override
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
OUString GetComponentServiceName() const override
OUString SAL_CALL getImplementationName() override
void SAL_CALL addTopWindowListener(const css::uno::Reference< css::awt::XTopWindowListener > &xListener) override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
sal_Int16 SAL_CALL execute() override
void SAL_CALL setTitle(const OUString &Title) override
void SAL_CALL dispose() override
virtual void PrepareWindowDescriptor(css::awt::WindowDescriptor &rDesc) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Reference< css::awt::XWindowPeer > SAL_CALL getPeer() override
OUString SAL_CALL getTitle() override
void SAL_CALL toBack() override
virtual void SAL_CALL endDialog(::sal_Int32 Result) override
virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override
virtual ~UnoDialogControl() override
UnoDialogControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
void SAL_CALL removeTopWindowListener(const css::uno::Reference< css::awt::XTopWindowListener > &xListener) override
virtual void SAL_CALL addWindowListener(const css::uno::Reference< css::awt::XWindowListener > &p1) override
virtual void SAL_CALL windowShown(const css::lang::EventObject &e) override
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
void SAL_CALL setMenuBar(const css::uno::Reference< css::awt::XMenuBar > &xMenu) override
virtual void ImplModelPropertiesChanged(const css::uno::Sequence< css::beans::PropertyChangeEvent > &rEvents) override
void SAL_CALL toFront() override
void SAL_CALL endExecute() override
void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &e) override
TopWindowListenerMultiplexer maTopWindowListeners
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &e) override
css::uno::Reference< css::awt::XMenuBar > mxMenuBar
virtual void SAL_CALL windowHidden(const css::lang::EventObject &e) override
sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &Model) override
UnoFrameControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual void ImplSetPosSize(css::uno::Reference< css::awt::XControl > &rxCtrl) override
OUString GetComponentServiceName() const override
virtual ~UnoFrameControl() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual OUString SAL_CALL getServiceName() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
rtl::Reference< UnoControlModel > Clone() const override
UnoFrameModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
virtual ~UnoFrameModel() override
virtual void SAL_CALL removed(::sal_Int32 ID) override
virtual void SAL_CALL addTabListener(const css::uno::Reference< css::awt::XTabListener > &Listener) override
virtual ::sal_Int32 SAL_CALL insertTab() override
virtual void SAL_CALL removeTab(::sal_Int32 ID) override
virtual void SAL_CALL activated(::sal_Int32 ID) override
virtual void SAL_CALL activateTab(::sal_Int32 ID) override
virtual void impl_createControlPeerIfNecessary(const css::uno::Reference< css::awt::XControl > &_rxControl) override
virtual void SAL_CALL disposing(const css::lang::EventObject &evt) override
virtual ::sal_Int32 SAL_CALL getActiveTabID() override
virtual ~UnoMultiPageControl() override
virtual void SAL_CALL setTabProps(::sal_Int32 ID, const css::uno::Sequence< css::beans::NamedValue > &Properties) override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
UnoMultiPageControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual void SAL_CALL deactivated(::sal_Int32 ID) override
void SAL_CALL dispose() override
virtual css::uno::Sequence< css::beans::NamedValue > SAL_CALL getTabProps(::sal_Int32 ID) override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
virtual void SAL_CALL removeTabListener(const css::uno::Reference< css::awt::XTabListener > &Listener) override
virtual void SAL_CALL changed(::sal_Int32 ID, const css::uno::Sequence< css::beans::NamedValue > &Properties) override
virtual void SAL_CALL inserted(::sal_Int32 ID) override
TabListenerMultiplexer maTabListeners
void bindPage(const css::uno::Reference< css::awt::XControl > &_rxControl)
OUString GetComponentServiceName() const override
virtual sal_Bool SAL_CALL getGroupControl() override
void SAL_CALL insertByName(const OUString &aName, const css::uno::Any &aElement) override
rtl::Reference< UnoControlModel > Clone() const override
UnoMultiPageModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
virtual ~UnoMultiPageModel() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
virtual OUString SAL_CALL getServiceName() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
OUString GetComponentServiceName() const override
virtual ~UnoPageControl() override
UnoPageControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
UnoPageModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
rtl::Reference< UnoControlModel > Clone() const override
virtual ~UnoPageModel() override
virtual sal_Bool SAL_CALL getGroupControl() override
virtual OUString SAL_CALL getServiceName() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
virtual ::sal_Int32 SAL_CALL insertTab() override
TabPage * getTabPage() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
css::uno::Type const & get()
constexpr tools::Long GetHeight() const
OUString getPhysicalLocation(const css::uno::Any &rbase, const css::uno::Any &rUrl)
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
::Size ImplMapPixelToAppFont(OutputDevice const *pOutDev, const ::Size &aSize)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoPageModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoDialogControl_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoMultiPageControl_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoMultiPageModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
constexpr OUStringLiteral PROPERTY_DIALOGSOURCEURL
constexpr OUStringLiteral PROPERTY_IMAGEURL
constexpr OUStringLiteral PROPERTY_GRAPHIC
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoPageControl_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlDialogModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoFrameControl_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoFrameModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
float u
Any aHelper
std::mutex m_aMutex
const char * name
OUString aName
#define IMPL_IMPLEMENTATION_ID(ClassName)
Definition: macros.hxx:27
css::uno::Sequence< typename M::key_type > mapKeysToSequence(M const &map)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
Type
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Title
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
long Long
const OUString & GetPropertyName(sal_uInt16 nPropertyId)
Definition: property.cxx:295
#define BASEPROPERTY_HSCROLL
Definition: property.hxx:45
#define BASEPROPERTY_CONTEXT_WRITING_MODE
Definition: property.hxx:174
#define BASEPROPERTY_MULTIPAGEVALUE
Definition: property.hxx:191
#define BASEPROPERTY_TITLE
Definition: property.hxx:102
#define BASEPROPERTY_HELPURL
Definition: property.hxx:91
#define BASEPROPERTY_SCROLLWIDTH
Definition: property.hxx:197
#define BASEPROPERTY_IMAGEURL
Definition: property.hxx:75
#define BASEPROPERTY_DESKTOP_AS_PARENT
Definition: property.hxx:156
#define BASEPROPERTY_BACKGROUNDCOLOR
Definition: property.hxx:35
#define BASEPROPERTY_TABSTOP
Definition: property.hxx:47
#define BASEPROPERTY_ENABLED
Definition: property.hxx:77
#define BASEPROPERTY_CLOSEABLE
Definition: property.hxx:104
#define BASEPROPERTY_DEFAULTCONTROL
Definition: property.hxx:52
#define BASEPROPERTY_WRITING_MODE
Definition: property.hxx:173
#define BASEPROPERTY_SCROLLLEFT
Definition: property.hxx:200
#define BASEPROPERTY_GRAPHIC
Definition: property.hxx:150
#define BASEPROPERTY_LABEL
Definition: property.hxx:53
#define BASEPROPERTY_FONTDESCRIPTOR
Definition: property.hxx:41
#define BASEPROPERTY_VSCROLL
Definition: property.hxx:46
#define BASEPROPERTY_SCROLLHEIGHT
Definition: property.hxx:198
#define BASEPROPERTY_ENABLEVISIBLE
Definition: property.hxx:180
#define BASEPROPERTY_HELPTEXT
Definition: property.hxx:106
#define BASEPROPERTY_SIZEABLE
Definition: property.hxx:105
#define BASEPROPERTY_MOVEABLE
Definition: property.hxx:103
#define BASEPROPERTY_DECORATION
Definition: property.hxx:152
#define BASEPROPERTY_SCROLLTOP
Definition: property.hxx:199
#define BASEPROPERTY_USERFORMCONTAINEES
Definition: property.hxx:192
#define BASEPROPERTY_DIALOGSOURCEURL
Definition: property.hxx:167
#define BASEPROPERTY_PRINTABLE
Definition: property.hxx:78
sal_Int32 nHandle
const char szServiceName_UnoControlDialog[]
bool hasValue()
Reference< XModel > xModel
#define SAL_MAX_INT32
unsigned char sal_Bool
#define SAL_MIN_INT32