LibreOffice Module toolkit (master) 1
unocontrols.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 <com/sun/star/awt/XTextArea.hpp>
21#include <com/sun/star/awt/XVclWindowPeer.hpp>
22#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
23#include <com/sun/star/uno/XComponentContext.hpp>
24#include <com/sun/star/awt/VisualEffect.hpp>
25#include <com/sun/star/awt/LineEndFormat.hpp>
26#include <com/sun/star/graphic/GraphicProvider.hpp>
27#include <com/sun/star/graphic/XGraphicProvider.hpp>
28#include <com/sun/star/util/Date.hpp>
29#include <com/sun/star/awt/ImageScaleMode.hpp>
30
31#include <o3tl/safeint.hxx>
34#include <helper/property.hxx>
36
37// for introspection
38#include <awt/vclxwindows.hxx>
43#include <tools/debug.hxx>
45
46#include <algorithm>
47
48#include <helper/imagealign.hxx>
50#include <utility>
51
52using namespace css;
53using namespace css::awt;
54using namespace css::lang;
55using namespace css::uno;
56using ::com::sun::star::graphic::XGraphic;
57using ::com::sun::star::uno::Reference;
58using namespace ::toolkit;
59
60uno::Reference< graphic::XGraphic >
61ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( uno::Reference< graphic::XGraphicObject >& xOutGraphicObj, const OUString& _rURL )
62{
63 xOutGraphicObj = nullptr;
65}
66
67css::uno::Reference< css::graphic::XGraphic >
69{
70 uno::Reference< graphic::XGraphic > xGraphic;
71 if ( _rURL.isEmpty() )
72 return xGraphic;
73
74 try
75 {
76 uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
77 uno::Reference< graphic::XGraphicProvider > xProvider( graphic::GraphicProvider::create(xContext) );
78 xGraphic = xProvider->queryGraphic({ comphelper::makePropertyValue("URL", _rURL) });
79 }
80 catch (const Exception&)
81 {
82 DBG_UNHANDLED_EXCEPTION("toolkit.controls");
83 }
84
85 return xGraphic;
86}
87
88
89UnoControlEditModel::UnoControlEditModel( const Reference< XComponentContext >& rxContext )
90 :UnoControlModel( rxContext )
91{
92 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXEdit>();
93}
94
96{
97 return "stardiv.vcl.controlmodel.Edit";
98}
99
101{
102 uno::Any aReturn;
103
104 switch ( nPropId )
105 {
107 aReturn <<= sal_Int16(awt::LineEndFormat::LINE_FEED); // LF
108 break;
110 aReturn <<= OUString( "stardiv.vcl.control.Edit" );
111 break;
112 default:
113 aReturn = UnoControlModel::ImplGetDefaultValue( nPropId );
114 break;
115 }
116 return aReturn;
117}
118
120{
122 return aHelper;
123}
124
125// beans::XMultiPropertySet
126uno::Reference< beans::XPropertySetInfo > UnoControlEditModel::getPropertySetInfo( )
127{
128 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
129 return xInfo;
130}
131
133{
134 return "stardiv.Toolkit.UnoControlEditModel";
135}
136
138{
139 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlEditModel", "stardiv.vcl.controlmodel.Edit" };
141}
142
143extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
145 css::uno::XComponentContext *context,
146 css::uno::Sequence<css::uno::Any> const &)
147{
148 return cppu::acquire(new UnoControlEditModel(context));
149}
150
151
152
153UnoEditControl::UnoEditControl()
154 :maTextListeners( *this )
155 ,mnMaxTextLen( 0 )
156 ,mbSetTextInPeer( false )
157 ,mbSetMaxTextLenInPeer( false )
158 ,mbHasTextProperty( false )
159{
160 maComponentInfos.nWidth = 100;
161 maComponentInfos.nHeight = 12;
162}
163
164uno::Any SAL_CALL UnoEditControl::queryAggregation( const uno::Type & rType )
165{
167 if ( !aReturn.hasValue() )
168 aReturn = UnoEditControl_Base::queryInterface( rType );
169 return aReturn;
170}
171
172uno::Any SAL_CALL UnoEditControl::queryInterface( const uno::Type & rType )
173{
174 return UnoControlBase::queryInterface( rType );
175}
176
177void SAL_CALL UnoEditControl::acquire( ) noexcept
178{
180}
181
182void SAL_CALL UnoEditControl::release( ) noexcept
183{
185}
186
188
189OUString UnoEditControl::GetComponentServiceName() const
190{
191 // by default, we want a simple edit field
192 OUString sName( "Edit" );
193
194 // but maybe we are to display multi-line text?
195 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_MULTILINE ) );
196 bool b = bool();
197 if ( ( aVal >>= b ) && b )
198 sName = "MultiLineEdit";
199
200 return sName;
201}
202
203sal_Bool SAL_CALL UnoEditControl::setModel(const uno::Reference< awt::XControlModel >& _rModel)
204{
205 bool bReturn = UnoControlBase::setModel( _rModel );
206 mbHasTextProperty = ImplHasProperty( BASEPROPERTY_TEXT );
207 return bReturn;
208}
209
210void UnoEditControl::ImplSetPeerProperty( const OUString& rPropName, const uno::Any& rVal )
211{
212 bool bDone = false;
213 if ( GetPropertyId( rPropName ) == BASEPROPERTY_TEXT )
214 {
215 // #96986# use setText(), or text listener will not be called.
216 uno::Reference < awt::XTextComponent > xTextComponent( getPeer(), uno::UNO_QUERY );
217 if ( xTextComponent.is() )
218 {
219 OUString sText;
220 rVal >>= sText;
221 ImplCheckLocalize( sText );
222 xTextComponent->setText( sText );
223 bDone = true;
224 }
225 }
226
227 if ( !bDone )
228 UnoControlBase::ImplSetPeerProperty( rPropName, rVal );
229}
230
231void UnoEditControl::dispose()
232{
233 lang::EventObject aEvt( *this );
234 maTextListeners.disposeAndClear( aEvt );
236}
237
238void UnoEditControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
239{
240 UnoControl::createPeer( rxToolkit, rParentPeer );
241
242 uno::Reference< awt::XTextComponent > xText( getPeer(), uno::UNO_QUERY );
243 if ( xText.is() )
244 {
245 xText->addTextListener( this );
246
247 if ( mbSetMaxTextLenInPeer )
248 xText->setMaxTextLen( mnMaxTextLen );
249 if ( mbSetTextInPeer )
250 xText->setText( maText );
251 }
252}
253
254void UnoEditControl::textChanged(const awt::TextEvent& e)
255{
256 uno::Reference< awt::XTextComponent > xText( getPeer(), uno::UNO_QUERY );
257
258 if ( mbHasTextProperty )
259 {
260 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TEXT ), uno::Any(xText->getText()), false );
261 }
262 else
263 {
264 maText = xText->getText();
265 }
266
267 if ( maTextListeners.getLength() )
268 maTextListeners.textChanged( e );
269}
270
271void UnoEditControl::addTextListener(const uno::Reference< awt::XTextListener > & l)
272{
273 // tdf#150974 some extensions pass null
274 if (!l)
275 {
276 SAL_WARN("toolkit", "null XTextListener");
277 return;
278 }
279 maTextListeners.addInterface( l );
280}
281
282void UnoEditControl::removeTextListener(const uno::Reference< awt::XTextListener > & l)
283{
284 // tdf#150974 some extensions pass null
285 if (!l)
286 {
287 SAL_WARN("toolkit", "null XTextListener");
288 return;
289 }
290 maTextListeners.removeInterface( l );
291}
292
293void UnoEditControl::setText( const OUString& aText )
294{
295 if ( mbHasTextProperty )
296 {
297 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TEXT ), uno::Any(aText), true );
298 }
299 else
300 {
301 maText = aText;
302 mbSetTextInPeer = true;
303 uno::Reference < awt::XTextComponent > xText( getPeer(), uno::UNO_QUERY );
304 if ( xText.is() )
305 xText->setText( maText );
306 }
307
308 // Setting the property to the VCLXWindow doesn't call textChanged
309 if ( maTextListeners.getLength() )
310 {
311 awt::TextEvent aEvent;
312 aEvent.Source = *this;
313 maTextListeners.textChanged( aEvent );
314 }
315}
316
317namespace
318{
319 void lcl_normalize( awt::Selection& _rSel )
320 {
321 if ( _rSel.Min > _rSel.Max )
322 ::std::swap( _rSel.Min, _rSel.Max );
323 }
324}
325
326void UnoEditControl::insertText( const awt::Selection& rSel, const OUString& rNewText )
327{
328 // normalize the selection - OUString::replaceAt has a strange behaviour if the min is greater than the max
329 awt::Selection aSelection( rSel );
330 lcl_normalize( aSelection );
331
332 OUString aOldText = getText();
333 if (aSelection.Min < 0 || aOldText.getLength() < aSelection.Max)
334 {
335 throw lang::IllegalArgumentException();
336 }
337
338 // preserve the selection resp. cursor position
339 awt::Selection aNewSelection( getSelection() );
340#ifdef ALSO_PRESERVE_COMPLETE_SELECTION
341 // (not sure - looks uglier ...)
342 sal_Int32 nDeletedCharacters = ( aSelection.Max - aSelection.Min ) - rNewText.getLength();
343 if ( aNewSelection.Min > aSelection.Min )
344 aNewSelection.Min -= nDeletedCharacters;
345 if ( aNewSelection.Max > aSelection.Max )
346 aNewSelection.Max -= nDeletedCharacters;
347#else
348 aNewSelection.Max = ::std::min( aNewSelection.Min, aNewSelection.Max ) + rNewText.getLength();
350#endif
351
352 OUString aNewText = aOldText.replaceAt( aSelection.Min, aSelection.Max - aSelection.Min, rNewText );
353 setText( aNewText );
354
355 setSelection( aNewSelection );
356}
357
358OUString UnoEditControl::getText()
359{
360 OUString aText = maText;
361
362 if ( mbHasTextProperty )
363 aText = ImplGetPropertyValue_UString( BASEPROPERTY_TEXT );
364 else
365 {
366 uno::Reference< awt::XTextComponent > xText( getPeer(), uno::UNO_QUERY );
367 if ( xText.is() )
368 aText = xText->getText();
369 }
370
371 return aText;
372}
373
374OUString UnoEditControl::getSelectedText()
375{
376 OUString sSelected;
377 uno::Reference< awt::XTextComponent > xText( getPeer(), uno::UNO_QUERY );
378 if ( xText.is() )
379 sSelected = xText->getSelectedText();
380
381 return sSelected;
382}
383
384void UnoEditControl::setSelection( const awt::Selection& aSelection )
385{
386 uno::Reference< awt::XTextComponent > xText( getPeer(), uno::UNO_QUERY );
387 if ( xText.is() )
388 xText->setSelection( aSelection );
389}
390
391awt::Selection UnoEditControl::getSelection()
392{
393 awt::Selection aSel;
394 uno::Reference< awt::XTextComponent > xText( getPeer(), uno::UNO_QUERY );
395 if ( xText.is() )
396 aSel = xText->getSelection();
397 return aSel;
398}
399
400sal_Bool UnoEditControl::isEditable()
401{
402 return !ImplGetPropertyValue_BOOL( BASEPROPERTY_READONLY );
403}
404
405void UnoEditControl::setEditable( sal_Bool bEditable )
406{
407 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_READONLY ), uno::Any(!bEditable), true );
408}
409
410sal_Int16 UnoEditControl::getMaxTextLen()
411{
412 sal_Int16 nMaxLen = mnMaxTextLen;
413
414 if ( ImplHasProperty( BASEPROPERTY_MAXTEXTLEN ) )
415 nMaxLen = ImplGetPropertyValue_INT16( BASEPROPERTY_MAXTEXTLEN );
416
417 return nMaxLen;
418}
419
420void UnoEditControl::setMaxTextLen( sal_Int16 nLen )
421{
422 if ( ImplHasProperty( BASEPROPERTY_MAXTEXTLEN) )
423 {
424 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MAXTEXTLEN ), uno::Any(nLen), true );
425 }
426 else
427 {
428 mnMaxTextLen = nLen;
429 mbSetMaxTextLenInPeer = true;
430 uno::Reference < awt::XTextComponent > xText( getPeer(), uno::UNO_QUERY );
431 if ( xText.is() )
432 xText->setMaxTextLen( mnMaxTextLen );
433 }
434}
435
436awt::Size UnoEditControl::getMinimumSize( )
437{
438 return Impl_getMinimumSize();
439}
440
441awt::Size UnoEditControl::getPreferredSize( )
442{
443 return Impl_getPreferredSize();
444}
445
446awt::Size UnoEditControl::calcAdjustedSize( const awt::Size& rNewSize )
447{
448 return Impl_calcAdjustedSize( rNewSize );
449}
450
451awt::Size UnoEditControl::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines )
452{
453 return Impl_getMinimumSize( nCols, nLines );
454}
455
456void UnoEditControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines )
457{
458 Impl_getColumnsAndLines( nCols, nLines );
459}
460
461OUString UnoEditControl::getImplementationName( )
462{
463 return "stardiv.Toolkit.UnoEditControl";
464}
465
466uno::Sequence< OUString > UnoEditControl::getSupportedServiceNames()
467{
468 css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlEdit", "stardiv.vcl.control.Edit" };
470}
471
472extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
474 css::uno::XComponentContext *,
475 css::uno::Sequence<css::uno::Any> const &)
476{
477 return cppu::acquire(new UnoEditControl());
478}
479
480
481
482UnoControlFileControlModel::UnoControlFileControlModel( const Reference< XComponentContext >& rxContext )
483 :UnoControlModel( rxContext )
484{
485 ImplRegisterProperty( BASEPROPERTY_ALIGN );
486 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
487 ImplRegisterProperty( BASEPROPERTY_BORDER );
488 ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
489 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
490 ImplRegisterProperty( BASEPROPERTY_ENABLED );
491 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
492 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
493 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
494 ImplRegisterProperty( BASEPROPERTY_HELPURL );
495 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
496 ImplRegisterProperty( BASEPROPERTY_READONLY );
497 ImplRegisterProperty( BASEPROPERTY_TABSTOP );
498 ImplRegisterProperty( BASEPROPERTY_TEXT );
499 ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
500 ImplRegisterProperty( BASEPROPERTY_WRITING_MODE );
501 ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE );
502 ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
503}
504
506{
507 return "stardiv.vcl.controlmodel.FileControl";
508}
509
511{
512 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
513 {
514 return uno::Any( OUString( "stardiv.vcl.control.FileControl" ) );
515 }
516 return UnoControlModel::ImplGetDefaultValue( nPropId );
517}
518
520{
522 return aHelper;
523}
524
525// beans::XMultiPropertySet
526uno::Reference< beans::XPropertySetInfo > UnoControlFileControlModel::getPropertySetInfo( )
527{
528 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
529 return xInfo;
530}
531
533{
534 return "stardiv.Toolkit.UnoControlFileControlModel";
535}
536
537css::uno::Sequence<OUString>
539{
540 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlFileControlModel", "stardiv.vcl.controlmodel.FileControl" };
542}
543
544extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
546 css::uno::XComponentContext *context,
547 css::uno::Sequence<css::uno::Any> const &)
548{
549 return cppu::acquire(new UnoControlFileControlModel(context));
550}
551
552
553
555{
556}
557
559{
560 return "filecontrol";
561}
562
564{
565 return "stardiv.Toolkit.UnoFileControl";
566}
567
568css::uno::Sequence<OUString> UnoFileControl::getSupportedServiceNames()
569{
570 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlFileControl", "stardiv.vcl.control.FileControl" };
571 return comphelper::concatSequences( UnoEditControl::getSupportedServiceNames(), vals );
572}
573
574extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
576 css::uno::XComponentContext *,
577 css::uno::Sequence<css::uno::Any> const &)
578{
579 return cppu::acquire(new UnoFileControl());
580}
581
582
583
585{
586 if ( nPropId == BASEPROPERTY_GRAPHIC )
587 return uno::Any( uno::Reference< graphic::XGraphic >() );
588
589 return UnoControlModel::ImplGetDefaultValue( nPropId );
590}
591
592void GraphicControlModel::setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue )
593{
595
596 // - ImageAlign and ImagePosition need to correspond to each other
597 // - Graphic and ImageURL need to correspond to each other
598 try
599 {
600 switch ( nHandle )
601 {
604 {
605 mbAdjustingGraphic = true;
606 OUString sImageURL;
607 OSL_VERIFY( rValue >>= sImageURL );
609 mbAdjustingGraphic = false;
610 }
611 break;
612
615 {
616 mbAdjustingGraphic = true;
618 mbAdjustingGraphic = false;
619 }
620 break;
621
624 {
626 sal_Int16 nUNOValue = 0;
627 OSL_VERIFY( rValue >>= nUNOValue );
630 }
631 break;
634 {
636 sal_Int16 nUNOValue = 0;
637 OSL_VERIFY( rValue >>= nUNOValue );
640 }
641 break;
642 }
643 }
644 catch( const css::uno::Exception& )
645 {
646 DBG_UNHANDLED_EXCEPTION("toolkit.controls");
647 OSL_FAIL( "GraphicControlModel::setFastPropertyValue_NoBroadcast: caught an exception while aligning the ImagePosition/ImageAlign properties!" );
649 }
650}
651
652
653
654UnoControlButtonModel::UnoControlButtonModel( const Reference< XComponentContext >& rxContext )
655 :GraphicControlModel( rxContext )
656{
657 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXButton>();
658
659 osl_atomic_increment( &m_refCount );
660 {
661 std::unique_lock aGuard(m_aMutex);
663 // this ensures that our ImagePosition is consistent with our ImageAlign property (since both
664 // defaults are not per se consistent), since both are coupled in setFastPropertyValue_NoBroadcast
665 }
666 osl_atomic_decrement( &m_refCount );
667}
668
670{
671 return "stardiv.vcl.controlmodel.Button";
672}
673
675{
676 switch ( nPropId )
677 {
679 return uno::Any( OUString( "stardiv.vcl.control.Button" ) );
681 return uno::Any( false );
683 return uno::Any( sal_Int16(PROPERTY_ALIGN_CENTER) );
685 return uno::Any( true );
686 }
687
689}
690
692{
694 return aHelper;
695}
696
697// beans::XMultiPropertySet
698uno::Reference< beans::XPropertySetInfo > UnoControlButtonModel::getPropertySetInfo( )
699{
700 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
701 return xInfo;
702}
703
705{
706 return "stardiv.Toolkit.UnoControlButtonModel";
707}
708
710{
711 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlButtonModel", "stardiv.vcl.controlmodel.Button" };
713}
714
715extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
717 css::uno::XComponentContext *context,
718 css::uno::Sequence<css::uno::Any> const &)
719{
720 return cppu::acquire(new UnoControlButtonModel(context));
721}
722
723
724
726 :maActionListeners( *this )
727 ,maItemListeners( *this )
728{
729 maComponentInfos.nWidth = 50;
730 maComponentInfos.nHeight = 14;
731}
732
734{
735 OUString aName( "pushbutton" );
736 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_PUSHBUTTONTYPE ) );
737 sal_Int16 n = sal_Int16();
738 if ( ( aVal >>= n ) && n )
739 {
740 // Use PushButtonType later when available...
741 switch ( n )
742 {
743 case 1 /*PushButtonType::OK*/: aName = "okbutton";
744 break;
745 case 2 /*PushButtonType::CANCEL*/: aName = "cancelbutton";
746 break;
747 case 3 /*PushButtonType::HELP*/: aName = "helpbutton";
748 break;
749 default:
750 {
751 OSL_FAIL( "Unknown Button Type!" );
752 }
753 }
754 }
755 return aName;
756}
757
759{
760 lang::EventObject aEvt;
761 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
762 maActionListeners.disposeAndClear( aEvt );
763 maItemListeners.disposeAndClear( aEvt );
765}
766
767void UnoButtonControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
768{
769 UnoControlBase::createPeer( rxToolkit, rParentPeer );
770
771 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
772 xButton->setActionCommand( maActionCommand );
773 if ( maActionListeners.getLength() )
774 xButton->addActionListener( &maActionListeners );
775
776 uno::Reference< XToggleButton > xPushButton( getPeer(), uno::UNO_QUERY );
777 if ( xPushButton.is() )
778 xPushButton->addItemListener( this );
779}
780
781void UnoButtonControl::addActionListener(const uno::Reference< awt::XActionListener > & l)
782{
783 // tdf#150974 some extensions pass null
784 if (!l)
785 {
786 SAL_WARN("toolkit", "null XActionListener");
787 return;
788 }
789
790 maActionListeners.addInterface( l );
791 if( getPeer().is() && maActionListeners.getLength() == 1 )
792 {
793 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
794 xButton->addActionListener( &maActionListeners );
795 }
796}
797
798void UnoButtonControl::removeActionListener(const uno::Reference< awt::XActionListener > & l)
799{
800 // tdf#150974 some extensions pass null
801 if (!l)
802 {
803 SAL_WARN("toolkit", "null XActionListener");
804 return;
805 }
806
807 if( getPeer().is() && maActionListeners.getLength() == 1 )
808 {
809 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
810 xButton->removeActionListener( &maActionListeners );
811 }
812 maActionListeners.removeInterface( l );
813}
814
815void UnoButtonControl::addItemListener(const uno::Reference< awt::XItemListener > & l)
816{
817 maItemListeners.addInterface( l );
818}
819
820void UnoButtonControl::removeItemListener(const uno::Reference< awt::XItemListener > & l)
821{
822 maItemListeners.removeInterface( l );
823}
824
825void SAL_CALL UnoButtonControl::disposing( const lang::EventObject& Source )
826{
828}
829
830void SAL_CALL UnoButtonControl::itemStateChanged( const awt::ItemEvent& rEvent )
831{
832 // forward to model
833 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STATE ), uno::Any(static_cast<sal_Int16>(rEvent.Selected)), false );
834
835 // multiplex
836 ItemEvent aEvent( rEvent );
837 aEvent.Source = *this;
838 maItemListeners.itemStateChanged( aEvent );
839}
840
841void UnoButtonControl::setLabel( const OUString& rLabel )
842{
843 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_LABEL ), uno::Any(rLabel), true );
844}
845
846void UnoButtonControl::setActionCommand( const OUString& rCommand )
847{
848 maActionCommand = rCommand;
849 if ( getPeer().is() )
850 {
851 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
852 xButton->setActionCommand( rCommand );
853 }
854}
855
857{
858 return Impl_getMinimumSize();
859}
860
862{
863 return Impl_getPreferredSize();
864}
865
866awt::Size UnoButtonControl::calcAdjustedSize( const awt::Size& rNewSize )
867{
868 return Impl_calcAdjustedSize( rNewSize );
869}
870
872{
873 return "stardiv.Toolkit.UnoButtonControl";
874}
875
876css::uno::Sequence<OUString> UnoButtonControl::getSupportedServiceNames()
877{
878 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlButton", "stardiv.vcl.control.Button" };
880}
881
882extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
884 css::uno::XComponentContext *,
885 css::uno::Sequence<css::uno::Any> const &)
886{
887 return cppu::acquire(new UnoButtonControl());
888}
889
890
891
892UnoControlImageControlModel::UnoControlImageControlModel( const Reference< XComponentContext >& rxContext )
893 :GraphicControlModel( rxContext )
894 ,mbAdjustingImageScaleMode( false )
895{
896 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXImageControl>();
897}
898
900{
901 return "stardiv.vcl.controlmodel.ImageControl";
902}
903
905{
906 return "stardiv.Toolkit.UnoControlImageControlModel";
907}
908
909css::uno::Sequence<OUString>
911{
912 const css::uno::Sequence<OUString> vals {
913 "com.sun.star.awt.UnoControlImageButtonModel",
914 "com.sun.star.awt.UnoControlImageControlModel",
915 "stardiv.vcl.controlmodel.ImageButton",
916 "stardiv.vcl.controlmodel.ImageControl"
917 };
919}
920
922{
923 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
924 return uno::Any( OUString( "stardiv.vcl.control.ImageControl" ) );
925
926 if ( nPropId == BASEPROPERTY_IMAGE_SCALE_MODE )
927 return Any( awt::ImageScaleMode::ANISOTROPIC );
928
930}
931
933{
935 return aHelper;
936}
937
938// beans::XMultiPropertySet
939uno::Reference< beans::XPropertySetInfo > UnoControlImageControlModel::getPropertySetInfo( )
940{
941 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
942 return xInfo;
943}
944
945void UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 _nHandle, const css::uno::Any& _rValue )
946{
948
949 // ScaleImage is an older (and less powerful) version of ScaleMode, but keep both in sync as far as possible
950 try
951 {
952 switch ( _nHandle )
953 {
956 {
958 sal_Int16 nScaleMode( awt::ImageScaleMode::ANISOTROPIC );
959 OSL_VERIFY( _rValue >>= nScaleMode );
960 setDependentFastPropertyValue( rGuard, BASEPROPERTY_SCALEIMAGE, uno::Any( nScaleMode != awt::ImageScaleMode::NONE ) );
962 }
963 break;
966 {
968 bool bScale = true;
969 OSL_VERIFY( _rValue >>= bScale );
970 setDependentFastPropertyValue( rGuard, BASEPROPERTY_IMAGE_SCALE_MODE, uno::Any( bScale ? awt::ImageScaleMode::ANISOTROPIC : awt::ImageScaleMode::NONE ) );
972 }
973 break;
974 }
975 }
976 catch( const Exception& )
977 {
979 throw;
980 }
981}
982
983extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
985 css::uno::XComponentContext *context,
986 css::uno::Sequence<css::uno::Any> const &)
987{
988 return cppu::acquire(new UnoControlImageControlModel(context));
989}
990
991
992
994 :maActionListeners( *this )
995{
996 // TODO: Where should I look for defaults?
997 maComponentInfos.nWidth = 100;
998 maComponentInfos.nHeight = 100;
999}
1000
1002{
1003 return "fixedimage";
1004}
1005
1007{
1008 lang::EventObject aEvt;
1009 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
1010 maActionListeners.disposeAndClear( aEvt );
1012}
1013
1015{
1016 return true;
1017}
1018
1020{
1021 return Impl_getMinimumSize();
1022}
1023
1025{
1026 return Impl_getPreferredSize();
1027}
1028
1029awt::Size UnoImageControlControl::calcAdjustedSize( const awt::Size& rNewSize )
1030{
1031 return Impl_calcAdjustedSize( rNewSize );
1032}
1033
1035{
1036 return "stardiv.Toolkit.UnoImageControlControl";
1037}
1038
1040{
1041 const css::uno::Sequence<OUString> vals {
1042 "com.sun.star.awt.UnoControlImageButton",
1043 "com.sun.star.awt.UnoControlImageControl",
1044 "stardiv.vcl.control.ImageButton",
1045 "stardiv.vcl.control.ImageControl"
1046 };
1048}
1049
1050extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1052 css::uno::XComponentContext *,
1053 css::uno::Sequence<css::uno::Any> const &)
1054{
1055 return cppu::acquire(new UnoImageControlControl());
1056}
1057
1058
1059
1060UnoControlRadioButtonModel::UnoControlRadioButtonModel( const Reference< XComponentContext >& rxContext )
1061 :GraphicControlModel( rxContext )
1062{
1063 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXRadioButton>();
1064}
1065
1067{
1068 return "stardiv.vcl.controlmodel.RadioButton";
1069}
1070
1072{
1073 switch ( nPropId )
1074 {
1076 return uno::Any( OUString( "stardiv.vcl.control.RadioButton" ) );
1077
1079 return uno::Any( sal_Int16(awt::VisualEffect::LOOK3D) );
1080 }
1081
1083}
1084
1086{
1088 return aHelper;
1089}
1090
1091// beans::XMultiPropertySet
1092uno::Reference< beans::XPropertySetInfo > UnoControlRadioButtonModel::getPropertySetInfo( )
1093{
1094 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1095 return xInfo;
1096}
1097
1099{
1100 return "stardiv.Toolkit.UnoControlRadioButtonModel";
1101}
1102
1103css::uno::Sequence<OUString>
1105{
1106 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlRadioButtonModel", "stardiv.vcl.controlmodel.RadioButton" };
1108}
1109
1110extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1112 css::uno::XComponentContext *context,
1113 css::uno::Sequence<css::uno::Any> const &)
1114{
1115 return cppu::acquire(new UnoControlRadioButtonModel(context));
1116}
1117
1118
1119
1121 :maItemListeners( *this )
1122 ,maActionListeners( *this )
1123{
1124 maComponentInfos.nWidth = 100;
1125 maComponentInfos.nHeight = 12;
1126}
1127
1129{
1130 return "radiobutton";
1131}
1132
1134{
1135 lang::EventObject aEvt;
1136 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
1137 maItemListeners.disposeAndClear( aEvt );
1139}
1140
1141
1143{
1144 return true;
1145}
1146
1147void UnoRadioButtonControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
1148{
1149 UnoControlBase::createPeer( rxToolkit, rParentPeer );
1150
1151 uno::Reference < awt::XRadioButton > xRadioButton( getPeer(), uno::UNO_QUERY );
1152 xRadioButton->addItemListener( this );
1153
1154 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
1155 xButton->setActionCommand( maActionCommand );
1156 if ( maActionListeners.getLength() )
1157 xButton->addActionListener( &maActionListeners );
1158
1159 // as default, set the "AutoToggle" to true
1160 // (it is set to false in VCLXToolkit::ImplCreateWindow because of #87254#, but we want to
1161 // have it enabled by default because of 85071)
1162 uno::Reference< awt::XVclWindowPeer > xVclWindowPeer( getPeer(), uno::UNO_QUERY );
1163 if ( xVclWindowPeer.is() )
1164 xVclWindowPeer->setProperty( GetPropertyName( BASEPROPERTY_AUTOTOGGLE ), css::uno::Any(true) );
1165}
1166
1167void UnoRadioButtonControl::addItemListener(const uno::Reference < awt::XItemListener > & l)
1168{
1169 maItemListeners.addInterface( l );
1170}
1171
1172void UnoRadioButtonControl::removeItemListener(const uno::Reference < awt::XItemListener > & l)
1173{
1174 maItemListeners.removeInterface( l );
1175}
1176
1177void UnoRadioButtonControl::addActionListener(const uno::Reference< awt::XActionListener > & l)
1178{
1179 maActionListeners.addInterface( l );
1180 if( getPeer().is() && maActionListeners.getLength() == 1 )
1181 {
1182 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
1183 xButton->addActionListener( &maActionListeners );
1184 }
1185}
1186
1187void UnoRadioButtonControl::removeActionListener(const uno::Reference< awt::XActionListener > & l)
1188{
1189 if( getPeer().is() && maActionListeners.getLength() == 1 )
1190 {
1191 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
1192 xButton->removeActionListener( &maActionListeners );
1193 }
1194 maActionListeners.removeInterface( l );
1195}
1196
1197void UnoRadioButtonControl::setLabel( const OUString& rLabel )
1198{
1199 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_LABEL ), uno::Any(rLabel), true );
1200}
1201
1202void UnoRadioButtonControl::setActionCommand( const OUString& rCommand )
1203{
1204 maActionCommand = rCommand;
1205 if ( getPeer().is() )
1206 {
1207 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
1208 xButton->setActionCommand( rCommand );
1209 }
1210}
1211
1213{
1214 sal_Int16 nState = bOn ? 1 : 0;
1215 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STATE ), uno::Any(nState), true );
1216}
1217
1219{
1220 sal_Int16 nState = 0;
1221 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STATE ) );
1222 aVal >>= nState;
1223 return nState != 0;
1224}
1225
1226void UnoRadioButtonControl::itemStateChanged( const awt::ItemEvent& rEvent )
1227{
1228 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STATE ), uno::Any(static_cast<sal_Int16>(rEvent.Selected)), false );
1229
1230 // compatibility:
1231 // in OOo 1.0.x, when the user clicked a radio button in a group of buttons, this resulted
1232 // in _one_ itemStateChanged call for exactly the radio button which's state changed from
1233 // "0" to "1".
1234 // Nowadays, since the listener handling changed a lot towards 1.1 (the VCLXWindow reacts on more
1235 // basic events from the VCL-windows, not anymore on the Link-based events like in 1.0.x), this
1236 // isn't the case anymore: For instance, this method here gets called for the radio button
1237 // which is being implicitly _de_selected, too. This is pretty bad for compatibility.
1238 // Thus, we suppress all events with a new state other than "1". This is unlogical, and weird, when looking
1239 // from a pure API perspective, but it's _compatible_ with older product versions, and this is
1240 // all which matters here.
1241 // #i14703#
1242 if ( 1 == rEvent.Selected )
1243 {
1244 if ( maItemListeners.getLength() )
1245 maItemListeners.itemStateChanged( rEvent );
1246 }
1247 // note that speaking strictly, this is wrong: When in 1.0.x, the user would have de-selected
1248 // a radio button _without_ selecting another one, this would have caused a notification.
1249 // With the change done here, this today won't cause a notification anymore.
1250
1251 // Fortunately, it's not possible for the user to de-select a radio button without selecting another on,
1252 // at least not via the regular UI. It _would_ be possible via the Accessibility API, which
1253 // counts as "user input", too. But in 1.0.x, there was no Accessibility API, so there is nothing
1254 // to be inconsistent with.
1255}
1256
1258{
1259 return Impl_getMinimumSize();
1260}
1261
1263{
1264 return Impl_getPreferredSize();
1265}
1266
1267awt::Size UnoRadioButtonControl::calcAdjustedSize( const awt::Size& rNewSize )
1268{
1269 return Impl_calcAdjustedSize( rNewSize );
1270}
1271
1273{
1274 return "stardiv.Toolkit.UnoRadioButtonControl";
1275}
1276
1278{
1279 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlRadioButton", "stardiv.vcl.control.RadioButton" };
1281}
1282
1283extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1285 css::uno::XComponentContext *,
1286 css::uno::Sequence<css::uno::Any> const &)
1287{
1288 return cppu::acquire(new UnoRadioButtonControl());
1289}
1290
1291
1292
1293UnoControlCheckBoxModel::UnoControlCheckBoxModel( const Reference< XComponentContext >& rxContext )
1294 :GraphicControlModel( rxContext )
1295{
1296 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXCheckBox>();
1297}
1298
1300{
1301 return "stardiv.vcl.controlmodel.CheckBox";
1302}
1303
1305{
1306 switch ( nPropId )
1307 {
1309 return uno::Any( OUString( "stardiv.vcl.control.CheckBox" ) );
1310
1312 return uno::Any( sal_Int16(awt::VisualEffect::LOOK3D) );
1313 }
1314
1316}
1317
1319{
1321 return aHelper;
1322}
1323
1324// beans::XMultiPropertySet
1325uno::Reference< beans::XPropertySetInfo > UnoControlCheckBoxModel::getPropertySetInfo( )
1326{
1327 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1328 return xInfo;
1329}
1330
1332{
1333 return "stardiv.Toolkit.UnoControlCheckBoxModel";
1334}
1335
1337{
1338 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlCheckBoxModel", "stardiv.vcl.controlmodel.CheckBox" };
1340}
1341
1342extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1344 css::uno::XComponentContext *context,
1345 css::uno::Sequence<css::uno::Any> const &)
1346{
1347 return cppu::acquire(new UnoControlCheckBoxModel(context));
1348}
1349
1350
1351
1353 :maItemListeners( *this ), maActionListeners( *this )
1354{
1355 maComponentInfos.nWidth = 100;
1356 maComponentInfos.nHeight = 12;
1357}
1358
1360{
1361 return "checkbox";
1362}
1363
1365{
1366 lang::EventObject aEvt;
1367 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
1368 maItemListeners.disposeAndClear( aEvt );
1370}
1371
1373{
1374 return true;
1375}
1376
1377void UnoCheckBoxControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
1378{
1379 UnoControlBase::createPeer( rxToolkit, rParentPeer );
1380
1381 uno::Reference < awt::XCheckBox > xCheckBox( getPeer(), uno::UNO_QUERY );
1382 xCheckBox->addItemListener( this );
1383
1384 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
1385 xButton->setActionCommand( maActionCommand );
1386 if ( maActionListeners.getLength() )
1387 xButton->addActionListener( &maActionListeners );
1388}
1389
1390void UnoCheckBoxControl::addItemListener(const uno::Reference < awt::XItemListener > & l)
1391{
1392 maItemListeners.addInterface( l );
1393}
1394
1395void UnoCheckBoxControl::removeItemListener(const uno::Reference < awt::XItemListener > & l)
1396{
1397 maItemListeners.removeInterface( l );
1398}
1399
1400void UnoCheckBoxControl::addActionListener(const uno::Reference< awt::XActionListener > & l)
1401{
1402 maActionListeners.addInterface( l );
1403 if( getPeer().is() && maActionListeners.getLength() == 1 )
1404 {
1405 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
1406 xButton->addActionListener( &maActionListeners );
1407 }
1408}
1409
1410void UnoCheckBoxControl::removeActionListener(const uno::Reference< awt::XActionListener > & l)
1411{
1412 if( getPeer().is() && maActionListeners.getLength() == 1 )
1413 {
1414 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
1415 xButton->removeActionListener( &maActionListeners );
1416 }
1417 maActionListeners.removeInterface( l );
1418}
1419
1420void UnoCheckBoxControl::setActionCommand( const OUString& rCommand )
1421{
1422 maActionCommand = rCommand;
1423 if ( getPeer().is() )
1424 {
1425 uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
1426 xButton->setActionCommand( rCommand );
1427 }
1428}
1429
1430
1431void UnoCheckBoxControl::setLabel( const OUString& rLabel )
1432{
1433 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_LABEL ), uno::Any(rLabel), true );
1434}
1435
1437{
1438 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STATE ), uno::Any(n), true );
1439}
1440
1442{
1443 sal_Int16 nState = 0;
1444 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STATE ) );
1445 aVal >>= nState;
1446 return nState;
1447}
1448
1450{
1451 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TRISTATE ), uno::Any(b), true );
1452}
1453
1454void UnoCheckBoxControl::itemStateChanged( const awt::ItemEvent& rEvent )
1455{
1456 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STATE ), uno::Any(static_cast<sal_Int16>(rEvent.Selected)), false );
1457
1458 if ( maItemListeners.getLength() )
1459 maItemListeners.itemStateChanged( rEvent );
1460}
1461
1463{
1464 return Impl_getMinimumSize();
1465}
1466
1468{
1469 return Impl_getPreferredSize();
1470}
1471
1472awt::Size UnoCheckBoxControl::calcAdjustedSize( const awt::Size& rNewSize )
1473{
1474 return Impl_calcAdjustedSize( rNewSize );
1475}
1476
1478{
1479 return "stardiv.Toolkit.UnoCheckBoxControl";
1480}
1481
1483{
1484 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlCheckBox", "stardiv.vcl.control.CheckBox" };
1486}
1487
1488extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1490 css::uno::XComponentContext *,
1491 css::uno::Sequence<css::uno::Any> const &)
1492{
1493 return cppu::acquire(new UnoCheckBoxControl());
1494}
1495
1496
1497
1498UnoControlFixedHyperlinkModel::UnoControlFixedHyperlinkModel( const Reference< XComponentContext >& rxContext )
1499 :UnoControlModel( rxContext )
1500{
1501 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXFixedHyperlink>();
1502}
1503
1505{
1506 return "com.sun.star.awt.UnoControlFixedHyperlinkModel";
1507}
1508
1510{
1511 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
1512 {
1513 return uno::Any( OUString( "com.sun.star.awt.UnoControlFixedHyperlink" ) );
1514 }
1515 else if ( nPropId == BASEPROPERTY_BORDER )
1516 {
1517 return uno::Any(sal_Int16(0));
1518 }
1519 else if ( nPropId == BASEPROPERTY_URL )
1520 {
1521 return uno::Any( OUString() );
1522 }
1523
1524 return UnoControlModel::ImplGetDefaultValue( nPropId );
1525}
1526
1528{
1530 return aHelper;
1531}
1532
1533// beans::XMultiPropertySet
1534uno::Reference< beans::XPropertySetInfo > UnoControlFixedHyperlinkModel::getPropertySetInfo( )
1535{
1536 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1537 return xInfo;
1538}
1539
1540extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1542 css::uno::XComponentContext *context,
1543 css::uno::Sequence<css::uno::Any> const &)
1544{
1545 return cppu::acquire(new UnoControlFixedHyperlinkModel(context));
1546}
1547
1548
1549
1551 :maActionListeners( *this )
1552{
1555}
1556
1558{
1559 return "fixedhyperlink";
1560}
1561
1562// uno::XInterface
1564{
1565 uno::Any aRet = ::cppu::queryInterface( rType,
1566 static_cast< awt::XFixedHyperlink* >(this),
1567 static_cast< awt::XLayoutConstrains* >(this) );
1568 return (aRet.hasValue() ? aRet : UnoControlBase::queryAggregation( rType ));
1569}
1570
1572
1573// lang::XTypeProvider
1574css::uno::Sequence< css::uno::Type > UnoFixedHyperlinkControl::getTypes()
1575{
1576 static const ::cppu::OTypeCollection aTypeList(
1581 );
1582 return aTypeList.getTypes();
1583}
1584
1586{
1587 return true;
1588}
1589
1590void UnoFixedHyperlinkControl::setText( const OUString& Text )
1591{
1593}
1594
1596{
1598}
1599
1600void UnoFixedHyperlinkControl::setURL( const OUString& URL )
1601{
1603}
1604
1606{
1608}
1609
1611{
1613}
1614
1616{
1617 sal_Int16 nAlign = 0;
1618 if ( mxModel.is() )
1619 {
1621 aVal >>= nAlign;
1622 }
1623 return nAlign;
1624}
1625
1627{
1628 return Impl_getMinimumSize();
1629}
1630
1632{
1633 return Impl_getPreferredSize();
1634}
1635
1636awt::Size UnoFixedHyperlinkControl::calcAdjustedSize( const awt::Size& rNewSize )
1637{
1638 return Impl_calcAdjustedSize( rNewSize );
1639}
1640
1642{
1643 lang::EventObject aEvt;
1644 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
1645 maActionListeners.disposeAndClear( aEvt );
1647}
1648
1649void UnoFixedHyperlinkControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
1650{
1651 UnoControlBase::createPeer( rxToolkit, rParentPeer );
1652
1653 uno::Reference < awt::XFixedHyperlink > xFixedHyperlink( getPeer(), uno::UNO_QUERY );
1654 if ( maActionListeners.getLength() )
1655 xFixedHyperlink->addActionListener( &maActionListeners );
1656}
1657
1658void UnoFixedHyperlinkControl::addActionListener(const uno::Reference< awt::XActionListener > & l)
1659{
1660 maActionListeners.addInterface( l );
1661 if( getPeer().is() && maActionListeners.getLength() == 1 )
1662 {
1663 uno::Reference < awt::XFixedHyperlink > xFixedHyperlink( getPeer(), uno::UNO_QUERY );
1664 xFixedHyperlink->addActionListener( &maActionListeners );
1665 }
1666}
1667
1668void UnoFixedHyperlinkControl::removeActionListener(const uno::Reference< awt::XActionListener > & l)
1669{
1670 if( getPeer().is() && maActionListeners.getLength() == 1 )
1671 {
1672 uno::Reference < awt::XFixedHyperlink > xFixedHyperlink( getPeer(), uno::UNO_QUERY );
1673 xFixedHyperlink->removeActionListener( &maActionListeners );
1674 }
1675 maActionListeners.removeInterface( l );
1676}
1677
1678extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1680 css::uno::XComponentContext *,
1681 css::uno::Sequence<css::uno::Any> const &)
1682{
1683 return cppu::acquire(new UnoFixedHyperlinkControl());
1684}
1685
1686
1687
1688UnoControlFixedTextModel::UnoControlFixedTextModel( const Reference< XComponentContext >& rxContext )
1689 :UnoControlModel( rxContext )
1690{
1691 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXFixedText>();
1692}
1693
1695{
1696 return "stardiv.vcl.controlmodel.FixedText";
1697}
1698
1700{
1701 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
1702 {
1703 return uno::Any( OUString( "stardiv.vcl.control.FixedText" ) );
1704 }
1705 else if ( nPropId == BASEPROPERTY_BORDER )
1706 {
1707 return uno::Any(sal_Int16(0));
1708 }
1709
1710 return UnoControlModel::ImplGetDefaultValue( nPropId );
1711}
1712
1714{
1716 return aHelper;
1717}
1718
1719// beans::XMultiPropertySet
1720uno::Reference< beans::XPropertySetInfo > UnoControlFixedTextModel::getPropertySetInfo( )
1721{
1722 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1723 return xInfo;
1724}
1725
1727{
1728 return "stardiv.Toolkit.UnoControlFixedTextModel";
1729}
1730
1731css::uno::Sequence<OUString>
1733{
1734 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlFixedTextModel", "stardiv.vcl.controlmodel.FixedText" };
1736}
1737
1738extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1740 css::uno::XComponentContext *context,
1741 css::uno::Sequence<css::uno::Any> const &)
1742{
1743 return cppu::acquire(new UnoControlFixedTextModel(context));
1744}
1745
1746
1747
1749{
1752}
1753
1755{
1756 return "fixedtext";
1757}
1758
1759// uno::XInterface
1761{
1762 uno::Any aRet = ::cppu::queryInterface( rType,
1763 static_cast< awt::XFixedText* >(this),
1764 static_cast< awt::XLayoutConstrains* >(this) );
1765 return (aRet.hasValue() ? aRet : UnoControlBase::queryAggregation( rType ));
1766}
1767
1769
1770// lang::XTypeProvider
1771css::uno::Sequence< css::uno::Type > UnoFixedTextControl::getTypes()
1772{
1773 static const ::cppu::OTypeCollection aTypeList(
1778 );
1779 return aTypeList.getTypes();
1780}
1781
1783{
1784 return true;
1785}
1786
1787void UnoFixedTextControl::setText( const OUString& Text )
1788{
1790}
1791
1793{
1795}
1796
1798{
1800}
1801
1803{
1804 sal_Int16 nAlign = 0;
1805 if ( mxModel.is() )
1806 {
1808 aVal >>= nAlign;
1809 }
1810 return nAlign;
1811}
1812
1814{
1815 return Impl_getMinimumSize();
1816}
1817
1819{
1820 return Impl_getPreferredSize();
1821}
1822
1823awt::Size UnoFixedTextControl::calcAdjustedSize( const awt::Size& rNewSize )
1824{
1825 return Impl_calcAdjustedSize( rNewSize );
1826}
1827
1829{
1830 return "stardiv.Toolkit.UnoFixedTextControl";
1831}
1832
1834{
1835 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlFixedText", "stardiv.vcl.control.FixedText" };
1837}
1838
1839extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1841 css::uno::XComponentContext *,
1842 css::uno::Sequence<css::uno::Any> const &)
1843{
1844 return cppu::acquire(new UnoFixedTextControl());
1845}
1846
1847
1848
1849UnoControlGroupBoxModel::UnoControlGroupBoxModel( const Reference< XComponentContext >& rxContext )
1850 :UnoControlModel( rxContext )
1851{
1852 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
1853 ImplRegisterProperty( BASEPROPERTY_ENABLED );
1854 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
1855 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
1856 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
1857 ImplRegisterProperty( BASEPROPERTY_HELPURL );
1858 ImplRegisterProperty( BASEPROPERTY_LABEL );
1859 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
1860 ImplRegisterProperty( BASEPROPERTY_WRITING_MODE );
1861 ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE );
1862}
1863
1865{
1866 return "stardiv.vcl.controlmodel.GroupBox";
1867}
1868
1870{
1871 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
1872 {
1873 return uno::Any(OUString( "stardiv.vcl.control.GroupBox" ) );
1874 }
1875 return UnoControlModel::ImplGetDefaultValue( nPropId );
1876}
1877
1879{
1881 return aHelper;
1882}
1883
1884// beans::XMultiPropertySet
1885uno::Reference< beans::XPropertySetInfo > UnoControlGroupBoxModel::getPropertySetInfo( )
1886{
1887 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
1888 return xInfo;
1889}
1890
1892{
1893 return "stardiv.Toolkit.UnoControlGroupBoxModel";
1894}
1895
1897{
1898 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlGroupBoxModel", "stardiv.vcl.controlmodel.GroupBox" };
1900}
1901
1902extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1904 css::uno::XComponentContext *context,
1905 css::uno::Sequence<css::uno::Any> const &)
1906{
1907 return cppu::acquire(new UnoControlGroupBoxModel(context));
1908}
1909
1910
1911
1913{
1916}
1917
1919{
1920 return "groupbox";
1921}
1922
1924{
1925 return true;
1926}
1927
1929{
1930 return "stardiv.Toolkit.UnoGroupBoxControl";
1931}
1932
1934{
1935 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlGroupBox", "stardiv.vcl.control.GroupBox" };
1937}
1938
1939extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1941 css::uno::XComponentContext *,
1942 css::uno::Sequence<css::uno::Any> const &)
1943{
1944 return cppu::acquire(new UnoGroupBoxControl());
1945}
1946
1947
1948// = UnoControlListBoxModel_Data
1949
1950namespace {
1951
1952struct ListItem
1953{
1954 OUString ItemText;
1955 OUString ItemImageURL;
1956 Any ItemData;
1957
1958 ListItem()
1959 {
1960 }
1961
1962 explicit ListItem( OUString i_ItemText )
1963 :ItemText(std::move( i_ItemText ))
1964 {
1965 }
1966};
1967
1968}
1969
1970typedef beans::Pair< OUString, OUString > UnoListItem;
1971
1972namespace {
1973
1974struct StripItemData
1975{
1976 UnoListItem operator()( const ListItem& i_rItem )
1977 {
1978 return UnoListItem( i_rItem.ItemText, i_rItem.ItemImageURL );
1979 }
1980};
1981
1982}
1983
1985{
1987 :m_bSettingLegacyProperty( false )
1988 ,m_rAntiImpl( i_rAntiImpl )
1989 {
1990 }
1991
1992 sal_Int32 getItemCount() const { return sal_Int32( m_aListItems.size() ); }
1993
1994 const ListItem& getItem( const sal_Int32 i_nIndex ) const
1995 {
1996 if ( ( i_nIndex < 0 ) || ( o3tl::make_unsigned(i_nIndex) >= m_aListItems.size() ) )
1997 throw IndexOutOfBoundsException( OUString(), m_rAntiImpl );
1998 return m_aListItems[ i_nIndex ];
1999 }
2000
2001 ListItem& getItem( const sal_Int32 i_nIndex )
2002 {
2003 return const_cast< ListItem& >( static_cast< const UnoControlListBoxModel_Data* >( this )->getItem( i_nIndex ) );
2004 }
2005
2006 ListItem& insertItem( const sal_Int32 i_nIndex )
2007 {
2008 if ( ( i_nIndex < 0 ) || ( o3tl::make_unsigned(i_nIndex) > m_aListItems.size() ) )
2009 throw IndexOutOfBoundsException( OUString(), m_rAntiImpl );
2010 return *m_aListItems.insert( m_aListItems.begin() + i_nIndex, ListItem() );
2011 }
2012
2013 Sequence< UnoListItem > getAllItems() const
2014 {
2015 Sequence< UnoListItem > aItems( sal_Int32( m_aListItems.size() ) );
2016 ::std::transform( m_aListItems.begin(), m_aListItems.end(), aItems.getArray(), StripItemData() );
2017 return aItems;
2018 }
2019
2020 void copyItems( const UnoControlListBoxModel_Data& i_copySource )
2021 {
2022 m_aListItems = i_copySource.m_aListItems;
2023 }
2024
2025 void setAllItems( ::std::vector< ListItem >&& i_rItems )
2026 {
2027 m_aListItems = std::move(i_rItems);
2028 }
2029
2030 void removeItem( const sal_Int32 i_nIndex )
2031 {
2032 if ( ( i_nIndex < 0 ) || ( o3tl::make_unsigned(i_nIndex) >= m_aListItems.size() ) )
2033 throw IndexOutOfBoundsException( OUString(), m_rAntiImpl );
2034 m_aListItems.erase( m_aListItems.begin() + i_nIndex );
2035 }
2036
2038 {
2039 std::vector<ListItem>().swap(m_aListItems);
2040 }
2041
2042public:
2044
2045private:
2047 ::std::vector< ListItem > m_aListItems;
2048};
2049
2050
2051// = UnoControlListBoxModel
2052
2053
2054UnoControlListBoxModel::UnoControlListBoxModel( const Reference< XComponentContext >& rxContext, ConstructorMode const i_mode )
2055 :UnoControlListBoxModel_Base( rxContext )
2056 ,m_xData( new UnoControlListBoxModel_Data( *this ) )
2057{
2058 if ( i_mode == ConstructDefault )
2059 {
2060 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXListBox>();
2061 }
2062}
2063
2065 :UnoControlListBoxModel_Base( i_rSource )
2066 ,m_xData( new UnoControlListBoxModel_Data( *this ) )
2067{
2068 m_xData->copyItems( *i_rSource.m_xData );
2069}
2071{
2072}
2073
2075{
2076 return "stardiv.Toolkit.UnoControlListBoxModel";
2077}
2078
2080{
2081 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlListBoxModel", "stardiv.vcl.controlmodel.ListBox" };
2083}
2084
2086{
2087 return "stardiv.vcl.controlmodel.ListBox";
2088}
2089
2090
2092{
2093 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
2094 {
2095 return uno::Any( OUString( "stardiv.vcl.control.ListBox" ) );
2096 }
2097 return UnoControlModel::ImplGetDefaultValue( nPropId );
2098}
2099
2100
2102{
2103 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
2104 return aHelper;
2105}
2106
2107
2108// beans::XMultiPropertySet
2109uno::Reference< beans::XPropertySetInfo > UnoControlListBoxModel::getPropertySetInfo( )
2110{
2111 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
2112 return xInfo;
2113}
2114
2115
2116namespace
2117{
2118 struct CreateListItem
2119 {
2120 ListItem operator()( const OUString& i_rItemText )
2121 {
2122 return ListItem( i_rItemText );
2123 }
2124 };
2125}
2126
2127
2128void UnoControlListBoxModel::setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const uno::Any& rValue )
2129{
2131
2133 return;
2134
2135 // reset selection
2136 uno::Sequence<sal_Int16> aSeq;
2137 setDependentFastPropertyValue( rGuard, BASEPROPERTY_SELECTEDITEMS, uno::Any(aSeq) );
2138
2139 if ( m_xData->m_bSettingLegacyProperty )
2140 return;
2141
2142 // synchronize the legacy StringItemList property with our list items
2143 Sequence< OUString > aStringItemList;
2144 Any aPropValue;
2145 getFastPropertyValue( rGuard, aPropValue, BASEPROPERTY_STRINGITEMLIST );
2146 OSL_VERIFY( aPropValue >>= aStringItemList );
2147
2148 ::std::vector< ListItem > aItems( aStringItemList.getLength() );
2149 ::std::transform(
2150 std::cbegin(aStringItemList),
2151 std::cend(aStringItemList),
2152 aItems.begin(),
2153 CreateListItem()
2154 );
2155 m_xData->setAllItems( std::move(aItems) );
2156
2157 // since an XItemListListener does not have a "all items modified" or some such method,
2158 // we simulate this by notifying removal of all items, followed by insertion of all new
2159 // items
2160 lang::EventObject aEvent;
2161 aEvent.Source = *this;
2162 m_aItemListListeners.notifyEach( rGuard, &XItemListListener::itemListChanged, aEvent );
2163 // TODO: OPropertySetHelper calls into this method with the mutex locked ...
2164 // which is wrong for the above notifications ...
2165}
2166
2167
2168void UnoControlListBoxModel::ImplNormalizePropertySequence( const sal_Int32 _nCount, sal_Int32* _pHandles,
2169 uno::Any* _pValues, sal_Int32* _pValidHandles ) const
2170{
2171 // dependencies we know:
2172 // BASEPROPERTY_STRINGITEMLIST->BASEPROPERTY_SELECTEDITEMS
2173 ImplEnsureHandleOrder( _nCount, _pHandles, _pValues, BASEPROPERTY_STRINGITEMLIST, BASEPROPERTY_SELECTEDITEMS );
2174 // BASEPROPERTY_STRINGITEMLIST->BASEPROPERTY_TYPEDITEMLIST
2175 ImplEnsureHandleOrder( _nCount, _pHandles, _pValues, BASEPROPERTY_STRINGITEMLIST, BASEPROPERTY_TYPEDITEMLIST );
2176
2177 UnoControlModel::ImplNormalizePropertySequence( _nCount, _pHandles, _pValues, _pValidHandles );
2178}
2179
2180
2182{
2183 std::unique_lock aGuard( m_aMutex );
2184 return m_xData->getItemCount();
2185}
2186
2187
2188void SAL_CALL UnoControlListBoxModel::insertItem( ::sal_Int32 i_nPosition, const OUString& i_rItemText, const OUString& i_rItemImageURL )
2189{
2190 std::unique_lock aGuard( m_aMutex );
2191 // SYNCHRONIZED ----->
2192 ListItem& rItem( m_xData->insertItem( i_nPosition ) );
2193 rItem.ItemText = i_rItemText;
2194 rItem.ItemImageURL = i_rItemImageURL;
2195
2196 impl_handleInsert( aGuard, i_nPosition, i_rItemText, i_rItemImageURL );
2197 // <----- SYNCHRONIZED
2198}
2199
2200
2201void SAL_CALL UnoControlListBoxModel::insertItemText( ::sal_Int32 i_nPosition, const OUString& i_rItemText )
2202{
2203 std::unique_lock aGuard( m_aMutex );
2204 // SYNCHRONIZED ----->
2205 ListItem& rItem( m_xData->insertItem( i_nPosition ) );
2206 rItem.ItemText = i_rItemText;
2207
2208 impl_handleInsert( aGuard, i_nPosition, i_rItemText, ::std::optional< OUString >() );
2209 // <----- SYNCHRONIZED
2210}
2211
2212
2213void SAL_CALL UnoControlListBoxModel::insertItemImage( ::sal_Int32 i_nPosition, const OUString& i_rItemImageURL )
2214{
2215 std::unique_lock aGuard( m_aMutex );
2216 // SYNCHRONIZED ----->
2217 ListItem& rItem( m_xData->insertItem( i_nPosition ) );
2218 rItem.ItemImageURL = i_rItemImageURL;
2219
2220 impl_handleInsert( aGuard, i_nPosition, ::std::optional< OUString >(), i_rItemImageURL );
2221 // <----- SYNCHRONIZED
2222}
2223
2224
2225void SAL_CALL UnoControlListBoxModel::removeItem( ::sal_Int32 i_nPosition )
2226{
2227 std::unique_lock aGuard( m_aMutex );
2228 // SYNCHRONIZED ----->
2229 m_xData->removeItem( i_nPosition );
2230
2231 impl_handleRemove( i_nPosition, aGuard );
2232 // <----- SYNCHRONIZED
2233}
2234
2235
2237{
2238 std::unique_lock aGuard( m_aMutex );
2239 // SYNCHRONIZED ----->
2240 m_xData->removeAllItems();
2241
2242 impl_handleRemove( -1, aGuard );
2243 // <----- SYNCHRONIZED
2244}
2245
2246
2247void SAL_CALL UnoControlListBoxModel::setItemText( ::sal_Int32 i_nPosition, const OUString& i_rItemText )
2248{
2249 std::unique_lock aGuard( m_aMutex );
2250 // SYNCHRONIZED ----->
2251 ListItem& rItem( m_xData->getItem( i_nPosition ) );
2252 rItem.ItemText = i_rItemText;
2253
2254 impl_handleModify( i_nPosition, i_rItemText, ::std::optional< OUString >(), aGuard );
2255 // <----- SYNCHRONIZED
2256}
2257
2258
2259void SAL_CALL UnoControlListBoxModel::setItemImage( ::sal_Int32 i_nPosition, const OUString& i_rItemImageURL )
2260{
2261 std::unique_lock aGuard( m_aMutex );
2262 // SYNCHRONIZED ----->
2263 ListItem& rItem( m_xData->getItem( i_nPosition ) );
2264 rItem.ItemImageURL = i_rItemImageURL;
2265
2266 impl_handleModify( i_nPosition, ::std::optional< OUString >(), i_rItemImageURL, aGuard );
2267 // <----- SYNCHRONIZED
2268}
2269
2270
2271void SAL_CALL UnoControlListBoxModel::setItemTextAndImage( ::sal_Int32 i_nPosition, const OUString& i_rItemText, const OUString& i_rItemImageURL )
2272{
2273 std::unique_lock aGuard( m_aMutex );
2274 // SYNCHRONIZED ----->
2275 ListItem& rItem( m_xData->getItem( i_nPosition ) );
2276 rItem.ItemText = i_rItemText;
2277 rItem.ItemImageURL = i_rItemImageURL;
2278
2279 impl_handleModify( i_nPosition, i_rItemText, i_rItemImageURL, aGuard );
2280 // <----- SYNCHRONIZED
2281}
2282
2283
2284void SAL_CALL UnoControlListBoxModel::setItemData( ::sal_Int32 i_nPosition, const Any& i_rDataValue )
2285{
2286 std::unique_lock aGuard( m_aMutex );
2287 ListItem& rItem( m_xData->getItem( i_nPosition ) );
2288 rItem.ItemData = i_rDataValue;
2289}
2290
2291
2292OUString SAL_CALL UnoControlListBoxModel::getItemText( ::sal_Int32 i_nPosition )
2293{
2294 std::unique_lock aGuard( m_aMutex );
2295 const ListItem& rItem( m_xData->getItem( i_nPosition ) );
2296 return rItem.ItemText;
2297}
2298
2299
2300OUString SAL_CALL UnoControlListBoxModel::getItemImage( ::sal_Int32 i_nPosition )
2301{
2302 std::unique_lock aGuard( m_aMutex );
2303 const ListItem& rItem( m_xData->getItem( i_nPosition ) );
2304 return rItem.ItemImageURL;
2305}
2306
2307
2308beans::Pair< OUString, OUString > SAL_CALL UnoControlListBoxModel::getItemTextAndImage( ::sal_Int32 i_nPosition )
2309{
2310 std::unique_lock aGuard( m_aMutex );
2311 const ListItem& rItem( m_xData->getItem( i_nPosition ) );
2312 return beans::Pair< OUString, OUString >( rItem.ItemText, rItem.ItemImageURL );
2313}
2314
2315
2316Any SAL_CALL UnoControlListBoxModel::getItemData( ::sal_Int32 i_nPosition )
2317{
2318 std::unique_lock aGuard( m_aMutex );
2319 const ListItem& rItem( m_xData->getItem( i_nPosition ) );
2320 return rItem.ItemData;
2321}
2322
2323
2324Sequence< beans::Pair< OUString, OUString > > SAL_CALL UnoControlListBoxModel::getAllItems( )
2325{
2326 std::unique_lock aGuard( m_aMutex );
2327 return m_xData->getAllItems();
2328}
2329
2330
2331void SAL_CALL UnoControlListBoxModel::addItemListListener( const uno::Reference< awt::XItemListListener >& i_Listener )
2332{
2333 std::unique_lock aGuard( m_aMutex );
2334 if ( i_Listener.is() )
2335 m_aItemListListeners.addInterface( aGuard, i_Listener );
2336}
2337
2338
2339void SAL_CALL UnoControlListBoxModel::removeItemListListener( const uno::Reference< awt::XItemListListener >& i_Listener )
2340{
2341 std::unique_lock aGuard( m_aMutex );
2342 if ( i_Listener.is() )
2343 m_aItemListListeners.removeInterface( aGuard, i_Listener );
2344}
2345
2346
2347void UnoControlListBoxModel::impl_getStringItemList( std::unique_lock<std::mutex>& rGuard, ::std::vector< OUString >& o_rStringItems ) const
2348{
2349 Sequence< OUString > aStringItemList;
2350 Any aPropValue;
2351 getFastPropertyValue( rGuard, aPropValue, BASEPROPERTY_STRINGITEMLIST );
2352 OSL_VERIFY( aPropValue >>= aStringItemList );
2353
2354 comphelper::sequenceToContainer(o_rStringItems, aStringItemList);
2355}
2356
2357
2358void UnoControlListBoxModel::impl_setStringItemList( std::unique_lock<std::mutex>& rGuard, const ::std::vector< OUString >& i_rStringItems )
2359{
2360 Sequence< OUString > aStringItems( comphelper::containerToSequence(i_rStringItems) );
2361 m_xData->m_bSettingLegacyProperty = true;
2362 try
2363 {
2364 setFastPropertyValueImpl( rGuard, BASEPROPERTY_STRINGITEMLIST, uno::Any( aStringItems ) );
2365 }
2366 catch( const Exception& )
2367 {
2368 m_xData->m_bSettingLegacyProperty = false;
2369 throw;
2370 }
2371 m_xData->m_bSettingLegacyProperty = false;
2372}
2373
2374
2375void UnoControlListBoxModel::impl_handleInsert( std::unique_lock<std::mutex>& rGuard,
2376 const sal_Int32 i_nItemPosition,
2377 const ::std::optional< OUString >& i_rItemText,
2378 const ::std::optional< OUString >& i_rItemImageURL )
2379{
2380 // SYNCHRONIZED ----->
2381 // sync with legacy StringItemList property
2382 ::std::vector< OUString > aStringItems;
2383 impl_getStringItemList( rGuard, aStringItems );
2384 OSL_ENSURE( o3tl::make_unsigned( i_nItemPosition ) <= aStringItems.size(), "UnoControlListBoxModel::impl_handleInsert" );
2385 if ( o3tl::make_unsigned( i_nItemPosition ) <= aStringItems.size() )
2386 {
2387 const OUString sItemText( !!i_rItemText ? *i_rItemText : OUString() );
2388 aStringItems.insert( aStringItems.begin() + i_nItemPosition, sItemText );
2389 }
2390
2391 impl_setStringItemList( rGuard, aStringItems );
2392
2393 // notify ItemListListeners
2394 impl_notifyItemListEvent( rGuard, i_nItemPosition, i_rItemText, i_rItemImageURL, &XItemListListener::listItemInserted );
2395}
2396
2397
2399 const sal_Int32 i_nItemPosition,
2400 std::unique_lock<std::mutex>& i_rClearBeforeNotify )
2401{
2402 // SYNCHRONIZED ----->
2403 const bool bAllItems = ( i_nItemPosition < 0 );
2404 // sync with legacy StringItemList property
2405 ::std::vector< OUString > aStringItems;
2406 impl_getStringItemList( i_rClearBeforeNotify, aStringItems );
2407 if ( !bAllItems )
2408 {
2409 OSL_ENSURE( o3tl::make_unsigned( i_nItemPosition ) < aStringItems.size(), "UnoControlListBoxModel::impl_handleRemove" );
2410 if ( o3tl::make_unsigned( i_nItemPosition ) < aStringItems.size() )
2411 {
2412 aStringItems.erase( aStringItems.begin() + i_nItemPosition );
2413 }
2414 }
2415 else
2416 {
2417 aStringItems.resize(0);
2418 }
2419
2420 impl_setStringItemList( i_rClearBeforeNotify, aStringItems );
2421
2422 // notify ItemListListeners
2423 if ( bAllItems )
2424 {
2425 EventObject aEvent( *this );
2426 m_aItemListListeners.notifyEach( i_rClearBeforeNotify, &XItemListListener::allItemsRemoved, aEvent );
2427 }
2428 else
2429 {
2430 impl_notifyItemListEvent( i_rClearBeforeNotify, i_nItemPosition, ::std::optional< OUString >(), ::std::optional< OUString >(),
2431 &XItemListListener::listItemRemoved );
2432 }
2433}
2434
2435
2437 const sal_Int32 i_nItemPosition, const ::std::optional< OUString >& i_rItemText,
2438 const ::std::optional< OUString >& i_rItemImageURL,
2439 std::unique_lock<std::mutex>& i_rClearBeforeNotify )
2440{
2441 // SYNCHRONIZED ----->
2442 if ( !!i_rItemText )
2443 {
2444 // sync with legacy StringItemList property
2445 ::std::vector< OUString > aStringItems;
2446 impl_getStringItemList( i_rClearBeforeNotify, aStringItems );
2447 OSL_ENSURE( o3tl::make_unsigned( i_nItemPosition ) < aStringItems.size(), "UnoControlListBoxModel::impl_handleModify" );
2448 if ( o3tl::make_unsigned( i_nItemPosition ) < aStringItems.size() )
2449 {
2450 aStringItems[ i_nItemPosition] = *i_rItemText;
2451 }
2452
2453 impl_setStringItemList( i_rClearBeforeNotify, aStringItems );
2454 }
2455
2456 // notify ItemListListeners
2457 impl_notifyItemListEvent( i_rClearBeforeNotify, i_nItemPosition, i_rItemText, i_rItemImageURL, &XItemListListener::listItemModified );
2458}
2459
2460
2462 std::unique_lock<std::mutex>& rGuard,
2463 const sal_Int32 i_nItemPosition, const ::std::optional< OUString >& i_rItemText,
2464 const ::std::optional< OUString >& i_rItemImageURL,
2465 void ( SAL_CALL XItemListListener::*NotificationMethod )( const ItemListEvent& ) )
2466{
2467 ItemListEvent aEvent;
2468 aEvent.Source = *this;
2469 aEvent.ItemPosition = i_nItemPosition;
2470 if ( !!i_rItemText )
2471 {
2472 aEvent.ItemText.IsPresent = true;
2473 aEvent.ItemText.Value = *i_rItemText;
2474 }
2475 if ( !!i_rItemImageURL )
2476 {
2477 aEvent.ItemImageURL.IsPresent = true;
2478 aEvent.ItemImageURL.Value = *i_rItemImageURL;
2479 }
2480
2481 m_aItemListListeners.notifyEach( rGuard, NotificationMethod, aEvent );
2482}
2483
2484extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
2486 css::uno::XComponentContext *context,
2487 css::uno::Sequence<css::uno::Any> const &)
2488{
2489 return cppu::acquire(new UnoControlListBoxModel(context));
2490}
2491
2492
2493
2495 :maActionListeners( *this )
2496 ,maItemListeners( *this )
2497{
2498 maComponentInfos.nWidth = 100;
2499 maComponentInfos.nHeight = 12;
2500}
2501
2503{
2504 return "listbox";
2505}
2506
2508{
2509 return "stardiv.Toolkit.UnoListBoxControl";
2510}
2511
2513{
2514 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlListBox", "stardiv.vcl.control.ListBox" };
2516}
2517
2519{
2520 lang::EventObject aEvt;
2521 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
2522 maActionListeners.disposeAndClear( aEvt );
2523 maItemListeners.disposeAndClear( aEvt );
2525}
2526
2528{
2529 if ( getPeer().is() )
2530 {
2531 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2532 DBG_ASSERT( xListBox.is(), "XListBox?" );
2533
2534 uno::Sequence<sal_Int16> aSeq = xListBox->getSelectedItemsPos();
2535 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_SELECTEDITEMS ), uno::Any(aSeq), false );
2536 }
2537}
2538
2540{
2542
2543 Reference< XItemListListener > xItemListListener( getPeer(), UNO_QUERY );
2544 ENSURE_OR_RETURN_VOID( xItemListListener.is(), "UnoListBoxControl::updateFromModel: a peer which is no ItemListListener?!" );
2545
2546 EventObject aEvent( getModel() );
2547 xItemListListener->itemListChanged( aEvent );
2548
2549 // notify the change of the SelectedItems property, again. While our base class, in updateFromModel,
2550 // already did this, our peer(s) can only legitimately set the selection after they have the string
2551 // item list, which we just notified with the itemListChanged call.
2552 const OUString& sSelectedItemsPropName( GetPropertyName( BASEPROPERTY_SELECTEDITEMS ) );
2553 ImplSetPeerProperty( sSelectedItemsPropName, ImplGetPropertyValue( sSelectedItemsPropName ) );
2554}
2555
2556void UnoListBoxControl::ImplSetPeerProperty( const OUString& rPropName, const uno::Any& rVal )
2557{
2558 if ( rPropName == GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) )
2559 // do not forward this to our peer. We are a XItemListListener at our model, and changes in the string item
2560 // list (which is a legacy property) will, later, arrive as changes in the ItemList. Those latter changes
2561 // will be forwarded to the peer, which will update itself accordingly.
2562 return;
2563
2564 UnoControl::ImplSetPeerProperty( rPropName, rVal );
2565}
2566
2567void UnoListBoxControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
2568{
2569 UnoControl::createPeer( rxToolkit, rParentPeer );
2570
2571 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2572 xListBox->addItemListener( this );
2573
2574 if ( maActionListeners.getLength() )
2575 xListBox->addActionListener( &maActionListeners );
2576}
2577
2578void UnoListBoxControl::addActionListener(const uno::Reference< awt::XActionListener > & l)
2579{
2580 maActionListeners.addInterface( l );
2581 if( getPeer().is() && maActionListeners.getLength() == 1 )
2582 {
2583 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2584 xListBox->addActionListener( &maActionListeners );
2585 }
2586}
2587
2588void UnoListBoxControl::removeActionListener(const uno::Reference< awt::XActionListener > & l)
2589{
2590 if( getPeer().is() && maActionListeners.getLength() == 1 )
2591 {
2592 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2593 xListBox->removeActionListener( &maActionListeners );
2594 }
2595 maActionListeners.removeInterface( l );
2596}
2597
2598void UnoListBoxControl::addItemListener(const uno::Reference < awt::XItemListener > & l)
2599{
2600 maItemListeners.addInterface( l );
2601}
2602
2603void UnoListBoxControl::removeItemListener(const uno::Reference < awt::XItemListener > & l)
2604{
2605 maItemListeners.removeInterface( l );
2606}
2607
2608void UnoListBoxControl::addItem( const OUString& aItem, sal_Int16 nPos )
2609{
2610 uno::Sequence<OUString> aSeq { aItem };
2611 addItems( aSeq, nPos );
2612}
2613
2614void UnoListBoxControl::addItems( const uno::Sequence< OUString>& aItems, sal_Int16 nPos )
2615{
2616 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) );
2617 uno::Sequence< OUString> aSeq;
2618 aVal >>= aSeq;
2619 sal_uInt16 nNewItems = static_cast<sal_uInt16>(aItems.getLength());
2620 sal_uInt16 nOldLen = static_cast<sal_uInt16>(aSeq.getLength());
2621 sal_uInt16 nNewLen = nOldLen + nNewItems;
2622
2623 uno::Sequence< OUString> aNewSeq( nNewLen );
2624
2625 if ( ( nPos < 0 ) || ( nPos > nOldLen ) )
2626 nPos = nOldLen;
2627
2628 // Items before the Paste-Position
2629 auto it = std::copy(std::cbegin(aSeq), std::next(std::cbegin(aSeq), nPos), aNewSeq.getArray());
2630
2631 // New Items
2632 it = std::copy(aItems.begin(), aItems.end(), it);
2633
2634 // Rest of old Items
2635 std::copy(std::next(std::cbegin(aSeq), nPos), std::cend(aSeq), it);
2636
2637 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ), uno::Any(aNewSeq), true );
2638}
2639
2640void UnoListBoxControl::removeItems( sal_Int16 nPos, sal_Int16 nCount )
2641{
2642 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) );
2643 uno::Sequence< OUString> aSeq;
2644 aVal >>= aSeq;
2645 sal_uInt16 nOldLen = static_cast<sal_uInt16>(aSeq.getLength());
2646 if ( !(nOldLen && ( nPos < nOldLen )) )
2647 return;
2648
2649 if ( nCount > ( nOldLen-nPos ) )
2650 nCount = nOldLen-nPos;
2651
2652 sal_uInt16 nNewLen = nOldLen - nCount;
2653
2654 uno::Sequence< OUString> aNewSeq( nNewLen );
2655
2656 // Items before the Remove-Position
2657 auto it = std::copy(std::cbegin(aSeq), std::next(std::cbegin(aSeq), nPos), aNewSeq.getArray());
2658
2659 // Rest of Items
2660 std::copy(std::next(std::cbegin(aSeq), nPos + nCount), std::cend(aSeq), it);
2661
2662 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ), uno::Any(aNewSeq), true );
2663}
2664
2666{
2667 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) );
2668 uno::Sequence< OUString> aSeq;
2669 aVal >>= aSeq;
2670 return static_cast<sal_Int16>(aSeq.getLength());
2671}
2672
2673OUString UnoListBoxControl::getItem( sal_Int16 nPos )
2674{
2675 OUString aItem;
2676 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) );
2677 uno::Sequence< OUString> aSeq;
2678 aVal >>= aSeq;
2679 if ( nPos < aSeq.getLength() )
2680 aItem = aSeq[nPos];
2681 return aItem;
2682}
2683
2684uno::Sequence< OUString> UnoListBoxControl::getItems()
2685{
2686 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) );
2687 uno::Sequence< OUString> aSeq;
2688 aVal >>= aSeq;
2689 return aSeq;
2690}
2691
2693{
2694 sal_Int16 n = -1;
2695 if ( getPeer().is() )
2696 {
2697 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2698 n = xListBox->getSelectedItemPos();
2699 }
2700 return n;
2701}
2702
2704{
2705 uno::Sequence<sal_Int16> aSeq;
2706 if ( getPeer().is() )
2707 {
2708 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2709 aSeq = xListBox->getSelectedItemsPos();
2710 }
2711 return aSeq;
2712}
2713
2715{
2716 OUString aItem;
2717 if ( getPeer().is() )
2718 {
2719 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2720 aItem = xListBox->getSelectedItem();
2721 }
2722 return aItem;
2723}
2724
2725uno::Sequence< OUString> UnoListBoxControl::getSelectedItems()
2726{
2727 uno::Sequence< OUString> aSeq;
2728 if ( getPeer().is() )
2729 {
2730 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2731 aSeq = xListBox->getSelectedItems();
2732 }
2733 return aSeq;
2734}
2735
2736void UnoListBoxControl::selectItemPos( sal_Int16 nPos, sal_Bool bSelect )
2737{
2738 if ( getPeer().is() )
2739 {
2740 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2741 xListBox->selectItemPos( nPos, bSelect );
2742 }
2744}
2745
2746void UnoListBoxControl::selectItemsPos( const uno::Sequence<sal_Int16>& aPositions, sal_Bool bSelect )
2747{
2748 if ( getPeer().is() )
2749 {
2750 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2751 xListBox->selectItemsPos( aPositions, bSelect );
2752 }
2754}
2755
2756void UnoListBoxControl::selectItem( const OUString& aItem, sal_Bool bSelect )
2757{
2758 if ( getPeer().is() )
2759 {
2760 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2761 xListBox->selectItem( aItem, bSelect );
2762 }
2764}
2765
2766void UnoListBoxControl::makeVisible( sal_Int16 nEntry )
2767{
2768 if ( getPeer().is() )
2769 {
2770 uno::Reference < awt::XListBox > xListBox( getPeer(), uno::UNO_QUERY );
2771 xListBox->makeVisible( nEntry );
2772 }
2773}
2774
2776{
2777 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_LINECOUNT ), uno::Any(nLines), true );
2778}
2779
2781{
2782 return ImplGetPropertyValue_INT16( BASEPROPERTY_LINECOUNT );
2783}
2784
2786{
2787 return ImplGetPropertyValue_BOOL( BASEPROPERTY_MULTISELECTION );
2788}
2789
2791{
2792 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTISELECTION ), uno::Any(bMulti), true );
2793}
2794
2795void UnoListBoxControl::itemStateChanged( const awt::ItemEvent& rEvent )
2796{
2798 if ( maItemListeners.getLength() )
2799 {
2800 try
2801 {
2802 maItemListeners.itemStateChanged( rEvent );
2803 }
2804 catch( const Exception& )
2805 {
2806 TOOLS_WARN_EXCEPTION( "toolkit", "UnoListBoxControl::itemStateChanged");
2807 }
2808 }
2809}
2810
2812{
2813 return Impl_getMinimumSize();
2814}
2815
2817{
2818 return Impl_getPreferredSize();
2819}
2820
2821awt::Size UnoListBoxControl::calcAdjustedSize( const awt::Size& rNewSize )
2822{
2823 return Impl_calcAdjustedSize( rNewSize );
2824}
2825
2826awt::Size UnoListBoxControl::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines )
2827{
2828 return Impl_getMinimumSize( nCols, nLines );
2829}
2830
2831void UnoListBoxControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines )
2832{
2833 Impl_getColumnsAndLines( nCols, nLines );
2834}
2835
2836sal_Bool SAL_CALL UnoListBoxControl::setModel( const uno::Reference< awt::XControlModel >& i_rModel )
2837{
2838 ::osl::MutexGuard aGuard( GetMutex() );
2839
2840 const Reference< XItemList > xOldItems( getModel(), UNO_QUERY );
2841 OSL_ENSURE( xOldItems.is() || !getModel().is(), "UnoListBoxControl::setModel: illegal old model!" );
2842 const Reference< XItemList > xNewItems( i_rModel, UNO_QUERY );
2843 OSL_ENSURE( xNewItems.is() || !i_rModel.is(), "UnoListBoxControl::setModel: illegal new model!" );
2844
2845 if ( !UnoListBoxControl_Base::setModel( i_rModel ) )
2846 return false;
2847
2848 if ( xOldItems.is() )
2849 xOldItems->removeItemListListener( this );
2850 if ( xNewItems.is() )
2851 xNewItems->addItemListListener( this );
2852
2853 return true;
2854}
2855
2856void SAL_CALL UnoListBoxControl::listItemInserted( const awt::ItemListEvent& i_rEvent )
2857{
2858 const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
2859 OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::listItemInserted: invalid peer!" );
2860 if ( xPeerListener.is() )
2861 xPeerListener->listItemInserted( i_rEvent );
2862}
2863
2864void SAL_CALL UnoListBoxControl::listItemRemoved( const awt::ItemListEvent& i_rEvent )
2865{
2866 const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
2867 OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::listItemRemoved: invalid peer!" );
2868 if ( xPeerListener.is() )
2869 xPeerListener->listItemRemoved( i_rEvent );
2870}
2871
2872void SAL_CALL UnoListBoxControl::listItemModified( const awt::ItemListEvent& i_rEvent )
2873{
2874 const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
2875 OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::listItemModified: invalid peer!" );
2876 if ( xPeerListener.is() )
2877 xPeerListener->listItemModified( i_rEvent );
2878}
2879
2880void SAL_CALL UnoListBoxControl::allItemsRemoved( const lang::EventObject& i_rEvent )
2881{
2882 const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
2883 OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::allItemsRemoved: invalid peer!" );
2884 if ( xPeerListener.is() )
2885 xPeerListener->allItemsRemoved( i_rEvent );
2886}
2887
2888void SAL_CALL UnoListBoxControl::itemListChanged( const lang::EventObject& i_rEvent )
2889{
2890 const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
2891 OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::itemListChanged: invalid peer!" );
2892 if ( xPeerListener.is() )
2893 xPeerListener->itemListChanged( i_rEvent );
2894}
2895
2896extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
2898 css::uno::XComponentContext *,
2899 css::uno::Sequence<css::uno::Any> const &)
2900{
2901 return cppu::acquire(new UnoListBoxControl());
2902}
2903
2904
2905
2906UnoControlComboBoxModel::UnoControlComboBoxModel( const Reference< XComponentContext >& rxContext )
2907 :UnoControlListBoxModel( rxContext, ConstructWithoutProperties )
2908{
2909 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXComboBox>();
2910}
2911
2913{
2914 return "stardiv.Toolkit.UnoControlComboBoxModel";
2915}
2916
2918{
2919 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlComboBoxModel", "stardiv.vcl.controlmodel.ComboBox" };
2921}
2922
2923uno::Reference< beans::XPropertySetInfo > UnoControlComboBoxModel::getPropertySetInfo( )
2924{
2925 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
2926 return xInfo;
2927}
2928
2930{
2931 static UnoPropertyArrayHelper aHelper( ImplGetPropertyIds() );
2932 return aHelper;
2933}
2934
2935
2937{
2938 return "stardiv.vcl.controlmodel.ComboBox";
2939}
2940
2941void UnoControlComboBoxModel::setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const uno::Any& rValue )
2942{
2944
2945 if (nHandle != BASEPROPERTY_STRINGITEMLIST || m_xData->m_bSettingLegacyProperty)
2946 return;
2947
2948 // synchronize the legacy StringItemList property with our list items
2949 Sequence< OUString > aStringItemList;
2950 Any aPropValue;
2951 getFastPropertyValue( rGuard, aPropValue, BASEPROPERTY_STRINGITEMLIST );
2952 OSL_VERIFY( aPropValue >>= aStringItemList );
2953
2954 ::std::vector< ListItem > aItems( aStringItemList.getLength() );
2955 ::std::transform(
2956 std::cbegin(aStringItemList),
2957 std::cend(aStringItemList),
2958 aItems.begin(),
2959 CreateListItem()
2960 );
2961 m_xData->setAllItems( std::move(aItems) );
2962
2963 // since an XItemListListener does not have a "all items modified" or some such method,
2964 // we simulate this by notifying removal of all items, followed by insertion of all new
2965 // items
2966 lang::EventObject aEvent;
2967 aEvent.Source = *this;
2968 m_aItemListListeners.notifyEach( rGuard, &XItemListListener::itemListChanged, aEvent );
2969}
2970
2972{
2973 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
2974 {
2975 return uno::Any( OUString( "stardiv.vcl.control.ComboBox" ) );
2976 }
2977 return UnoControlModel::ImplGetDefaultValue( nPropId );
2978}
2979
2980extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
2982 css::uno::XComponentContext *context,
2983 css::uno::Sequence<css::uno::Any> const &)
2984{
2985 return cppu::acquire(new UnoControlComboBoxModel(context));
2986}
2987
2988
2989
2991 :maActionListeners( *this )
2992 ,maItemListeners( *this )
2993{
2994 maComponentInfos.nWidth = 100;
2995 maComponentInfos.nHeight = 12;
2996}
2997
2999{
3000 return "stardiv.Toolkit.UnoComboBoxControl";
3001}
3002
3004{
3005 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlComboBox", "stardiv.vcl.control.ComboBox" };
3006 return comphelper::concatSequences( UnoEditControl::getSupportedServiceNames(), vals);
3007}
3008
3010{
3011 return "combobox";
3012}
3013
3015{
3016 lang::EventObject aEvt;
3017 aEvt.Source = static_cast<cppu::OWeakObject*>(this);
3018 maActionListeners.disposeAndClear( aEvt );
3019 maItemListeners.disposeAndClear( aEvt );
3021}
3023{
3024 uno::Any aRet = ::cppu::queryInterface( rType,
3025 static_cast< awt::XComboBox* >(this) );
3026 if ( !aRet.hasValue() )
3027 {
3028 aRet = ::cppu::queryInterface( rType,
3029 static_cast< awt::XItemListener* >(this) );
3030 if ( !aRet.hasValue() )
3031 {
3032 aRet = ::cppu::queryInterface( rType,
3033 static_cast< awt::XItemListListener* >(this) );
3034 }
3035 }
3036 return (aRet.hasValue() ? aRet : UnoEditControl::queryAggregation( rType ));
3037}
3038
3040
3041// lang::XTypeProvider
3042css::uno::Sequence< css::uno::Type > UnoComboBoxControl::getTypes()
3043{
3044 static const ::cppu::OTypeCollection aTypeList(
3048 UnoEditControl::getTypes()
3049 );
3050 return aTypeList.getTypes();
3051}
3052
3054{
3055 UnoEditControl::updateFromModel();
3056
3057 Reference< XItemListListener > xItemListListener( getPeer(), UNO_QUERY );
3058 ENSURE_OR_RETURN_VOID( xItemListListener.is(), "UnoComboBoxControl::updateFromModel: a peer which is no ItemListListener?!" );
3059
3060 EventObject aEvent( getModel() );
3061 xItemListListener->itemListChanged( aEvent );
3062}
3063void UnoComboBoxControl::ImplSetPeerProperty( const OUString& rPropName, const uno::Any& rVal )
3064{
3065 if ( rPropName == GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) )
3066 // do not forward this to our peer. We are a XItemListListener at our model, and changes in the string item
3067 // list (which is a legacy property) will, later, arrive as changes in the ItemList. Those latter changes
3068 // will be forwarded to the peer, which will update itself accordingly.
3069 return;
3070
3071 UnoEditControl::ImplSetPeerProperty( rPropName, rVal );
3072}
3073void UnoComboBoxControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
3074{
3075 UnoEditControl::createPeer( rxToolkit, rParentPeer );
3076
3077 uno::Reference < awt::XComboBox > xComboBox( getPeer(), uno::UNO_QUERY );
3078 if ( maActionListeners.getLength() )
3079 xComboBox->addActionListener( &maActionListeners );
3080 if ( maItemListeners.getLength() )
3081 xComboBox->addItemListener( &maItemListeners );
3082}
3083
3084void UnoComboBoxControl::addActionListener(const uno::Reference< awt::XActionListener > & l)
3085{
3086 maActionListeners.addInterface( l );
3087 if( getPeer().is() && maActionListeners.getLength() == 1 )
3088 {
3089 uno::Reference < awt::XComboBox > xComboBox( getPeer(), uno::UNO_QUERY );
3090 xComboBox->addActionListener( &maActionListeners );
3091 }
3092}
3093
3094void UnoComboBoxControl::removeActionListener(const uno::Reference< awt::XActionListener > & l)
3095{
3096 if( getPeer().is() && maActionListeners.getLength() == 1 )
3097 {
3098 uno::Reference < awt::XComboBox > xComboBox( getPeer(), uno::UNO_QUERY );
3099 xComboBox->removeActionListener( &maActionListeners );
3100 }
3101 maActionListeners.removeInterface( l );
3102}
3103
3104void UnoComboBoxControl::addItemListener(const uno::Reference < awt::XItemListener > & l)
3105{
3106 maItemListeners.addInterface( l );
3107 if( getPeer().is() && maItemListeners.getLength() == 1 )
3108 {
3109 uno::Reference < awt::XComboBox > xComboBox( getPeer(), uno::UNO_QUERY );
3110 xComboBox->addItemListener( &maItemListeners );
3111 }
3112}
3113
3114void UnoComboBoxControl::removeItemListener(const uno::Reference < awt::XItemListener > & l)
3115{
3116 if( getPeer().is() && maItemListeners.getLength() == 1 )
3117 {
3118 // This call is prettier than creating a Ref and calling query
3119 uno::Reference < awt::XComboBox > xComboBox( getPeer(), uno::UNO_QUERY );
3120 xComboBox->removeItemListener( &maItemListeners );
3121 }
3122 maItemListeners.removeInterface( l );
3123}
3124void UnoComboBoxControl::itemStateChanged( const awt::ItemEvent& rEvent )
3125{
3126 if ( maItemListeners.getLength() )
3127 {
3128 try
3129 {
3130 maItemListeners.itemStateChanged( rEvent );
3131 }
3132 catch( const Exception& )
3133 {
3134 TOOLS_WARN_EXCEPTION( "toolkit", "UnoComboBoxControl::itemStateChanged");
3135 }
3136 }
3137}
3138sal_Bool SAL_CALL UnoComboBoxControl::setModel( const uno::Reference< awt::XControlModel >& i_rModel )
3139{
3140 ::osl::MutexGuard aGuard( GetMutex() );
3141
3142 const Reference< XItemList > xOldItems( getModel(), UNO_QUERY );
3143 OSL_ENSURE( xOldItems.is() || !getModel().is(), "UnoComboBoxControl::setModel: illegal old model!" );
3144 const Reference< XItemList > xNewItems( i_rModel, UNO_QUERY );
3145 OSL_ENSURE( xNewItems.is() || !i_rModel.is(), "UnoComboBoxControl::setModel: illegal new model!" );
3146
3147 if ( !UnoEditControl::setModel( i_rModel ) )
3148 return false;
3149
3150 if ( xOldItems.is() )
3151 xOldItems->removeItemListListener( this );
3152 if ( xNewItems.is() )
3153 xNewItems->addItemListListener( this );
3154
3155 return true;
3156}
3157
3158void SAL_CALL UnoComboBoxControl::listItemInserted( const awt::ItemListEvent& i_rEvent )
3159{
3160 const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
3161 OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemInserted: invalid peer!" );
3162 if ( xPeerListener.is() )
3163 xPeerListener->listItemInserted( i_rEvent );
3164}
3165
3166void SAL_CALL UnoComboBoxControl::listItemRemoved( const awt::ItemListEvent& i_rEvent )
3167{
3168 const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
3169 OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemRemoved: invalid peer!" );
3170 if ( xPeerListener.is() )
3171 xPeerListener->listItemRemoved( i_rEvent );
3172}
3173
3174void SAL_CALL UnoComboBoxControl::listItemModified( const awt::ItemListEvent& i_rEvent )
3175{
3176 const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
3177 OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemModified: invalid peer!" );
3178 if ( xPeerListener.is() )
3179 xPeerListener->listItemModified( i_rEvent );
3180}
3181
3182void SAL_CALL UnoComboBoxControl::allItemsRemoved( const lang::EventObject& i_rEvent )
3183{
3184 const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
3185 OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::allItemsRemoved: invalid peer!" );
3186 if ( xPeerListener.is() )
3187 xPeerListener->allItemsRemoved( i_rEvent );
3188}
3189
3190void SAL_CALL UnoComboBoxControl::itemListChanged( const lang::EventObject& i_rEvent )
3191{
3192 const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
3193 OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::itemListChanged: invalid peer!" );
3194 if ( xPeerListener.is() )
3195 xPeerListener->itemListChanged( i_rEvent );
3196}
3197
3198void UnoComboBoxControl::addItem( const OUString& aItem, sal_Int16 nPos )
3199{
3200 uno::Sequence<OUString> aSeq { aItem };
3201 addItems( aSeq, nPos );
3202}
3203
3204void UnoComboBoxControl::addItems( const uno::Sequence< OUString>& aItems, sal_Int16 nPos )
3205{
3206 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) );
3207 uno::Sequence< OUString> aSeq;
3208 aVal >>= aSeq;
3209 sal_uInt16 nNewItems = static_cast<sal_uInt16>(aItems.getLength());
3210 sal_uInt16 nOldLen = static_cast<sal_uInt16>(aSeq.getLength());
3211 sal_uInt16 nNewLen = nOldLen + nNewItems;
3212
3213 uno::Sequence< OUString> aNewSeq( nNewLen );
3214
3215 if ( ( nPos < 0 ) || ( nPos > nOldLen ) )
3216 nPos = nOldLen;
3217
3218 // items before the insert position
3219 auto it = std::copy(std::cbegin(aSeq), std::next(std::cbegin(aSeq), nPos), aNewSeq.getArray());
3220
3221 // New items
3222 it = std::copy(aItems.begin(), aItems.end(), it);
3223
3224 // remainder of old items
3225 std::copy(std::next(std::cbegin(aSeq), nPos), std::cend(aSeq), it);
3226
3227 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ), Any(aNewSeq), true );
3228}
3229
3230void UnoComboBoxControl::removeItems( sal_Int16 nPos, sal_Int16 nCount )
3231{
3232 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) );
3233 uno::Sequence< OUString> aSeq;
3234 aVal >>= aSeq;
3235 sal_uInt16 nOldLen = static_cast<sal_uInt16>(aSeq.getLength());
3236 if ( !nOldLen || ( nPos >= nOldLen ) )
3237 return;
3238
3239 if ( nCount > ( nOldLen-nPos ) )
3240 nCount = nOldLen-nPos;
3241
3242 sal_uInt16 nNewLen = nOldLen - nCount;
3243
3244 uno::Sequence< OUString> aNewSeq( nNewLen );
3245
3246 // items before the deletion position
3247 auto it = std::copy(std::cbegin(aSeq), std::next(std::cbegin(aSeq), nPos), aNewSeq.getArray());
3248
3249 // remainder of old items
3250 std::copy(std::next(std::cbegin(aSeq), nPos + nCount), std::cend(aSeq), it);
3251
3252 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ), uno::Any(aNewSeq), true );
3253}
3254
3256{
3257 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) );
3258 uno::Sequence< OUString> aSeq;
3259 aVal >>= aSeq;
3260 return static_cast<sal_Int16>(aSeq.getLength());
3261}
3262
3263OUString UnoComboBoxControl::getItem( sal_Int16 nPos )
3264{
3265 OUString aItem;
3266 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) );
3267 uno::Sequence< OUString> aSeq;
3268 aVal >>= aSeq;
3269 if ( nPos < aSeq.getLength() )
3270 aItem = aSeq[nPos];
3271 return aItem;
3272}
3273
3274uno::Sequence< OUString> UnoComboBoxControl::getItems()
3275{
3276 uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) );
3277 uno::Sequence< OUString> aSeq;
3278 aVal >>= aSeq;
3279 return aSeq;
3280}
3281
3283{
3284 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_LINECOUNT ), uno::Any(nLines), true );
3285}
3286
3288{
3289 return ImplGetPropertyValue_INT16( BASEPROPERTY_LINECOUNT );
3290}
3291
3292extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3294 css::uno::XComponentContext *,
3295 css::uno::Sequence<css::uno::Any> const &)
3296{
3297 return cppu::acquire(new UnoComboBoxControl());
3298}
3299
3300
3301// UnoSpinFieldControl
3302
3304 :maSpinListeners( *this )
3305{
3306 mbRepeat = false;
3307}
3308
3309// uno::XInterface
3311{
3312 uno::Any aRet = ::cppu::queryInterface( rType,
3313 static_cast< awt::XSpinField* >(this) );
3314 return (aRet.hasValue() ? aRet : UnoEditControl::queryAggregation( rType ));
3315}
3316
3318
3319// lang::XTypeProvider
3320css::uno::Sequence< css::uno::Type > UnoSpinFieldControl::getTypes()
3321{
3322 static const ::cppu::OTypeCollection aTypeList(
3325 UnoEditControl::getTypes()
3326 );
3327 return aTypeList.getTypes();
3328}
3329
3330void UnoSpinFieldControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
3331{
3332 UnoEditControl::createPeer( rxToolkit, rParentPeer );
3333
3334 uno::Reference < awt::XSpinField > xField( getPeer(), uno::UNO_QUERY );
3335 xField->enableRepeat( mbRepeat );
3336 if ( maSpinListeners.getLength() )
3337 xField->addSpinListener( &maSpinListeners );
3338}
3339
3340 // css::awt::XSpinField
3341void UnoSpinFieldControl::addSpinListener( const css::uno::Reference< css::awt::XSpinListener >& l )
3342{
3343 maSpinListeners.addInterface( l );
3344 if( getPeer().is() && maSpinListeners.getLength() == 1 )
3345 {
3346 uno::Reference < awt::XSpinField > xField( getPeer(), uno::UNO_QUERY );
3347 xField->addSpinListener( &maSpinListeners );
3348 }
3349}
3350
3351void UnoSpinFieldControl::removeSpinListener( const css::uno::Reference< css::awt::XSpinListener >& l )
3352{
3353 if( getPeer().is() && maSpinListeners.getLength() == 1 )
3354 {
3355 uno::Reference < awt::XSpinField > xField( getPeer(), uno::UNO_QUERY );
3356 xField->removeSpinListener( &maSpinListeners );
3357 }
3358 maSpinListeners.removeInterface( l );
3359}
3360
3362{
3363 uno::Reference < awt::XSpinField > xField( getPeer(), uno::UNO_QUERY );
3364 if ( xField.is() )
3365 xField->up();
3366}
3367
3369{
3370 uno::Reference < awt::XSpinField > xField( getPeer(), uno::UNO_QUERY );
3371 if ( xField.is() )
3372 xField->down();
3373}
3374
3376{
3377 uno::Reference < awt::XSpinField > xField( getPeer(), uno::UNO_QUERY );
3378 if ( xField.is() )
3379 xField->first();
3380}
3381
3383{
3384 uno::Reference < awt::XSpinField > xField( getPeer(), uno::UNO_QUERY );
3385 if ( xField.is() )
3386 xField->last();
3387}
3388
3390{
3391 mbRepeat = bRepeat;
3392
3393 uno::Reference < awt::XSpinField > xField( getPeer(), uno::UNO_QUERY );
3394 if ( xField.is() )
3395 xField->enableRepeat( bRepeat );
3396}
3397
3398
3399
3400UnoControlDateFieldModel::UnoControlDateFieldModel( const Reference< XComponentContext >& rxContext )
3401 :UnoControlModel( rxContext )
3402{
3403 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXDateField>();
3404}
3405
3407{
3408 return "stardiv.vcl.controlmodel.DateField";
3409}
3410
3412{
3413 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
3414 {
3415 return uno::Any( OUString( "stardiv.vcl.control.DateField" ) );
3416 }
3417 return UnoControlModel::ImplGetDefaultValue( nPropId );
3418}
3419
3420
3422{
3424 return aHelper;
3425}
3426
3427// beans::XMultiPropertySet
3428uno::Reference< beans::XPropertySetInfo > UnoControlDateFieldModel::getPropertySetInfo( )
3429{
3430 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
3431 return xInfo;
3432}
3433
3435{
3436 return "stardiv.Toolkit.UnoControlDateFieldModel";
3437}
3438
3439css::uno::Sequence<OUString>
3441{
3442 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlDateFieldModel", "stardiv.vcl.controlmodel.DateField" };
3444}
3445
3446extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3448 css::uno::XComponentContext *context,
3449 css::uno::Sequence<css::uno::Any> const &)
3450{
3451 return cppu::acquire(new UnoControlDateFieldModel(context));
3452}
3453
3454
3455
3457{
3458 mnFirst = util::Date( 1, 1, 1900 );
3459 mnLast = util::Date( 31, 12, 2200 );
3461}
3462
3464{
3465 return "datefield";
3466}
3467
3468// uno::XInterface
3470{
3471 uno::Any aRet = ::cppu::queryInterface( rType,
3472 static_cast< awt::XDateField* >(this) );
3473 return (aRet.hasValue() ? aRet : UnoSpinFieldControl::queryAggregation( rType ));
3474}
3475
3477
3478// lang::XTypeProvider
3479css::uno::Sequence< css::uno::Type > UnoDateFieldControl::getTypes()
3480{
3481 static const ::cppu::OTypeCollection aTypeList(
3485 );
3486 return aTypeList.getTypes();
3487}
3488
3489void UnoDateFieldControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
3490{
3491 UnoSpinFieldControl::createPeer( rxToolkit, rParentPeer );
3492
3493 uno::Reference < awt::XDateField > xField( getPeer(), uno::UNO_QUERY );
3494 xField->setFirst( mnFirst );
3495 xField->setLast( mnLast );
3497 xField->setLongFormat( mbLongFormat != TRISTATE_FALSE);
3498}
3499
3500
3501void UnoDateFieldControl::textChanged( const awt::TextEvent& e )
3502{
3503 uno::Reference< awt::XVclWindowPeer > xPeer( getPeer(), uno::UNO_QUERY );
3504
3505 // also change the text property (#i25106#)
3506 if ( xPeer.is() )
3507 {
3508 const OUString& sTextPropertyName = GetPropertyName( BASEPROPERTY_TEXT );
3509 ImplSetPropertyValue( sTextPropertyName, xPeer->getProperty( sTextPropertyName ), false );
3510 }
3511
3512 // re-calc the Date property
3513 uno::Reference < awt::XDateField > xField( getPeer(), uno::UNO_QUERY );
3514 uno::Any aValue;
3515 if ( xField->isEmpty() )
3516 {
3517 // the field says it's empty
3518 bool bEnforceFormat = true;
3519 if ( xPeer.is() )
3520 xPeer->getProperty( GetPropertyName( BASEPROPERTY_ENFORCE_FORMAT ) ) >>= bEnforceFormat;
3521 if ( !bEnforceFormat )
3522 {
3523 // and it also says that it is currently accepting invalid inputs, without
3524 // forcing it to a valid date
3525 uno::Reference< awt::XTextComponent > xText( xPeer, uno::UNO_QUERY );
3526 if ( xText.is() && xText->getText().getLength() )
3527 // and in real, the text of the peer is *not* empty
3528 // -> simulate an invalid date, which is different from "no date"
3529 aValue <<= util::Date();
3530 }
3531 }
3532 else
3533 aValue <<= xField->getDate();
3534
3535 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_DATE ), aValue, false );
3536
3537 // multiplex the event
3538 if ( GetTextListeners().getLength() )
3539 GetTextListeners().textChanged( e );
3540}
3541
3542void UnoDateFieldControl::setDate( const util::Date& Date )
3543{
3544 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_DATE ), uno::Any(Date), true );
3545}
3546
3548{
3549 return ImplGetPropertyValue_Date( BASEPROPERTY_DATE );
3550}
3551
3552void UnoDateFieldControl::setMin( const util::Date& Date )
3553{
3554 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_DATEMIN ), uno::Any(Date), true );
3555}
3556
3558{
3559 return ImplGetPropertyValue_Date( BASEPROPERTY_DATEMIN );
3560}
3561
3562void UnoDateFieldControl::setMax( const util::Date& Date )
3563{
3564 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_DATEMAX ), uno::Any(Date), true );
3565}
3566
3568{
3569 return ImplGetPropertyValue_Date( BASEPROPERTY_DATEMAX );
3570}
3571
3572void UnoDateFieldControl::setFirst( const util::Date& Date )
3573{
3574 mnFirst = Date;
3575 if ( getPeer().is() )
3576 {
3577 uno::Reference < awt::XDateField > xField( getPeer(), uno::UNO_QUERY );
3578 xField->setFirst( Date );
3579 }
3580}
3581
3583{
3584 return mnFirst;
3585}
3586
3587void UnoDateFieldControl::setLast( const util::Date& Date )
3588{
3589 mnLast = Date;
3590 if ( getPeer().is() )
3591 {
3592 uno::Reference < awt::XDateField > xField( getPeer(), uno::UNO_QUERY );
3593 xField->setLast( Date );
3594 }
3595}
3596
3598{
3599 return mnLast;
3600}
3601
3603{
3605 if ( getPeer().is() )
3606 {
3607 uno::Reference < awt::XDateField > xField( getPeer(), uno::UNO_QUERY );
3608 xField->setLongFormat( bLong );
3609 }
3610}
3611
3613{
3614 return mbLongFormat == TRISTATE_TRUE;
3615}
3616
3618{
3619 if ( getPeer().is() )
3620 {
3621 uno::Reference < awt::XDateField > xField( getPeer(), uno::UNO_QUERY );
3622 xField->setEmpty();
3623 }
3624}
3625
3627{
3628 bool bEmpty = false;
3629 if ( getPeer().is() )
3630 {
3631 uno::Reference < awt::XDateField > xField( getPeer(), uno::UNO_QUERY );
3632 bEmpty = xField->isEmpty();
3633 }
3634 return bEmpty;
3635}
3636
3638{
3639 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STRICTFORMAT ), uno::Any(bStrict), true );
3640}
3641
3643{
3644 return ImplGetPropertyValue_BOOL( BASEPROPERTY_STRICTFORMAT );
3645}
3646
3648{
3649 return "stardiv.Toolkit.UnoDateFieldControl";
3650}
3651
3653{
3654 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlDateField", "stardiv.vcl.control.DateField" };
3655 return comphelper::concatSequences( UnoSpinFieldControl::getSupportedServiceNames(), vals );
3656}
3657
3658extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3660 css::uno::XComponentContext *,
3661 css::uno::Sequence<css::uno::Any> const &)
3662{
3663 return cppu::acquire(new UnoDateFieldControl());
3664}
3665
3666
3667
3668UnoControlTimeFieldModel::UnoControlTimeFieldModel( const Reference< XComponentContext >& rxContext )
3669 :UnoControlModel( rxContext )
3670{
3671 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXTimeField>();
3672}
3673
3675{
3676 return "stardiv.vcl.controlmodel.TimeField";
3677}
3678
3680{
3681 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
3682 {
3683 return uno::Any( OUString( "stardiv.vcl.control.TimeField" ) );
3684 }
3685 return UnoControlModel::ImplGetDefaultValue( nPropId );
3686}
3687
3688
3690{
3692 return aHelper;
3693}
3694
3695// beans::XMultiPropertySet
3696uno::Reference< beans::XPropertySetInfo > UnoControlTimeFieldModel::getPropertySetInfo( )
3697{
3698 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
3699 return xInfo;
3700}
3701
3703{
3704 return "stardiv.Toolkit.UnoControlTimeFieldModel";
3705}
3706
3707css::uno::Sequence<OUString>
3709{
3710 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlTimeFieldModel", "stardiv.vcl.controlmodel.TimeField" };
3712}
3713
3714extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3716 css::uno::XComponentContext *context,
3717 css::uno::Sequence<css::uno::Any> const &)
3718{
3719 return cppu::acquire(new UnoControlTimeFieldModel(context));
3720}
3721
3722
3723
3725{
3726 mnFirst = util::Time( 0, 0, 0, 0, false );
3727 mnLast = util::Time( 999999999, 59, 59, 23, false );
3728}
3729
3731{
3732 return "timefield";
3733}
3734
3735// uno::XInterface
3737{
3738 uno::Any aRet = ::cppu::queryInterface( rType,
3739 static_cast< awt::XTimeField* >(this) );
3740 return (aRet.hasValue() ? aRet : UnoSpinFieldControl::queryAggregation( rType ));
3741}
3742
3744
3745// lang::XTypeProvider
3746css::uno::Sequence< css::uno::Type > UnoTimeFieldControl::getTypes()
3747{
3748 static const ::cppu::OTypeCollection aTypeList(
3752 );
3753 return aTypeList.getTypes();
3754}
3755
3756void UnoTimeFieldControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
3757{
3758 UnoSpinFieldControl::createPeer( rxToolkit, rParentPeer );
3759
3760 uno::Reference < awt::XTimeField > xField( getPeer(), uno::UNO_QUERY );
3761 xField->setFirst( mnFirst );
3762 xField->setLast( mnLast );
3763}
3764
3765void UnoTimeFieldControl::textChanged( const awt::TextEvent& e )
3766{
3767 // also change the text property (#i25106#)
3768 uno::Reference< awt::XVclWindowPeer > xPeer( getPeer(), uno::UNO_QUERY );
3769 const OUString& sTextPropertyName = GetPropertyName( BASEPROPERTY_TEXT );
3770 ImplSetPropertyValue( sTextPropertyName, xPeer->getProperty( sTextPropertyName ), false );
3771
3772 // re-calc the Time property
3773 uno::Reference < awt::XTimeField > xField( getPeer(), uno::UNO_QUERY );
3774 uno::Any aValue;
3775 if ( !xField->isEmpty() )
3776 aValue <<= xField->getTime();
3777 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TIME ), aValue, false );
3778
3779 // multiplex the event
3780 if ( GetTextListeners().getLength() )
3781 GetTextListeners().textChanged( e );
3782}
3783
3784void UnoTimeFieldControl::setTime( const util::Time& Time )
3785{
3786 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TIME ), Any(Time), true );
3787}
3788
3790{
3791 return ImplGetPropertyValue_Time( BASEPROPERTY_TIME );
3792}
3793
3794void UnoTimeFieldControl::setMin( const util::Time& Time )
3795{
3796 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TIMEMIN ), uno::Any(Time), true );
3797}
3798
3800{
3801 return ImplGetPropertyValue_Time( BASEPROPERTY_TIMEMIN );
3802}
3803
3804void UnoTimeFieldControl::setMax( const util::Time& Time )
3805{
3806 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TIMEMAX ), uno::Any(Time), true );
3807}
3808
3810{
3811 return ImplGetPropertyValue_Time( BASEPROPERTY_TIMEMAX );
3812}
3813
3814void UnoTimeFieldControl::setFirst( const util::Time& Time )
3815{
3816 mnFirst = Time;
3817 if ( getPeer().is() )
3818 {
3819 uno::Reference < awt::XTimeField > xField( getPeer(), uno::UNO_QUERY );
3820 xField->setFirst( mnFirst );
3821 }
3822}
3823
3825{
3826 return mnFirst;
3827}
3828
3829void UnoTimeFieldControl::setLast( const util::Time& Time )
3830{
3831 mnLast = Time;
3832 if ( getPeer().is() )
3833 {
3834 uno::Reference < awt::XTimeField > xField( getPeer(), uno::UNO_QUERY );
3835 xField->setFirst( mnLast );
3836 }
3837}
3838
3840{
3841 return mnLast;
3842}
3843
3845{
3846 if ( getPeer().is() )
3847 {
3848 uno::Reference < awt::XTimeField > xField( getPeer(), uno::UNO_QUERY );
3849 xField->setEmpty();
3850 }
3851}
3852
3854{
3855 bool bEmpty = false;
3856 if ( getPeer().is() )
3857 {
3858 uno::Reference < awt::XTimeField > xField( getPeer(), uno::UNO_QUERY );
3859 bEmpty = xField->isEmpty();
3860 }
3861 return bEmpty;
3862}
3863
3865{
3866 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STRICTFORMAT ), uno::Any(bStrict), true );
3867}
3868
3870{
3871 return ImplGetPropertyValue_BOOL( BASEPROPERTY_STRICTFORMAT );
3872}
3873
3875{
3876 return "stardiv.Toolkit.UnoTimeFieldControl";
3877}
3878
3880{
3881 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlTimeField", "stardiv.vcl.control.TimeField" };
3882 return comphelper::concatSequences( UnoSpinFieldControl::getSupportedServiceNames(), vals );
3883}
3884
3885extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3887 css::uno::XComponentContext *,
3888 css::uno::Sequence<css::uno::Any> const &)
3889{
3890 return cppu::acquire(new UnoTimeFieldControl());
3891}
3892
3893
3894
3895UnoControlNumericFieldModel::UnoControlNumericFieldModel( const Reference< XComponentContext >& rxContext )
3896 :UnoControlModel( rxContext )
3897{
3898 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXNumericField>();
3899}
3900
3902{
3903 return "stardiv.vcl.controlmodel.NumericField";
3904}
3905
3907{
3908 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
3909 {
3910 return uno::Any( OUString( "stardiv.vcl.control.NumericField" ) );
3911 }
3912 return UnoControlModel::ImplGetDefaultValue( nPropId );
3913}
3914
3915
3917{
3919 return aHelper;
3920}
3921
3922// beans::XMultiPropertySet
3923uno::Reference< beans::XPropertySetInfo > UnoControlNumericFieldModel::getPropertySetInfo( )
3924{
3925 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
3926 return xInfo;
3927}
3928
3930{
3931 return "stardiv.Toolkit.UnoControlNumericFieldModel";
3932}
3933
3934css::uno::Sequence<OUString>
3936{
3937 const css::uno::Sequence<OUString> vals { "stardiv.vcl.controlmodel.NumericField", "com.sun.star.awt.UnoControlNumericFieldModel" };
3939}
3940
3941extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3943 css::uno::XComponentContext *context,
3944 css::uno::Sequence<css::uno::Any> const &)
3945{
3946 return cppu::acquire(new UnoControlNumericFieldModel(context));
3947}
3948
3949
3950
3952{
3953 mnFirst = 0;
3954 mnLast = 0x7FFFFFFF;
3955}
3956
3958{
3959 return "numericfield";
3960}
3961
3962// uno::XInterface
3964{
3965 uno::Any aRet = ::cppu::queryInterface( rType,
3966 static_cast< awt::XNumericField* >(this) );
3967 return (aRet.hasValue() ? aRet : UnoSpinFieldControl::queryAggregation( rType ));
3968}
3969
3971
3972// lang::XTypeProvider
3973css::uno::Sequence< css::uno::Type > UnoNumericFieldControl::getTypes()
3974{
3975 static const ::cppu::OTypeCollection aTypeList(
3979 );
3980 return aTypeList.getTypes();
3981}
3982
3983void UnoNumericFieldControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
3984{
3985 UnoSpinFieldControl::createPeer( rxToolkit, rParentPeer );
3986
3987 uno::Reference < awt::XNumericField > xField( getPeer(), uno::UNO_QUERY );
3988 xField->setFirst( mnFirst );
3989 xField->setLast( mnLast );
3990}
3991
3992
3993void UnoNumericFieldControl::textChanged( const awt::TextEvent& e )
3994{
3995 uno::Reference < awt::XNumericField > xField( getPeer(), uno::UNO_QUERY );
3996 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_VALUE_DOUBLE ), uno::Any(xField->getValue()), false );
3997
3998 if ( GetTextListeners().getLength() )
3999 GetTextListeners().textChanged( e );
4000}
4001
4003{
4004 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_VALUE_DOUBLE ), uno::Any(Value), true );
4005}
4006
4008{
4009 return ImplGetPropertyValue_DOUBLE( BASEPROPERTY_VALUE_DOUBLE );
4010}
4011
4013{
4014 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_VALUEMIN_DOUBLE ), uno::Any(Value), true );
4015}
4016
4018{
4019 return ImplGetPropertyValue_DOUBLE( BASEPROPERTY_VALUEMIN_DOUBLE );
4020}
4021
4023{
4024 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_VALUEMAX_DOUBLE ), uno::Any(Value), true );
4025}
4026
4028{
4029 return ImplGetPropertyValue_DOUBLE( BASEPROPERTY_VALUEMAX_DOUBLE );
4030}
4031
4033{
4034 mnFirst = Value;
4035 if ( getPeer().is() )
4036 {
4037 uno::Reference < awt::XNumericField > xField( getPeer(), uno::UNO_QUERY );
4038 xField->setFirst( mnFirst );
4039 }
4040}
4041
4043{
4044 return mnFirst;
4045}
4046
4048{
4049 mnLast = Value;
4050 if ( getPeer().is() )
4051 {
4052 uno::Reference < awt::XNumericField > xField( getPeer(), uno::UNO_QUERY );
4053 xField->setLast( mnLast );
4054 }
4055}
4056
4058{
4059 return mnLast;
4060}
4061
4063{
4064 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STRICTFORMAT ), uno::Any(bStrict), true );
4065}
4066
4068{
4069 return ImplGetPropertyValue_BOOL( BASEPROPERTY_STRICTFORMAT );
4070}
4071
4073{
4074 return "stardiv.Toolkit.UnoNumericFieldControl";
4075}
4076
4078{
4079 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlNumericField", "stardiv.vcl.control.NumericField" };
4080 return comphelper::concatSequences( UnoSpinFieldControl::getSupportedServiceNames(), vals );
4081}
4082
4084{
4085 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_VALUESTEP_DOUBLE ), uno::Any(Digits), true );
4086}
4087
4089{
4090 return ImplGetPropertyValue_DOUBLE( BASEPROPERTY_VALUESTEP_DOUBLE );
4091}
4092
4094{
4095 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_DECIMALACCURACY ), uno::Any(Digits), true );
4096}
4097
4099{
4100 return ImplGetPropertyValue_INT16( BASEPROPERTY_DECIMALACCURACY );
4101}
4102
4103extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4105 css::uno::XComponentContext *,
4106 css::uno::Sequence<css::uno::Any> const &)
4107{
4108 return cppu::acquire(new UnoNumericFieldControl());
4109}
4110
4111UnoControlCurrencyFieldModel::UnoControlCurrencyFieldModel( const Reference< XComponentContext >& rxContext )
4112 :UnoControlModel( rxContext )
4113{
4114 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<SVTXCurrencyField>();
4115}
4116
4118{
4119 return "stardiv.vcl.controlmodel.CurrencyField";
4120}
4121
4123{
4124 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
4125 {
4126 return uno::Any( OUString( "stardiv.vcl.control.CurrencyField" ) );
4127 }
4128 if ( nPropId == BASEPROPERTY_CURSYM_POSITION )
4129 {
4130 return uno::Any(false);
4131 }
4132
4133 return UnoControlModel::ImplGetDefaultValue( nPropId );
4134}
4135
4137{
4139 return aHelper;
4140}
4141
4142// beans::XMultiPropertySet
4143uno::Reference< beans::XPropertySetInfo > UnoControlCurrencyFieldModel::getPropertySetInfo( )
4144{
4145 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
4146 return xInfo;
4147}
4148
4150{
4151 return "stardiv.Toolkit.UnoControlCurrencyFieldModel";
4152}
4153
4154css::uno::Sequence<OUString>
4156{
4157 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlCurrencyFieldModel", "stardiv.vcl.controlmodel.CurrencyField" };
4159}
4160
4161extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4163 css::uno::XComponentContext *context,
4164 css::uno::Sequence<css::uno::Any> const &)
4165{
4166 return cppu::acquire(new UnoControlCurrencyFieldModel(context));
4167}
4168
4169
4170
4172{
4173 mnFirst = 0;
4174 mnLast = 0x7FFFFFFF;
4175}
4176
4178{
4179 return "longcurrencyfield";
4180}
4181
4182// uno::XInterface
4184{
4185 uno::Any aRet = ::cppu::queryInterface( rType,
4186 static_cast< awt::XCurrencyField* >(this) );
4187 return (aRet.hasValue() ? aRet : UnoSpinFieldControl::queryAggregation( rType ));
4188}
4189
4191
4192// lang::XTypeProvider
4193css::uno::Sequence< css::uno::Type > UnoCurrencyFieldControl::getTypes()
4194{
4195 static const ::cppu::OTypeCollection aTypeList(
4199 );
4200 return aTypeList.getTypes();
4201}
4202
4203void UnoCurrencyFieldControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer )
4204{
4205 UnoSpinFieldControl::createPeer( rxToolkit, rParentPeer );
4206
4207 uno::Reference < awt::XCurrencyField > xField( getPeer(), uno::UNO_QUERY );
4208 xField->setFirst( mnFirst );
4209 xField->setLast( mnLast );
4210}
4211
4212void UnoCurrencyFieldControl::textChanged( const awt::TextEvent& e )
4213{
4214 uno::Reference < awt::XCurrencyField > xField( getPeer(), uno::UNO_QUERY );
4215 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_VALUE_DOUBLE ), uno::Any(xField->getValue()), false );
4216
4217 if ( GetTextListeners().getLength() )
4218 GetTextListeners().textChanged( e );
4219}
4220
4222{
4223 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_VALUE_DOUBLE ), Any(Value), true );
4224}
4225
4227{
4228 return ImplGetPropertyValue_DOUBLE( BASEPROPERTY_VALUE_DOUBLE );
4229}
4230
4232{
4233 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_VALUEMIN_DOUBLE ), uno::Any(Value), true );
4234}
4235
4237{
4238 return ImplGetPropertyValue_DOUBLE( BASEPROPERTY_VALUEMIN_DOUBLE );
4239}
4240
4242{
4243 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_VALUEMAX_DOUBLE ), uno::Any(Value), true );
4244}
4245
4247{
4248 return ImplGetPropertyValue_DOUBLE( BASEPROPERTY_VALUEMAX_DOUBLE );
4249}
4250
4252{
4253 mnFirst = Value;
4254 if ( getPeer().is() )
4255 {
4256 uno::Reference < awt::XCurrencyField > xField( getPeer(), uno::UNO_QUERY );
4257 xField->setFirst( mnFirst );
4258 }
4259}
4260
4262{
4263 return mnFirst;
4264}
4265
4267{
4268 mnLast = Value;
4269 if ( getPeer().is() )
4270 {
4271 uno::Reference < awt::XCurrencyField > xField( getPeer(), uno::UNO_QUERY );
4272 xField->setLast( mnLast );
4273 }
4274}
4275
4277{
4278 return mnLast;
4279}
4280
4282{
4283 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STRICTFORMAT ), uno::Any(bStrict), true );
4284}
4285
4287{
4288 return ImplGetPropertyValue_BOOL( BASEPROPERTY_STRICTFORMAT );
4289}
4290
4292{
4293 return "stardiv.Toolkit.UnoCurrencyFieldControl";
4294}
4295
4296css::uno::Sequence<OUString>
4298{
4299 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlCurrencyField", "stardiv.vcl.control.CurrencyField" };
4300 return comphelper::concatSequences( UnoSpinFieldControl::getSupportedServiceNames(), vals );
4301}
4302
4304{
4305 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_VALUESTEP_DOUBLE ), uno::Any(Digits), true );
4306}
4307
4309{
4310 return ImplGetPropertyValue_DOUBLE( BASEPROPERTY_VALUESTEP_DOUBLE );
4311}
4312
4314{
4315 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_DECIMALACCURACY ), uno::Any(Digits), true );
4316}
4317
4319{
4320 return ImplGetPropertyValue_INT16( BASEPROPERTY_DECIMALACCURACY );
4321}
4322
4323extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4325 css::uno::XComponentContext *,
4326 css::uno::Sequence<css::uno::Any> const &)
4327{
4328 return cppu::acquire(new UnoCurrencyFieldControl());
4329}
4330
4331
4332
4333UnoControlPatternFieldModel::UnoControlPatternFieldModel( const Reference< XComponentContext >& rxContext )
4334 :UnoControlModel( rxContext )
4335{
4336 UNO_CONTROL_MODEL_REGISTER_PROPERTIES<VCLXPatternField>();
4337}
4338
4340{
4341 return "stardiv.vcl.controlmodel.PatternField";
4342}
4343
4345{
4346 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
4347 {
4348 return uno::Any( OUString( "stardiv.vcl.control.PatternField" ) );
4349 }
4350 return UnoControlModel::ImplGetDefaultValue( nPropId );
4351}
4352
4354{
4356 return aHelper;
4357}
4358
4359// beans::XMultiPropertySet
4360uno::Reference< beans::XPropertySetInfo > UnoControlPatternFieldModel::getPropertySetInfo( )
4361{
4362 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
4363 return xInfo;
4364}
4365
4367{
4368 return "stardiv.Toolkit.UnoControlPatternFieldModel";
4369}
4370
4371css::uno::Sequence<OUString>
4373{
4374 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlPatternFieldModel", "stardiv.vcl.controlmodel.PatternField" };
4376}
4377
4378extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4380 css::uno::XComponentContext *context,
4381 css::uno::Sequence<css::uno::Any> const &)
4382{
4383 return cppu::acquire(new UnoControlPatternFieldModel(context));
4384}
4385
4386
4387
4389{
4390}
4391
4393{
4394 return "patternfield";
4395}
4396
4397void UnoPatternFieldControl::ImplSetPeerProperty( const OUString& rPropName, const uno::Any& rVal )
4398{
4399 sal_uInt16 nType = GetPropertyId( rPropName );
4401 {
4402 // These masks cannot be set consecutively
4403 OUString Text = ImplGetPropertyValue_UString( BASEPROPERTY_TEXT );
4404 OUString EditMask = ImplGetPropertyValue_UString( BASEPROPERTY_EDITMASK );
4405 OUString LiteralMask = ImplGetPropertyValue_UString( BASEPROPERTY_LITERALMASK );
4406
4407 uno::Reference < awt::XPatternField > xPF( getPeer(), uno::UNO_QUERY );
4408 if (xPF.is())
4409 {
4410 // same comment as in UnoControl::ImplSetPeerProperty - see there
4411 OUString sText( Text );
4412 ImplCheckLocalize( sText );
4413 xPF->setString( sText );
4414 xPF->setMasks( EditMask, LiteralMask );
4415 }
4416 }
4417 else
4418 UnoSpinFieldControl::ImplSetPeerProperty( rPropName, rVal );
4419}
4420
4421
4422// uno::XInterface
4424{
4425 uno::Any aRet = ::cppu::queryInterface( rType,
4426 static_cast< awt::XPatternField* >(this) );
4427 return (aRet.hasValue() ? aRet : UnoSpinFieldControl::queryAggregation( rType ));
4428}
4429
4431
4432// lang::XTypeProvider
4433css::uno::Sequence< css::uno::Type > UnoPatternFieldControl::getTypes()
4434{
4435 static const ::cppu::OTypeCollection aTypeList(
4439 );
4440 return aTypeList.getTypes();
4441}
4442
4443void UnoPatternFieldControl::setString( const OUString& rString )
4444{
4445 setText( rString );
4446}
4447
4449{
4450 return getText();
4451}
4452
4453void UnoPatternFieldControl::setMasks( const OUString& EditMask, const OUString& LiteralMask )
4454{
4455 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_EDITMASK ), uno::Any(EditMask), true );
4456 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_LITERALMASK ), uno::Any(LiteralMask), true );
4457}
4458
4459void UnoPatternFieldControl::getMasks( OUString& EditMask, OUString& LiteralMask )
4460{
4461 EditMask = ImplGetPropertyValue_UString( BASEPROPERTY_EDITMASK );
4462 LiteralMask = ImplGetPropertyValue_UString( BASEPROPERTY_LITERALMASK );
4463}
4464
4466{
4467 ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_STRICTFORMAT ), uno::Any(bStrict), true );
4468}
4469
4471{
4472 return ImplGetPropertyValue_BOOL( BASEPROPERTY_STRICTFORMAT );
4473}
4474
4476{
4477 return "stardiv.Toolkit.UnoPatternFieldControl";
4478}
4479
4481{
4482 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlPatternField", "stardiv.vcl.control.PatternField" };
4483 return comphelper::concatSequences( UnoSpinFieldControl::getSupportedServiceNames(), vals );
4484}
4485
4486extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4488 css::uno::XComponentContext *,
4489 css::uno::Sequence<css::uno::Any> const &)
4490{
4491 return cppu::acquire(new UnoPatternFieldControl());
4492}
4493
4494
4495
4496UnoControlProgressBarModel::UnoControlProgressBarModel( const Reference< XComponentContext >& rxContext )
4497 :UnoControlModel( rxContext )
4498{
4499 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
4500 ImplRegisterProperty( BASEPROPERTY_BORDER );
4501 ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
4502 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
4503 ImplRegisterProperty( BASEPROPERTY_ENABLED );
4504 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
4505 ImplRegisterProperty( BASEPROPERTY_FILLCOLOR );
4506 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
4507 ImplRegisterProperty( BASEPROPERTY_HELPURL );
4508 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
4509 ImplRegisterProperty( BASEPROPERTY_PROGRESSVALUE );
4510 ImplRegisterProperty( BASEPROPERTY_PROGRESSVALUE_MAX );
4511 ImplRegisterProperty( BASEPROPERTY_PROGRESSVALUE_MIN );
4512}
4513
4515{
4516 return "stardiv.vcl.controlmodel.ProgressBar";
4517}
4518
4520{
4521 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
4522 {
4523 return uno::Any( OUString( "stardiv.vcl.control.ProgressBar" ) );
4524 }
4525
4526 return UnoControlModel::ImplGetDefaultValue( nPropId );
4527}
4528
4530{
4532 return aHelper;
4533}
4534
4535// beans::XMultiPropertySet
4536uno::Reference< beans::XPropertySetInfo > UnoControlProgressBarModel::getPropertySetInfo( )
4537{
4538 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
4539 return xInfo;
4540}
4541
4543{
4544 return "stardiv.Toolkit.UnoControlProgressBarModel";
4545}
4546
4547css::uno::Sequence<OUString>
4549{
4550 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlProgressBarModel", "stardiv.vcl.controlmodel.ProgressBar" };
4552}
4553
4554extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4556 css::uno::XComponentContext *context,
4557 css::uno::Sequence<css::uno::Any> const &)
4558{
4559 return cppu::acquire(new UnoControlProgressBarModel(context));
4560}
4561
4562
4563
4565{
4566}
4567
4569{
4570 return "ProgressBar";
4571}
4572
4573// uno::XInterface
4575{
4576 uno::Any aRet = ::cppu::queryInterface( rType,
4577 static_cast< awt::XProgressBar* >(this) );
4578 return (aRet.hasValue() ? aRet : UnoControlBase::queryAggregation( rType ));
4579}
4580
4582
4583// lang::XTypeProvider
4584css::uno::Sequence< css::uno::Type > UnoProgressBarControl::getTypes()
4585{
4586 static const ::cppu::OTypeCollection aTypeList(
4590 );
4591 return aTypeList.getTypes();
4592}
4593
4594// css::awt::XProgressBar
4596{
4598}
4599
4601{
4603}
4604
4605void UnoProgressBarControl::setValue( sal_Int32 nValue )
4606{
4608}
4609
4610void UnoProgressBarControl::setRange( sal_Int32 nMin, sal_Int32 nMax )
4611{
4612 uno::Any aMin;
4613 uno::Any aMax;
4614
4615 if ( nMin < nMax )
4616 {
4617 // take correct min and max
4618 aMin <<= nMin;
4619 aMax <<= nMax;
4620 }
4621 else
4622 {
4623 // change min and max
4624 aMin <<= nMax;
4625 aMax <<= nMin;
4626 }
4627
4630}
4631
4633{
4635}
4636
4638{
4639 return "stardiv.Toolkit.UnoProgressBarControl";
4640}
4641
4643{
4644 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlProgressBar", "stardiv.vcl.control.ProgressBar" };
4646}
4647
4648extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4650 css::uno::XComponentContext *,
4651 css::uno::Sequence<css::uno::Any> const &)
4652{
4653 return cppu::acquire(new UnoProgressBarControl());
4654}
4655
4656
4657
4658UnoControlFixedLineModel::UnoControlFixedLineModel( const Reference< XComponentContext >& rxContext )
4659 :UnoControlModel( rxContext )
4660{
4661 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
4662 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
4663 ImplRegisterProperty( BASEPROPERTY_ENABLED );
4664 ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
4665 ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
4666 ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
4667 ImplRegisterProperty( BASEPROPERTY_HELPURL );
4668 ImplRegisterProperty( BASEPROPERTY_LABEL );
4669 ImplRegisterProperty( BASEPROPERTY_ORIENTATION );
4670 ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
4671}
4672
4674{
4675 return "stardiv.vcl.controlmodel.FixedLine";
4676}
4677
4679{
4680 if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
4681 {
4682 return uno::Any( OUString( "stardiv.vcl.control.FixedLine" ) );
4683 }
4684 return UnoControlModel::ImplGetDefaultValue( nPropId );
4685}
4686
4688{
4690 return aHelper;
4691}
4692
4693// beans::XMultiPropertySet
4694uno::Reference< beans::XPropertySetInfo > UnoControlFixedLineModel::getPropertySetInfo( )
4695{
4696 static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
4697 return xInfo;
4698}
4699
4701{
4702 return "stardiv.Toolkit.UnoControlFixedLineModel";
4703}
4704
4705css::uno::Sequence<OUString>
4707{
4708 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlFixedLineModel", "stardiv.vcl.controlmodel.FixedLine" };
4710}
4711
4712extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4714 css::uno::XComponentContext *context,
4715 css::uno::Sequence<css::uno::Any> const &)
4716{
4717 return cppu::acquire(new UnoControlFixedLineModel(context));
4718}
4719
4720
4721
4723{
4724 maComponentInfos.nWidth = 100; // ??
4725 maComponentInfos.nHeight = 100; // ??
4726}
4727
4729{
4730 return "FixedLine";
4731}
4732
4734{
4735 return true;
4736}
4737
4739{
4740 return "stardiv.Toolkit.UnoFixedLineControl";
4741}
4742
4744{
4745 const css::uno::Sequence<OUString> vals { "com.sun.star.awt.UnoControlFixedLine", "stardiv.vcl.control.FixedLine" };
4747}
4748
4749extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4751 css::uno::XComponentContext *,
4752 css::uno::Sequence<css::uno::Any> const &)
4753{
4754 return cppu::acquire(new UnoFixedLineControl());
4755}
4756
4757/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Text maText
AnyEventRef aEvent
void setFastPropertyValue_NoBroadcast(std::unique_lock< std::mutex > &rGuard, sal_Int32 nHandle, const css::uno::Any &rValue) 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
OUString GetComponentServiceName() const override
OUString SAL_CALL getImplementationName() override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &aNewSize) override
void SAL_CALL removeItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
void SAL_CALL addItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
ActionListenerMultiplexer maActionListeners
OUString maActionCommand
css::awt::Size SAL_CALL getMinimumSize() override
css::awt::Size SAL_CALL getPreferredSize() override
ItemListenerMultiplexer maItemListeners
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
void SAL_CALL setLabel(const OUString &Label) override
void SAL_CALL setActionCommand(const OUString &Command) override
virtual void SAL_CALL itemStateChanged(const css::awt::ItemEvent &rEvent) override
void SAL_CALL dispose() override
virtual void SAL_CALL addItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
virtual void SAL_CALL removeItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
sal_Int16 SAL_CALL getState() override
css::awt::Size SAL_CALL getPreferredSize() override
void SAL_CALL setLabel(const OUString &Label) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &aNewSize) override
void SAL_CALL setActionCommand(const OUString &Command) override
void SAL_CALL enableTriState(sal_Bool b) override
void SAL_CALL setState(sal_Int16 n) override
OUString SAL_CALL getImplementationName() override
void SAL_CALL itemStateChanged(const css::awt::ItemEvent &rEvent) override
ActionListenerMultiplexer maActionListeners
void SAL_CALL dispose() override
css::awt::Size SAL_CALL getMinimumSize() override
OUString maActionCommand
void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
OUString GetComponentServiceName() const override
ItemListenerMultiplexer maItemListeners
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
sal_Bool SAL_CALL isTransparent() override
ActionListenerMultiplexer maActionListeners
css::uno::Sequence< OUString > SAL_CALL getItems() override
virtual sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &Model) override
sal_Int16 SAL_CALL getItemCount() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void SAL_CALL addItem(const OUString &aItem, sal_Int16 nPos) override
void SAL_CALL dispose() override
OUString SAL_CALL getImplementationName() override
OUString GetComponentServiceName() const override
OUString SAL_CALL getItem(sal_Int16 nPos) override
void SAL_CALL removeItems(sal_Int16 nPos, sal_Int16 nCount) override
ItemListenerMultiplexer maItemListeners
void SAL_CALL removeItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
virtual void SAL_CALL listItemModified(const css::awt::ItemListEvent &Event) override
virtual void SAL_CALL listItemInserted(const css::awt::ItemListEvent &Event) override
virtual void SAL_CALL listItemRemoved(const css::awt::ItemListEvent &Event) override
void SAL_CALL addItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
void SAL_CALL addItems(const css::uno::Sequence< OUString > &aItems, sal_Int16 nPos) override
virtual void SAL_CALL itemListChanged(const css::lang::EventObject &Event) override
sal_Int16 SAL_CALL getDropDownLineCount() override
virtual void updateFromModel() override
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
virtual void ImplSetPeerProperty(const OUString &rPropName, const css::uno::Any &rVal) override
virtual void SAL_CALL allItemsRemoved(const css::lang::EventObject &Event) override
void SAL_CALL setDropDownLineCount(sal_Int16 nLines) override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
virtual void SAL_CALL itemStateChanged(const css::awt::ItemEvent &rEvent) override
css::uno::Any ImplGetPropertyValue(const OUString &aPropertyName) const
void ImplSetPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue, bool bUpdateThis)
sal_Int32 ImplGetPropertyValue_INT32(sal_uInt16 nProp)
OUString ImplGetPropertyValue_UString(sal_uInt16 nProp)
css::awt::Size Impl_getMinimumSize()
css::awt::Size Impl_calcAdjustedSize(const css::awt::Size &rNewSize)
css::awt::Size Impl_getPreferredSize()
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
OUString SAL_CALL getImplementationName() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
UnoControlButtonModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
::cppu::IPropertyArrayHelper & getInfoHelper() override
OUString SAL_CALL getServiceName() override
UnoControlCheckBoxModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
OUString SAL_CALL getServiceName() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
OUString SAL_CALL getImplementationName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
::cppu::IPropertyArrayHelper & getInfoHelper() override
OUString SAL_CALL getImplementationName() override
UnoControlComboBoxModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
OUString SAL_CALL getServiceName() override
void setFastPropertyValue_NoBroadcast(std::unique_lock< std::mutex > &rGuard, sal_Int32 nHandle, const css::uno::Any &rValue) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
::cppu::IPropertyArrayHelper & getInfoHelper() override
OUString SAL_CALL getServiceName() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
UnoControlCurrencyFieldModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
OUString SAL_CALL getImplementationName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString SAL_CALL getImplementationName() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
OUString SAL_CALL getServiceName() override
UnoControlDateFieldModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
UnoControlEditModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString SAL_CALL getServiceName() override
Definition: unocontrols.cxx:95
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
::cppu::IPropertyArrayHelper & getInfoHelper() override
OUString SAL_CALL getServiceName() override
OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
UnoControlFileControlModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
OUString SAL_CALL getServiceName() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
UnoControlFixedHyperlinkModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
UnoControlFixedLineModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
OUString SAL_CALL getImplementationName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
OUString SAL_CALL getServiceName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
UnoControlFixedTextModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
::cppu::IPropertyArrayHelper & getInfoHelper() override
OUString SAL_CALL getImplementationName() override
OUString SAL_CALL getServiceName() override
OUString SAL_CALL getImplementationName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
UnoControlGroupBoxModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
OUString SAL_CALL getServiceName() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
UnoControlImageControlModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
OUString SAL_CALL getImplementationName() override
void setFastPropertyValue_NoBroadcast(std::unique_lock< std::mutex > &rGuard, sal_Int32 nHandle, const css::uno::Any &rValue) override
OUString SAL_CALL getServiceName() override
virtual css::uno::Sequence< css::beans::Pair< OUString, OUString > > SAL_CALL getAllItems() override
virtual void SAL_CALL setItemImage(::sal_Int32 Position, const OUString &ItemImageURL) override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
void impl_notifyItemListEvent(std::unique_lock< std::mutex > &rGuard, const sal_Int32 i_nItemPosition, const ::std::optional< OUString > &i_rItemText, const ::std::optional< OUString > &i_rItemImageURL, void(SAL_CALL css::awt::XItemListListener::*NotificationMethod)(const css::awt::ItemListEvent &))
OUString SAL_CALL getImplementationName() override
virtual css::beans::Pair< OUString, OUString > SAL_CALL getItemTextAndImage(::sal_Int32 Position) override
virtual void SAL_CALL setItemData(::sal_Int32 Position, const css::uno::Any &DataValue) override
virtual OUString SAL_CALL getItemImage(::sal_Int32 Position) override
virtual css::uno::Any SAL_CALL getItemData(::sal_Int32 Position) override
virtual void SAL_CALL insertItemImage(::sal_Int32 Position, const OUString &ItemImageURL) override
virtual void SAL_CALL removeItemListListener(const css::uno::Reference< css::awt::XItemListListener > &Listener) override
std::unique_ptr< UnoControlListBoxModel_Data > m_xData
void impl_handleInsert(std::unique_lock< std::mutex > &rGuard, const sal_Int32 i_nItemPosition, const ::std::optional< OUString > &i_rItemText, const ::std::optional< OUString > &i_rItemImageURL)
void impl_getStringItemList(std::unique_lock< std::mutex > &rGuard, ::std::vector< OUString > &o_rStringItems) const
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
void impl_handleModify(const sal_Int32 i_nItemPosition, const ::std::optional< OUString > &i_rItemText, const ::std::optional< OUString > &i_rItemImageURL, std::unique_lock< std::mutex > &i_rClearBeforeNotify)
virtual void SAL_CALL removeItem(::sal_Int32 Position) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getItemText(::sal_Int32 Position) override
void impl_setStringItemList(std::unique_lock< std::mutex > &rGuard, const ::std::vector< OUString > &i_rStringItems)
virtual void SAL_CALL addItemListListener(const css::uno::Reference< css::awt::XItemListListener > &Listener) override
virtual void SAL_CALL setItemText(::sal_Int32 Position, const OUString &ItemText) override
void impl_handleRemove(const sal_Int32 i_nItemPosition, std::unique_lock< std::mutex > &i_rClearBeforeNotify)
OUString SAL_CALL getServiceName() override
virtual void SAL_CALL setItemTextAndImage(::sal_Int32 Position, const OUString &ItemText, const OUString &ItemImageURL) override
::cppu::IPropertyArrayHelper & getInfoHelper() override
void setFastPropertyValue_NoBroadcast(std::unique_lock< std::mutex > &rGuard, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void SAL_CALL removeAllItems() override
::comphelper::OInterfaceContainerHelper4< css::awt::XItemListListener > m_aItemListListeners
virtual void SAL_CALL insertItemText(::sal_Int32 Position, const OUString &ItemText) override
virtual void SAL_CALL insertItem(::sal_Int32 Position, const OUString &ItemText, const OUString &ItemImageURL) override
virtual void ImplNormalizePropertySequence(const sal_Int32 _nCount, sal_Int32 *_pHandles, css::uno::Any *_pValues, sal_Int32 *_pValidHandles) const override
virtual ::sal_Int32 SAL_CALL getItemCount() override
virtual ~UnoControlListBoxModel() override
UnoControlListBoxModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext, ConstructorMode const i_mode=ConstructDefault)
css::uno::Sequence< sal_Int32 > ImplGetPropertyIds() const
void setFastPropertyValue_NoBroadcast(std::unique_lock< std::mutex > &rGuard, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const
virtual void ImplNormalizePropertySequence(const sal_Int32 _nCount, sal_Int32 *_pHandles, css::uno::Any *_pValues, sal_Int32 *_pValidHandles) const
called before setting multiple properties, allows to care for property dependencies
bool ImplHasProperty(sal_uInt16 nPropId) const
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString SAL_CALL getImplementationName() override
OUString SAL_CALL getServiceName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
UnoControlNumericFieldModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
::cppu::IPropertyArrayHelper & getInfoHelper() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
UnoControlPatternFieldModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
OUString SAL_CALL getServiceName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
OUString SAL_CALL getServiceName() override
OUString SAL_CALL getImplementationName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
UnoControlProgressBarModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
::cppu::IPropertyArrayHelper & getInfoHelper() override
OUString SAL_CALL getServiceName() override
OUString SAL_CALL getImplementationName() override
UnoControlRadioButtonModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
OUString SAL_CALL getImplementationName() override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
::cppu::IPropertyArrayHelper & getInfoHelper() override
UnoControlTimeFieldModel(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
OUString SAL_CALL getServiceName() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void SAL_CALL dispose() override
Definition: unocontrol.cxx:346
virtual void updateFromModel()
Definition: unocontrol.cxx:311
UnoControlComponentInfos maComponentInfos
Definition: unocontrol.hxx:105
virtual void ImplSetPeerProperty(const OUString &rPropName, const css::uno::Any &rVal)
Definition: unocontrol.cxx:249
sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &Model) override
void SAL_CALL disposing(const css::lang::EventObject &Source) override
Definition: unocontrol.cxx:654
css::uno::Reference< css::awt::XControlModel > mxModel
Definition: unocontrol.hxx:93
css::uno::Reference< css::awt::XWindowPeer > SAL_CALL getPeer() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
double SAL_CALL getFirst() override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
void SAL_CALL setValue(double Value) override
double SAL_CALL getLast() override
sal_Int16 SAL_CALL getDecimalDigits() override
OUString SAL_CALL getImplementationName() override
void SAL_CALL setMax(double Value) override
void SAL_CALL setDecimalDigits(sal_Int16 nDigits) override
void SAL_CALL setMin(double Value) override
double SAL_CALL getValue() override
double SAL_CALL getMax() override
void SAL_CALL textChanged(const css::awt::TextEvent &rEvent) override
double SAL_CALL getMin() override
sal_Bool SAL_CALL isStrictFormat() override
void SAL_CALL setSpinSize(double Value) override
OUString GetComponentServiceName() const override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
double SAL_CALL getSpinSize() override
void SAL_CALL setFirst(double Value) override
void SAL_CALL setLast(double Value) override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
void SAL_CALL setFirst(const css::util::Date &Date) override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
css::util::Date SAL_CALL getLast() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::util::Date SAL_CALL getFirst() override
css::util::Date mnFirst
css::util::Date SAL_CALL getMin() override
css::util::Date mnLast
OUString SAL_CALL getImplementationName() override
void SAL_CALL setLast(const css::util::Date &Date) override
css::util::Date SAL_CALL getMax() override
void SAL_CALL setLongFormat(sal_Bool bLong) override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
sal_Bool SAL_CALL isLongFormat() override
void SAL_CALL setDate(const css::util::Date &Date) override
OUString GetComponentServiceName() const override
void SAL_CALL setMin(const css::util::Date &Date) override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
void SAL_CALL setEmpty() override
sal_Bool SAL_CALL isStrictFormat() override
css::util::Date SAL_CALL getDate() override
void SAL_CALL setMax(const css::util::Date &Date) override
sal_Bool SAL_CALL isEmpty() override
void SAL_CALL textChanged(const css::awt::TextEvent &rEvent) override
OUString SAL_CALL getImplementationName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString GetComponentServiceName() const override
sal_Int16 SAL_CALL getAlignment() override
void SAL_CALL setURL(const OUString &URL) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &aNewSize) override
css::awt::Size SAL_CALL getPreferredSize() override
ActionListenerMultiplexer maActionListeners
void SAL_CALL setAlignment(sal_Int16 nAlign) override
css::awt::Size SAL_CALL getMinimumSize() override
OUString SAL_CALL getURL() override
void SAL_CALL dispose() override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
OUString SAL_CALL getText() override
void SAL_CALL setText(const OUString &Text) override
sal_Bool SAL_CALL isTransparent() override
void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
OUString GetComponentServiceName() const override
OUString GetComponentServiceName() const override
OUString SAL_CALL getImplementationName() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
sal_Bool SAL_CALL isTransparent() override
void SAL_CALL setAlignment(sal_Int16 nAlign) override
sal_Int16 SAL_CALL getAlignment() override
OUString SAL_CALL getImplementationName() override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &aNewSize) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::awt::Size SAL_CALL getPreferredSize() override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
css::awt::Size SAL_CALL getMinimumSize() override
void SAL_CALL setText(const OUString &Text) override
OUString SAL_CALL getText() override
OUString GetComponentServiceName() const override
sal_Bool SAL_CALL isTransparent() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString GetComponentServiceName() const override
sal_Bool SAL_CALL isTransparent() override
OUString SAL_CALL getImplementationName() override
void SAL_CALL dispose() override
css::awt::Size SAL_CALL getPreferredSize() override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &aNewSize) override
ActionListenerMultiplexer maActionListeners
OUString SAL_CALL getImplementationName() override
OUString GetComponentServiceName() const override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::awt::Size SAL_CALL getMinimumSize() override
sal_Bool SAL_CALL isTransparent() override
virtual void SAL_CALL allItemsRemoved(const css::lang::EventObject &Event) override
ActionListenerMultiplexer maActionListeners
OUString SAL_CALL getItem(sal_Int16 nPos) override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
void SAL_CALL setMultipleMode(sal_Bool bMulti) override
OUString GetComponentServiceName() const override
void SAL_CALL itemStateChanged(const css::awt::ItemEvent &rEvent) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &aNewSize) override
virtual void SAL_CALL listItemInserted(const css::awt::ItemListEvent &Event) override
css::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos() override
void SAL_CALL addItems(const css::uno::Sequence< OUString > &aItems, sal_Int16 nPos) override
sal_Bool SAL_CALL isMutipleMode() override
virtual void ImplSetPeerProperty(const OUString &rPropName, const css::uno::Any &rVal) override
sal_Int16 SAL_CALL getDropDownLineCount() override
void SAL_CALL addItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
void SAL_CALL removeItems(sal_Int16 nPos, sal_Int16 nCount) override
css::awt::Size SAL_CALL getMinimumSize() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL listItemRemoved(const css::awt::ItemListEvent &Event) override
void SAL_CALL selectItemPos(sal_Int16 nPos, sal_Bool bSelect) override
void SAL_CALL getColumnsAndLines(sal_Int16 &nCols, sal_Int16 &nLines) override
void SAL_CALL selectItem(const OUString &aItem, sal_Bool bSelect) override
void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
void ImplUpdateSelectedItemsProperty()
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
void SAL_CALL setDropDownLineCount(sal_Int16 nLines) override
OUString SAL_CALL getSelectedItem() override
void SAL_CALL makeVisible(sal_Int16 nEntry) override
sal_Int16 SAL_CALL getSelectedItemPos() override
css::awt::Size SAL_CALL getPreferredSize() override
ItemListenerMultiplexer maItemListeners
css::uno::Sequence< OUString > SAL_CALL getItems() override
void SAL_CALL selectItemsPos(const css::uno::Sequence< sal_Int16 > &aPositions, sal_Bool bSelect) override
sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &Model) override
OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL listItemModified(const css::awt::ItemListEvent &Event) override
css::uno::Sequence< OUString > SAL_CALL getSelectedItems() override
sal_Int16 SAL_CALL getItemCount() override
void SAL_CALL dispose() override
void SAL_CALL removeItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
virtual void updateFromModel() override
void SAL_CALL addItem(const OUString &aItem, sal_Int16 nPos) override
virtual void SAL_CALL itemListChanged(const css::lang::EventObject &Event) override
double SAL_CALL getValue() override
void SAL_CALL setFirst(double Value) override
sal_Int16 SAL_CALL getDecimalDigits() override
void SAL_CALL setSpinSize(double Value) override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
void SAL_CALL setMax(double Value) override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
double SAL_CALL getMin() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void SAL_CALL setMin(double Value) override
sal_Bool SAL_CALL isStrictFormat() override
double SAL_CALL getMax() override
void SAL_CALL textChanged(const css::awt::TextEvent &rEvent) override
double SAL_CALL getLast() override
double SAL_CALL getFirst() override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
double SAL_CALL getSpinSize() override
void SAL_CALL setDecimalDigits(sal_Int16 nDigits) override
void SAL_CALL setLast(double Value) override
OUString GetComponentServiceName() const override
OUString SAL_CALL getImplementationName() override
void SAL_CALL setValue(double Value) override
OUString GetComponentServiceName() const override
OUString SAL_CALL getString() override
OUString SAL_CALL getImplementationName() override
void SAL_CALL getMasks(OUString &EditMask, OUString &LiteralMask) override
void SAL_CALL setMasks(const OUString &EditMask, const OUString &LiteralMask) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void ImplSetPeerProperty(const OUString &rPropName, const css::uno::Any &rVal) override
sal_Bool SAL_CALL isStrictFormat() override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
void SAL_CALL setString(const OUString &Str) override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
OUString GetComponentServiceName() const override
void SAL_CALL setForegroundColor(sal_Int32 nColor) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void SAL_CALL setValue(sal_Int32 nValue) override
OUString SAL_CALL getImplementationName() override
sal_Int32 SAL_CALL getValue() override
void SAL_CALL setBackgroundColor(sal_Int32 nColor) override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
void SAL_CALL setRange(sal_Int32 nMin, sal_Int32 nMax) override
sal_Bool SAL_CALL isTransparent() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void SAL_CALL setLabel(const OUString &Label) override
void SAL_CALL itemStateChanged(const css::awt::ItemEvent &rEvent) override
void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
ActionListenerMultiplexer maActionListeners
OUString SAL_CALL getImplementationName() override
void SAL_CALL setActionCommand(const OUString &Command) override
sal_Bool SAL_CALL getState() override
css::awt::Size SAL_CALL getPreferredSize() override
ItemListenerMultiplexer maItemListeners
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &aNewSize) override
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
css::awt::Size SAL_CALL getMinimumSize() override
void SAL_CALL addItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
void SAL_CALL removeItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
void SAL_CALL setState(sal_Bool b) override
OUString GetComponentServiceName() const override
void SAL_CALL dispose() override
void SAL_CALL addSpinListener(const css::uno::Reference< css::awt::XSpinListener > &l) override
css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
void SAL_CALL last() override
void SAL_CALL enableRepeat(sal_Bool bRepeat) override
void SAL_CALL removeSpinListener(const css::uno::Reference< css::awt::XSpinListener > &l) override
void SAL_CALL first() override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
void SAL_CALL down() override
SpinListenerMultiplexer maSpinListeners
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
void SAL_CALL up() override
void SAL_CALL setTime(const css::util::Time &Time) override
OUString GetComponentServiceName() const override
OUString SAL_CALL getImplementationName() override
css::util::Time SAL_CALL getMax() override
sal_Bool SAL_CALL isStrictFormat() override
css::util::Time mnLast
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::util::Time SAL_CALL getMin() override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
void SAL_CALL setFirst(const css::util::Time &Time) override
css::util::Time SAL_CALL getTime() override
void SAL_CALL setMin(const css::util::Time &Time) override
void SAL_CALL textChanged(const css::awt::TextEvent &rEvent) override
css::util::Time mnFirst
void SAL_CALL setLast(const css::util::Time &Time) override
void SAL_CALL setEmpty() override
css::util::Time SAL_CALL getFirst() override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
void SAL_CALL setMax(const css::util::Time &Time) override
css::util::Time SAL_CALL getLast() override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
sal_Bool SAL_CALL isEmpty() override
sal_Int32 addInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(std::unique_lock< std::mutex > &rGuard, void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event) const
sal_Int32 removeInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
static css::uno::Reference< css::beans::XPropertySetInfo > createPropertySetInfo(cppu::IPropertyArrayHelper &rProperties)
void setDependentFastPropertyValue(std::unique_lock< std::mutex > &rGuard, sal_Int32 i_handle, const css::uno::Any &i_value)
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
oslInterlockedCount m_refCount
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
int nCount
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
#define ENSURE_OR_RETURN_VOID(c, m)
ESelection aNewSelection(GetSelection())
sal_Int32 nState
Any aHelper
sal_Int16 nValue
OUString sName
TRISTATE_FALSE
TRISTATE_INDET
TRISTATE_TRUE
std::mutex m_aMutex
OUString aName
sal_Int64 n
sal_uInt16 nPos
DECL_LISTENERMULTIPLEXER_END void SAL_CALL textChanged(const css::awt::TextEvent &rEvent) override
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
#define IMPL_IMPLEMENTATION_ID(ClassName)
Definition: macros.hxx:27
double getLength(const B2DPolygon &rCandidate)
@ Exception
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
DstType sequenceToContainer(const css::uno::Sequence< SrcType > &i_Sequence)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
Type
Value
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sal_Int16 translateImagePosition(ImageAlign _eVCLAlign)
translates a VCL ImageAlign value into a css.awt.ImagePosition value
Definition: imagealign.cxx:33
sal_Int16 getExtendedImagePosition(sal_Int16 _nImageAlign)
translates a css.awt.ImageAlign value into a css.awt.ImagePosition value
Definition: imagealign.cxx:109
sal_Int16 getCompatibleImageAlign(ImageAlign _eAlign)
translates a VCL ImageAlign value into a compatible css.awt.ImageAlign value
Definition: imagealign.cxx:81
const OUString & GetPropertyName(sal_uInt16 nPropertyId)
Definition: property.cxx:295
sal_uInt16 GetPropertyId(const OUString &rPropertyName)
Definition: property.cxx:278
#define BASEPROPERTY_MULTILINE
Definition: property.hxx:43
#define BASEPROPERTY_LITERALMASK
Definition: property.hxx:74
#define BASEPROPERTY_LINE_END_FORMAT
Definition: property.hxx:137
#define BASEPROPERTY_EDITMASK
Definition: property.hxx:73
#define BASEPROPERTY_BORDER
Definition: property.hxx:39
#define BASEPROPERTY_VISUALEFFECT
Definition: property.hxx:144
#define BASEPROPERTY_FILLCOLOR
Definition: property.hxx:36
#define BASEPROPERTY_STRINGITEMLIST
Definition: property.hxx:44
#define BASEPROPERTY_HIDEINACTIVESELECTION
Definition: property.hxx:143
#define BASEPROPERTY_ENFORCE_FORMAT
Definition: property.hxx:135
#define BASEPROPERTY_AUTOTOGGLE
Definition: property.hxx:92
#define BASEPROPERTY_SCALEIMAGE
Definition: property.hxx:120
#define BASEPROPERTY_ORIENTATION
Definition: property.hxx:115
#define BASEPROPERTY_URL
Definition: property.hxx:169
#define BASEPROPERTY_CONTEXT_WRITING_MODE
Definition: property.hxx:174
#define BASEPROPERTY_TIMEMIN
Definition: property.hxx:67
#define BASEPROPERTY_TEXT
Definition: property.hxx:34
#define BASEPROPERTY_READONLY
Definition: property.hxx:76
#define BASEPROPERTY_DATEMAX
Definition: property.hxx:65
#define BASEPROPERTY_ALIGN
Definition: property.hxx:40
#define BASEPROPERTY_IMAGEPOSITION
Definition: property.hxx:146
#define BASEPROPERTY_TOGGLE
Definition: property.hxx:141
#define BASEPROPERTY_HELPURL
Definition: property.hxx:91
#define BASEPROPERTY_LINECOUNT
Definition: property.hxx:54
#define BASEPROPERTY_TIME
Definition: property.hxx:66
#define BASEPROPERTY_PROGRESSVALUE_MIN
Definition: property.hxx:108
#define BASEPROPERTY_IMAGEURL
Definition: property.hxx:75
#define BASEPROPERTY_VALUEMIN_DOUBLE
Definition: property.hxx:86
#define BASEPROPERTY_BACKGROUNDCOLOR
Definition: property.hxx:35
#define BASEPROPERTY_TYPEDITEMLIST
Definition: property.hxx:207
#define BASEPROPERTY_MULTISELECTION
Definition: property.hxx:83
#define BASEPROPERTY_PROGRESSVALUE
Definition: property.hxx:107
#define BASEPROPERTY_TABSTOP
Definition: property.hxx:47
#define BASEPROPERTY_ENABLED
Definition: property.hxx:77
#define BASEPROPERTY_STRICTFORMAT
Definition: property.hxx:61
#define BASEPROPERTY_DEFAULTCONTROL
Definition: property.hxx:52
#define BASEPROPERTY_VERTICALALIGN
Definition: property.hxx:148
#define BASEPROPERTY_PROGRESSVALUE_MAX
Definition: property.hxx:109
#define BASEPROPERTY_TRISTATE
Definition: property.hxx:89
#define BASEPROPERTY_WRITING_MODE
Definition: property.hxx:173
#define BASEPROPERTY_GRAPHIC
Definition: property.hxx:150
#define BASEPROPERTY_LABEL
Definition: property.hxx:53
#define BASEPROPERTY_DATE
Definition: property.hxx:63
#define BASEPROPERTY_FOCUSONCLICK
Definition: property.hxx:142
#define BASEPROPERTY_BORDERCOLOR
Definition: property.hxx:145
#define BASEPROPERTY_CURSYM_POSITION
Definition: property.hxx:101
#define BASEPROPERTY_FONTDESCRIPTOR
Definition: property.hxx:41
#define BASEPROPERTY_MAXTEXTLEN
Definition: property.hxx:80
#define PROPERTY_ALIGN_CENTER
Definition: property.hxx:231
#define BASEPROPERTY_DATEMIN
Definition: property.hxx:64
#define BASEPROPERTY_DECIMALACCURACY
Definition: property.hxx:62
#define BASEPROPERTY_ENABLEVISIBLE
Definition: property.hxx:180
#define BASEPROPERTY_HELPTEXT
Definition: property.hxx:106
#define BASEPROPERTY_VALUEMAX_DOUBLE
Definition: property.hxx:87
#define BASEPROPERTY_VALUE_DOUBLE
Definition: property.hxx:85
#define BASEPROPERTY_STATE
Definition: property.hxx:48
#define BASEPROPERTY_SELECTEDITEMS
Definition: property.hxx:84
#define BASEPROPERTY_IMAGEALIGN
Definition: property.hxx:119
#define BASEPROPERTY_TIMEMAX
Definition: property.hxx:68
#define BASEPROPERTY_IMAGE_SCALE_MODE
Definition: property.hxx:172
#define BASEPROPERTY_PUSHBUTTONTYPE
Definition: property.hxx:121
#define BASEPROPERTY_PRINTABLE
Definition: property.hxx:78
#define BASEPROPERTY_VALUESTEP_DOUBLE
Definition: property.hxx:88
QPRO_FUNC_TYPE nType
sal_Int32 nHandle
IMPLEMENT_FORWARD_XTYPEPROVIDER2(ORoadmapEntry, ORoadmapEntry_Base, ::comphelper::OPropertyContainer)
ListItem & insertItem(const sal_Int32 i_nIndex)
void setAllItems(::std::vector< ListItem > &&i_rItems)
sal_Int32 getItemCount() const
Sequence< UnoListItem > getAllItems() const
ListItem & getItem(const sal_Int32 i_nIndex)
UnoControlListBoxModel & m_rAntiImpl
void copyItems(const UnoControlListBoxModel_Data &i_copySource)
UnoControlListBoxModel_Data(UnoControlListBoxModel &i_rAntiImpl)
void removeItem(const sal_Int32 i_nIndex)
const ListItem & getItem(const sal_Int32 i_nIndex) const
::std::vector< ListItem > m_aListItems
bool hasValue()
unsigned char sal_Bool
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlProgressBarModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlListBoxModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoRadioButtonControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlImageControlModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlCurrencyFieldModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlButtonModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoGroupBoxControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoCheckBoxControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlEditModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoButtonControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlTimeFieldModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlRadioButtonModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlFixedTextModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoFixedLineControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoFixedHyperlinkControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlFileControlModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlComboBoxModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoPatternFieldControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoDateFieldControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlNumericFieldModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoImageControlControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
beans::Pair< OUString, OUString > UnoListItem
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoListBoxControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoNumericFieldControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlPatternFieldModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoCurrencyFieldControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoComboBoxControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoFileControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlDateFieldModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlCheckBoxModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoEditControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoTimeFieldControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlFixedLineModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoProgressBarControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoFixedTextControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlGroupBoxModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_UnoControlFixedHyperlinkModel_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)