LibreOffice Module toolkit (master) 1
vclxwindows.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
22#include <com/sun/star/awt/LineEndFormat.hpp>
23#include <com/sun/star/awt/ScrollBarOrientation.hpp>
24#include <com/sun/star/graphic/GraphicProvider.hpp>
25#include <com/sun/star/graphic/XGraphicProvider.hpp>
27#include <helper/property.hxx>
29#include <com/sun/star/awt/VisualEffect.hpp>
30#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
31#include <com/sun/star/resource/XStringResourceResolver.hpp>
32#include <com/sun/star/awt/ImageScaleMode.hpp>
33#include <com/sun/star/awt/XItemList.hpp>
34#include <com/sun/star/awt/TextAlign.hpp>
37#include <sal/log.hxx>
38
39#include <awt/vclxwindows.hxx>
40#include <controls/filectrl.hxx>
41#include <controls/svmedit.hxx>
44#include <vcl/graph.hxx>
47#include <vcl/toolkit/field.hxx>
53#include <vcl/svapp.hxx>
54#include <vcl/tabpage.hxx>
55#include <vcl/tabctrl.hxx>
56#include <vcl/settings.hxx>
58#include <tools/debug.hxx>
59
60#include <helper/imagealign.hxx>
61#include <helper/msgbox.hxx>
62#include <helper/tkresmgr.hxx>
64#include <svl/numformat.hxx>
65
66using ::com::sun::star::uno::Any;
67using ::com::sun::star::uno::Reference;
68using ::com::sun::star::uno::RuntimeException;
69using ::com::sun::star::lang::EventObject;
70using ::com::sun::star::awt::ItemListEvent;
71using ::com::sun::star::awt::XItemList;
72using ::com::sun::star::graphic::XGraphic;
73using ::com::sun::star::graphic::XGraphicProvider;
74
75using namespace ::com::sun::star;
76using namespace ::com::sun::star::awt::VisualEffect;
77namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
78
79static double ImplCalcLongValue( double nValue, sal_uInt16 nDigits )
80{
81 double n = nValue;
82 for ( sal_uInt16 d = 0; d < nDigits; d++ )
83 n *= 10;
84 return n;
85}
86
87static double ImplCalcDoubleValue( double nValue, sal_uInt16 nDigits )
88{
89 double n = nValue;
90 for ( sal_uInt16 d = 0; d < nDigits; d++ )
91 n /= 10;
92 return n;
93}
94
95namespace toolkit
96{
99 void setButtonLikeFaceColor( vcl::Window* _pWindow, const css::uno::Any& _rColorValue )
100 {
101 AllSettings aSettings = _pWindow->GetSettings();
102 StyleSettings aStyleSettings = aSettings.GetStyleSettings();
103
104 if ( !_rColorValue.hasValue() )
105 {
107 aStyleSettings.SetFaceColor( aAppStyle.GetFaceColor( ) );
108 aStyleSettings.SetCheckedColor( aAppStyle.GetCheckedColor( ) );
109 aStyleSettings.SetLightBorderColor( aAppStyle.GetLightBorderColor() );
110 aStyleSettings.SetLightColor( aAppStyle.GetLightColor() );
111 aStyleSettings.SetShadowColor( aAppStyle.GetShadowColor() );
112 aStyleSettings.SetDarkShadowColor( aAppStyle.GetDarkShadowColor() );
113 }
114 else
115 {
116 Color nBackgroundColor;
117 _rColorValue >>= nBackgroundColor;
118 aStyleSettings.SetFaceColor( nBackgroundColor );
119
120 // for the real background (everything except the buttons and the thumb),
121 // use an average between the desired color and "white"
122 Color aWhite( COL_WHITE );
123 Color aCheckedBackground( nBackgroundColor );
124 aCheckedBackground.SetRed( ( aCheckedBackground.GetRed() + aWhite.GetRed() ) / 2 );
125 aCheckedBackground.SetGreen( ( aCheckedBackground.GetGreen() + aWhite.GetGreen() ) / 2 );
126 aCheckedBackground.SetBlue( ( aCheckedBackground.GetBlue() + aWhite.GetBlue() ) / 2 );
127 aStyleSettings.SetCheckedColor( aCheckedBackground );
128
129 sal_Int32 nBackgroundLuminance = nBackgroundColor.GetLuminance();
130 sal_Int32 nWhiteLuminance = COL_WHITE.GetLuminance();
131
132 Color aLightShadow( nBackgroundColor );
133 aLightShadow.IncreaseLuminance( static_cast<sal_uInt8>( ( nWhiteLuminance - nBackgroundLuminance ) * 2 / 3 ) );
134 aStyleSettings.SetLightBorderColor( aLightShadow );
135
136 Color aLight( nBackgroundColor );
137 aLight.IncreaseLuminance( static_cast<sal_uInt8>( ( nWhiteLuminance - nBackgroundLuminance ) * 1 / 3 ) );
138 aStyleSettings.SetLightColor( aLight );
139
140 Color aShadow( nBackgroundColor );
141 aShadow.DecreaseLuminance( static_cast<sal_uInt8>( nBackgroundLuminance * 1 / 3 ) );
142 aStyleSettings.SetShadowColor( aShadow );
143
144 Color aDarkShadow( nBackgroundColor );
145 aDarkShadow.DecreaseLuminance( static_cast<sal_uInt8>( nBackgroundLuminance * 2 / 3 ) );
146 aStyleSettings.SetDarkShadowColor( aDarkShadow );
147 }
148
149 aSettings.SetStyleSettings( aStyleSettings );
150 _pWindow->SetSettings( aSettings, true );
151 }
152
154 {
155 Color nBackgroundColor = _pWindow->GetSettings().GetStyleSettings().GetFaceColor();
156 return Any( sal_Int32(nBackgroundColor) );
157 }
158
159 static void adjustBooleanWindowStyle( const Any& _rValue, vcl::Window* _pWindow, WinBits _nBits, bool _bInverseSemantics )
160 {
161 WinBits nStyle = _pWindow->GetStyle();
162 bool bValue( false );
163 OSL_VERIFY( _rValue >>= bValue );
164 if ( bValue != _bInverseSemantics )
165 nStyle |= _nBits;
166 else
167 nStyle &= ~_nBits;
168 _pWindow->SetStyle( nStyle );
169 }
170
171 static void setVisualEffect( const Any& _rValue, vcl::Window* _pWindow )
172 {
173 AllSettings aSettings = _pWindow->GetSettings();
174 StyleSettings aStyleSettings = aSettings.GetStyleSettings();
175
176 sal_Int16 nStyle = LOOK3D;
177 OSL_VERIFY( _rValue >>= nStyle );
178 switch ( nStyle )
179 {
180 case FLAT:
181 aStyleSettings.SetOptions( aStyleSettings.GetOptions() | StyleSettingsOptions::Mono );
182 break;
183 case LOOK3D:
184 default:
185 aStyleSettings.SetOptions( aStyleSettings.GetOptions() & ~StyleSettingsOptions::Mono );
186 }
187 aSettings.SetStyleSettings( aStyleSettings );
188 _pWindow->SetSettings( aSettings );
189 }
190
191 static Any getVisualEffect( vcl::Window const * _pWindow )
192 {
193 Any aEffect;
194
195 StyleSettings aStyleSettings = _pWindow->GetSettings().GetStyleSettings();
196 if ( aStyleSettings.GetOptions() & StyleSettingsOptions::Mono )
197 aEffect <<= sal_Int16(FLAT);
198 else
199 aEffect <<= sal_Int16(LOOK3D);
200 return aEffect;
201 }
202}
203
204
205
206
207void VCLXGraphicControl::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
208{
210}
211
213{
214 OSL_PRECOND( GetWindow(), "VCLXGraphicControl::ImplSetNewImage: window is required to be not-NULL!" );
215 VclPtr< Button > pButton = GetAsDynamic< Button >();
216 pButton->SetModeImage( GetImage() );
217}
218
219void VCLXGraphicControl::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags )
220{
221 SolarMutexGuard aGuard;
222
223 if ( GetWindow() )
224 {
225 Size aOldSize = GetWindow()->GetSizePixel();
227 if ( ( aOldSize.Width() != Width ) || ( aOldSize.Height() != Height ) )
229 }
230}
231
232void VCLXGraphicControl::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
233{
234 SolarMutexGuard aGuard;
235
236 if ( !GetWindow() )
237 return;
238
239 sal_uInt16 nPropType = GetPropertyId( PropertyName );
240 switch ( nPropType )
241 {
243 {
244 Reference< XGraphic > xGraphic;
245 OSL_VERIFY( Value >>= xGraphic );
246 maImage = Image( xGraphic );
248 }
249 break;
250
252 {
254 if ( ( eType == WindowType::PUSHBUTTON )
255 || ( eType == WindowType::RADIOBUTTON )
256 || ( eType == WindowType::CHECKBOX )
257 )
258 {
259 sal_Int16 nAlignment = sal_Int16();
260 if ( Value >>= nAlignment )
261 GetAs< Button >()->SetImageAlign( static_cast< ImageAlign >( nAlignment ) );
262 }
263 }
264 break;
266 {
268 if ( ( eType == WindowType::PUSHBUTTON )
269 || ( eType == WindowType::RADIOBUTTON )
270 || ( eType == WindowType::CHECKBOX )
271 )
272 {
273 sal_Int16 nImagePosition = 2;
274 OSL_VERIFY( Value >>= nImagePosition );
275 GetAs<Button>()->SetImageAlign( ::toolkit::translateImagePosition( nImagePosition ) );
276 }
277 }
278 break;
279 default:
280 VCLXWindow::setProperty( PropertyName, Value );
281 break;
282 }
283}
284
285css::uno::Any VCLXGraphicControl::getProperty( const OUString& PropertyName )
286{
287 SolarMutexGuard aGuard;
288
289 css::uno::Any aProp;
290 if ( !GetWindow() )
291 return aProp;
292
293 sal_uInt16 nPropType = GetPropertyId( PropertyName );
294 switch ( nPropType )
295 {
297 aProp <<= Graphic(maImage.GetBitmapEx()).GetXGraphic();
298 break;
300 {
302 if ( ( eType == WindowType::PUSHBUTTON )
303 || ( eType == WindowType::RADIOBUTTON )
304 || ( eType == WindowType::CHECKBOX )
305 )
306 {
308 GetAs<Button>()->GetImageAlign() );
309 }
310 }
311 break;
313 {
315 if ( ( eType == WindowType::PUSHBUTTON )
316 || ( eType == WindowType::RADIOBUTTON )
317 || ( eType == WindowType::CHECKBOX )
318 )
319 {
321 GetAs< Button >()->GetImageAlign() );
322 }
323 }
324 break;
325 default:
326 {
327 aProp = VCLXWindow::getProperty( PropertyName );
328 }
329 break;
330 }
331 return aProp;
332}
333
334
335
336
337void VCLXButton::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
338{
339 PushPropertyIds( rIds,
367 0);
369}
370
372 :maActionListeners( *this )
373 ,maItemListeners( *this )
374{
375}
376
378{
379}
380
381css::uno::Reference< css::accessibility::XAccessibleContext > VCLXButton::CreateAccessibleContext()
382{
383 return getAccessibleFactory().createAccessibleContext( this );
384}
385
387{
388 SolarMutexGuard aGuard;
389
390 css::lang::EventObject aObj;
391 aObj.Source = static_cast<cppu::OWeakObject*>(this);
392 maActionListeners.disposeAndClear( aObj );
393 maItemListeners.disposeAndClear( aObj );
395}
396
397void VCLXButton::addActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
398{
399 SolarMutexGuard aGuard;
400 maActionListeners.addInterface( l );
401}
402
403void VCLXButton::removeActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
404{
405 SolarMutexGuard aGuard;
406 maActionListeners.removeInterface( l );
407}
408
409void VCLXButton::addItemListener( const css::uno::Reference< css::awt::XItemListener > & l )
410{
411 SolarMutexGuard aGuard;
412 maItemListeners.addInterface( l );
413}
414
415void VCLXButton::removeItemListener( const css::uno::Reference< css::awt::XItemListener > & l )
416{
417 SolarMutexGuard aGuard;
418 maItemListeners.removeInterface( l );
419}
420
421void VCLXButton::setLabel( const OUString& rLabel )
422{
423 SolarMutexGuard aGuard;
424
425 VclPtr<vcl::Window> pWindow = GetWindow();
426 if ( pWindow )
427 pWindow->SetText( rLabel );
428}
429
430void VCLXButton::setActionCommand( const OUString& rCommand )
431{
432 SolarMutexGuard aGuard;
433
434 maActionCommand = rCommand;
435}
436
438{
439 SolarMutexGuard aGuard;
440
441 Size aSz;
442 VclPtr< PushButton > pButton = GetAs< PushButton >();
443 if ( pButton )
444 aSz = pButton->CalcMinimumSize();
445 return AWTSize(aSz);
446}
447
449{
450 css::awt::Size aSz = getMinimumSize();
451 aSz.Width += 16;
452 aSz.Height += 10;
453 return aSz;
454}
455
456css::awt::Size VCLXButton::calcAdjustedSize( const css::awt::Size& rNewSize )
457{
458 SolarMutexGuard aGuard;
459
460 Size aSz = VCLSize(rNewSize);
461 VclPtr< PushButton > pButton = GetAs< PushButton >();
462 if ( pButton )
463 {
464 Size aMinSz = pButton->CalcMinimumSize();
465 // no text, thus image
466 if ( pButton->GetText().isEmpty() )
467 {
468 if ( aSz.Width() < aMinSz.Width() )
469 aSz.setWidth( aMinSz.Width() );
470 if ( aSz.Height() < aMinSz.Height() )
471 aSz.setHeight( aMinSz.Height() );
472 }
473 else
474 {
475 if ( ( aSz.Width() > aMinSz.Width() ) && ( aSz.Height() < aMinSz.Height() ) )
476 aSz.setHeight( aMinSz.Height() );
477 else
478 aSz = aMinSz;
479 }
480 }
481 return AWTSize(aSz);
482}
483
484void VCLXButton::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
485{
486 SolarMutexGuard aGuard;
487
488 VclPtr< Button > pButton = GetAs< Button >();
489 if ( !pButton )
490 return;
491
492 sal_uInt16 nPropType = GetPropertyId( PropertyName );
493 switch ( nPropType )
494 {
497 break;
498
501 break;
502
504 {
505 WinBits nStyle = pButton->GetStyle() | WB_DEFBUTTON;
506 bool b = bool();
507 if ( ( Value >>= b ) && !b )
508 nStyle &= ~WB_DEFBUTTON;
509 pButton->SetStyle( nStyle );
510 }
511 break;
513 {
514 if ( GetWindow()->GetType() == WindowType::PUSHBUTTON )
515 {
516 sal_Int16 n = sal_Int16();
517 if ( Value >>= n )
518 static_cast<PushButton*>(pButton.get())->SetState( static_cast<TriState>(n) );
519 }
520 }
521 break;
522 default:
523 {
524 VCLXGraphicControl::setProperty( PropertyName, Value );
525 }
526 }
527}
528
529css::uno::Any VCLXButton::getProperty( const OUString& PropertyName )
530{
531 SolarMutexGuard aGuard;
532
533 css::uno::Any aProp;
534 VclPtr< Button > pButton = GetAs< Button >();
535 if ( pButton )
536 {
537 sal_uInt16 nPropType = GetPropertyId( PropertyName );
538 switch ( nPropType )
539 {
541 aProp <<= ( ( pButton->GetStyle() & WB_NOPOINTERFOCUS ) == 0 );
542 break;
543
545 aProp <<= ( ( pButton->GetStyle() & WB_TOGGLE ) != 0 );
546 break;
547
549 {
550 aProp <<= ( pButton->GetStyle() & WB_DEFBUTTON ) != 0;
551 }
552 break;
554 {
555 if ( GetWindow()->GetType() == WindowType::PUSHBUTTON )
556 {
557 aProp <<= static_cast<sal_Int16>(static_cast<PushButton*>(pButton.get())->GetState());
558 }
559 }
560 break;
561 default:
562 {
563 aProp = VCLXGraphicControl::getProperty( PropertyName );
564 }
565 }
566 }
567 return aProp;
568}
569
570void VCLXButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
571{
572 switch ( rVclWindowEvent.GetId() )
573 {
574 case VclEventId::ButtonClick:
575 {
576 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
577 // since we call listeners below, there is a potential that we will be destroyed
578 // during the listener call. To prevent the resulting crashes, we keep us
579 // alive as long as we're here
580
581 if ( maActionListeners.getLength() )
582 {
583 css::awt::ActionEvent aEvent;
584 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
585 aEvent.ActionCommand = maActionCommand;
586
587 Callback aCallback = [ this, aEvent ]()
588 { this->maActionListeners.actionPerformed( aEvent ); };
589
590 ImplExecuteAsyncWithoutSolarLock( aCallback );
591 }
592 }
593 break;
594
595 case VclEventId::PushbuttonToggle:
596 {
597 PushButton& rButton = dynamic_cast< PushButton& >( *rVclWindowEvent.GetWindow() );
598
599 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
600 if ( maItemListeners.getLength() )
601 {
602 css::awt::ItemEvent aEvent;
603 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
604 aEvent.Selected = ( rButton.GetState() == TRISTATE_TRUE ) ? 1 : 0;
605 maItemListeners.itemStateChanged( aEvent );
606 }
607 }
608 break;
609
610 default:
612 break;
613 }
614}
615
616
617
618
619void VCLXImageControl::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
620{
621 PushPropertyIds( rIds,
638 0);
640}
641
643{
644}
645
647{
648}
649
651{
652 OSL_PRECOND( GetWindow(), "VCLXImageControl::ImplSetNewImage: window is required to be not-NULL!" );
653 VclPtr<ImageControl> pControl = GetAs< ImageControl >();
654 pControl->SetImage( GetImage() );
655}
656
658{
659 SolarMutexGuard aGuard;
660
661 Size aSz = GetImage().GetSizePixel();
662 aSz = ImplCalcWindowSize( aSz );
663
664 return AWTSize(aSz);
665}
666
668{
669 return getMinimumSize();
670}
671
672css::awt::Size VCLXImageControl::calcAdjustedSize( const css::awt::Size& rNewSize )
673{
674 SolarMutexGuard aGuard;
675
676 css::awt::Size aSz = rNewSize;
677 css::awt::Size aMinSz = getMinimumSize();
678 if ( aSz.Width < aMinSz.Width )
679 aSz.Width = aMinSz.Width;
680 if ( aSz.Height < aMinSz.Height )
681 aSz.Height = aMinSz.Height;
682 return aSz;
683}
684
685void VCLXImageControl::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
686{
687 SolarMutexGuard aGuard;
688
689 VclPtr< ImageControl > pImageControl = GetAs< ImageControl >();
690
691 sal_uInt16 nPropType = GetPropertyId( PropertyName );
692 switch ( nPropType )
693 {
695 {
696 sal_Int16 nScaleMode( ImageScaleMode::ANISOTROPIC );
697 if ( pImageControl && ( Value >>= nScaleMode ) )
698 {
699 pImageControl->SetScaleMode( nScaleMode );
700 }
701 }
702 break;
703
705 {
706 // this is for compatibility only, nowadays, the ImageScaleMode property should be used
707 bool bScaleImage = false;
708 if ( pImageControl && ( Value >>= bScaleImage ) )
709 {
710 pImageControl->SetScaleMode( bScaleImage ? ImageScaleMode::ANISOTROPIC : ImageScaleMode::NONE );
711 }
712 }
713 break;
714
715 default:
716 VCLXGraphicControl::setProperty( PropertyName, Value );
717 break;
718 }
719}
720
721css::uno::Any VCLXImageControl::getProperty( const OUString& PropertyName )
722{
723 SolarMutexGuard aGuard;
724
725 css::uno::Any aProp;
726 VclPtr< ImageControl > pImageControl = GetAs< ImageControl >();
727 sal_uInt16 nPropType = GetPropertyId( PropertyName );
728
729 switch ( nPropType )
730 {
732 aProp <<= ( pImageControl ? pImageControl->GetScaleMode() : ImageScaleMode::ANISOTROPIC );
733 break;
734
736 aProp <<= ( pImageControl && pImageControl->GetScaleMode() != ImageScaleMode::NONE );
737 break;
738
739 default:
740 aProp = VCLXGraphicControl::getProperty( PropertyName );
741 break;
742 }
743 return aProp;
744}
745
746
747
748
749void VCLXCheckBox::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
750{
751 PushPropertyIds( rIds,
774 0);
776}
777
778VCLXCheckBox::VCLXCheckBox() : maActionListeners( *this ), maItemListeners( *this )
779{
780}
781
782css::uno::Reference< css::accessibility::XAccessibleContext > VCLXCheckBox::CreateAccessibleContext()
783{
784 return getAccessibleFactory().createAccessibleContext( this );
785}
786
788{
789 SolarMutexGuard aGuard;
790
791 css::lang::EventObject aObj;
792 aObj.Source = static_cast<cppu::OWeakObject*>(this);
793 maItemListeners.disposeAndClear( aObj );
795}
796
797void VCLXCheckBox::addItemListener( const css::uno::Reference< css::awt::XItemListener > & l )
798{
799 SolarMutexGuard aGuard;
800 maItemListeners.addInterface( l );
801}
802
803void VCLXCheckBox::removeItemListener( const css::uno::Reference< css::awt::XItemListener > & l )
804{
805 SolarMutexGuard aGuard;
806 maItemListeners.removeInterface( l );
807}
808
809void VCLXCheckBox::addActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
810{
811 SolarMutexGuard aGuard;
812 maActionListeners.addInterface( l );
813}
814
815void VCLXCheckBox::removeActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
816{
817 SolarMutexGuard aGuard;
818 maActionListeners.removeInterface( l );
819}
820
821void VCLXCheckBox::setActionCommand( const OUString& rCommand )
822{
823 SolarMutexGuard aGuard;
824 maActionCommand = rCommand;
825}
826
827void VCLXCheckBox::setLabel( const OUString& rLabel )
828{
829 SolarMutexGuard aGuard;
830
831 VclPtr<vcl::Window> pWindow = GetWindow();
832 if ( pWindow )
833 pWindow->SetText( rLabel );
834}
835
836void VCLXCheckBox::setState( sal_Int16 n )
837{
838 SolarMutexGuard aGuard;
839
840 VclPtr< CheckBox> pCheckBox = GetAs< CheckBox >();
841 if ( !pCheckBox)
842 return;
843
844 TriState eState;
845 switch ( n )
846 {
847 case 0: eState = TRISTATE_FALSE; break;
848 case 1: eState = TRISTATE_TRUE; break;
849 case 2: eState = TRISTATE_INDET; break;
850 default: eState = TRISTATE_FALSE;
851 }
852 pCheckBox->SetState( eState );
853
854 // #105198# call C++ click listeners (needed for accessibility)
855 // pCheckBox->GetClickHdl().Call( pCheckBox );
856
857 // #107218# Call same virtual methods and listeners like VCL would do after user interaction
858 SetSynthesizingVCLEvent( true );
859 pCheckBox->Toggle();
860 pCheckBox->Click();
861 SetSynthesizingVCLEvent( false );
862}
863
865{
866 SolarMutexGuard aGuard;
867
868 sal_Int16 nState = -1;
869 VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >();
870 if ( pCheckBox )
871 {
872 switch ( pCheckBox->GetState() )
873 {
874 case TRISTATE_FALSE: nState = 0; break;
875 case TRISTATE_TRUE: nState = 1; break;
876 case TRISTATE_INDET: nState = 2; break;
877 default: OSL_FAIL( "VCLXCheckBox::getState(): unknown TriState!" );
878 }
879 }
880
881 return nState;
882}
883
885{
886 SolarMutexGuard aGuard;
887
888 VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >();
889 if ( pCheckBox)
890 pCheckBox->EnableTriState( b );
891}
892
894{
895 SolarMutexGuard aGuard;
896
897 Size aSz;
898 VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >();
899 if ( pCheckBox )
900 aSz = pCheckBox->CalcMinimumSize();
901 return AWTSize(aSz);
902}
903
905{
906 return getMinimumSize();
907}
908
909css::awt::Size VCLXCheckBox::calcAdjustedSize( const css::awt::Size& rNewSize )
910{
911 SolarMutexGuard aGuard;
912
913 Size aSz = VCLSize(rNewSize);
914 VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >();
915 if ( pCheckBox )
916 {
917 Size aMinSz = pCheckBox->CalcMinimumSize(rNewSize.Width);
918 if ( ( aSz.Width() > aMinSz.Width() ) && ( aSz.Height() < aMinSz.Height() ) )
919 aSz.setHeight( aMinSz.Height() );
920 else
921 aSz = aMinSz;
922 }
923 return AWTSize(aSz);
924}
925
926void VCLXCheckBox::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
927{
928 SolarMutexGuard aGuard;
929
930 VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >();
931 if ( !pCheckBox )
932 return;
933
934 sal_uInt16 nPropType = GetPropertyId( PropertyName );
935 switch ( nPropType )
936 {
938 ::toolkit::setVisualEffect( Value, pCheckBox );
939 break;
940
942 {
943 bool b = bool();
944 if ( Value >>= b )
945 pCheckBox->EnableTriState( b );
946 }
947 break;
949 {
950 sal_Int16 n = sal_Int16();
951 if ( Value >>= n )
952 setState( n );
953 }
954 break;
955 default:
956 {
957 VCLXGraphicControl::setProperty( PropertyName, Value );
958 }
959 }
960}
961
962css::uno::Any VCLXCheckBox::getProperty( const OUString& PropertyName )
963{
964 SolarMutexGuard aGuard;
965
966 css::uno::Any aProp;
967 VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >();
968 if ( pCheckBox )
969 {
970 sal_uInt16 nPropType = GetPropertyId( PropertyName );
971 switch ( nPropType )
972 {
974 aProp = ::toolkit::getVisualEffect( pCheckBox );
975 break;
977 aProp <<= pCheckBox->IsTriStateEnabled();
978 break;
980 aProp <<= static_cast<sal_Int16>(pCheckBox->GetState());
981 break;
982 default:
983 {
984 aProp = VCLXGraphicControl::getProperty( PropertyName );
985 }
986 }
987 }
988 return aProp;
989}
990
992{
993 switch ( rVclWindowEvent.GetId() )
994 {
995 case VclEventId::CheckboxToggle:
996 {
997 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
998 // since we call listeners below, there is a potential that we will be destroyed
999 // in during the listener call. To prevent the resulting crashes, we keep us
1000 // alive as long as we're here
1001
1002 VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >();
1003 if ( pCheckBox )
1004 {
1005 if ( maItemListeners.getLength() )
1006 {
1007 css::awt::ItemEvent aEvent;
1008 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
1009 aEvent.Highlighted = 0;
1010 aEvent.Selected = pCheckBox->GetState();
1011 maItemListeners.itemStateChanged( aEvent );
1012 }
1013 if ( !IsSynthesizingVCLEvent() && maActionListeners.getLength() )
1014 {
1015 css::awt::ActionEvent aEvent;
1016 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
1017 aEvent.ActionCommand = maActionCommand;
1018 maActionListeners.actionPerformed( aEvent );
1019 }
1020 }
1021 }
1022 break;
1023
1024 default:
1025 VCLXGraphicControl::ProcessWindowEvent( rVclWindowEvent );
1026 break;
1027 }
1028}
1029
1030
1031
1032void VCLXRadioButton::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
1033{
1034 PushPropertyIds( rIds,
1057 0);
1059}
1060
1061
1062VCLXRadioButton::VCLXRadioButton() : maItemListeners( *this ), maActionListeners( *this )
1063{
1064}
1065
1066css::uno::Reference< css::accessibility::XAccessibleContext > VCLXRadioButton::CreateAccessibleContext()
1067{
1068 return getAccessibleFactory().createAccessibleContext( this );
1069}
1070
1072{
1073 SolarMutexGuard aGuard;
1074
1075 css::lang::EventObject aObj;
1076 aObj.Source = static_cast<cppu::OWeakObject*>(this);
1077 maItemListeners.disposeAndClear( aObj );
1079}
1080
1081void VCLXRadioButton::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
1082{
1083 SolarMutexGuard aGuard;
1084
1085 VclPtr< RadioButton > pButton = GetAs< RadioButton >();
1086 if ( !pButton )
1087 return;
1088
1089 sal_uInt16 nPropType = GetPropertyId( PropertyName );
1090 switch ( nPropType )
1091 {
1094 break;
1095
1096 case BASEPROPERTY_STATE:
1097 {
1098 sal_Int16 n = sal_Int16();
1099 if ( Value >>= n )
1100 {
1101 bool b = n != 0;
1102 if ( pButton->IsRadioCheckEnabled() )
1103 pButton->Check( b );
1104 else
1105 pButton->SetState( b );
1106 }
1107 }
1108 break;
1110 {
1111 bool b = bool();
1112 if ( Value >>= b )
1113 pButton->EnableRadioCheck( b );
1114 }
1115 break;
1116 default:
1117 {
1118 VCLXGraphicControl::setProperty( PropertyName, Value );
1119 }
1120 }
1121}
1122
1123css::uno::Any VCLXRadioButton::getProperty( const OUString& PropertyName )
1124{
1125 SolarMutexGuard aGuard;
1126
1127 css::uno::Any aProp;
1128 VclPtr< RadioButton > pButton = GetAs< RadioButton >();
1129 if ( pButton )
1130 {
1131 sal_uInt16 nPropType = GetPropertyId( PropertyName );
1132 switch ( nPropType )
1133 {
1135 aProp = ::toolkit::getVisualEffect( pButton );
1136 break;
1137 case BASEPROPERTY_STATE:
1138 aProp <<= static_cast<sal_Int16>( pButton->IsChecked() ? 1 : 0 );
1139 break;
1141 aProp <<= pButton->IsRadioCheckEnabled();
1142 break;
1143 default:
1144 {
1145 aProp = VCLXGraphicControl::getProperty( PropertyName );
1146 }
1147 }
1148 }
1149 return aProp;
1150}
1151
1152void VCLXRadioButton::addItemListener( const css::uno::Reference< css::awt::XItemListener > & l )
1153{
1154 SolarMutexGuard aGuard;
1155 maItemListeners.addInterface( l );
1156}
1157
1158void VCLXRadioButton::removeItemListener( const css::uno::Reference< css::awt::XItemListener > & l )
1159{
1160 SolarMutexGuard aGuard;
1161 maItemListeners.removeInterface( l );
1162}
1163
1164void VCLXRadioButton::addActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
1165{
1166 SolarMutexGuard aGuard;
1167 maActionListeners.addInterface( l );
1168}
1169
1170void VCLXRadioButton::removeActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
1171{
1172 SolarMutexGuard aGuard;
1173 maActionListeners.removeInterface( l );
1174}
1175
1176void VCLXRadioButton::setLabel( const OUString& rLabel )
1177{
1178 SolarMutexGuard aGuard;
1179
1180 VclPtr<vcl::Window> pWindow = GetWindow();
1181 if ( pWindow )
1182 pWindow->SetText( rLabel );
1183}
1184
1185void VCLXRadioButton::setActionCommand( const OUString& rCommand )
1186{
1187 SolarMutexGuard aGuard;
1188 maActionCommand = rCommand;
1189}
1190
1192{
1193 SolarMutexGuard aGuard;
1194
1195 VclPtr< RadioButton > pRadioButton = GetAs< RadioButton >();
1196 if ( pRadioButton)
1197 {
1198 pRadioButton->Check( b );
1199 // #102717# item listeners are called, but not C++ click listeners in StarOffice code => call click hdl
1200 // But this is needed in old code because Accessibility API uses it.
1201 // pRadioButton->GetClickHdl().Call( pRadioButton );
1202
1203 // #107218# Call same virtual methods and listeners like VCL would do after user interaction
1204 SetSynthesizingVCLEvent( true );
1205 pRadioButton->Click();
1206 SetSynthesizingVCLEvent( false );
1207 }
1208}
1209
1211{
1212 SolarMutexGuard aGuard;
1213
1214 VclPtr< RadioButton > pRadioButton = GetAs< RadioButton >();
1215 return pRadioButton && pRadioButton->IsChecked();
1216}
1217
1219{
1220 SolarMutexGuard aGuard;
1221
1222 Size aSz;
1223 VclPtr< RadioButton > pRadioButton = GetAs< RadioButton >();
1224 if ( pRadioButton )
1225 aSz = pRadioButton->CalcMinimumSize();
1226 return AWTSize(aSz);
1227}
1228
1230{
1231 return getMinimumSize();
1232}
1233
1234css::awt::Size VCLXRadioButton::calcAdjustedSize( const css::awt::Size& rNewSize )
1235{
1236 SolarMutexGuard aGuard;
1237
1238 Size aSz = VCLSize(rNewSize);
1239 VclPtr< RadioButton > pRadioButton = GetAs< RadioButton >();
1240 if ( pRadioButton )
1241 {
1242 Size aMinSz = pRadioButton->CalcMinimumSize(rNewSize.Width);
1243 if ( ( aSz.Width() > aMinSz.Width() ) && ( aSz.Height() < aMinSz.Height() ) )
1244 aSz.setHeight( aMinSz.Height() );
1245 else
1246 aSz = aMinSz;
1247 }
1248 return AWTSize(aSz);
1249}
1250
1252{
1253 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
1254 // since we call listeners below, there is a potential that we will be destroyed
1255 // in during the listener call. To prevent the resulting crashes, we keep us
1256 // alive as long as we're here
1257
1258 switch ( rVclWindowEvent.GetId() )
1259 {
1260 case VclEventId::ButtonClick:
1261 if ( !IsSynthesizingVCLEvent() && maActionListeners.getLength() )
1262 {
1263 css::awt::ActionEvent aEvent;
1264 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
1265 aEvent.ActionCommand = maActionCommand;
1266 maActionListeners.actionPerformed( aEvent );
1267 }
1268 ImplClickedOrToggled( false );
1269 break;
1270
1271 case VclEventId::RadiobuttonToggle:
1272 ImplClickedOrToggled( true );
1273 break;
1274
1275 default:
1276 VCLXGraphicControl::ProcessWindowEvent( rVclWindowEvent );
1277 break;
1278 }
1279}
1280
1282{
1283 // In the forms, RadioChecked is not enabled, call itemStateChanged only for click
1284 // In the dialog editor, RadioChecked is enabled, call itemStateChanged only for bToggled
1285 VclPtr< RadioButton > pRadioButton = GetAs< RadioButton >();
1286 if ( pRadioButton && ( pRadioButton->IsRadioCheckEnabled() == bToggled ) && ( bToggled || pRadioButton->IsStateChanged() ) && maItemListeners.getLength() )
1287 {
1288 css::awt::ItemEvent aEvent;
1289 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
1290 aEvent.Highlighted = 0;
1291 aEvent.Selected = pRadioButton->IsChecked() ? 1 : 0;
1292 maItemListeners.itemStateChanged( aEvent );
1293 }
1294}
1295
1296
1297
1298void VCLXSpinField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
1299{
1300 PushPropertyIds( rIds,
1302 0 );
1304}
1305
1306VCLXSpinField::VCLXSpinField() : maSpinListeners( *this )
1307{
1308}
1309
1310void VCLXSpinField::addSpinListener( const css::uno::Reference< css::awt::XSpinListener > & l )
1311{
1312 SolarMutexGuard aGuard;
1313 maSpinListeners.addInterface( l );
1314}
1315
1316void VCLXSpinField::removeSpinListener( const css::uno::Reference< css::awt::XSpinListener > & l )
1317{
1318 SolarMutexGuard aGuard;
1319 maSpinListeners.removeInterface( l );
1320}
1321
1323{
1324 SolarMutexGuard aGuard;
1325
1326 VclPtr< SpinField > pSpinField = GetAs< SpinField >();
1327 if ( pSpinField )
1328 pSpinField->Up();
1329}
1330
1332{
1333 SolarMutexGuard aGuard;
1334
1335 VclPtr< SpinField > pSpinField = GetAs< SpinField >();
1336 if ( pSpinField )
1337 pSpinField->Down();
1338}
1339
1341{
1342 SolarMutexGuard aGuard;
1343
1344 VclPtr< SpinField > pSpinField = GetAs< SpinField >();
1345 if ( pSpinField )
1346 pSpinField->First();
1347}
1348
1350{
1351 SolarMutexGuard aGuard;
1352
1353 VclPtr< SpinField > pSpinField = GetAs< SpinField >();
1354 if ( pSpinField )
1355 pSpinField->Last();
1356}
1357
1359{
1360 SolarMutexGuard aGuard;
1361
1362 VclPtr<vcl::Window> pWindow = GetWindow();
1363 if ( pWindow )
1364 {
1365 WinBits nStyle = pWindow->GetStyle();
1366 if ( bRepeat )
1367 nStyle |= WB_REPEAT;
1368 else
1369 nStyle &= ~WB_REPEAT;
1370 pWindow->SetStyle( nStyle );
1371 }
1372}
1373
1375{
1376 switch ( rVclWindowEvent.GetId() )
1377 {
1378 case VclEventId::SpinfieldUp:
1379 case VclEventId::SpinfieldDown:
1380 case VclEventId::SpinfieldFirst:
1381 case VclEventId::SpinfieldLast:
1382 {
1383 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
1384 // since we call listeners below, there is a potential that we will be destroyed
1385 // in during the listener call. To prevent the resulting crashes, we keep us
1386 // alive as long as we're here
1387
1388 if ( maSpinListeners.getLength() )
1389 {
1390 css::awt::SpinEvent aEvent;
1391 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
1392 switch ( rVclWindowEvent.GetId() )
1393 {
1394 case VclEventId::SpinfieldUp: maSpinListeners.up( aEvent );
1395 break;
1396 case VclEventId::SpinfieldDown: maSpinListeners.down( aEvent );
1397 break;
1398 case VclEventId::SpinfieldFirst: maSpinListeners.first( aEvent );
1399 break;
1400 case VclEventId::SpinfieldLast: maSpinListeners.last( aEvent );
1401 break;
1402 default: break;
1403 }
1404
1405 }
1406 }
1407 break;
1408
1409 default:
1410 VCLXEdit::ProcessWindowEvent( rVclWindowEvent );
1411 break;
1412 }
1413}
1414
1415
1416
1417void VCLXListBox::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
1418{
1419 PushPropertyIds( rIds,
1447 0);
1449}
1450
1451
1453 : maActionListeners( *this ),
1454 maItemListeners( *this )
1455{
1456}
1457
1459{
1460 SolarMutexGuard aGuard;
1461
1462 css::lang::EventObject aObj;
1463 aObj.Source = static_cast<cppu::OWeakObject*>(this);
1464 maItemListeners.disposeAndClear( aObj );
1465 maActionListeners.disposeAndClear( aObj );
1467}
1468
1469void VCLXListBox::addItemListener( const css::uno::Reference< css::awt::XItemListener > & l )
1470{
1471 SolarMutexGuard aGuard;
1472 maItemListeners.addInterface( l );
1473}
1474
1475void VCLXListBox::removeItemListener( const css::uno::Reference< css::awt::XItemListener > & l )
1476{
1477 SolarMutexGuard aGuard;
1478 maItemListeners.removeInterface( l );
1479}
1480
1481void VCLXListBox::addActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
1482{
1483 SolarMutexGuard aGuard;
1484 maActionListeners.addInterface( l );
1485}
1486
1487void VCLXListBox::removeActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
1488{
1489 SolarMutexGuard aGuard;
1490 maActionListeners.removeInterface( l );
1491}
1492
1493void VCLXListBox::addItem( const OUString& aItem, sal_Int16 nPos )
1494{
1495 SolarMutexGuard aGuard;
1496 VclPtr< ListBox > pBox = GetAs< ListBox >();
1497 if ( pBox )
1498 pBox->InsertEntry( aItem, nPos );
1499}
1500
1501void VCLXListBox::addItems( const css::uno::Sequence< OUString>& aItems, sal_Int16 nPos )
1502{
1503 SolarMutexGuard aGuard;
1504 VclPtr< ListBox > pBox = GetAs< ListBox >();
1505 if ( !pBox )
1506 return;
1507
1508 sal_uInt16 nP = nPos;
1509 for ( auto const & item : aItems )
1510 {
1511 if ( nP == 0xFFFF )
1512 {
1513 OSL_FAIL( "VCLXListBox::addItems: too many entries!" );
1514 // skip remaining entries, list cannot hold them, anyway
1515 break;
1516 }
1517
1518 pBox->InsertEntry( item, nP++ );
1519 }
1520}
1521
1522void VCLXListBox::removeItems( sal_Int16 nPos, sal_Int16 nCount )
1523{
1524 SolarMutexGuard aGuard;
1525 VclPtr< ListBox > pBox = GetAs< ListBox >();
1526 if ( pBox )
1527 {
1528 for ( sal_Int16 n = nCount; n; )
1529 pBox->RemoveEntry( nPos + (--n) );
1530 }
1531}
1532
1534{
1535 SolarMutexGuard aGuard;
1536
1537 VclPtr< ListBox > pBox = GetAs< ListBox >();
1538 return pBox ? pBox->GetEntryCount() : 0;
1539}
1540
1541OUString VCLXListBox::getItem( sal_Int16 nPos )
1542{
1543 SolarMutexGuard aGuard;
1544
1545 OUString aItem;
1546 VclPtr< ListBox > pBox = GetAs< ListBox >();
1547 if ( pBox )
1548 aItem = pBox->GetEntry( nPos );
1549 return aItem;
1550}
1551
1552css::uno::Sequence< OUString> VCLXListBox::getItems()
1553{
1554 SolarMutexGuard aGuard;
1555
1556 css::uno::Sequence< OUString> aSeq;
1557 VclPtr< ListBox > pBox = GetAs< ListBox >();
1558 if ( pBox )
1559 {
1560 auto n = pBox->GetEntryCount();
1561 aSeq = css::uno::Sequence< OUString>( n );
1562 while (n)
1563 {
1564 --n;
1565 aSeq.getArray()[n] = pBox->GetEntry( n );
1566 }
1567 }
1568 return aSeq;
1569}
1570
1572{
1573 SolarMutexGuard aGuard;
1574 VclPtr< ListBox > pBox = GetAs< ListBox >();
1575 return pBox ? pBox->GetSelectedEntryPos() : 0;
1576}
1577
1578css::uno::Sequence<sal_Int16> VCLXListBox::getSelectedItemsPos()
1579{
1580 SolarMutexGuard aGuard;
1581
1582 css::uno::Sequence<sal_Int16> aSeq;
1583 VclPtr< ListBox > pBox = GetAs< ListBox >();
1584 if ( pBox )
1585 {
1586 const sal_Int32 nSelEntries = pBox->GetSelectedEntryCount();
1587 aSeq = css::uno::Sequence<sal_Int16>( nSelEntries );
1588 for ( sal_Int32 n = 0; n < nSelEntries; ++n )
1589 aSeq.getArray()[n] = pBox->GetSelectedEntryPos( n );
1590 }
1591 return aSeq;
1592}
1593
1595{
1596 SolarMutexGuard aGuard;
1597
1598 OUString aItem;
1599 VclPtr< ListBox > pBox = GetAs< ListBox >();
1600 if ( pBox )
1601 aItem = pBox->GetSelectedEntry();
1602 return aItem;
1603}
1604
1605css::uno::Sequence< OUString> VCLXListBox::getSelectedItems()
1606{
1607 SolarMutexGuard aGuard;
1608
1609 css::uno::Sequence< OUString> aSeq;
1610 VclPtr< ListBox > pBox = GetAs< ListBox >();
1611 if ( pBox )
1612 {
1613 const sal_Int32 nSelEntries = pBox->GetSelectedEntryCount();
1614 aSeq = css::uno::Sequence< OUString>( nSelEntries );
1615 for ( sal_Int32 n = 0; n < nSelEntries; ++n )
1616 aSeq.getArray()[n] = pBox->GetSelectedEntry( n );
1617 }
1618 return aSeq;
1619}
1620
1621void VCLXListBox::selectItemPos( sal_Int16 nPos, sal_Bool bSelect )
1622{
1623 SolarMutexGuard aGuard;
1624
1625 VclPtr< ListBox > pBox = GetAs< ListBox >();
1626 if ( pBox && ( pBox->IsEntryPosSelected( nPos ) != bool(bSelect) ) )
1627 {
1628 pBox->SelectEntryPos( nPos, bSelect );
1629
1630 // VCL doesn't call select handler after API call.
1631 // ImplCallItemListeners();
1632
1633 // #107218# Call same listeners like VCL would do after user interaction
1634 SetSynthesizingVCLEvent( true );
1635 pBox->Select();
1636 SetSynthesizingVCLEvent( false );
1637 }
1638}
1639
1640void VCLXListBox::selectItemsPos( const css::uno::Sequence<sal_Int16>& aPositions, sal_Bool bSelect )
1641{
1642 SolarMutexGuard aGuard;
1643
1644 VclPtr< ListBox > pBox = GetAs< ListBox >();
1645 if ( !pBox )
1646 return;
1647
1648 std::vector<sal_Int32> aPositionVec;
1649 aPositionVec.reserve(aPositions.getLength());
1650
1651 bool bChanged = false;
1652 for ( auto n = aPositions.getLength(); n; )
1653 {
1654 const auto nPos = aPositions.getConstArray()[--n];
1655 if ( pBox->IsEntryPosSelected( nPos ) != bool(bSelect) )
1656 {
1657 aPositionVec.push_back(nPos);
1658 bChanged = true;
1659 }
1660 }
1661
1662 if ( !bChanged )
1663 return;
1664
1665 bool bOrigUpdateMode = pBox->IsUpdateMode();
1666 pBox->SetUpdateMode(false);
1667
1668 pBox->SelectEntriesPos(aPositionVec, bSelect);
1669
1670 pBox->SetUpdateMode(bOrigUpdateMode);
1671
1672 // VCL doesn't call select handler after API call.
1673 // ImplCallItemListeners();
1674
1675 // #107218# Call same listeners like VCL would do after user interaction
1676 SetSynthesizingVCLEvent( true );
1677 pBox->Select();
1678 SetSynthesizingVCLEvent( false );
1679}
1680
1681void VCLXListBox::selectItem( const OUString& rItemText, sal_Bool bSelect )
1682{
1683 SolarMutexGuard aGuard;
1684
1685 VclPtr< ListBox > pBox = GetAs< ListBox >();
1686 if ( pBox )
1687 {
1688 selectItemPos( pBox->GetEntryPos( rItemText ), bSelect );
1689 }
1690}
1691
1693{
1694 SolarMutexGuard aGuard;
1695 VclPtr< ListBox > pBox = GetAs< ListBox >();
1696 if ( pBox )
1697 pBox->SetDropDownLineCount( nLines );
1698}
1699
1701{
1702 SolarMutexGuard aGuard;
1703
1704 sal_Int16 nLines = 0;
1705 VclPtr< ListBox > pBox = GetAs< ListBox >();
1706 if ( pBox )
1707 nLines = pBox->GetDropDownLineCount();
1708 return nLines;
1709}
1710
1712{
1713 SolarMutexGuard aGuard;
1714 bool bMulti = false;
1715 VclPtr< ListBox > pBox = GetAs< ListBox >();
1716 if ( pBox )
1717 bMulti = pBox->IsMultiSelectionEnabled();
1718 return bMulti;
1719}
1720
1722{
1723 SolarMutexGuard aGuard;
1724 VclPtr< ListBox > pBox = GetAs< ListBox >();
1725 if ( pBox )
1726 pBox->EnableMultiSelection( bMulti );
1727}
1728
1729void VCLXListBox::makeVisible( sal_Int16 nEntry )
1730{
1731 SolarMutexGuard aGuard;
1732 VclPtr< ListBox > pBox = GetAs< ListBox >();
1733 if ( pBox )
1734 pBox->SetTopEntry( nEntry );
1735}
1736
1738{
1739 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
1740 // since we call listeners below, there is a potential that we will be destroyed
1741 // in during the listener call. To prevent the resulting crashes, we keep us
1742 // alive as long as we're here
1743
1744 switch ( rVclWindowEvent.GetId() )
1745 {
1746 case VclEventId::ListboxSelect:
1747 {
1748 VclPtr< ListBox > pListBox = GetAs< ListBox >();
1749 if( pListBox )
1750 {
1751 bool bDropDown = ( pListBox->GetStyle() & WB_DROPDOWN ) != 0;
1752 if ( bDropDown && !IsSynthesizingVCLEvent() && maActionListeners.getLength() )
1753 {
1754 // Call ActionListener on DropDown event
1755 css::awt::ActionEvent aEvent;
1756 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
1757 aEvent.ActionCommand = pListBox->GetSelectedEntry();
1758 maActionListeners.actionPerformed( aEvent );
1759 }
1760
1761 if ( maItemListeners.getLength() )
1762 {
1764 }
1765 }
1766 }
1767 break;
1768
1769 case VclEventId::ListboxDoubleClick:
1770 if ( GetWindow() && maActionListeners.getLength() )
1771 {
1772 css::awt::ActionEvent aEvent;
1773 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
1774 aEvent.ActionCommand = GetAs<ListBox>()->GetSelectedEntry();
1775 maActionListeners.actionPerformed( aEvent );
1776 }
1777 break;
1778
1779 default:
1780 VCLXWindow::ProcessWindowEvent( rVclWindowEvent );
1781 break;
1782 }
1783}
1784
1785css::uno::Reference< css::accessibility::XAccessibleContext > VCLXListBox::CreateAccessibleContext()
1786{
1787 SolarMutexGuard aGuard;
1788
1789 return getAccessibleFactory().createAccessibleContext( this );
1790}
1791
1792void VCLXListBox::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
1793{
1794 SolarMutexGuard aGuard;
1795 VclPtr< ListBox > pListBox = GetAs< ListBox >();
1796 if ( !pListBox )
1797 return;
1798
1799 sal_uInt16 nPropType = GetPropertyId( PropertyName );
1800 switch ( nPropType )
1801 {
1803 {
1804 sal_Int16 nSeparatorPos(0);
1805 if ( Value >>= nSeparatorPos )
1806 pListBox->SetSeparatorPos( nSeparatorPos );
1807 }
1808 break;
1810 {
1811 bool b = false;
1812 if ( Value >>= b )
1813 pListBox->SetReadOnly( b);
1814 }
1815 break;
1817 {
1818 bool b = false;
1819 if ( Value >>= b )
1820 pListBox->EnableMultiSelection( b );
1821 }
1822 break;
1825 break;
1827 {
1828 sal_Int16 n = 0;
1829 if ( Value >>= n )
1830 pListBox->SetDropDownLineCount( n );
1831 }
1832 break;
1834 {
1835 css::uno::Sequence< OUString> aItems;
1836 if ( Value >>= aItems )
1837 {
1838 pListBox->Clear();
1839 addItems( aItems, 0 );
1840 }
1841 }
1842 break;
1844 {
1845 css::uno::Sequence<sal_Int16> aItems;
1846 if ( Value >>= aItems )
1847 {
1848 for ( auto n = pListBox->GetEntryCount(); n; )
1849 pListBox->SelectEntryPos( --n, false );
1850
1851 if ( aItems.hasElements() )
1852 selectItemsPos( aItems, true );
1853 else
1854 pListBox->SetNoSelection();
1855
1856 if ( !pListBox->GetSelectedEntryCount() )
1857 pListBox->SetTopEntry( 0 );
1858 }
1859 }
1860 break;
1862 {
1863 Color nColor = 0;
1864 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
1865 if (bVoid)
1866 {
1868 }
1869 else
1870 {
1871 if (!(Value >>= nColor))
1872 break;
1873 }
1874 pListBox->SetHighlightColor(nColor);
1875 }
1876 break;
1878 {
1879 Color nColor = 0;
1880 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
1881 if (bVoid)
1882 {
1884 }
1885 else
1886 {
1887 if (!(Value >>= nColor))
1888 break;
1889 }
1890 pListBox->SetHighlightTextColor(nColor);
1891 }
1892 break;
1893 default:
1894 {
1895 VCLXWindow::setProperty( PropertyName, Value );
1896 }
1897 }
1898}
1899
1900css::uno::Any VCLXListBox::getProperty( const OUString& PropertyName )
1901{
1902 SolarMutexGuard aGuard;
1903 css::uno::Any aProp;
1904 VclPtr< ListBox > pListBox = GetAs< ListBox >();
1905 if ( pListBox )
1906 {
1907 sal_uInt16 nPropType = GetPropertyId( PropertyName );
1908 switch ( nPropType )
1909 {
1911 aProp <<= sal_Int16( pListBox->GetSeparatorPos() );
1912 break;
1914 {
1915 aProp <<= pListBox->IsReadOnly();
1916 }
1917 break;
1919 {
1920 aProp <<= pListBox->IsMultiSelectionEnabled();
1921 }
1922 break;
1924 {
1925 aProp <<= ( ( pListBox->GetStyle() & WB_SIMPLEMODE ) == 0 );
1926 }
1927 break;
1929 {
1930 aProp <<= static_cast<sal_Int16>(pListBox->GetDropDownLineCount());
1931 }
1932 break;
1934 {
1935 const sal_Int32 nItems = pListBox->GetEntryCount();
1936 css::uno::Sequence< OUString> aSeq( nItems );
1937 OUString* pStrings = aSeq.getArray();
1938 for ( sal_Int32 n = 0; n < nItems; ++n )
1939 pStrings[n] = pListBox->GetEntry( n );
1940 aProp <<= aSeq;
1941
1942 }
1943 break;
1944 default:
1945 {
1946 aProp = VCLXWindow::getProperty( PropertyName );
1947 }
1948 }
1949 }
1950 return aProp;
1951}
1952
1954{
1955 SolarMutexGuard aGuard;
1956 Size aSz;
1957 VclPtr< ListBox > pListBox = GetAs< ListBox >();
1958 if ( pListBox )
1959 aSz = pListBox->CalcMinimumSize();
1960 return AWTSize(aSz);
1961}
1962
1964{
1965 SolarMutexGuard aGuard;
1966 Size aSz;
1967 VclPtr< ListBox > pListBox = GetAs< ListBox >();
1968 if ( pListBox )
1969 {
1970 aSz = pListBox->CalcMinimumSize();
1971 if ( pListBox->GetStyle() & WB_DROPDOWN )
1972 aSz.AdjustHeight(4 );
1973 }
1974 return AWTSize(aSz);
1975}
1976
1977css::awt::Size VCLXListBox::calcAdjustedSize( const css::awt::Size& rNewSize )
1978{
1979 SolarMutexGuard aGuard;
1980 Size aSz = VCLSize(rNewSize);
1981 VclPtr< ListBox > pListBox = GetAs< ListBox >();
1982 if ( pListBox )
1983 aSz = pListBox->CalcAdjustedSize( aSz );
1984 return AWTSize(aSz);
1985}
1986
1987css::awt::Size VCLXListBox::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines )
1988{
1989 SolarMutexGuard aGuard;
1990 Size aSz;
1991 VclPtr< ListBox > pListBox = GetAs< ListBox >();
1992 if ( pListBox )
1993 aSz = pListBox->CalcBlockSize( nCols, nLines );
1994 return AWTSize(aSz);
1995}
1996
1997void VCLXListBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines )
1998{
1999 SolarMutexGuard aGuard;
2000 nCols = nLines = 0;
2001 VclPtr< ListBox > pListBox = GetAs< ListBox >();
2002 if ( pListBox )
2003 {
2004 sal_uInt16 nC, nL;
2005 pListBox->GetMaxVisColumnsAndLines( nC, nL );
2006 nCols = nC;
2007 nLines = nL;
2008 }
2009}
2010
2012{
2013 VclPtr< ListBox > pListBox = GetAs< ListBox >();
2014 if ( pListBox && maItemListeners.getLength() )
2015 {
2016 css::awt::ItemEvent aEvent;
2017 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
2018 aEvent.Highlighted = 0;
2019
2020 // Set to 0xFFFF on multiple selection, selected entry ID otherwise
2021 aEvent.Selected = (pListBox->GetSelectedEntryCount() == 1 ) ? pListBox->GetSelectedEntryPos() : 0xFFFF;
2022
2023 maItemListeners.itemStateChanged( aEvent );
2024 }
2025}
2026namespace
2027{
2028 Image lcl_getImageFromURL( const OUString& i_rImageURL )
2029 {
2030 if ( i_rImageURL.isEmpty() )
2031 return Image();
2032
2033 try
2034 {
2035 Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
2036 Reference< XGraphicProvider > xProvider(graphic::GraphicProvider::create(xContext));
2037 ::comphelper::NamedValueCollection aMediaProperties;
2038 aMediaProperties.put( "URL", i_rImageURL );
2039 Reference< XGraphic > xGraphic = xProvider->queryGraphic( aMediaProperties.getPropertyValues() );
2040 return Image( xGraphic );
2041 }
2042 catch( const uno::Exception& )
2043 {
2044 DBG_UNHANDLED_EXCEPTION("toolkit");
2045 }
2046 return Image();
2047 }
2048}
2049void SAL_CALL VCLXListBox::listItemInserted( const ItemListEvent& i_rEvent )
2050{
2051 SolarMutexGuard aGuard;
2052 VclPtr< ListBox > pListBox = GetAs< ListBox >();
2053
2054 ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemInserted: no ListBox?!" );
2055 ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition <= pListBox->GetEntryCount() ),
2056 "VCLXListBox::listItemInserted: illegal (inconsistent) item position!" );
2057 pListBox->InsertEntry(
2058 i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : OUString(),
2059 i_rEvent.ItemImageURL.IsPresent ? TkResMgr::getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(),
2060 i_rEvent.ItemPosition );
2061}
2062
2063void SAL_CALL VCLXListBox::listItemRemoved( const ItemListEvent& i_rEvent )
2064{
2065 SolarMutexGuard aGuard;
2066 VclPtr< ListBox > pListBox = GetAs< ListBox >();
2067
2068 ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemRemoved: no ListBox?!" );
2069 ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < pListBox->GetEntryCount() ),
2070 "VCLXListBox::listItemRemoved: illegal (inconsistent) item position!" );
2071
2072 pListBox->RemoveEntry( i_rEvent.ItemPosition );
2073}
2074
2075void SAL_CALL VCLXListBox::listItemModified( const ItemListEvent& i_rEvent )
2076{
2077 SolarMutexGuard aGuard;
2078 VclPtr< ListBox > pListBox = GetAs< ListBox >();
2079
2080 ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemModified: no ListBox?!" );
2081 ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < pListBox->GetEntryCount() ),
2082 "VCLXListBox::listItemModified: illegal (inconsistent) item position!" );
2083
2084 // VCL's ListBox does not support changing an entry's text or image, so remove and re-insert
2085
2086 const OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : pListBox->GetEntry( i_rEvent.ItemPosition );
2087 const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? TkResMgr::getImageFromURL( i_rEvent.ItemImageURL.Value ) : pListBox->GetEntryImage( i_rEvent.ItemPosition ) );
2088
2089 pListBox->RemoveEntry( i_rEvent.ItemPosition );
2090 pListBox->InsertEntry( sNewText, aNewImage, i_rEvent.ItemPosition );
2091}
2092
2093void SAL_CALL VCLXListBox::allItemsRemoved( const EventObject& )
2094{
2095 SolarMutexGuard aGuard;
2096
2097 VclPtr< ListBox > pListBox = GetAs< ListBox >();
2098 ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemModified: no ListBox?!" );
2099
2100 pListBox->Clear();
2101}
2102
2103void SAL_CALL VCLXListBox::itemListChanged( const EventObject& i_rEvent )
2104{
2105 SolarMutexGuard aGuard;
2106
2107 VclPtr< ListBox > pListBox = GetAs< ListBox >();
2108 ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemModified: no ListBox?!" );
2109
2110 pListBox->Clear();
2111
2112 uno::Reference< beans::XPropertySet > xPropSet( i_rEvent.Source, uno::UNO_QUERY_THROW );
2113 uno::Reference< beans::XPropertySetInfo > xPSI( xPropSet->getPropertySetInfo(), uno::UNO_SET_THROW );
2114 uno::Reference< resource::XStringResourceResolver > xStringResourceResolver;
2115 if ( xPSI->hasPropertyByName("ResourceResolver") )
2116 {
2117 xStringResourceResolver.set(
2118 xPropSet->getPropertyValue("ResourceResolver"),
2119 uno::UNO_QUERY
2120 );
2121 }
2122
2123
2124 Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW );
2125 const uno::Sequence< beans::Pair< OUString, OUString > > aItems = xItemList->getAllItems();
2126 for ( const auto& rItem : aItems )
2127 {
2128 OUString aLocalizationKey( rItem.First );
2129 if ( xStringResourceResolver.is() && aLocalizationKey.startsWith("&") )
2130 {
2131 aLocalizationKey = xStringResourceResolver->resolveString(aLocalizationKey.copy( 1 ));
2132 }
2133 pListBox->InsertEntry( aLocalizationKey, lcl_getImageFromURL( rItem.Second ) );
2134 }
2135}
2136
2137void SAL_CALL VCLXListBox::disposing( const EventObject& i_rEvent )
2138{
2139 // just disambiguate
2140 VCLXWindow::disposing( i_rEvent );
2141}
2142
2143
2144
2145
2146void VCLXMessageBox::GetPropertyIds( std::vector< sal_uInt16 > &rIds )
2147{
2149}
2150
2152{
2153}
2154
2156{
2157}
2158
2159void VCLXMessageBox::setCaptionText( const OUString& rText )
2160{
2161 SolarMutexGuard aGuard;
2162
2163 VclPtr<vcl::Window> pWindow = GetWindow();
2164 if ( pWindow )
2165 pWindow->SetText( rText );
2166}
2167
2169{
2170 SolarMutexGuard aGuard;
2171
2172 OUString aText;
2173 VclPtr<vcl::Window> pWindow = GetWindow();
2174 if ( pWindow )
2175 aText = pWindow->GetText();
2176 return aText;
2177}
2178
2179void VCLXMessageBox::setMessageText( const OUString& rText )
2180{
2181 SolarMutexGuard aGuard;
2182 VclPtr< MessBox > pBox = GetAs< MessBox >();
2183 if ( pBox )
2184 pBox->SetMessText( rText );
2185}
2186
2188{
2189 SolarMutexGuard aGuard;
2190 OUString aText;
2191 VclPtr< MessBox > pBox = GetAs< MessBox >();
2192 if ( pBox )
2193 aText = pBox->GetMessText();
2194 return aText;
2195}
2196
2198{
2199 SolarMutexGuard aGuard;
2200 VclPtr< MessBox > pBox = GetAs< MessBox >();
2201 return pBox ? pBox->Execute() : 0;
2202}
2203
2204css::awt::Size SAL_CALL VCLXMessageBox::getMinimumSize()
2205{
2206 return css::awt::Size( 250, 100 );
2207}
2208
2209
2210
2211void VCLXDialog::GetPropertyIds( std::vector< sal_uInt16 > &rIds )
2212{
2214}
2215
2217{
2218 SAL_INFO("toolkit", "XDialog created");
2219}
2220
2222{
2223 SAL_INFO("toolkit", __FUNCTION__);
2224}
2225
2226void SAL_CALL VCLXDialog::endDialog( ::sal_Int32 i_result )
2227{
2228 SolarMutexGuard aGuard;
2229 VclPtr<Dialog> pDialog = GetAsDynamic< Dialog >();
2230 if ( pDialog )
2231 pDialog->EndDialog( i_result );
2232}
2233
2234void SAL_CALL VCLXDialog::setHelpId( const OUString& rId )
2235{
2236 SolarMutexGuard aGuard;
2237 VclPtr< vcl::Window > pWindow = GetWindow();
2238 if ( pWindow )
2239 pWindow->SetHelpId( rId );
2240}
2241
2242void VCLXDialog::setTitle( const OUString& Title )
2243{
2244 SolarMutexGuard aGuard;
2245 VclPtr< vcl::Window > pWindow = GetWindow();
2246 if ( pWindow )
2247 pWindow->SetText( Title );
2248}
2249
2251{
2252 SolarMutexGuard aGuard;
2253
2254 OUString aTitle;
2255 VclPtr< vcl::Window > pWindow = GetWindow();
2256 if ( pWindow )
2257 aTitle = pWindow->GetText();
2258 return aTitle;
2259}
2260
2262{
2263 SolarMutexGuard aGuard;
2264
2265 sal_Int16 nRet = 0;
2266 if ( GetWindow() )
2267 {
2268 VclPtr< Dialog > pDlg = GetAs< Dialog >();
2269 vcl::Window* pParent = pDlg->GetWindow( GetWindowType::ParentOverlap );
2270 vcl::Window* pOldParent = nullptr;
2271 vcl::Window* pSetParent = nullptr;
2272 if ( pParent && !pParent->IsReallyVisible() )
2273 {
2274 pOldParent = pDlg->GetParent();
2275 vcl::Window* pFrame = pDlg->GetWindow( GetWindowType::Frame );
2276 if( pFrame != pDlg )
2277 {
2278 pDlg->SetParent( pFrame );
2279 pSetParent = pFrame;
2280 }
2281 }
2282
2283 nRet = pDlg->Execute();
2284
2285 // set the parent back only in case no new parent was set from outside
2286 // in other words, revert only own changes
2287 if ( pOldParent && pDlg->GetParent() == pSetParent )
2288 pDlg->SetParent( pOldParent );
2289 }
2290 return nRet;
2291}
2292
2294{
2295 endDialog(0);
2296}
2297
2298void SAL_CALL VCLXDialog::draw( sal_Int32 nX, sal_Int32 nY )
2299{
2300 SolarMutexGuard aGuard;
2301 VclPtr< vcl::Window > pWindow = GetWindow();
2302 if ( pWindow )
2303 {
2304 OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
2305 if ( !pDev )
2306 pDev = pWindow->GetParent()->GetOutDev();
2307
2308 Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
2309 pWindow->Draw( pDev, aPos, SystemTextColorFlags::NoControls );
2310 }
2311}
2312
2313css::awt::DeviceInfo VCLXDialog::getInfo()
2314{
2315 css::awt::DeviceInfo aInfo = VCLXDevice::getInfo();
2316
2317 SolarMutexGuard aGuard;
2318 VclPtr< Dialog > pDlg = GetAs< Dialog >();
2319 if ( pDlg )
2320 pDlg->GetDrawWindowBorder( aInfo.LeftInset, aInfo.TopInset, aInfo.RightInset, aInfo.BottomInset );
2321
2322 return aInfo;
2323}
2324
2326 const OUString& PropertyName,
2327 const css::uno::Any& Value )
2328{
2329 SolarMutexGuard aGuard;
2330 VclPtr< Dialog > pDialog = GetAs< Dialog >();
2331 if ( !pDialog )
2332 return;
2333
2334 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
2335
2336 sal_uInt16 nPropType = GetPropertyId( PropertyName );
2337 switch ( nPropType )
2338 {
2340 {
2341 Reference< XGraphic > xGraphic;
2342 if (( Value >>= xGraphic ) && xGraphic.is() )
2343 {
2344 Graphic aImage(xGraphic);
2345
2346 Wallpaper aWallpaper(aImage.GetBitmapEx());
2347 aWallpaper.SetStyle( WallpaperStyle::Scale );
2348 pDialog->SetBackground( aWallpaper );
2349 }
2350 else if ( bVoid || !xGraphic.is() )
2351 {
2352 Color aColor = pDialog->GetControlBackground();
2353 if ( aColor == COL_AUTO )
2354 aColor = pDialog->GetSettings().GetStyleSettings().GetDialogColor();
2355
2356 Wallpaper aWallpaper( aColor );
2357 pDialog->SetBackground( aWallpaper );
2358 }
2359 }
2360 break;
2361
2362 default:
2363 {
2364 VCLXContainer::setProperty( PropertyName, Value );
2365 }
2366 }
2367}
2368
2369
2370
2371VCLXMultiPage::VCLXMultiPage() : maTabListeners( *this ), mTabId( 1 )
2372{
2373 SAL_INFO("toolkit", "VCLXMultiPage::VCLXMultiPage()" );
2374}
2375
2376void VCLXMultiPage::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
2377{
2378 PushPropertyIds( rIds,
2394 0);
2396}
2397
2399{
2400}
2402{
2403 SolarMutexGuard aGuard;
2404
2405 css::lang::EventObject aObj;
2406 aObj.Source = static_cast<cppu::OWeakObject*>(this);
2407 maTabListeners.disposeAndClear( aObj );
2408 VCLXContainer::dispose();
2409}
2410// css::awt::XView
2411void SAL_CALL VCLXMultiPage::draw( sal_Int32 nX, sal_Int32 nY )
2412{
2413 SolarMutexGuard aGuard;
2414 VclPtr< vcl::Window > pWindow = GetWindow();
2415
2416 if ( pWindow )
2417 {
2418 OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
2419 if ( !pDev )
2420 pDev = pWindow->GetParent()->GetOutDev();
2421
2422 Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
2423 pWindow->Draw( pDev, aPos, SystemTextColorFlags::NoControls );
2424 }
2425}
2426
2427uno::Any SAL_CALL VCLXMultiPage::getProperty( const OUString& PropertyName )
2428{
2429 SAL_INFO("toolkit", " **** VCLXMultiPage::getProperty " << PropertyName );
2430 SolarMutexGuard aGuard;
2431 css::uno::Any aProp;
2432 sal_uInt16 nPropType = GetPropertyId( PropertyName );
2433 switch ( nPropType )
2434 {
2435
2437 {
2438 aProp <<= getActiveTabID();
2439 }
2440 break;
2441 default:
2442 aProp = VCLXContainer::getProperty( PropertyName );
2443 }
2444 return aProp;
2445}
2446
2448 const OUString& PropertyName,
2449 const css::uno::Any& Value )
2450{
2451 SAL_INFO("toolkit", " **** VCLXMultiPage::setProperty " << PropertyName );
2452 SolarMutexGuard aGuard;
2453
2454 VclPtr< TabControl > pTabControl = GetAs< TabControl >();
2455 if ( !pTabControl )
2456 return;
2457
2458 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
2459
2460 sal_uInt16 nPropType = GetPropertyId( PropertyName );
2461 switch ( nPropType )
2462 {
2464 {
2465 SAL_INFO("toolkit", "***MULTIPAGE VALUE");
2466 sal_Int32 nId(0);
2467 Value >>= nId;
2468 // when the multipage is created we attempt to set the activepage
2469 // but no pages created
2470 if ( nId && nId <= getWindows().getLength() )
2471 activateTab( nId );
2472 break;
2473 }
2475 {
2476 Reference< XGraphic > xGraphic;
2477 if (( Value >>= xGraphic ) && xGraphic.is() )
2478 {
2479 Graphic aImage(xGraphic);
2480
2481 Wallpaper aWallpaper(aImage.GetBitmapEx());
2482 aWallpaper.SetStyle( WallpaperStyle::Scale );
2483 pTabControl->SetBackground( aWallpaper );
2484 }
2485 else if ( bVoid || !xGraphic.is() )
2486 {
2487 Color aColor = pTabControl->GetControlBackground();
2488 if ( aColor == COL_AUTO )
2489 aColor = pTabControl->GetSettings().GetStyleSettings().GetDialogColor();
2490
2491 Wallpaper aWallpaper( aColor );
2492 pTabControl->SetBackground( aWallpaper );
2493 }
2494 }
2495 break;
2496
2497 default:
2498 {
2499 VCLXContainer::setProperty( PropertyName, Value );
2500 }
2501 }
2502}
2503
2505{
2506 VclPtr<TabControl> pTabControl = GetAsDynamic< TabControl >();
2507 if ( pTabControl )
2508 return pTabControl;
2509 throw uno::RuntimeException();
2510}
2511sal_Int32 SAL_CALL VCLXMultiPage::insertTab()
2512{
2513 TabControl *pTabControl = getTabControl();
2514 VclPtrInstance<TabPage> pTab( pTabControl );
2515 return static_cast< sal_Int32 >( insertTab( pTab, OUString() ) );
2516}
2517
2518sal_uInt16 VCLXMultiPage::insertTab( TabPage* pPage, OUString const & sTitle )
2519{
2520 TabControl *pTabControl = getTabControl();
2521 sal_uInt16 id = sal::static_int_cast< sal_uInt16 >( mTabId++ );
2522 pTabControl->InsertPage( id, sTitle );
2523 pTabControl->SetTabPage( id, pPage );
2524 return id;
2525}
2526
2527void SAL_CALL VCLXMultiPage::removeTab( sal_Int32 ID )
2528{
2529 TabControl *pTabControl = getTabControl();
2530 if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == nullptr )
2531 throw lang::IndexOutOfBoundsException();
2532 pTabControl->RemovePage( sal::static_int_cast< sal_uInt16 >( ID ) );
2533}
2534
2535void SAL_CALL VCLXMultiPage::activateTab( sal_Int32 ID )
2536{
2537 TabControl *pTabControl = getTabControl();
2538 SAL_INFO(
2539 "toolkit",
2540 "Attempting to activate tab " << ID << ", active tab is "
2541 << getActiveTabID() << ", numtabs is " << getWindows().getLength());
2542 if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == nullptr )
2543 throw lang::IndexOutOfBoundsException();
2544 pTabControl->SelectTabPage( sal::static_int_cast< sal_uInt16 >( ID ) );
2545}
2546
2548{
2549 return getTabControl()->GetCurPageId( );
2550}
2551
2552void SAL_CALL VCLXMultiPage::addTabListener( const uno::Reference< awt::XTabListener >& xListener )
2553{
2554 SolarMutexGuard aGuard;
2555 maTabListeners.addInterface( xListener );
2556}
2557
2558void SAL_CALL VCLXMultiPage::removeTabListener( const uno::Reference< awt::XTabListener >& xListener )
2559{
2560 SolarMutexGuard aGuard;
2561 maTabListeners.addInterface( xListener );
2562}
2563
2564void SAL_CALL VCLXMultiPage::setTabProps( sal_Int32 ID, const uno::Sequence< beans::NamedValue >& Properties )
2565{
2566 SolarMutexGuard aGuard;
2567 TabControl *pTabControl = getTabControl();
2568 if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == nullptr )
2569 throw lang::IndexOutOfBoundsException();
2570
2571 for (const auto& rProp : Properties)
2572 {
2573 const OUString &name = rProp.Name;
2574 const uno::Any &value = rProp.Value;
2575
2576 if (name == "Title")
2577 {
2578 OUString title = value.get<OUString>();
2579 pTabControl->SetPageText( sal::static_int_cast< sal_uInt16 >( ID ), title );
2580 }
2581 }
2582}
2583
2584uno::Sequence< beans::NamedValue > SAL_CALL VCLXMultiPage::getTabProps( sal_Int32 ID )
2585{
2586 SolarMutexGuard aGuard;
2587 TabControl *pTabControl = getTabControl();
2588 if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == nullptr )
2589 throw lang::IndexOutOfBoundsException();
2590
2591 uno::Sequence< beans::NamedValue > props
2592 {
2593 { "Title", css::uno::Any(pTabControl->GetPageText( sal::static_int_cast< sal_uInt16 >( ID ) )) },
2594 { "Position", css::uno::Any(pTabControl->GetPagePos( sal::static_int_cast< sal_uInt16 >( ID ) )) }
2595 };
2596 return props;
2597}
2599{
2600 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
2601 switch ( rVclWindowEvent.GetId() )
2602 {
2603 case VclEventId::TabpageDeactivate:
2604 {
2605 sal_uLong nPageID = reinterpret_cast<sal_uLong>( rVclWindowEvent.GetData() );
2606 maTabListeners.deactivated( nPageID );
2607 break;
2608
2609 }
2610 case VclEventId::TabpageActivate:
2611 {
2612 sal_uLong nPageID = reinterpret_cast<sal_uLong>( rVclWindowEvent.GetData() );
2613 maTabListeners.activated( nPageID );
2614 break;
2615 }
2616 default:
2617 VCLXContainer::ProcessWindowEvent( rVclWindowEvent );
2618 break;
2619 }
2620}
2621
2622
2623
2625{
2626}
2627
2628void VCLXTabPage::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
2629{
2630 PushPropertyIds( rIds,
2645 0);
2647}
2648
2650{
2651}
2652
2653// css::awt::XView
2654void SAL_CALL VCLXTabPage::draw( sal_Int32 nX, sal_Int32 nY )
2655{
2656 SolarMutexGuard aGuard;
2657 VclPtr< vcl::Window > pWindow = GetWindow();
2658
2659 if ( pWindow )
2660 {
2661 OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
2662 if ( !pDev )
2663 pDev = pWindow->GetParent()->GetOutDev();
2664
2665 Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
2666 pWindow->Draw( pDev, aPos, SystemTextColorFlags::NoControls );
2667 }
2668}
2669
2671 const OUString& PropertyName,
2672 const css::uno::Any& Value )
2673{
2674 SolarMutexGuard aGuard;
2675 VclPtr< TabPage > pTabPage = GetAs< TabPage >();
2676 if ( !pTabPage )
2677 return;
2678
2679 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
2680
2681 sal_uInt16 nPropType = GetPropertyId( PropertyName );
2682 switch ( nPropType )
2683 {
2685 {
2686 Reference< XGraphic > xGraphic;
2687 if (( Value >>= xGraphic ) && xGraphic.is() )
2688 {
2689 Graphic aImage(xGraphic);
2690
2691 Wallpaper aWallpaper(aImage.GetBitmapEx());
2692 aWallpaper.SetStyle( WallpaperStyle::Scale );
2693 pTabPage->SetBackground( aWallpaper );
2694 }
2695 else if ( bVoid || !xGraphic.is() )
2696 {
2697 Color aColor = pTabPage->GetControlBackground();
2698 if ( aColor == COL_AUTO )
2699 aColor = pTabPage->GetSettings().GetStyleSettings().GetDialogColor();
2700
2701 Wallpaper aWallpaper( aColor );
2702 pTabPage->SetBackground( aWallpaper );
2703 }
2704 }
2705 break;
2706 case BASEPROPERTY_TITLE:
2707 {
2708 OUString sTitle;
2709 if ( Value >>= sTitle )
2710 {
2711 pTabPage->SetText(sTitle);
2712 }
2713 }
2714 break;
2715
2716 default:
2717 {
2718 VCLXContainer::setProperty( PropertyName, Value );
2719 }
2720 }
2721}
2722
2724{
2725 VclPtr< TabPage > pTabPage = GetAsDynamic< TabPage >();
2726 if ( pTabPage )
2727 return pTabPage;
2728 throw uno::RuntimeException();
2729}
2730
2731
2732
2733
2735
2736 maActionListeners( *this )
2737
2738{
2739}
2740
2742{
2743}
2744
2746{
2747 SolarMutexGuard aGuard;
2748
2749 css::lang::EventObject aObj;
2750 aObj.Source = static_cast<cppu::OWeakObject*>(this);
2751 maActionListeners.disposeAndClear( aObj );
2753}
2754
2756{
2757 switch ( rVclWindowEvent.GetId() )
2758 {
2759 case VclEventId::ButtonClick:
2760 {
2761 if ( maActionListeners.getLength() )
2762 {
2763 css::awt::ActionEvent aEvent;
2764 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
2765 maActionListeners.actionPerformed( aEvent );
2766 }
2767 [[fallthrough]];
2768 }
2769 default:
2770 VCLXWindow::ProcessWindowEvent( rVclWindowEvent );
2771 break;
2772 }
2773}
2774
2775css::uno::Reference< css::accessibility::XAccessibleContext > VCLXFixedHyperlink::CreateAccessibleContext()
2776{
2777 return getAccessibleFactory().createAccessibleContext( this );
2778}
2779
2780void VCLXFixedHyperlink::setText( const OUString& Text )
2781{
2782 SolarMutexGuard aGuard;
2783 VclPtr< FixedHyperlink > pBase = GetAs< FixedHyperlink >();
2784 if (pBase)
2785 pBase->SetText(Text);
2786}
2787
2789{
2790 SolarMutexGuard aGuard;
2791
2792 OUString aText;
2793 VclPtr< vcl::Window > pWindow = GetWindow();
2794 if ( pWindow )
2795 aText = pWindow->GetText();
2796 return aText;
2797}
2798
2799void VCLXFixedHyperlink::setURL( const OUString& URL )
2800{
2801 SolarMutexGuard aGuard;
2802 VclPtr< FixedHyperlink > pBase = GetAs< FixedHyperlink >();
2803 if ( pBase )
2804 pBase->SetURL( URL );
2805}
2806
2808{
2809 SolarMutexGuard aGuard;
2810
2811 OUString aText;
2812 VclPtr< FixedHyperlink > pBase = GetAs< FixedHyperlink >();
2813 if ( pBase )
2814 aText = pBase->GetURL();
2815 return aText;
2816}
2817
2818void VCLXFixedHyperlink::setAlignment( sal_Int16 nAlign )
2819{
2820 SolarMutexGuard aGuard;
2821
2822 VclPtr< vcl::Window > pWindow = GetWindow();
2823 if ( !pWindow )
2824 return;
2825
2826 WinBits nNewBits = 0;
2827 if ( nAlign == css::awt::TextAlign::LEFT )
2828 nNewBits = WB_LEFT;
2829 else if ( nAlign == css::awt::TextAlign::CENTER )
2830 nNewBits = WB_CENTER;
2831 else
2832 nNewBits = WB_RIGHT;
2833
2834 WinBits nStyle = pWindow->GetStyle();
2835 nStyle &= ~(WB_LEFT|WB_CENTER|WB_RIGHT);
2836 pWindow->SetStyle( nStyle | nNewBits );
2837}
2838
2840{
2841 SolarMutexGuard aGuard;
2842
2843 sal_Int16 nAlign = 0;
2844 VclPtr< vcl::Window > pWindow = GetWindow();
2845 if ( pWindow )
2846 {
2847 WinBits nStyle = pWindow->GetStyle();
2848 if ( nStyle & WB_LEFT )
2849 nAlign = css::awt::TextAlign::LEFT;
2850 else if ( nStyle & WB_CENTER )
2851 nAlign = css::awt::TextAlign::CENTER;
2852 else
2853 nAlign = css::awt::TextAlign::RIGHT;
2854 }
2855 return nAlign;
2856}
2857
2858void VCLXFixedHyperlink::addActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
2859{
2860 SolarMutexGuard aGuard;
2861 maActionListeners.addInterface( l );
2862}
2863
2864void VCLXFixedHyperlink::removeActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
2865{
2866 SolarMutexGuard aGuard;
2867 maActionListeners.removeInterface( l );
2868}
2869
2871{
2872 SolarMutexGuard aGuard;
2873 Size aSz;
2874 VclPtr< FixedText > pFixedText = GetAs< FixedText >();
2875 if ( pFixedText )
2876 aSz = pFixedText->CalcMinimumSize();
2877 return AWTSize(aSz);
2878}
2879
2881{
2882 return getMinimumSize();
2883}
2884
2885css::awt::Size VCLXFixedHyperlink::calcAdjustedSize( const css::awt::Size& rNewSize )
2886{
2887 SolarMutexGuard aGuard;
2888 Size aSz( VCLUnoHelper::ConvertToVCLSize( rNewSize ));
2889 VclPtr< FixedText > pFixedText = GetAs< FixedText >();
2890 if (pFixedText)
2891 {
2892 Size aMinSz = pFixedText->CalcMinimumSize(rNewSize.Width);
2893 if ( ( aSz.Width() > aMinSz.Width() ) && ( aSz.Height() < aMinSz.Height() ) )
2894 aSz.setHeight( aMinSz.Height() );
2895 else
2896 aSz = aMinSz;
2897 }
2898
2900}
2901
2902void VCLXFixedHyperlink::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
2903{
2904 SolarMutexGuard aGuard;
2905
2906 VclPtr< FixedHyperlink > pBase = GetAs< FixedHyperlink >();
2907 if ( !pBase )
2908 return;
2909
2910 sal_uInt16 nPropType = GetPropertyId( PropertyName );
2911 switch ( nPropType )
2912 {
2913 case BASEPROPERTY_LABEL:
2914 {
2915 OUString sNewLabel;
2916 if ( Value >>= sNewLabel )
2917 pBase->SetText(sNewLabel);
2918 break;
2919 }
2920
2921 case BASEPROPERTY_URL:
2922 {
2923 OUString sNewURL;
2924 if ( Value >>= sNewURL )
2925 pBase->SetURL( sNewURL );
2926 break;
2927 }
2928
2929 default:
2930 {
2931 VCLXWindow::setProperty( PropertyName, Value );
2932 }
2933 }
2934}
2935
2936css::uno::Any VCLXFixedHyperlink::getProperty( const OUString& PropertyName )
2937{
2938 SolarMutexGuard aGuard;
2939
2940 css::uno::Any aProp;
2941 VclPtr< FixedHyperlink > pBase = GetAs< FixedHyperlink >();
2942 if ( pBase )
2943 {
2944 sal_uInt16 nPropType = GetPropertyId( PropertyName );
2945 switch ( nPropType )
2946 {
2947 case BASEPROPERTY_URL:
2948 {
2949 aProp <<= pBase->GetURL();
2950 break;
2951 }
2952
2953 default:
2954 {
2955 aProp = VCLXWindow::getProperty( PropertyName );
2956 }
2957 }
2958 }
2959 return aProp;
2960}
2961
2962void VCLXFixedHyperlink::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
2963{
2964 PushPropertyIds( rIds,
2984 0);
2986}
2987
2988
2989
2990void VCLXFixedText::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
2991{
2992 PushPropertyIds( rIds,
3014 0);
3016}
3017
3019{
3020}
3021
3023{
3024}
3025
3026css::uno::Reference< css::accessibility::XAccessibleContext > VCLXFixedText::CreateAccessibleContext()
3027{
3028 return getAccessibleFactory().createAccessibleContext( this );
3029}
3030
3031void VCLXFixedText::setText( const OUString& Text )
3032{
3033 SolarMutexGuard aGuard;
3034
3035 VclPtr< vcl::Window > pWindow = GetWindow();
3036 if ( pWindow )
3037 pWindow->SetText( Text );
3038}
3039
3041{
3042 SolarMutexGuard aGuard;
3043
3044 OUString aText;
3045 VclPtr< vcl::Window > pWindow = GetWindow();
3046 if ( pWindow )
3047 aText = pWindow->GetText();
3048 return aText;
3049}
3050
3051void VCLXFixedText::setAlignment( sal_Int16 nAlign )
3052{
3053 SolarMutexGuard aGuard;
3054
3055 VclPtr< vcl::Window > pWindow = GetWindow();
3056 if ( !pWindow )
3057 return;
3058
3059 WinBits nNewBits = 0;
3060 if ( nAlign == css::awt::TextAlign::LEFT )
3061 nNewBits = WB_LEFT;
3062 else if ( nAlign == css::awt::TextAlign::CENTER )
3063 nNewBits = WB_CENTER;
3064 else
3065 nNewBits = WB_RIGHT;
3066
3067 WinBits nStyle = pWindow->GetStyle();
3068 nStyle &= ~(WB_LEFT|WB_CENTER|WB_RIGHT);
3069 pWindow->SetStyle( nStyle | nNewBits );
3070}
3071
3073{
3074 SolarMutexGuard aGuard;
3075
3076 sal_Int16 nAlign = 0;
3077 VclPtr< vcl::Window > pWindow = GetWindow();
3078 if ( pWindow )
3079 {
3080 WinBits nStyle = pWindow->GetStyle();
3081 if ( nStyle & WB_LEFT )
3082 nAlign = css::awt::TextAlign::LEFT;
3083 else if ( nStyle & WB_CENTER )
3084 nAlign = css::awt::TextAlign::CENTER;
3085 else
3086 nAlign = css::awt::TextAlign::RIGHT;
3087 }
3088 return nAlign;
3089}
3090
3092{
3093 SolarMutexGuard aGuard;
3094
3095 Size aSz;
3096 VclPtr< FixedText > pFixedText = GetAs< FixedText >();
3097 if ( pFixedText )
3098 aSz = pFixedText->CalcMinimumSize();
3099 return AWTSize(aSz);
3100}
3101
3103{
3104 return getMinimumSize();
3105}
3106
3107css::awt::Size VCLXFixedText::calcAdjustedSize( const css::awt::Size& rMaxSize )
3108{
3109 SolarMutexGuard aGuard;
3110
3111 Size aAdjustedSize( VCLUnoHelper::ConvertToVCLSize( rMaxSize ) );
3112 VclPtr< FixedText > pFixedText = GetAs< FixedText >();
3113 if ( pFixedText )
3114 aAdjustedSize = pFixedText->CalcMinimumSize( rMaxSize.Width );
3115 return VCLUnoHelper::ConvertToAWTSize( aAdjustedSize );
3116}
3117
3118
3119
3120void VCLXScrollBar::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
3121{
3122 PushPropertyIds( rIds,
3145 0);
3147}
3148
3149VCLXScrollBar::VCLXScrollBar() : maAdjustmentListeners( *this )
3150{
3151}
3152
3153css::uno::Reference< css::accessibility::XAccessibleContext > VCLXScrollBar::CreateAccessibleContext()
3154{
3155 return getAccessibleFactory().createAccessibleContext( this );
3156}
3157
3158// css::lang::XComponent
3160{
3161 SolarMutexGuard aGuard;
3162
3163 css::lang::EventObject aObj;
3164 aObj.Source = static_cast<cppu::OWeakObject*>(this);
3165 maAdjustmentListeners.disposeAndClear( aObj );
3167}
3168
3169// css::awt::XScrollbar
3170void VCLXScrollBar::addAdjustmentListener( const css::uno::Reference< css::awt::XAdjustmentListener > & l )
3171{
3172 SolarMutexGuard aGuard;
3173 maAdjustmentListeners.addInterface( l );
3174}
3175
3176void VCLXScrollBar::removeAdjustmentListener( const css::uno::Reference< css::awt::XAdjustmentListener > & l )
3177{
3178 SolarMutexGuard aGuard;
3179 maAdjustmentListeners.removeInterface( l );
3180}
3181
3182void VCLXScrollBar::setValue( sal_Int32 n )
3183{
3184 SolarMutexGuard aGuard;
3185
3186 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3187 if ( pScrollBar )
3188 pScrollBar->DoScroll( n );
3189}
3190
3191void VCLXScrollBar::setValues( sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 nMax )
3192{
3193 SolarMutexGuard aGuard;
3194
3195 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3196 if ( pScrollBar )
3197 {
3198 pScrollBar->SetVisibleSize( nVisible );
3199 pScrollBar->SetRangeMax( nMax );
3200 pScrollBar->DoScroll( nValue );
3201 }
3202}
3203
3205{
3206 SolarMutexGuard aGuard;
3207
3208 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3209 return pScrollBar ? pScrollBar->GetThumbPos() : 0;
3210}
3211
3212void VCLXScrollBar::setMaximum( sal_Int32 n )
3213{
3214 SolarMutexGuard aGuard;
3215
3216 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3217 if ( pScrollBar )
3218 pScrollBar->SetRangeMax( n );
3219}
3220
3222{
3223 SolarMutexGuard aGuard;
3224
3225 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3226 return pScrollBar ? pScrollBar->GetRangeMax() : 0;
3227}
3228
3229void VCLXScrollBar::setMinimum( sal_Int32 n )
3230{
3231 SolarMutexGuard aGuard;
3232
3233 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3234 if ( pScrollBar )
3235 pScrollBar->SetRangeMin( n );
3236}
3237
3239{
3240 SolarMutexGuard aGuard;
3241
3242 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3243 return pScrollBar ? pScrollBar->GetRangeMin() : 0;
3244}
3245
3247{
3248 SolarMutexGuard aGuard;
3249
3250 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3251 if ( pScrollBar )
3252 pScrollBar->SetLineSize( n );
3253}
3254
3256{
3257 SolarMutexGuard aGuard;
3258
3259 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3260 return pScrollBar ? pScrollBar->GetLineSize() : 0;
3261}
3262
3264{
3265 SolarMutexGuard aGuard;
3266
3267 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3268 if ( pScrollBar )
3269 pScrollBar->SetPageSize( n );
3270}
3271
3273{
3274 SolarMutexGuard aGuard;
3275
3276 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3277 return pScrollBar ? pScrollBar->GetPageSize() : 0;
3278}
3279
3281{
3282 SolarMutexGuard aGuard;
3283
3284 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3285 if ( pScrollBar )
3286 pScrollBar->SetVisibleSize( n );
3287}
3288
3290{
3291 SolarMutexGuard aGuard;
3292
3293 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3294 return pScrollBar ? pScrollBar->GetVisibleSize() : 0;
3295}
3296
3298{
3299 SolarMutexGuard aGuard;
3300
3301 VclPtr< vcl::Window > pWindow = GetWindow();
3302 if ( pWindow )
3303 {
3304 WinBits nStyle = pWindow->GetStyle();
3305 nStyle &= ~(WB_HORZ|WB_VERT);
3306 if ( n == css::awt::ScrollBarOrientation::HORIZONTAL )
3307 nStyle |= WB_HORZ;
3308 else
3309 nStyle |= WB_VERT;
3310
3311 pWindow->SetStyle( nStyle );
3312 pWindow->Resize();
3313 }
3314}
3315
3317{
3318 SolarMutexGuard aGuard;
3319
3320 sal_Int32 n = 0;
3321 VclPtr< vcl::Window > pWindow = GetWindow();
3322 if ( pWindow )
3323 {
3324 WinBits nStyle = pWindow->GetStyle();
3325 if ( nStyle & WB_HORZ )
3326 n = css::awt::ScrollBarOrientation::HORIZONTAL;
3327 else
3328 n = css::awt::ScrollBarOrientation::VERTICAL;
3329 }
3330 return n;
3331
3332}
3333
3334// css::awt::VclWindowPeer
3335void VCLXScrollBar::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
3336{
3337 SolarMutexGuard aGuard;
3338
3339 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3340 if ( !pScrollBar )
3341 return;
3342
3343 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
3344
3345 sal_uInt16 nPropType = GetPropertyId( PropertyName );
3346 switch ( nPropType )
3347 {
3349 {
3350 bool bDo = false;
3351 if ( !bVoid )
3352 {
3353 OSL_VERIFY( Value >>= bDo );
3354 }
3355 AllSettings aSettings( pScrollBar->GetSettings() );
3356 StyleSettings aStyle( aSettings.GetStyleSettings() );
3357 DragFullOptions nDragOptions = aStyle.GetDragFullOptions();
3358 if ( bDo )
3359 nDragOptions |= DragFullOptions::Scroll;
3360 else
3361 nDragOptions &= ~DragFullOptions::Scroll;
3362 aStyle.SetDragFullOptions( nDragOptions );
3363 aSettings.SetStyleSettings( aStyle );
3364 pScrollBar->SetSettings( aSettings );
3365 }
3366 break;
3367
3369 {
3370 if ( !bVoid )
3371 {
3372 sal_Int32 n = 0;
3373 if ( Value >>= n )
3374 setValue( n );
3375 }
3376 }
3377 break;
3380 {
3381 if ( !bVoid )
3382 {
3383 sal_Int32 n = 0;
3384 if ( Value >>= n )
3385 {
3386 if ( nPropType == BASEPROPERTY_SCROLLVALUE_MAX )
3387 setMaximum( n );
3388 else
3389 setMinimum( n );
3390 }
3391 }
3392 }
3393 break;
3395 {
3396 if ( !bVoid )
3397 {
3398 sal_Int32 n = 0;
3399 if ( Value >>= n )
3401 }
3402 }
3403 break;
3405 {
3406 if ( !bVoid )
3407 {
3408 sal_Int32 n = 0;
3409 if ( Value >>= n )
3411 }
3412 }
3413 break;
3415 {
3416 if ( !bVoid )
3417 {
3418 sal_Int32 n = 0;
3419 if ( Value >>= n )
3420 setVisibleSize( n );
3421 }
3422 }
3423 break;
3425 {
3426 if ( !bVoid )
3427 {
3428 sal_Int32 n = 0;
3429 if ( Value >>= n )
3430 setOrientation( n );
3431 }
3432 }
3433 break;
3434
3436 {
3437 // the default implementation of the base class doesn't work here, since our
3438 // interpretation for this property is slightly different
3440 }
3441 break;
3442
3443 default:
3444 {
3445 VCLXWindow::setProperty( PropertyName, Value );
3446 }
3447 }
3448}
3449
3450css::uno::Any VCLXScrollBar::getProperty( const OUString& PropertyName )
3451{
3452 SolarMutexGuard aGuard;
3453
3454 css::uno::Any aProp;
3455 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3456 if ( pScrollBar )
3457 {
3458 sal_uInt16 nPropType = GetPropertyId( PropertyName );
3459
3460 switch ( nPropType )
3461 {
3463 {
3464 aProp <<= bool( pScrollBar->GetSettings().GetStyleSettings().GetDragFullOptions() & DragFullOptions::Scroll );
3465 }
3466 break;
3468 {
3469 aProp <<= getValue();
3470 }
3471 break;
3473 {
3474 aProp <<= getMaximum();
3475 }
3476 break;
3478 {
3479 aProp <<= getMinimum();
3480 }
3481 break;
3483 {
3484 aProp <<= getLineIncrement();
3485 }
3486 break;
3488 {
3489 aProp <<= getBlockIncrement();
3490 }
3491 break;
3493 {
3494 aProp <<= getVisibleSize();
3495 }
3496 break;
3498 {
3499 aProp <<= getOrientation();
3500 }
3501 break;
3503 {
3504 // the default implementation of the base class doesn't work here, since our
3505 // interpretation for this property is slightly different
3506 aProp = ::toolkit::getButtonLikeFaceColor( pScrollBar );
3507 }
3508 break;
3509
3510 default:
3511 {
3512 aProp = VCLXWindow::getProperty( PropertyName );
3513 }
3514 }
3515 }
3516 return aProp;
3517}
3518
3520{
3521 switch ( rVclWindowEvent.GetId() )
3522 {
3523 case VclEventId::ScrollbarScroll:
3524 {
3525 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
3526 // since we call listeners below, there is a potential that we will be destroyed
3527 // in during the listener call. To prevent the resulting crashes, we keep us
3528 // alive as long as we're here
3529
3530 if ( maAdjustmentListeners.getLength() )
3531 {
3532 VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
3533
3534 if( pScrollBar )
3535 {
3536 css::awt::AdjustmentEvent aEvent;
3537 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
3538 aEvent.Value = pScrollBar->GetThumbPos();
3539
3540 // set adjustment type
3541 ScrollType aType = pScrollBar->GetType();
3542 if ( aType == ScrollType::LineUp || aType == ScrollType::LineDown )
3543 {
3544 aEvent.Type = css::awt::AdjustmentType_ADJUST_LINE;
3545 }
3546 else if ( aType == ScrollType::PageUp || aType == ScrollType::PageDown )
3547 {
3548 aEvent.Type = css::awt::AdjustmentType_ADJUST_PAGE;
3549 }
3550 else if ( aType == ScrollType::Drag )
3551 {
3552 aEvent.Type = css::awt::AdjustmentType_ADJUST_ABS;
3553 }
3554
3555 maAdjustmentListeners.adjustmentValueChanged( aEvent );
3556 }
3557 }
3558 }
3559 break;
3560
3561 default:
3562 VCLXWindow::ProcessWindowEvent( rVclWindowEvent );
3563 break;
3564 }
3565}
3566
3568{
3569 tools::Long n = p->GetSettings().GetStyleSettings().GetScrollBarSize();
3570 return css::awt::Size( n, n );
3571}
3572
3573css::awt::Size SAL_CALL VCLXScrollBar::getMinimumSize()
3574{
3575 SolarMutexGuard aGuard;
3576 return implGetMinimumSize( GetWindow() );
3577}
3578
3579
3580
3581
3582void VCLXEdit::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
3583{
3584 PushPropertyIds( rIds,
3615 0);
3617}
3618
3619VCLXEdit::VCLXEdit() : maTextListeners( *this )
3620{
3621}
3622
3623css::uno::Reference< css::accessibility::XAccessibleContext > VCLXEdit::CreateAccessibleContext()
3624{
3625 return getAccessibleFactory().createAccessibleContext( this );
3626}
3627
3629{
3630 SolarMutexGuard aGuard;
3631
3632 css::lang::EventObject aObj;
3633 aObj.Source = static_cast<cppu::OWeakObject*>(this);
3634 maTextListeners.disposeAndClear( aObj );
3636}
3637
3638void VCLXEdit::addTextListener( const css::uno::Reference< css::awt::XTextListener > & l )
3639{
3640 SolarMutexGuard aGuard;
3641 GetTextListeners().addInterface( l );
3642}
3643
3644void VCLXEdit::removeTextListener( const css::uno::Reference< css::awt::XTextListener > & l )
3645{
3646 SolarMutexGuard aGuard;
3647 GetTextListeners().removeInterface( l );
3648}
3649
3650void VCLXEdit::setText( const OUString& aText )
3651{
3652 SolarMutexGuard aGuard;
3653
3654 VclPtr< Edit > pEdit = GetAs< Edit >();
3655 if ( pEdit )
3656 {
3657 pEdit->SetText( aText );
3658
3659 // #107218# Call same listeners like VCL would do after user interaction
3660 SetSynthesizingVCLEvent( true );
3661 pEdit->SetModifyFlag();
3662 pEdit->Modify();
3663 SetSynthesizingVCLEvent( false );
3664 }
3665}
3666
3667void VCLXEdit::insertText( const css::awt::Selection& rSel, const OUString& aText )
3668{
3669 SolarMutexGuard aGuard;
3670
3671 VclPtr< Edit > pEdit = GetAs< Edit >();
3672 if ( pEdit )
3673 {
3674 pEdit->SetSelection( Selection( rSel.Min, rSel.Max ) );
3675 pEdit->ReplaceSelected( aText );
3676
3677 // #107218# Call same listeners like VCL would do after user interaction
3678 SetSynthesizingVCLEvent( true );
3679 pEdit->SetModifyFlag();
3680 pEdit->Modify();
3681 SetSynthesizingVCLEvent( false );
3682 }
3683}
3684
3686{
3687 SolarMutexGuard aGuard;
3688
3689 OUString aText;
3690 VclPtr< vcl::Window > pWindow = GetWindow();
3691 if ( pWindow )
3692 aText = pWindow->GetText();
3693 return aText;
3694}
3695
3697{
3698 SolarMutexGuard aGuard;
3699
3700 OUString aText;
3701 VclPtr< Edit > pEdit = GetAs< Edit >();
3702 if ( pEdit)
3703 aText = pEdit->GetSelected();
3704 return aText;
3705
3706}
3707
3708void VCLXEdit::setSelection( const css::awt::Selection& aSelection )
3709{
3710 SolarMutexGuard aGuard;
3711
3712 VclPtr< Edit > pEdit = GetAs< Edit >();
3713 if ( pEdit )
3714 pEdit->SetSelection( Selection( aSelection.Min, aSelection.Max ) );
3715}
3716
3717css::awt::Selection VCLXEdit::getSelection()
3718{
3719 SolarMutexGuard aGuard;
3720
3721 Selection aSel;
3722 VclPtr< Edit > pEdit = GetAs< Edit >();
3723 if ( pEdit )
3724 aSel = pEdit->GetSelection();
3725 return css::awt::Selection( aSel.Min(), aSel.Max() );
3726}
3727
3729{
3730 SolarMutexGuard aGuard;
3731
3732 VclPtr< Edit > pEdit = GetAs< Edit >();
3733 return pEdit && !pEdit->IsReadOnly() && pEdit->IsEnabled();
3734}
3735
3737{
3738 SolarMutexGuard aGuard;
3739
3740 VclPtr< Edit > pEdit = GetAs< Edit >();
3741 if ( pEdit )
3742 pEdit->SetReadOnly( !bEditable );
3743}
3744
3745
3746void VCLXEdit::setMaxTextLen( sal_Int16 nLen )
3747{
3748 SolarMutexGuard aGuard;
3749
3750 VclPtr< Edit > pEdit = GetAs< Edit >();
3751 if ( pEdit )
3752 pEdit->SetMaxTextLen( nLen );
3753}
3754
3756{
3757 SolarMutexGuard aGuard;
3758
3759 VclPtr< Edit > pEdit = GetAs< Edit >();
3760 return pEdit ? pEdit->GetMaxTextLen() : 0;
3761}
3762
3764{
3765 SolarMutexGuard aGuard;
3766
3767 VclPtr< Edit > pEdit = GetAs< Edit >();
3768 if ( pEdit )
3769 pEdit->SetEchoChar( cEcho );
3770}
3771
3772void VCLXEdit::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
3773{
3774 SolarMutexGuard aGuard;
3775
3776 VclPtr< Edit > pEdit = GetAs< Edit >();
3777 if ( !pEdit )
3778 return;
3779
3780 sal_uInt16 nPropType = GetPropertyId( PropertyName );
3781 switch ( nPropType )
3782 {
3785 if ( pEdit->GetSubEdit() )
3786 ::toolkit::adjustBooleanWindowStyle( Value, pEdit->GetSubEdit(), WB_NOHIDESELECTION, true );
3787 break;
3788
3790 {
3791 bool b = bool();
3792 if ( Value >>= b )
3793 pEdit->SetReadOnly( b );
3794 }
3795 break;
3797 {
3798 sal_Int16 n = sal_Int16();
3799 if ( Value >>= n )
3800 pEdit->SetEchoChar( n );
3801 }
3802 break;
3804 {
3805 sal_Int16 n = sal_Int16();
3806 if ( Value >>= n )
3807 pEdit->SetMaxTextLen( n );
3808 }
3809 break;
3810 default:
3811 {
3812 VCLXWindow::setProperty( PropertyName, Value );
3813 }
3814 }
3815}
3816
3817css::uno::Any VCLXEdit::getProperty( const OUString& PropertyName )
3818{
3819 SolarMutexGuard aGuard;
3820
3821 css::uno::Any aProp;
3822 VclPtr< Edit > pEdit = GetAs< Edit >();
3823 if ( pEdit )
3824 {
3825 sal_uInt16 nPropType = GetPropertyId( PropertyName );
3826 switch ( nPropType )
3827 {
3829 aProp <<= ( ( pEdit->GetStyle() & WB_NOHIDESELECTION ) == 0 );
3830 break;
3832 aProp <<= pEdit->IsReadOnly();
3833 break;
3835 aProp <<= static_cast<sal_Int16>(pEdit->GetEchoChar());
3836 break;
3838 aProp <<= static_cast<sal_Int16>(pEdit->GetMaxTextLen());
3839 break;
3840 default:
3841 {
3842 aProp = VCLXWindow::getProperty( PropertyName );
3843 }
3844 }
3845 }
3846 return aProp;
3847}
3848
3850{
3851 SolarMutexGuard aGuard;
3852
3853 Size aSz;
3854 VclPtr< Edit > pEdit = GetAs< Edit >();
3855 if ( pEdit )
3856 aSz = pEdit->CalcMinimumSize();
3857 return AWTSize(aSz);
3858}
3859
3861{
3862 SolarMutexGuard aGuard;
3863
3864 Size aSz;
3865 VclPtr< Edit > pEdit = GetAs< Edit >();
3866 if ( pEdit )
3867 {
3868 aSz = pEdit->CalcMinimumSize();
3869 aSz.AdjustHeight(4 );
3870 }
3871 return AWTSize(aSz);
3872}
3873
3874css::awt::Size VCLXEdit::calcAdjustedSize( const css::awt::Size& rNewSize )
3875{
3876 SolarMutexGuard aGuard;
3877
3878 css::awt::Size aSz = rNewSize;
3879 css::awt::Size aMinSz = getMinimumSize();
3880 if ( aSz.Height != aMinSz.Height )
3881 aSz.Height = aMinSz.Height;
3882
3883 return aSz;
3884}
3885
3886css::awt::Size VCLXEdit::getMinimumSize( sal_Int16 nCols, sal_Int16 )
3887{
3888 SolarMutexGuard aGuard;
3889
3890 Size aSz;
3891 VclPtr< Edit > pEdit = GetAs< Edit >();
3892 if ( pEdit )
3893 {
3894 if ( nCols )
3895 aSz = pEdit->CalcSize( nCols );
3896 else
3897 aSz = pEdit->CalcMinimumSize();
3898 }
3899 return AWTSize(aSz);
3900}
3901
3902void VCLXEdit::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines )
3903{
3904 SolarMutexGuard aGuard;
3905
3906 nLines = 1;
3907 nCols = 0;
3908 VclPtr< Edit > pEdit = GetAs< Edit >();
3909 if ( pEdit )
3910 nCols = pEdit->GetMaxVisChars();
3911}
3912
3913void VCLXEdit::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
3914{
3915 switch ( rVclWindowEvent.GetId() )
3916 {
3917 case VclEventId::EditModify:
3918 {
3919 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
3920 // since we call listeners below, there is a potential that we will be destroyed
3921 // during the listener call. To prevent the resulting crashes, we keep us
3922 // alive as long as we're here
3923
3924 if ( GetTextListeners().getLength() )
3925 {
3926 css::awt::TextEvent aEvent;
3927 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
3928 GetTextListeners().textChanged( aEvent );
3929 }
3930 }
3931 break;
3932
3933 default:
3934 VCLXWindow::ProcessWindowEvent( rVclWindowEvent );
3935 break;
3936 }
3937}
3938
3939
3940
3941
3942void VCLXComboBox::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
3943{
3944 PushPropertyIds( rIds,
3972 0);
3973 // no, don't call VCLXEdit here - it has properties which we do *not* want to have at combo box
3974 // #i92690# / 2008-08-12 / frank.schoenheit@sun.com
3975 // VCLXEdit::ImplGetPropertyIds( rIds );
3977}
3978
3980 : maActionListeners( *this ), maItemListeners( *this )
3981{
3982}
3983
3985{
3986 SAL_INFO("toolkit", __FUNCTION__);
3987}
3988
3989css::uno::Reference< css::accessibility::XAccessibleContext > VCLXComboBox::CreateAccessibleContext()
3990{
3991 SolarMutexGuard aGuard;
3992
3993 return getAccessibleFactory().createAccessibleContext( this );
3994}
3995
3997{
3998 SolarMutexGuard aGuard;
3999
4000 css::lang::EventObject aObj;
4001 aObj.Source = static_cast<cppu::OWeakObject*>(this);
4002 maItemListeners.disposeAndClear( aObj );
4003 maActionListeners.disposeAndClear( aObj );
4005}
4006
4007
4008void VCLXComboBox::addItemListener( const css::uno::Reference< css::awt::XItemListener > & l )
4009{
4010 SolarMutexGuard aGuard;
4011 maItemListeners.addInterface( l );
4012}
4013
4014void VCLXComboBox::removeItemListener( const css::uno::Reference< css::awt::XItemListener > & l )
4015{
4016 SolarMutexGuard aGuard;
4017 maItemListeners.removeInterface( l );
4018}
4019
4020void VCLXComboBox::addActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
4021{
4022 SolarMutexGuard aGuard;
4023 maActionListeners.addInterface( l );
4024}
4025
4026void VCLXComboBox::removeActionListener( const css::uno::Reference< css::awt::XActionListener > & l )
4027{
4028 SolarMutexGuard aGuard;
4029 maActionListeners.removeInterface( l );
4030}
4031
4032void VCLXComboBox::addItem( const OUString& aItem, sal_Int16 nPos )
4033{
4034 SolarMutexGuard aGuard;
4035
4036 VclPtr< ComboBox > pBox = GetAs< ComboBox >();
4037 if ( pBox )
4038 pBox->InsertEntry( aItem, nPos );
4039}
4040
4041void VCLXComboBox::addItems( const css::uno::Sequence< OUString>& aItems, sal_Int16 nPos )
4042{
4043 SolarMutexGuard aGuard;
4044
4045 VclPtr< ComboBox > pBox = GetAs< ComboBox >();
4046 if ( !pBox )
4047 return;
4048
4049 sal_uInt16 nP = nPos;
4050 for ( const auto& rItem : aItems )
4051 {
4052 pBox->InsertEntry( rItem, nP );
4053 if ( nP == 0xFFFF )
4054 {
4055 OSL_FAIL( "VCLXComboBox::addItems: too many entries!" );
4056 // skip remaining entries, list cannot hold them, anyway
4057 break;
4058 }
4059 }
4060}
4061
4062void VCLXComboBox::removeItems( sal_Int16 nPos, sal_Int16 nCount )
4063{
4064 SolarMutexGuard aGuard;
4065
4066 VclPtr< ComboBox > pBox = GetAs< ComboBox >();
4067 if ( pBox )
4068 {
4069 for ( sal_uInt16 n = nCount; n; )
4070 pBox->RemoveEntryAt( nPos + (--n) );
4071 }
4072}
4073
4075{
4076 SolarMutexGuard aGuard;
4077
4078 VclPtr< ComboBox > pBox = GetAs< ComboBox >();
4079 return pBox ? pBox->GetEntryCount() : 0;
4080}
4081
4082OUString VCLXComboBox::getItem( sal_Int16 nPos )
4083{
4084 SolarMutexGuard aGuard;
4085
4086 OUString aItem;
4087 VclPtr< ComboBox > pBox = GetAs< ComboBox >();
4088 if ( pBox )
4089 aItem = pBox->GetEntry( nPos );
4090 return aItem;
4091}
4092
4093css::uno::Sequence< OUString> VCLXComboBox::getItems()
4094{
4095 SolarMutexGuard aGuard;
4096
4097 css::uno::Sequence< OUString> aSeq;
4098 VclPtr< ComboBox > pBox = GetAs< ComboBox >();
4099 if ( pBox )
4100 {
4101 auto n = pBox->GetEntryCount();
4102 aSeq = css::uno::Sequence< OUString>( n );
4103 while ( n )
4104 {
4105 --n;
4106 aSeq.getArray()[n] = pBox->GetEntry( n );
4107 }
4108 }
4109 return aSeq;
4110}
4111
4113{
4114 SolarMutexGuard aGuard;
4115
4116 VclPtr< ComboBox > pBox = GetAs< ComboBox >();
4117 if ( pBox )
4118 pBox->SetDropDownLineCount( nLines );
4119}
4120
4122{
4123 SolarMutexGuard aGuard;
4124
4125 sal_Int16 nLines = 0;
4126 VclPtr< ComboBox > pBox = GetAs< ComboBox >();
4127 if ( pBox )
4128 nLines = pBox->GetDropDownLineCount();
4129 return nLines;
4130}
4131
4132void VCLXComboBox::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
4133{
4134 SolarMutexGuard aGuard;
4135
4136 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
4137 if ( !pComboBox )
4138 return;
4139
4140 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
4141 sal_uInt16 nPropType = GetPropertyId( PropertyName );
4142 switch ( nPropType )
4143 {
4145 {
4146 sal_Int16 n = sal_Int16();
4147 if ( Value >>= n )
4148 pComboBox->SetDropDownLineCount( n );
4149 }
4150 break;
4152 {
4153 sal_Int16 n = sal_Int16();
4154 if ( Value >>= n )
4155 pComboBox->EnableAutocomplete( n != 0 );
4156 else
4157 {
4158 bool b = bool();
4159 if ( Value >>= b )
4160 pComboBox->EnableAutocomplete( b );
4161 }
4162 }
4163 break;
4165 {
4166 css::uno::Sequence< OUString> aItems;
4167 if ( Value >>= aItems )
4168 {
4169 pComboBox->Clear();
4170 addItems( aItems, 0 );
4171 }
4172 }
4173 break;
4175 {
4176 Color nColor = 0;
4177 if (bVoid)
4178 {
4180 }
4181 else
4182 {
4183 if (!(Value >>= nColor))
4184 break;
4185 }
4186 pComboBox->SetHighlightColor(nColor);
4187 }
4188 break;
4190 {
4191 Color nColor = 0;
4192 if (bVoid)
4193 {
4195 }
4196 else
4197 {
4198 if (!(Value >>= nColor))
4199 break;
4200 }
4201 pComboBox->SetHighlightTextColor(nColor);
4202 }
4203 break;
4204 default:
4205 {
4206 VCLXEdit::setProperty( PropertyName, Value );
4207
4208 // #109385# SetBorderStyle is not virtual
4209 if ( nPropType == BASEPROPERTY_BORDER )
4210 {
4211 sal_uInt16 nBorder = sal_uInt16();
4212 if ( (Value >>= nBorder) && nBorder != 0 )
4213 pComboBox->SetBorderStyle( static_cast<WindowBorderStyle>(nBorder) );
4214 }
4215 }
4216 }
4217}
4218
4219css::uno::Any VCLXComboBox::getProperty( const OUString& PropertyName )
4220{
4221 SolarMutexGuard aGuard;
4222
4223 css::uno::Any aProp;
4224 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
4225 if ( pComboBox )
4226 {
4227 sal_uInt16 nPropType = GetPropertyId( PropertyName );
4228 switch ( nPropType )
4229 {
4231 {
4232 aProp <<= static_cast<sal_Int16>(pComboBox->GetDropDownLineCount());
4233 }
4234 break;
4236 {
4237 aProp <<= pComboBox->IsAutocompleteEnabled();
4238 }
4239 break;
4241 {
4242 const sal_Int32 nItems = pComboBox->GetEntryCount();
4243 css::uno::Sequence< OUString> aSeq( nItems );
4244 OUString* pStrings = aSeq.getArray();
4245 for ( sal_Int32 n = 0; n < nItems; ++n )
4246 pStrings[n] = pComboBox->GetEntry( n );
4247 aProp <<= aSeq;
4248
4249 }
4250 break;
4251 default:
4252 {
4253 aProp = VCLXEdit::getProperty( PropertyName );
4254 }
4255 }
4256 }
4257 return aProp;
4258}
4259
4261{
4262 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
4263 // since we call listeners below, there is a potential that we will be destroyed
4264 // during the listener call. To prevent the resulting crashes, we keep us
4265 // alive as long as we're here
4266
4267 switch ( rVclWindowEvent.GetId() )
4268 {
4269 case VclEventId::ComboboxSelect:
4270 if ( maItemListeners.getLength() )
4271 {
4272 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
4273 if( pComboBox )
4274 {
4275 if ( !pComboBox->IsTravelSelect() )
4276 {
4277 css::awt::ItemEvent aEvent;
4278 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
4279 aEvent.Highlighted = 0;
4280
4281 // Set to 0xFFFF on multiple selection, selected entry ID otherwise
4282 aEvent.Selected = pComboBox->GetEntryPos( pComboBox->GetText() );
4283
4284 maItemListeners.itemStateChanged( aEvent );
4285 }
4286 }
4287 }
4288 break;
4289
4290 case VclEventId::ComboboxDoubleClick:
4291 if ( maActionListeners.getLength() )
4292 {
4293 css::awt::ActionEvent aEvent;
4294 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
4295// aEvent.ActionCommand = ...;
4296 maActionListeners.actionPerformed( aEvent );
4297 }
4298 break;
4299
4300 default:
4301 VCLXEdit::ProcessWindowEvent( rVclWindowEvent );
4302 break;
4303 }
4304}
4305
4307{
4308 SolarMutexGuard aGuard;
4309
4310 Size aSz;
4311 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
4312 if ( pComboBox )
4313 aSz = pComboBox->CalcMinimumSize();
4314 return AWTSize(aSz);
4315}
4316
4318{
4319 SolarMutexGuard aGuard;
4320
4321 Size aSz;
4322 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
4323 if ( pComboBox )
4324 {
4325 aSz = pComboBox->CalcMinimumSize();
4326 if ( pComboBox->GetStyle() & WB_DROPDOWN )
4327 aSz.AdjustHeight(4 );
4328 }
4329 return AWTSize(aSz);
4330}
4331
4332css::awt::Size VCLXComboBox::calcAdjustedSize( const css::awt::Size& rNewSize )
4333{
4334 SolarMutexGuard aGuard;
4335
4336 Size aSz = VCLSize(rNewSize);
4337 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
4338 if ( pComboBox )
4339 aSz = pComboBox->CalcAdjustedSize( aSz );
4340 return AWTSize(aSz);
4341}
4342
4343css::awt::Size VCLXComboBox::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines )
4344{
4345 SolarMutexGuard aGuard;
4346
4347 Size aSz;
4348 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
4349 if ( pComboBox )
4350 aSz = pComboBox->CalcBlockSize( nCols, nLines );
4351 return AWTSize(aSz);
4352}
4353
4354void VCLXComboBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines )
4355{
4356 SolarMutexGuard aGuard;
4357
4358 nCols = nLines = 0;
4359 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
4360 if ( pComboBox )
4361 {
4362 sal_uInt16 nC, nL;
4363 pComboBox->GetMaxVisColumnsAndLines( nC, nL );
4364 nCols = nC;
4365 nLines = nL;
4366 }
4367}
4368void SAL_CALL VCLXComboBox::listItemInserted( const ItemListEvent& i_rEvent )
4369{
4370 SolarMutexGuard aGuard;
4371
4372 VclPtr< ComboBox > pComboBox = GetAsDynamic< ComboBox >();
4373
4374 ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemInserted: no ComboBox?!" );
4375 ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition <= pComboBox->GetEntryCount() ),
4376 "VCLXComboBox::listItemInserted: illegal (inconsistent) item position!" );
4377 pComboBox->InsertEntryWithImage(
4378 i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : OUString(),
4379 i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(),
4380 i_rEvent.ItemPosition );
4381}
4382
4383void SAL_CALL VCLXComboBox::listItemRemoved( const ItemListEvent& i_rEvent )
4384{
4385 SolarMutexGuard aGuard;
4386
4387 VclPtr< ComboBox > pComboBox = GetAsDynamic< ComboBox >();
4388
4389 ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemRemoved: no ComboBox?!" );
4390 ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < pComboBox->GetEntryCount() ),
4391 "VCLXComboBox::listItemRemoved: illegal (inconsistent) item position!" );
4392
4393 pComboBox->RemoveEntryAt( i_rEvent.ItemPosition );
4394}
4395
4396void SAL_CALL VCLXComboBox::listItemModified( const ItemListEvent& i_rEvent )
4397{
4398 SolarMutexGuard aGuard;
4399
4400 VclPtr< ComboBox > pComboBox = GetAsDynamic< ComboBox >();
4401
4402 ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" );
4403 ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < pComboBox->GetEntryCount() ),
4404 "VCLXComboBox::listItemModified: illegal (inconsistent) item position!" );
4405
4406 // VCL's ComboBox does not support changing an entry's text or image, so remove and re-insert
4407
4408 const OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : pComboBox->GetEntry( i_rEvent.ItemPosition );
4409 const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : pComboBox->GetEntryImage( i_rEvent.ItemPosition ) );
4410
4411 pComboBox->RemoveEntryAt( i_rEvent.ItemPosition );
4412 pComboBox->InsertEntryWithImage(sNewText, aNewImage, i_rEvent.ItemPosition);
4413}
4414
4415void SAL_CALL VCLXComboBox::allItemsRemoved( const EventObject& )
4416{
4417 SolarMutexGuard aGuard;
4418
4419 VclPtr< ComboBox > pComboBox = GetAsDynamic< ComboBox >();
4420 ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" );
4421
4422 pComboBox->Clear();
4423}
4424
4425void SAL_CALL VCLXComboBox::itemListChanged( const EventObject& i_rEvent )
4426{
4427 SolarMutexGuard aGuard;
4428
4429 VclPtr< ComboBox > pComboBox = GetAsDynamic< ComboBox >();
4430 ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" );
4431
4432 pComboBox->Clear();
4433
4434 uno::Reference< beans::XPropertySet > xPropSet( i_rEvent.Source, uno::UNO_QUERY_THROW );
4435 uno::Reference< beans::XPropertySetInfo > xPSI( xPropSet->getPropertySetInfo(), uno::UNO_SET_THROW );
4436 // bool localize = xPSI->hasPropertyByName("ResourceResolver");
4437 uno::Reference< resource::XStringResourceResolver > xStringResourceResolver;
4438 if ( xPSI->hasPropertyByName("ResourceResolver") )
4439 {
4440 xStringResourceResolver.set(
4441 xPropSet->getPropertyValue("ResourceResolver"),
4442 uno::UNO_QUERY
4443 );
4444 }
4445
4446
4447 Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW );
4448 const uno::Sequence< beans::Pair< OUString, OUString > > aItems = xItemList->getAllItems();
4449 for ( const auto& rItem : aItems )
4450 {
4451 OUString aLocalizationKey( rItem.First );
4452 if ( xStringResourceResolver.is() && !aLocalizationKey.isEmpty() && aLocalizationKey[0] == '&' )
4453 {
4454 aLocalizationKey = xStringResourceResolver->resolveString(aLocalizationKey.copy( 1 ));
4455 }
4456 pComboBox->InsertEntryWithImage(aLocalizationKey,
4457 lcl_getImageFromURL(rItem.Second));
4458 }
4459}
4460void SAL_CALL VCLXComboBox::disposing( const EventObject& i_rEvent )
4461{
4462 // just disambiguate
4463 VCLXEdit::disposing( i_rEvent );
4464}
4465
4466
4467
4468void VCLXFormattedSpinField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
4469{
4470 // Interestingly in the UnoControl API this is
4471 // - not derived from XEdit ultimately, (correct ?) - so cut this here ...
4472// VCLXSpinField::ImplGetPropertyIds( rIds );
4474}
4475
4477 : mpFormatter(nullptr)
4478{
4479}
4480
4482{
4483}
4484
4486{
4487 SolarMutexGuard aGuard;
4488
4489 FormatterBase* pFormatter = GetFormatter();
4490 if ( pFormatter )
4491 pFormatter->SetStrictFormat( bStrict );
4492}
4493
4495{
4496 FormatterBase* pFormatter = GetFormatter();
4497 return pFormatter && pFormatter->IsStrictFormat();
4498}
4499
4500
4501void VCLXFormattedSpinField::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
4502{
4503 SolarMutexGuard aGuard;
4504
4505 FormatterBase* pFormatter = GetFormatter();
4506 if ( !pFormatter )
4507 return;
4508
4509 sal_uInt16 nPropType = GetPropertyId( PropertyName );
4510 switch ( nPropType )
4511 {
4512 case BASEPROPERTY_SPIN:
4513 {
4514 bool b = bool();
4515 if ( Value >>= b )
4516 {
4517 WinBits nStyle = GetWindow()->GetStyle() | WB_SPIN;
4518 if ( !b )
4519 nStyle &= ~WB_SPIN;
4520 GetWindow()->SetStyle( nStyle );
4521 }
4522 }
4523 break;
4525 {
4526 bool b = bool();
4527 if ( Value >>= b )
4528 {
4529 pFormatter->SetStrictFormat( b );
4530 }
4531 }
4532 break;
4533 default:
4534 {
4535 VCLXSpinField::setProperty( PropertyName, Value );
4536 }
4537 }
4538}
4539
4540css::uno::Any VCLXFormattedSpinField::getProperty( const OUString& PropertyName )
4541{
4542 SolarMutexGuard aGuard;
4543
4544 css::uno::Any aProp;
4545 FormatterBase* pFormatter = GetFormatter();
4546 if ( pFormatter )
4547 {
4548 sal_uInt16 nPropType = GetPropertyId( PropertyName );
4549 switch ( nPropType )
4550 {
4552 {
4553 aProp <<= ( GetWindow()->GetStyle() & WB_SPIN ) != 0;
4554 }
4555 break;
4557 {
4558 aProp <<= pFormatter->IsStrictFormat();
4559 }
4560 break;
4561 default:
4562 {
4563 aProp = VCLXSpinField::getProperty( PropertyName );
4564 }
4565 }
4566 }
4567 return aProp;
4568}
4569
4570
4571
4572
4573void VCLXDateField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
4574{
4575 PushPropertyIds( rIds,
4608 0);
4610}
4611
4613{
4614}
4615
4617{
4618}
4619
4620//change the window type here to match the role
4621css::uno::Reference< css::accessibility::XAccessibleContext > VCLXDateField::CreateAccessibleContext()
4622{
4623 VclPtr< vcl::Window > pWindow = GetWindow();
4624 if ( pWindow )
4625 {
4626 pWindow->SetType( WindowType::DATEFIELD );
4627 }
4628 return getAccessibleFactory().createAccessibleContext( this );
4629}
4630
4631void VCLXDateField::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
4632{
4633 SolarMutexGuard aGuard;
4634
4635 if ( !(GetWindow()) )
4636 return;
4637
4638 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
4639
4640 sal_uInt16 nPropType = GetPropertyId( PropertyName );
4641 switch ( nPropType )
4642 {
4643 case BASEPROPERTY_DATE:
4644 {
4645 if ( bVoid )
4646 {
4647 GetAs< DateField >()->EnableEmptyFieldValue( true );
4648 GetAs< DateField >()->SetEmptyFieldValue();
4649 }
4650 else
4651 {
4652 util::Date d;
4653 if ((Value >>= d) && d.Year != 0)
4654 setDate( d );
4655 }
4656 }
4657 break;
4659 {
4660 util::Date d;
4661 if ((Value >>= d) && d.Year != 0)
4662 setMin( d );
4663 }
4664 break;
4666 {
4667 util::Date d;
4668 if ((Value >>= d) && d.Year != 0)
4669 setMax( d );
4670 }
4671 break;
4673 {
4674 sal_Int16 n = sal_Int16();
4675 if ( Value >>= n )
4676 GetAs< DateField >()->SetExtDateFormat( static_cast<ExtDateFieldFormat>(n) );
4677 }
4678 break;
4680 {
4681 bool b = bool();
4682 if ( Value >>= b )
4683 GetAs< DateField >()->SetShowDateCentury( b );
4684 }
4685 break;
4687 {
4688 bool bEnforce( true );
4689 OSL_VERIFY( Value >>= bEnforce );
4690 GetAs< DateField >()->EnforceValidValue( bEnforce );
4691 }
4692 break;
4693 default:
4694 {
4696 }
4697 }
4698}
4699
4700css::uno::Any VCLXDateField::getProperty( const OUString& PropertyName )
4701{
4702 SolarMutexGuard aGuard;
4703
4704 css::uno::Any aProp;
4705 FormatterBase* pFormatter = GetFormatter();
4706 if ( pFormatter )
4707 {
4708 sal_uInt16 nPropType = GetPropertyId( PropertyName );
4709 switch ( nPropType )
4710 {
4711 case BASEPROPERTY_DATE:
4712 {
4713 aProp <<= getDate();
4714 }
4715 break;
4717 {
4718 aProp <<= getMin();
4719 }
4720 break;
4722 {
4723 aProp <<= getMax();
4724 }
4725 break;
4727 {
4728 aProp <<= GetAs< DateField >()->IsShowDateCentury();
4729 }
4730 break;
4732 {
4733 aProp <<= GetAs< DateField >()->IsEnforceValidValue( );
4734 }
4735 break;
4736 default:
4737 {
4738 aProp = VCLXFormattedSpinField::getProperty( PropertyName );
4739 }
4740 }
4741 }
4742 return aProp;
4743}
4744
4745
4746void VCLXDateField::setDate( const util::Date& aDate )
4747{
4748 SolarMutexGuard aGuard;
4749
4750 VclPtr< DateField > pDateField = GetAs< DateField >();
4751 if ( pDateField )
4752 {
4753 pDateField->SetDate( aDate );
4754
4755 // #107218# Call same listeners like VCL would do after user interaction
4756 SetSynthesizingVCLEvent( true );
4757 pDateField->SetModifyFlag();
4758 pDateField->Modify();
4759 SetSynthesizingVCLEvent( false );
4760 }
4761}
4762
4764{
4765 SolarMutexGuard aGuard;
4766
4767 VclPtr< DateField > pDateField = GetAs< DateField >();
4768 if ( pDateField )
4769 return pDateField->GetDate().GetUNODate();
4770 else
4771 return util::Date();
4772}
4773
4774void VCLXDateField::setMin( const util::Date& aDate )
4775{
4776 SolarMutexGuard aGuard;
4777
4778 VclPtr< DateField > pDateField = GetAs< DateField >();
4779 if ( pDateField )
4780 pDateField->SetMin( aDate );
4781}
4782
4784{
4785 SolarMutexGuard aGuard;
4786
4787 VclPtr< DateField > pDateField = GetAs< DateField >();
4788 if ( pDateField )
4789 return pDateField->GetMin().GetUNODate();
4790 else
4791 return util::Date();
4792}
4793
4794void VCLXDateField::setMax( const util::Date& aDate )
4795{
4796 SolarMutexGuard aGuard;
4797
4798 VclPtr< DateField > pDateField = GetAs< DateField >();
4799 if ( pDateField )
4800 pDateField->SetMax( aDate );
4801}
4802
4804{
4805 SolarMutexGuard aGuard;
4806
4807 VclPtr< DateField > pDateField = GetAs< DateField >();
4808 if ( pDateField )
4809 return pDateField->GetMax().GetUNODate();
4810 else
4811 return util::Date();
4812}
4813
4814void VCLXDateField::setFirst( const util::Date& aDate )
4815{
4816 SolarMutexGuard aGuard;
4817
4818 VclPtr< DateField > pDateField = GetAs< DateField >();
4819 if ( pDateField )
4820 pDateField->SetFirst( aDate );
4821}
4822
4824{
4825 SolarMutexGuard aGuard;
4826
4827 VclPtr< DateField > pDateField = GetAs< DateField >();
4828 if ( pDateField )
4829 return pDateField->GetFirst().GetUNODate();
4830 else
4831 return util::Date();
4832}
4833
4834void VCLXDateField::setLast( const util::Date& aDate )
4835{
4836 SolarMutexGuard aGuard;
4837
4838 VclPtr< DateField > pDateField = GetAs< DateField >();
4839 if ( pDateField )
4840 pDateField->SetLast( aDate );
4841}
4842
4844{
4845 SolarMutexGuard aGuard;
4846
4847 VclPtr< DateField > pDateField = GetAs< DateField >();
4848 if ( pDateField )
4849 return pDateField->GetLast().GetUNODate();
4850 else
4851 return util::Date();
4852}
4853
4855{
4856 SolarMutexGuard aGuard;
4857
4858 VclPtr< DateField > pDateField = GetAs< DateField >();
4859 if ( pDateField )
4860 pDateField->SetLongFormat( bLong );
4861}
4862
4864{
4865 SolarMutexGuard aGuard;
4866
4867 VclPtr< DateField > pDateField = GetAs< DateField >();
4868 return pDateField && pDateField->IsLongFormat();
4869}
4870
4872{
4873 SolarMutexGuard aGuard;
4874
4875 VclPtr< DateField > pDateField = GetAs< DateField >();
4876 if ( pDateField )
4877 {
4878 pDateField->SetEmptyDate();
4879
4880 // #107218# Call same listeners like VCL would do after user interaction
4881 SetSynthesizingVCLEvent( true );
4882 pDateField->SetModifyFlag();
4883 pDateField->Modify();
4884 SetSynthesizingVCLEvent( false );
4885 }
4886}
4887
4889{
4890 SolarMutexGuard aGuard;
4891
4892 VclPtr< DateField > pDateField = GetAs< DateField >();
4893 return pDateField && pDateField->IsEmptyDate();
4894}
4895
4897{
4899}
4900
4902{
4904}
4905
4906
4907
4908
4909void VCLXTimeField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
4910{
4911 PushPropertyIds( rIds,
4942 0);
4944}
4945
4947{
4948}
4949
4951{
4952}
4953
4954//change the window type here to match the role
4955css::uno::Reference< css::accessibility::XAccessibleContext > VCLXTimeField::CreateAccessibleContext()
4956{
4957 VclPtr< vcl::Window > pWindow = GetWindow();
4958 if ( pWindow )
4959 {
4960 pWindow->SetType( WindowType::TIMEFIELD );
4961 }
4962 return getAccessibleFactory().createAccessibleContext( this );
4963}
4964
4965void VCLXTimeField::setTime( const util::Time& aTime )
4966{
4967 SolarMutexGuard aGuard;
4968
4969 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
4970 if ( pTimeField )
4971 {
4972 pTimeField->SetTime( aTime );
4973
4974 // #107218# Call same listeners like VCL would do after user interaction
4975 SetSynthesizingVCLEvent( true );
4976 pTimeField->SetModifyFlag();
4977 pTimeField->Modify();
4978 SetSynthesizingVCLEvent( false );
4979 }
4980}
4981
4983{
4984 SolarMutexGuard aGuard;
4985
4986 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
4987 if ( pTimeField )
4988 return pTimeField->GetTime().GetUNOTime();
4989 else
4990 return util::Time();
4991}
4992
4993void VCLXTimeField::setMin( const util::Time& aTime )
4994{
4995 SolarMutexGuard aGuard;
4996
4997 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
4998 if ( pTimeField )
4999 pTimeField->SetMin( aTime );
5000}
5001
5003{
5004 SolarMutexGuard aGuard;
5005
5006 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
5007 if ( pTimeField )
5008 return pTimeField->GetMin().GetUNOTime();
5009 else
5010 return util::Time();
5011}
5012
5013void VCLXTimeField::setMax( const util::Time& aTime )
5014{
5015 SolarMutexGuard aGuard;
5016
5017 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
5018 if ( pTimeField )
5019 pTimeField->SetMax( aTime );
5020}
5021
5023{
5024 SolarMutexGuard aGuard;
5025
5026 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
5027 if ( pTimeField )
5028 return pTimeField->GetMax().GetUNOTime();
5029 else
5030 return util::Time();
5031}
5032
5033void VCLXTimeField::setFirst( const util::Time& aTime )
5034{
5035 SolarMutexGuard aGuard;
5036
5037 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
5038 if ( pTimeField )
5039 pTimeField->SetFirst( aTime );
5040}
5041
5043{
5044 SolarMutexGuard aGuard;
5045
5046 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
5047 if ( pTimeField )
5048 return pTimeField->GetFirst().GetUNOTime();
5049 else
5050 return util::Time();
5051}
5052
5053void VCLXTimeField::setLast( const util::Time& aTime )
5054{
5055 SolarMutexGuard aGuard;
5056
5057 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
5058 if ( pTimeField )
5059 pTimeField->SetLast( aTime );
5060}
5061
5063{
5064 SolarMutexGuard aGuard;
5065
5066 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
5067 if ( pTimeField )
5068 return pTimeField->GetLast().GetUNOTime();
5069 else
5070 return util::Time();
5071}
5072
5074{
5075 SolarMutexGuard aGuard;
5076
5077 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
5078 if ( pTimeField )
5079 pTimeField->SetEmptyTime();
5080}
5081
5083{
5084 SolarMutexGuard aGuard;
5085
5086 VclPtr< TimeField > pTimeField = GetAs< TimeField >();
5087 return pTimeField && pTimeField->IsEmptyTime();
5088}
5089
5091{
5093}
5094
5096{
5098}
5099
5100
5101void VCLXTimeField::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
5102{
5103 SolarMutexGuard aGuard;
5104
5105 if ( !(GetWindow()) )
5106 return;
5107
5108 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
5109
5110 sal_uInt16 nPropType = GetPropertyId( PropertyName );
5111 switch ( nPropType )
5112 {
5113 case BASEPROPERTY_TIME:
5114 {
5115 if ( bVoid )
5116 {
5117 GetAs< TimeField >()->EnableEmptyFieldValue( true );
5118 GetAs< TimeField >()->SetEmptyFieldValue();
5119 }
5120 else
5121 {
5122 util::Time t;
5123 if ( Value >>= t )
5124 setTime( t );
5125 }
5126 }
5127 break;
5129 {
5130 util::Time t;
5131 if ( Value >>= t )
5132 setMin( t );
5133 }
5134 break;
5136 {
5137 util::Time t;
5138 if ( Value >>= t )
5139 setMax( t );
5140 }
5141 break;
5143 {
5144 sal_Int16 n = sal_Int16();
5145 if ( Value >>= n )
5146 GetAs< TimeField >()->SetExtFormat( static_cast<ExtTimeFieldFormat>(n) );
5147 }
5148 break;
5150 {
5151 bool bEnforce( true );
5152 OSL_VERIFY( Value >>= bEnforce );
5153 GetAs< TimeField >()->EnforceValidValue( bEnforce );
5154 }
5155 break;
5156 default:
5157 {
5159 }
5160 }
5161}
5162
5163css::uno::Any VCLXTimeField::getProperty( const OUString& PropertyName )
5164{
5165 SolarMutexGuard aGuard;
5166
5167 css::uno::Any aProp;
5168 if ( GetWindow() )
5169 {
5170 sal_uInt16 nPropType = GetPropertyId( PropertyName );
5171 switch ( nPropType )
5172 {
5173 case BASEPROPERTY_TIME:
5174 {
5175 aProp <<= getTime();
5176 }
5177 break;
5179 {
5180 aProp <<= getMin();
5181 }
5182 break;
5184 {
5185 aProp <<= getMax();
5186 }
5187 break;
5189 {
5190 aProp <<= GetAs< TimeField >()->IsEnforceValidValue( );
5191 }
5192 break;
5193 default:
5194 {
5195 aProp = VCLXFormattedSpinField::getProperty( PropertyName );
5196 }
5197 }
5198 }
5199 return aProp;
5200}
5201
5202
5203
5204
5205void VCLXNumericField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
5206{
5207 PushPropertyIds( rIds,
5239 0);
5241}
5242
5244{
5245}
5246
5248{
5249}
5250
5251void VCLXNumericField::setValue( double Value )
5252{
5253 SolarMutexGuard aGuard;
5254
5255 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5256 if ( !pNumericFormatter )
5257 return;
5258
5259 // shift long value using decimal digits
5260 // (e.g., input 105 using 2 digits returns 1,05)
5261 // Thus, to set a value of 1,05, insert 105 and 2 digits
5262 pNumericFormatter->SetValue(
5263 static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) );
5264
5265 // #107218# Call same listeners like VCL would do after user interaction
5266 VclPtr< Edit > pEdit = GetAs< Edit >();
5267 if ( pEdit )
5268 {
5269 SetSynthesizingVCLEvent( true );
5270 pEdit->SetModifyFlag();
5271 pEdit->Modify();
5272 SetSynthesizingVCLEvent( false );
5273 }
5274}
5275
5277{
5278 SolarMutexGuard aGuard;
5279
5280 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5281 return pNumericFormatter
5282 ? ImplCalcDoubleValue( static_cast<double>(pNumericFormatter->GetValue()), pNumericFormatter->GetDecimalDigits() )
5283 : 0;
5284}
5285
5286void VCLXNumericField::setMin( double Value )
5287{
5288 SolarMutexGuard aGuard;
5289
5290 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5291 if ( pNumericFormatter )
5292 pNumericFormatter->SetMin(
5293 static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) );
5294}
5295
5297{
5298 SolarMutexGuard aGuard;
5299
5300 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5301 return pNumericFormatter
5302 ? ImplCalcDoubleValue( static_cast<double>(pNumericFormatter->GetMin()), pNumericFormatter->GetDecimalDigits() )
5303 : 0;
5304}
5305
5306void VCLXNumericField::setMax( double Value )
5307{
5308 SolarMutexGuard aGuard;
5309
5310 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5311 if ( pNumericFormatter )
5312 pNumericFormatter->SetMax(
5313 static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) );
5314}
5315
5317{
5318 SolarMutexGuard aGuard;
5319
5320 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5321 return pNumericFormatter
5322 ? ImplCalcDoubleValue( static_cast<double>(pNumericFormatter->GetMax()), pNumericFormatter->GetDecimalDigits() )
5323 : 0;
5324}
5325
5326void VCLXNumericField::setFirst( double Value )
5327{
5328 SolarMutexGuard aGuard;
5329
5330 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5331 if ( pNumericFormatter )
5332 pNumericFormatter->SetFirst(
5333 static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) );
5334}
5335
5337{
5338 SolarMutexGuard aGuard;
5339
5340 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5341 return pNumericFormatter
5342 ? ImplCalcDoubleValue( static_cast<double>(pNumericFormatter->GetFirst()), pNumericFormatter->GetDecimalDigits() )
5343 : 0;
5344}
5345
5346void VCLXNumericField::setLast( double Value )
5347{
5348 SolarMutexGuard aGuard;
5349
5350 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5351 if ( pNumericFormatter )
5352 pNumericFormatter->SetLast(
5353 static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) );
5354}
5355
5357{
5358 SolarMutexGuard aGuard;
5359
5360 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5361 return pNumericFormatter
5362 ? ImplCalcDoubleValue( static_cast<double>(pNumericFormatter->GetLast()), pNumericFormatter->GetDecimalDigits() )
5363 : 0;
5364}
5365
5367{
5369}
5370
5372{
5374}
5375
5377{
5378 SolarMutexGuard aGuard;
5379
5380 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5381 if ( pNumericFormatter )
5382 pNumericFormatter->SetSpinSize(
5383 static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) );
5384}
5385
5387{
5388 SolarMutexGuard aGuard;
5389
5390 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5391 return pNumericFormatter
5392 ? ImplCalcDoubleValue( static_cast<double>(pNumericFormatter->GetSpinSize()), pNumericFormatter->GetDecimalDigits() )
5393 : 0;
5394}
5395
5397{
5398 SolarMutexGuard aGuard;
5399
5400 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5401 if ( pNumericFormatter )
5402 {
5403 double n = getValue();
5404 pNumericFormatter->SetDecimalDigits( Value );
5405 setValue( n );
5406 }
5407}
5408
5410{
5411 SolarMutexGuard aGuard;
5412
5413 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5414 return pNumericFormatter ? pNumericFormatter->GetDecimalDigits() : 0;
5415}
5416
5417void VCLXNumericField::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
5418{
5419 SolarMutexGuard aGuard;
5420
5421 if ( !(GetWindow()) )
5422 return;
5423
5424 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
5425
5426 sal_uInt16 nPropType = GetPropertyId( PropertyName );
5427 switch ( nPropType )
5428 {
5430 {
5431 if ( bVoid )
5432 {
5433 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5434 if (!pNumericFormatter)
5435 return;
5436 pNumericFormatter->EnableEmptyFieldValue( true );
5437 pNumericFormatter->SetEmptyFieldValue();
5438 }
5439 else
5440 {
5441 double d = 0;
5442 if ( Value >>= d )
5443 setValue( d );
5444 }
5445 }
5446 break;
5448 {
5449 double d = 0;
5450 if ( Value >>= d )
5451 setMin( d );
5452 }
5453 break;
5455 {
5456 double d = 0;
5457 if ( Value >>= d )
5458 setMax( d );
5459 }
5460 break;
5462 {
5463 double d = 0;
5464 if ( Value >>= d )
5465 setSpinSize( d );
5466 }
5467 break;
5469 {
5470 sal_Int16 n = sal_Int16();
5471 if ( Value >>= n )
5473 }
5474 break;
5476 {
5477 bool b = bool();
5478 if ( Value >>= b )
5479 {
5480 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5481 if (!pNumericFormatter)
5482 return;
5483 pNumericFormatter->SetUseThousandSep( b );
5484 }
5485 }
5486 break;
5487 default:
5488 {
5490 }
5491 }
5492}
5493
5494css::uno::Any VCLXNumericField::getProperty( const OUString& PropertyName )
5495{
5496 SolarMutexGuard aGuard;
5497
5498 css::uno::Any aProp;
5499 FormatterBase* pFormatter = GetFormatter();
5500 if ( pFormatter )
5501 {
5502 sal_uInt16 nPropType = GetPropertyId( PropertyName );
5503 switch ( nPropType )
5504 {
5506 {
5507 aProp <<= getValue();
5508 }
5509 break;
5511 {
5512 aProp <<= getMin();
5513 }
5514 break;
5516 {
5517 aProp <<= getMax();
5518 }
5519 break;
5521 {
5522 aProp <<= getSpinSize();
5523 }
5524 break;
5526 {
5527 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(pFormatter);
5528 aProp <<= pNumericFormatter->IsUseThousandSep();
5529 }
5530 break;
5531 default:
5532 {
5533 aProp = VCLXFormattedSpinField::getProperty( PropertyName );
5534 }
5535 }
5536 }
5537 return aProp;
5538}
5539
5540
5541// ----------------------------------------------------
5542// ----------------------------------------------------
5543
5544void VCLXMetricField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
5545{
5546 PushPropertyIds( rIds,
5573 0);
5575}
5576
5578{
5579}
5580
5582{
5583}
5584
5586{
5587 MetricFormatter *pFormatter = static_cast<MetricFormatter *>(GetFormatter());
5588 if (!pFormatter)
5589 throw css::uno::RuntimeException();
5590 return pFormatter;
5591}
5592
5594{
5595 VclPtr< MetricField > pField = GetAs< MetricField >();
5596 if (!pField)
5597 throw css::uno::RuntimeException();
5598 return pField;
5599}
5600
5601// FIXME: later ...
5602#define MetricUnitUnoToVcl(a) (static_cast<FieldUnit>(a))
5603
5604#define METRIC_MAP_PAIR(method,parent) \
5605 sal_Int64 VCLXMetricField::get##method( sal_Int16 nUnit ) \
5606 { \
5607 SolarMutexGuard aGuard; \
5608 return GetMetric##parent()->Get##method( MetricUnitUnoToVcl( nUnit ) ); \
5609 } \
5610 void VCLXMetricField::set##method( sal_Int64 nValue, sal_Int16 nUnit ) \
5611 { \
5612 SolarMutexGuard aGuard; \
5613 GetMetric##parent()->Set##method( nValue, MetricUnitUnoToVcl( nUnit ) ); \
5614 }
5615
5618METRIC_MAP_PAIR(First, Field)
5619METRIC_MAP_PAIR(Last, Field)
5620
5621#undef METRIC_MAP_PAIR
5622
5623::sal_Int64 VCLXMetricField::getValue( ::sal_Int16 nUnit )
5624{
5625 SolarMutexGuard aGuard;
5626 return GetMetricFormatter()->GetValue( MetricUnitUnoToVcl( nUnit ) );
5627}
5628
5629::sal_Int64 VCLXMetricField::getCorrectedValue( ::sal_Int16 nUnit )
5630{
5631 SolarMutexGuard aGuard;
5633}
5634
5635// FIXME: acute cut/paste evilness - move this to the parent Edit class ?
5637{
5638 // #107218# Call same listeners like VCL would do after user interaction
5639 VclPtr< Edit > pEdit = GetAs< Edit >();
5640 if ( pEdit )
5641 {
5642 SetSynthesizingVCLEvent( true );
5643 pEdit->SetModifyFlag();
5644 pEdit->Modify();
5645 SetSynthesizingVCLEvent( false );
5646 }
5647}
5648
5649void VCLXMetricField::setValue( ::sal_Int64 Value, ::sal_Int16 Unit )
5650{
5651 SolarMutexGuard aGuard;
5653 CallListeners();
5654}
5655
5656void VCLXMetricField::setUserValue( ::sal_Int64 Value, ::sal_Int16 Unit )
5657{
5658 SolarMutexGuard aGuard;
5660 CallListeners();
5661}
5662
5664{
5666}
5667
5669{
5671}
5672
5673void VCLXMetricField::setSpinSize( sal_Int64 Value )
5674{
5675 SolarMutexGuard aGuard;
5676 GetMetricField()->SetSpinSize( Value );
5677}
5678
5680{
5681 SolarMutexGuard aGuard;
5682 return GetMetricField()->GetSpinSize();
5683}
5684
5686{
5687 SolarMutexGuard aGuard;
5688 GetMetricFormatter()->SetDecimalDigits( Value );
5689}
5690
5692{
5693 SolarMutexGuard aGuard;
5694
5695 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5696 return pNumericFormatter ? pNumericFormatter->GetDecimalDigits() : 0;
5697}
5698
5699void VCLXMetricField::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
5700{
5701 SolarMutexGuard aGuard;
5702
5703 if ( !(GetWindow()) )
5704 return;
5705
5706 sal_uInt16 nPropType = GetPropertyId( PropertyName );
5707 switch ( nPropType )
5708 {
5710 {
5711 sal_Int16 n = 0;
5712 if ( Value >>= n )
5714 break;
5715 }
5717 {
5718 bool b = false;
5719 if ( Value >>= b )
5720 {
5721 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
5722 if (!pNumericFormatter)
5723 return;
5724 pNumericFormatter->SetUseThousandSep( b );
5725 }
5726 }
5727 break;
5728 case BASEPROPERTY_UNIT:
5729 {
5730 sal_uInt16 nVal = 0;
5731 if ( Value >>= nVal )
5732 GetAs< MetricField >()->SetUnit( static_cast<FieldUnit>(nVal) );
5733 break;
5734 }
5736 {
5737 OUString aStr;
5738 if ( Value >>= aStr )
5739 GetAs< MetricField >()->SetCustomUnitText( aStr );
5740 break;
5741 }
5742 default:
5743 {
5745 break;
5746 }
5747 }
5748}
5749
5750css::uno::Any VCLXMetricField::getProperty( const OUString& PropertyName )
5751{
5752 SolarMutexGuard aGuard;
5753
5754 css::uno::Any aProp;
5755 FormatterBase* pFormatter = GetFormatter();
5756 if ( pFormatter )
5757 {
5758 sal_uInt16 nPropType = GetPropertyId( PropertyName );
5759 switch ( nPropType )
5760 {
5762 {
5763 NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(pFormatter);
5764 aProp <<= pNumericFormatter->IsUseThousandSep();
5765 break;
5766 }
5767 case BASEPROPERTY_UNIT:
5768 aProp <<= static_cast<sal_uInt16>(GetAs< MetricField >()->GetUnit());
5769 break;
5771 aProp <<= GetAs< MetricField >()->GetCustomUnitText();
5772 break;
5773 default:
5774 {
5775 aProp = VCLXFormattedSpinField::getProperty( PropertyName );
5776 break;
5777 }
5778 }
5779 }
5780 return aProp;
5781}
5782
5783void VCLXPatternField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
5784{
5785 PushPropertyIds( rIds,
5811 0);
5813}
5814
5816{
5817}
5818
5820{
5821}
5822
5823void VCLXPatternField::setMasks( const OUString& EditMask, const OUString& LiteralMask )
5824{
5825 SolarMutexGuard aGuard;
5826
5827 VclPtr< PatternField > pPatternField = GetAs< PatternField >();
5828 if ( pPatternField )
5829 {
5830 pPatternField->SetMask( OUStringToOString(EditMask, RTL_TEXTENCODING_ASCII_US), LiteralMask );
5831 }
5832}
5833
5834void VCLXPatternField::getMasks( OUString& EditMask, OUString& LiteralMask )
5835{
5836 SolarMutexGuard aGuard;
5837
5838 VclPtr< PatternField > pPatternField = GetAs< PatternField >();
5839 if ( pPatternField )
5840 {
5841 EditMask = OStringToOUString(pPatternField->GetEditMask(), RTL_TEXTENCODING_ASCII_US);
5842 LiteralMask = pPatternField->GetLiteralMask();
5843 }
5844}
5845
5846void VCLXPatternField::setString( const OUString& Str )
5847{
5848 SolarMutexGuard aGuard;
5849 VclPtr< PatternField > pPatternField = GetAs< PatternField >();
5850 if ( pPatternField )
5851 pPatternField->SetString( Str );
5852}
5853
5855{
5856 SolarMutexGuard aGuard;
5857
5858 OUString aString;
5859 VclPtr< PatternField > pPatternField = GetAs< PatternField >();
5860 if ( pPatternField )
5861 aString = pPatternField->GetString();
5862 return aString;
5863}
5864
5866{
5868}
5869
5871{
5873}
5874
5875void VCLXPatternField::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
5876{
5877 SolarMutexGuard aGuard;
5878
5879 if ( !(GetWindow()) )
5880 return;
5881
5882 sal_uInt16 nPropType = GetPropertyId( PropertyName );
5883 switch ( nPropType )
5884 {
5887 {
5888 OUString aString;
5889 if ( Value >>= aString )
5890 {
5891 OUString aEditMask, aLiteralMask;
5892 getMasks( aEditMask, aLiteralMask );
5893 if ( nPropType == BASEPROPERTY_EDITMASK )
5894 aEditMask = aString;
5895 else
5896 aLiteralMask = aString;
5897 setMasks( aEditMask, aLiteralMask );
5898 }
5899 }
5900 break;
5901 default:
5902 {
5904 }
5905 }
5906}
5907
5908css::uno::Any VCLXPatternField::getProperty( const OUString& PropertyName )
5909{
5910 SolarMutexGuard aGuard;
5911
5912 css::uno::Any aProp;
5913 if ( GetWindow() )
5914 {
5915 sal_uInt16 nPropType = GetPropertyId( PropertyName );
5916 switch ( nPropType )
5917 {
5920 {
5921 OUString aEditMask, aLiteralMask;
5922 getMasks( aEditMask, aLiteralMask );
5923 if ( nPropType == BASEPROPERTY_EDITMASK )
5924 aProp <<= aEditMask;
5925 else
5926 aProp <<= aLiteralMask;
5927 }
5928 break;
5929 default:
5930 {
5931 aProp = VCLXFormattedSpinField::getProperty( PropertyName );
5932 }
5933 }
5934 }
5935 return aProp;
5936}
5937
5938
5939
5941{
5942}
5943
5945{
5946}
5947
5948css::uno::Reference< css::accessibility::XAccessibleContext > VCLXToolBox::CreateAccessibleContext()
5949{
5951}
5952
5954{
5955}
5956
5958{
5959}
5960
5961css::uno::Reference< css::accessibility::XAccessibleContext > VCLXHeaderBar::CreateAccessibleContext()
5962{
5964}
5965
5966
5968{
5969}
5970
5971void VCLXFrame::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
5972{
5973 PushPropertyIds( rIds,
5984 0);
5986}
5987
5989{
5990}
5991
5992// css::awt::XView
5993void SAL_CALL VCLXFrame::draw( sal_Int32 nX, sal_Int32 nY )
5994{
5995 SolarMutexGuard aGuard;
5996 VclPtr< vcl::Window > pWindow = GetWindow();
5997
5998 if ( pWindow )
5999 {
6000 OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
6001 if ( !pDev )
6002 pDev = pWindow->GetParent()->GetOutDev();
6003
6004 Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
6005 pWindow->Draw( pDev, aPos, SystemTextColorFlags::NoControls );
6006 }
6007}
6008
6010 const OUString& PropertyName,
6011 const css::uno::Any& Value )
6012{
6013 SolarMutexGuard aGuard;
6014
6015 VCLXContainer::setProperty( PropertyName, Value );
6016}
6017
6018void VCLXFrame::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
6019{
6020 css::uno::Reference< css::awt::XWindow > xKeepAlive( this );
6021 VCLXContainer::ProcessWindowEvent( rVclWindowEvent );
6022}
6023
6025 :m_nValue(0)
6026 ,m_nValueMin(0)
6027 ,m_nValueMax(100)
6028{
6029}
6030
6032{
6033}
6034
6036{
6037 VclPtr< ProgressBar > pProgressBar = GetAs< ProgressBar >();
6038 if ( !pProgressBar )
6039 return;
6040
6041 sal_Int32 nVal;
6042 sal_Int32 nValMin;
6043 sal_Int32 nValMax;
6044
6045 // check min and max
6047 {
6048 nValMin = m_nValueMin;
6049 nValMax = m_nValueMax;
6050 }
6051 else
6052 {
6053 nValMin = m_nValueMax;
6054 nValMax = m_nValueMin;
6055 }
6056
6057 // check value
6058 if (m_nValue < nValMin)
6059 {
6060 nVal = nValMin;
6061 }
6062 else if (m_nValue > nValMax)
6063 {
6064 nVal = nValMax;
6065 }
6066 else
6067 {
6068 nVal = m_nValue;
6069 }
6070
6071 // calculate percent
6072 sal_Int32 nPercent;
6073 if (nValMin != nValMax)
6074 {
6075 nPercent = 100 * (nVal - nValMin) / (nValMax - nValMin);
6076 }
6077 else
6078 {
6079 nPercent = 0;
6080 }
6081
6082 // set progressbar value
6083 pProgressBar->SetValue( static_cast<sal_uInt16>(nPercent) );
6084}
6085
6086// css::awt::XProgressBar
6088{
6089 SolarMutexGuard aGuard;
6090
6091 VclPtr<vcl::Window> pWindow = GetWindow();
6092 if ( pWindow )
6093 {
6094 pWindow->SetControlForeground( Color(ColorTransparency, nColor) );
6095 }
6096}
6097
6099{
6100 SolarMutexGuard aGuard;
6101
6102 VclPtr<vcl::Window> pWindow = GetWindow();
6103 if ( pWindow )
6104 {
6105 Color aColor( ColorTransparency, nColor );
6106 pWindow->SetBackground( aColor );
6107 pWindow->SetControlBackground( aColor );
6108 pWindow->Invalidate();
6109 }
6110}
6111
6112void VCLXProgressBar::setValue( sal_Int32 nValue )
6113{
6114 SolarMutexGuard aGuard;
6115
6116 m_nValue = nValue;
6118}
6119
6120void VCLXProgressBar::setRange( sal_Int32 nMin, sal_Int32 nMax )
6121{
6122 SolarMutexGuard aGuard;
6123
6124 if ( nMin < nMax )
6125 {
6126 // take correct min and max
6127 m_nValueMin = nMin;
6128 m_nValueMax = nMax;
6129 }
6130 else
6131 {
6132 // change min and max
6133 m_nValueMin = nMax;
6134 m_nValueMax = nMin;
6135 }
6136
6138}
6139
6141{
6142 SolarMutexGuard aGuard;
6143
6144 return m_nValue;
6145}
6146
6147// css::awt::VclWindowPeer
6148void VCLXProgressBar::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
6149{
6150 SolarMutexGuard aGuard;
6151
6152 VclPtr< ProgressBar > pProgressBar = GetAs< ProgressBar >();
6153 if ( !pProgressBar )
6154 return;
6155
6156 sal_uInt16 nPropType = GetPropertyId( PropertyName );
6157 switch ( nPropType )
6158 {
6160 {
6161 if ( Value >>= m_nValue )
6163 }
6164 break;
6166 {
6167 if ( Value >>= m_nValueMin )
6169 }
6170 break;
6172 {
6173 if ( Value >>= m_nValueMax )
6175 }
6176 break;
6178 {
6179 VclPtr<vcl::Window> pWindow = GetWindow();
6180 if ( pWindow )
6181 {
6182 bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID;
6183
6184 if ( bVoid )
6185 {
6186 pWindow->SetControlForeground();
6187 }
6188 else
6189 {
6190 Color nColor;
6191 if ( Value >>= nColor )
6192 pWindow->SetControlForeground( nColor );
6193 }
6194 }
6195 }
6196 break;
6197 default:
6198 VCLXWindow::setProperty( PropertyName, Value );
6199 break;
6200 }
6201}
6202
6203css::uno::Any VCLXProgressBar::getProperty( const OUString& PropertyName )
6204{
6205 SolarMutexGuard aGuard;
6206
6207 css::uno::Any aProp;
6208 VclPtr< ProgressBar > pProgressBar = GetAs< ProgressBar >();
6209 if ( pProgressBar )
6210 {
6211 sal_uInt16 nPropType = GetPropertyId( PropertyName );
6212 switch ( nPropType )
6213 {
6215 {
6216 aProp <<= m_nValue;
6217 }
6218 break;
6220 {
6221 aProp <<= m_nValueMin;
6222 }
6223 break;
6225 {
6226 aProp <<= m_nValueMax;
6227 }
6228 break;
6229 default:
6230 aProp = VCLXWindow::getProperty( PropertyName );
6231 break;
6232 }
6233 }
6234 return aProp;
6235}
6236
6237void VCLXProgressBar::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
6238{
6239 PushPropertyIds( rIds,
6244 0);
6245 VCLXWindow::ImplGetPropertyIds( rIds, true );
6246}
6247
6248VCLXFileControl::VCLXFileControl() : maTextListeners( *this )
6249{
6250}
6251
6253{
6254 VclPtr< FileControl > pControl = GetAs< FileControl >();
6255 if ( pControl )
6256 pControl->GetEdit().SetModifyHdl( Link<Edit&,void>() );
6257}
6258
6259namespace
6260{
6261 void lcl_setWinBits( vcl::Window* _pWindow, WinBits _nBits, bool _bSet )
6262 {
6263 WinBits nStyle = _pWindow->GetStyle();
6264 if ( _bSet )
6265 nStyle |= _nBits;
6266 else
6267 nStyle &= ~_nBits;
6268 _pWindow->SetStyle( nStyle );
6269 }
6270}
6271
6272void SAL_CALL VCLXFileControl::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
6273{
6274 SolarMutexGuard aGuard;
6275
6276 VclPtr< FileControl > pControl = GetAs< FileControl >();
6277 if ( !pControl )
6278 return;
6279
6280 sal_uInt16 nPropType = GetPropertyId( PropertyName );
6281 switch ( nPropType )
6282 {
6284 {
6285 bool bValue(false);
6286 OSL_VERIFY( Value >>= bValue );
6287
6288 lcl_setWinBits( pControl, WB_NOHIDESELECTION, !bValue );
6289 lcl_setWinBits( &pControl->GetEdit(), WB_NOHIDESELECTION, !bValue );
6290 }
6291 break;
6292
6293 default:
6294 VCLXWindow::setProperty( PropertyName, Value );
6295 break;
6296 }
6297}
6298
6300{
6301 VclPtr< FileControl > pPrevFileControl = GetAsDynamic< FileControl >();
6302 if ( pPrevFileControl )
6303 pPrevFileControl->SetEditModifyHdl( Link<Edit&,void>() );
6304
6305 FileControl* pNewFileControl = dynamic_cast<FileControl*>( pWindow.get() );
6306 if ( pNewFileControl )
6307 pNewFileControl->SetEditModifyHdl( LINK( this, VCLXFileControl, ModifyHdl ) );
6308
6309 VCLXWindow::SetWindow( pWindow );
6310}
6311
6312void VCLXFileControl::addTextListener( const css::uno::Reference< css::awt::XTextListener > & l )
6313{
6314 maTextListeners.addInterface( l );
6315}
6316
6317void VCLXFileControl::removeTextListener( const css::uno::Reference< css::awt::XTextListener > & l )
6318{
6319 maTextListeners.removeInterface( l );
6320}
6321
6322void VCLXFileControl::setText( const OUString& aText )
6323{
6324 SolarMutexGuard aGuard;
6325
6326 VclPtr<vcl::Window> pWindow = GetWindow();
6327 if ( pWindow )
6328 {
6329 pWindow->SetText( aText );
6330
6331 // also in Java a textChanged is triggered, not in VCL.
6332 // css::awt::Toolkit should be JAVA-compliant...
6333 ModifyHdl();
6334 }
6335}
6336
6337void VCLXFileControl::insertText( const css::awt::Selection& rSel, const OUString& aText )
6338{
6339 SolarMutexGuard aGuard;
6340
6341 VclPtr< FileControl > pFileControl = GetAs< FileControl >();
6342 if ( pFileControl )
6343 {
6344 pFileControl->GetEdit().SetSelection( Selection( rSel.Min, rSel.Max ) );
6345 pFileControl->GetEdit().ReplaceSelected( aText );
6346 }
6347}
6348
6350{
6351 SolarMutexGuard aGuard;
6352
6353 OUString aText;
6354 VclPtr<vcl::Window> pWindow = GetWindow();
6355 if ( pWindow )
6356 aText = pWindow->GetText();
6357 return aText;
6358}
6359
6361{
6362 SolarMutexGuard aGuard;
6363
6364 OUString aText;
6365 VclPtr< FileControl > pFileControl = GetAs< FileControl >();
6366 if ( pFileControl)
6367 aText = pFileControl->GetEdit().GetSelected();
6368 return aText;
6369
6370}
6371
6372void VCLXFileControl::setSelection( const css::awt::Selection& aSelection )
6373{
6374 SolarMutexGuard aGuard;
6375
6376 VclPtr< FileControl > pFileControl = GetAs< FileControl >();
6377 if ( pFileControl )
6378 pFileControl->GetEdit().SetSelection( Selection( aSelection.Min, aSelection.Max ) );
6379}
6380
6382{
6383 SolarMutexGuard aGuard;
6384
6385 css::awt::Selection aSel;
6386 VclPtr< FileControl > pFileControl = GetAs< FileControl >();
6387 if ( pFileControl )
6388 {
6389 aSel.Min = pFileControl->GetEdit().GetSelection().Min();
6390 aSel.Max = pFileControl->GetEdit().GetSelection().Max();
6391 }
6392 return aSel;
6393}
6394
6396{
6397 SolarMutexGuard aGuard;
6398
6399 VclPtr< FileControl > pFileControl = GetAs< FileControl >();
6400 return pFileControl && !pFileControl->GetEdit().IsReadOnly() && pFileControl->GetEdit().IsEnabled();
6401}
6402
6404{
6405 SolarMutexGuard aGuard;
6406
6407 VclPtr< FileControl > pFileControl = GetAs< FileControl >();
6408 if ( pFileControl )
6409 pFileControl->GetEdit().SetReadOnly( !bEditable );
6410}
6411
6413{
6414 SolarMutexGuard aGuard;
6415
6416 VclPtr< FileControl > pFileControl = GetAs< FileControl >();
6417 if ( pFileControl )
6418 pFileControl->GetEdit().SetMaxTextLen( nLen );
6419}
6420
6422{
6423 SolarMutexGuard aGuard;
6424
6425 VclPtr< FileControl > pFileControl = GetAs< FileControl >();
6426 return pFileControl ? pFileControl->GetEdit().GetMaxTextLen() : 0;
6427}
6428
6429
6431{
6432 ModifyHdl();
6433}
6434
6436{
6437 css::awt::TextEvent aEvent;
6438 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
6439 maTextListeners.textChanged( aEvent );
6440}
6441
6443{
6444 SolarMutexGuard aGuard;
6445
6446 css::awt::Size aSz;
6447 VclPtr< FileControl > pControl = GetAs< FileControl >();
6448 if ( pControl )
6449 {
6450 Size aTmpSize = pControl->GetEdit().CalcMinimumSize();
6451 aTmpSize.AdjustWidth(pControl->GetButton().CalcMinimumSize().Width() );
6452 aSz = AWTSize(pControl->CalcWindowSize( aTmpSize ));
6453 }
6454 return aSz;
6455}
6456
6458{
6459 css::awt::Size aSz = getMinimumSize();
6460 aSz.Height += 4;
6461 return aSz;
6462}
6463
6464css::awt::Size VCLXFileControl::calcAdjustedSize( const css::awt::Size& rNewSize )
6465{
6466 SolarMutexGuard aGuard;
6467
6468 css::awt::Size aSz =rNewSize;
6469 VclPtr< FileControl > pControl = GetAs< FileControl >();
6470 if ( pControl )
6471 {
6472 css::awt::Size aMinSz = getMinimumSize();
6473 if ( aSz.Height != aMinSz.Height )
6474 aSz.Height = aMinSz.Height;
6475 }
6476 return aSz;
6477}
6478
6479css::awt::Size VCLXFileControl::getMinimumSize( sal_Int16 nCols, sal_Int16 )
6480{
6481 SolarMutexGuard aGuard;
6482
6483 css::awt::Size aSz;
6484 VclPtr< FileControl > pControl = GetAs< FileControl >();
6485 if ( pControl )
6486 {
6487 aSz = AWTSize(pControl->GetEdit().CalcSize( nCols ));
6488 aSz.Width += pControl->GetButton().CalcMinimumSize().Width();
6489 }
6490 return aSz;
6491}
6492
6493void VCLXFileControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines )
6494{
6495 SolarMutexGuard aGuard;
6496
6497 nCols = 0;
6498 nLines = 1;
6499 VclPtr< FileControl > pControl = GetAs< FileControl >();
6500 if ( pControl )
6501 nCols = pControl->GetEdit().GetMaxVisChars();
6502}
6503
6504void VCLXFileControl::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
6505{
6506 PushPropertyIds( rIds,
6507 // FIXME: elide duplication ?
6509 0);
6510 VCLXWindow::ImplGetPropertyIds( rIds, true );
6511}
6512
6514 :bIsStandardSupplier(true)
6515 ,nKeyToSetDelayed(-1)
6516{
6517}
6518
6520{
6521}
6522
6524{
6525 VCLXSpinField::SetWindow(_pWindow);
6526 if (GetAs< FormattedField >())
6527 GetAs< FormattedField >()->GetFormatter().SetAutoColor(true);
6528}
6529
6530void SVTXFormattedField::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
6531{
6532 SolarMutexGuard aGuard;
6533
6534 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6535 if ( pField )
6536 {
6537 Formatter& rFormatter = pField->GetFormatter();
6538 sal_uInt16 nPropType = GetPropertyId( PropertyName );
6539 switch (nPropType)
6540 {
6542 {
6543 bool bEnable( true );
6544 if ( Value >>= bEnable )
6545 rFormatter.EnableNotANumber( !bEnable );
6546 }
6547 break;
6548
6552 break;
6553
6557 break;
6558
6561 break;
6562
6564 {
6565 bool b;
6566 if ( Value >>= b )
6568 }
6569 break;
6570
6572 if (!Value.hasValue())
6573 setFormatsSupplier(css::uno::Reference< css::util::XNumberFormatsSupplier > (nullptr));
6574 else
6575 {
6576 css::uno::Reference< css::util::XNumberFormatsSupplier > xNFS;
6577 if ( Value >>= xNFS )
6578 setFormatsSupplier(xNFS);
6579 }
6580 break;
6582 if (!Value.hasValue())
6583 setFormatKey(0);
6584 else
6585 {
6586 sal_Int32 n = 0;
6587 if ( Value >>= n )
6588 setFormatKey(n);
6589 }
6590 break;
6591
6594 {
6595 const css::uno::TypeClass rTC = Value.getValueType().getTypeClass();
6596 if (rTC != css::uno::TypeClass_STRING)
6597 // no string
6598 if (rTC != css::uno::TypeClass_DOUBLE)
6599 // no double
6600 if (Value.hasValue())
6601 { // but a value
6602 // try if it is something convertible
6603 sal_Int32 nValue = 0;
6604 if (!(Value >>= nValue))
6605 throw css::lang::IllegalArgumentException();
6606 SetValue(css::uno::Any(static_cast<double>(nValue)));
6607 break;
6608 }
6609
6610 SetValue(Value);
6611 }
6612 break;
6614 {
6615 double d = 0.0;
6616 if ( Value >>= d )
6617 rFormatter.SetSpinSize( d );
6618 else
6619 {
6620 sal_Int32 n = 0;
6621 if ( Value >>= n )
6622 rFormatter.SetSpinSize( n );
6623 }
6624 }
6625 break;
6627 {
6628 sal_Int32 n = 0;
6629 if ( Value >>= n )
6630 rFormatter.SetDecimalDigits( static_cast<sal_uInt16>(n) );
6631 }
6632 break;
6634 {
6635 bool b;
6636 if ( Value >>= b )
6637 rFormatter.SetThousandsSep( b );
6638 }
6639 break;
6640
6641 default:
6642 VCLXSpinField::setProperty( PropertyName, Value );
6643 }
6644
6645 if (BASEPROPERTY_TEXTCOLOR == nPropType)
6646 { // after setting a new text color, think again about the AutoColor flag of the control
6647 // 17.05.2001 - 86859 - frank.schoenheit@germany.sun.com
6648 rFormatter.SetAutoColor(!Value.hasValue());
6649 }
6650 }
6651 else
6652 VCLXSpinField::setProperty( PropertyName, Value );
6653}
6654
6655css::uno::Any SVTXFormattedField::getProperty( const OUString& PropertyName )
6656{
6657 SolarMutexGuard aGuard;
6658
6659 css::uno::Any aReturn;
6660
6661 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6662 if ( pField )
6663 {
6664 Formatter& rFormatter = pField->GetFormatter();
6665 sal_uInt16 nPropType = GetPropertyId( PropertyName );
6666 switch (nPropType)
6667 {
6670 aReturn = GetMinValue();
6671 break;
6672
6675 aReturn = GetMaxValue();
6676 break;
6677
6679 aReturn = GetDefaultValue();
6680 break;
6681
6683 aReturn <<= GetTreatAsNumber();
6684 break;
6685
6688 aReturn = GetValue();
6689 break;
6690
6692 aReturn <<= rFormatter.GetSpinSize();
6693 break;
6694
6696 aReturn <<= rFormatter.GetDecimalDigits();
6697 break;
6698
6700 {
6702 { // ansonsten void
6703 css::uno::Reference< css::util::XNumberFormatsSupplier > xSupplier = m_xCurrentSupplier;
6704 aReturn <<= xSupplier;
6705 }
6706 }
6707 break;
6708
6710 {
6712 aReturn <<= getFormatKey();
6713 }
6714 break;
6715
6716 default:
6717 aReturn = VCLXSpinField::getProperty(PropertyName);
6718 }
6719 }
6720 return aReturn;
6721}
6722
6723css::uno::Any SVTXFormattedField::convertEffectiveValue(const css::uno::Any& rValue) const
6724{
6725 css::uno::Any aReturn;
6726
6727 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6728 if (!pField)
6729 return aReturn;
6730
6731 Formatter& rFieldFormatter = pField->GetFormatter();
6732 switch (rValue.getValueType().getTypeClass())
6733 {
6734 case css::uno::TypeClass_DOUBLE:
6735 if (rFieldFormatter.TreatingAsNumber())
6736 {
6737 double d = 0.0;
6738 rValue >>= d;
6739 aReturn <<= d;
6740 }
6741 else
6742 {
6743 SvNumberFormatter* pFormatter = rFieldFormatter.GetFormatter();
6744 if (!pFormatter)
6745 pFormatter = rFieldFormatter.StandardFormatter();
6746 // should never fail
6747
6748 const Color* pDum;
6749 double d = 0.0;
6750 rValue >>= d;
6751 OUString sConverted;
6752 pFormatter->GetOutputString(d, 0, sConverted, &pDum);
6753 aReturn <<= sConverted;
6754 }
6755 break;
6756 case css::uno::TypeClass_STRING:
6757 {
6758 OUString aStr;
6759 rValue >>= aStr;
6760 if (rFieldFormatter.TreatingAsNumber())
6761 {
6762 SvNumberFormatter* pFormatter = rFieldFormatter.GetFormatter();
6763 if (!pFormatter)
6764 pFormatter = rFieldFormatter.StandardFormatter();
6765
6766 double dVal;
6767 sal_uInt32 nTestFormat(0);
6768 if (!pFormatter->IsNumberFormat(aStr, nTestFormat, dVal))
6769 aReturn.clear();
6770 aReturn <<= dVal;
6771 }
6772 else
6773 aReturn <<= aStr;
6774 }
6775 break;
6776 default:
6777 aReturn.clear();
6778 break;
6779 }
6780 return aReturn;
6781}
6782
6783void SVTXFormattedField::SetMinValue(const css::uno::Any& rValue)
6784{
6785 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6786 if (!pField)
6787 return;
6788
6789 Formatter& rFormatter = pField->GetFormatter();
6790 switch (rValue.getValueType().getTypeClass())
6791
6792 {
6793 case css::uno::TypeClass_DOUBLE:
6794 {
6795 double d = 0.0;
6796 rValue >>= d;
6797 rFormatter.SetMinValue(d);
6798 break;
6799 }
6800 default:
6801 DBG_ASSERT(rValue.getValueType().getTypeClass() == css::uno::TypeClass_VOID, "SVTXFormattedField::SetMinValue : invalid argument (an exception will be thrown) !");
6802 if ( rValue.getValueType().getTypeClass() != css::uno::TypeClass_VOID )
6803
6804 {
6805 throw css::lang::IllegalArgumentException();
6806 }
6807 rFormatter.ClearMinValue();
6808 break;
6809 }
6810}
6811
6813{
6814 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6815 if (!pField)
6816 return css::uno::Any();
6817 Formatter& rFormatter = pField->GetFormatter();
6818 if (!rFormatter.HasMinValue())
6819 return css::uno::Any();
6820
6821 css::uno::Any aReturn;
6822 aReturn <<= rFormatter.GetMinValue();
6823 return aReturn;
6824}
6825
6826void SVTXFormattedField::SetMaxValue(const css::uno::Any& rValue)
6827{
6828 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6829 if (!pField)
6830 return;
6831
6832 Formatter& rFormatter = pField->GetFormatter();
6833 switch (rValue.getValueType().getTypeClass())
6834 {
6835 case css::uno::TypeClass_DOUBLE:
6836 {
6837 double d = 0.0;
6838 rValue >>= d;
6839 rFormatter.SetMaxValue(d);
6840 break;
6841 }
6842 default:
6843 if (rValue.getValueType().getTypeClass() != css::uno::TypeClass_VOID)
6844
6845 {
6846 throw css::lang::IllegalArgumentException();
6847 }
6848 rFormatter.ClearMaxValue();
6849 break;
6850 }
6851}
6852
6854{
6855 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6856 if (!pField)
6857 return css::uno::Any();
6858 Formatter& rFormatter = pField->GetFormatter();
6859 if (!rFormatter.HasMaxValue())
6860 return css::uno::Any();
6861
6862 css::uno::Any aReturn;
6863 aReturn <<= rFormatter.GetMaxValue();
6864 return aReturn;
6865}
6866
6867void SVTXFormattedField::SetDefaultValue(const css::uno::Any& rValue)
6868{
6869 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6870 if (!pField)
6871 return;
6872
6873 css::uno::Any aConverted = convertEffectiveValue(rValue);
6874
6875 Formatter& rFormatter = pField->GetFormatter();
6876 switch (aConverted.getValueType().getTypeClass())
6877 {
6878 case css::uno::TypeClass_DOUBLE:
6879 {
6880 double d = 0.0;
6881 aConverted >>= d;
6882 rFormatter.SetDefaultValue(d);
6883 }
6884 break;
6885 case css::uno::TypeClass_STRING:
6886 {
6887 OUString aStr;
6888 aConverted >>= aStr;
6889 rFormatter.SetDefaultText( aStr );
6890 }
6891 break;
6892 default:
6893 rFormatter.EnableEmptyField(true);
6894 // only void accepted
6895 break;
6896 }
6897}
6898
6900{
6901 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6902 if (!pField)
6903 return css::uno::Any();
6904 Formatter& rFormatter = pField->GetFormatter();
6905 if (rFormatter.IsEmptyFieldEnabled())
6906 return css::uno::Any();
6907
6908 css::uno::Any aReturn;
6909 if (rFormatter.TreatingAsNumber())
6910 aReturn <<= rFormatter.GetDefaultValue();
6911 else
6912 aReturn <<= rFormatter.GetDefaultText();
6913 return aReturn;
6914}
6915
6917{
6918 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6919 if (pField)
6920 return pField->GetFormatter().TreatingAsNumber();
6921
6922 return true;
6923}
6924
6926{
6927 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6928 if (pField)
6929 pField->GetFormatter().TreatAsNumber(bSet);
6930}
6931
6932css::uno::Any SVTXFormattedField::GetValue() const
6933{
6934 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6935 if (!pField)
6936 return css::uno::Any();
6937
6938 Formatter& rFormatter = pField->GetFormatter();
6939 css::uno::Any aReturn;
6940 if (!rFormatter.TreatingAsNumber())
6941 {
6942 OUString sText = rFormatter.GetTextValue();
6943 aReturn <<= sText;
6944 }
6945 else
6946 {
6947 if (!pField->GetText().isEmpty()) // empty is returned as void by default
6948 aReturn <<= rFormatter.GetValue();
6949 }
6950
6951 return aReturn;
6952}
6953
6954void SVTXFormattedField::SetValue(const css::uno::Any& rValue)
6955{
6956 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6957 if (!pField)
6958 return;
6959
6960 if (!rValue.hasValue())
6961 {
6962 pField->SetText("");
6963 }
6964 else
6965 {
6966 Formatter& rFormatter = pField->GetFormatter();
6967 if (rValue.getValueType().getTypeClass() == css::uno::TypeClass_DOUBLE )
6968 {
6969 double d = 0.0;
6970 rValue >>= d;
6971 rFormatter.SetValue(d);
6972 }
6973 else
6974 {
6975 DBG_ASSERT(rValue.getValueType().getTypeClass() == css::uno::TypeClass_STRING, "SVTXFormattedField::SetValue : invalid argument !");
6976
6977 OUString sText;
6978 rValue >>= sText;
6979 if (!rFormatter.TreatingAsNumber())
6980 rFormatter.SetTextFormatted(sText);
6981 else
6982 rFormatter.SetTextValue(sText);
6983 }
6984 }
6985// NotifyTextListeners();
6986}
6987
6988void SVTXFormattedField::setFormatsSupplier(const css::uno::Reference< css::util::XNumberFormatsSupplier > & xSupplier)
6989{
6990 VclPtr<FormattedField> pField = GetAs< FormattedField >();
6991
6993 if (!xSupplier.is())
6994 {
6995 if (pField)
6996 {
6997 Formatter& rFormatter = pField->GetFormatter();
6998 pNew = new SvNumberFormatsSupplierObj(rFormatter.StandardFormatter());
6999 bIsStandardSupplier = true;
7000 }
7001 }
7002 else
7003 {
7004 pNew = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xSupplier);
7005 bIsStandardSupplier = false;
7006 }
7007
7008 if (!pNew)
7009 return; // TODO : how to process ?
7010
7011 m_xCurrentSupplier = pNew;
7012 if (!pField)
7013 return;
7014
7015 // save the actual value
7016 css::uno::Any aCurrent = GetValue();
7017 Formatter& rFormatter = pField->GetFormatter();
7018 rFormatter.SetFormatter(m_xCurrentSupplier->GetNumberFormatter(), false);
7019 if (nKeyToSetDelayed != -1)
7020 {
7021 rFormatter.SetFormatKey(nKeyToSetDelayed);
7022 nKeyToSetDelayed = -1;
7023 }
7024 SetValue(aCurrent);
7026}
7027
7029{
7030 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7031 return pField ? pField->GetFormatter().GetFormatKey() : 0;
7032}
7033
7035{
7036 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7037 if (!pField)
7038 return;
7039
7040 Formatter& rFormatter = pField->GetFormatter();
7041 if (rFormatter.GetFormatter())
7042 rFormatter.SetFormatKey(nKey);
7043 else
7044 {
7045 // probably I am in a block, in which first the key and next the formatter will be set,
7046 // initially this happens quite certain, as the properties are set in alphabetic sequence,
7047 // and the FormatsSupplier is processed before the FormatKey
7048 nKeyToSetDelayed = nKey;
7049 }
7051}
7052
7054{
7055 if ( GetTextListeners().getLength() )
7056 {
7057 css::awt::TextEvent aEvent;
7058 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
7059 GetTextListeners().textChanged( aEvent );
7060 }
7061}
7062
7063void SVTXFormattedField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
7064{
7065 PushPropertyIds( rIds,
7066 // FIXME: elide duplication ?
7082 0);
7083 VCLXWindow::ImplGetPropertyIds( rIds, true );
7085}
7086
7088{
7089}
7090
7092{
7093}
7094
7096{
7097 SolarMutexGuard aGuard;
7098
7099 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7100 if ( pField )
7101 pField->GetFormatter().SetValue( Value );
7102}
7103
7105{
7106 SolarMutexGuard aGuard;
7107
7108 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7109 return pField ? pField->GetFormatter().GetValue() : 0;
7110}
7111
7112void SVTXCurrencyField::setMin( double Value )
7113{
7114 SolarMutexGuard aGuard;
7115
7116 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7117 if ( pField )
7118 pField->GetFormatter().SetMinValue( Value );
7119}
7120
7122{
7123 SolarMutexGuard aGuard;
7124
7125 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7126 return pField ? pField->GetFormatter().GetMinValue() : 0;
7127}
7128
7129void SVTXCurrencyField::setMax( double Value )
7130{
7131 SolarMutexGuard aGuard;
7132
7133 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7134 if ( pField )
7135 pField->GetFormatter().SetMaxValue( Value );
7136}
7137
7139{
7140 SolarMutexGuard aGuard;
7141
7142 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7143 return pField ? pField->GetFormatter().GetMaxValue() : 0;
7144}
7145
7147{
7148 SolarMutexGuard aGuard;
7149
7150 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7151 if ( pField )
7152 pField->GetFormatter().SetSpinFirst( Value );
7153}
7154
7156{
7157 SolarMutexGuard aGuard;
7158
7159 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7160 return pField ? pField->GetFormatter().GetSpinFirst() : 0;
7161}
7162
7163void SVTXCurrencyField::setLast( double Value )
7164{
7165 SolarMutexGuard aGuard;
7166
7167 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7168 if ( pField )
7169 pField->GetFormatter().SetSpinLast( Value );
7170}
7171
7173{
7174 SolarMutexGuard aGuard;
7175
7176 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7177 return pField ? pField->GetFormatter().GetSpinLast() : 0;
7178}
7179
7181{
7182 SolarMutexGuard aGuard;
7183
7184 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7185 if ( pField )
7186 pField->GetFormatter().SetSpinSize( Value );
7187}
7188
7190{
7191 SolarMutexGuard aGuard;
7192
7193 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7194 return pField ? pField->GetFormatter().GetSpinSize() : 0;
7195}
7196
7198{
7199 SolarMutexGuard aGuard;
7200
7201 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7202 if ( pField )
7203 pField->GetFormatter().SetDecimalDigits( Value );
7204}
7205
7207{
7208 SolarMutexGuard aGuard;
7209
7210 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7211 return pField ? pField->GetFormatter().GetDecimalDigits() : 0;
7212}
7213
7215{
7216 SolarMutexGuard aGuard;
7217
7218 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7219 if ( pField )
7220 pField->GetFormatter().SetStrictFormat( bStrict );
7221}
7222
7224{
7225 SolarMutexGuard aGuard;
7226
7227 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7228 return pField && pField->GetFormatter().IsStrictFormat();
7229}
7230
7231void SVTXCurrencyField::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
7232{
7233 SolarMutexGuard aGuard;
7234
7235 VclPtr< DoubleCurrencyField > pField = GetAs< DoubleCurrencyField >();
7236 if ( pField )
7237 {
7238 sal_uInt16 nPropType = GetPropertyId( PropertyName );
7239 switch (nPropType)
7240 {
7242 {
7243 OUString aStr;
7244 Value >>= aStr;
7245 pField->setCurrencySymbol( aStr );
7246 }
7247 break;
7249 {
7250 bool b = false;
7251 Value >>= b;
7252 pField->setPrependCurrSym(b);
7253 }
7254 break;
7255
7256 default:
7258 }
7259 }
7260 else
7262}
7263
7264css::uno::Any SVTXCurrencyField::getProperty( const OUString& PropertyName )
7265{
7266 SolarMutexGuard aGuard;
7267
7268 css::uno::Any aReturn;
7269
7270 VclPtr< DoubleCurrencyField > pField = GetAs< DoubleCurrencyField >();
7271 if ( pField )
7272 {
7273 sal_uInt16 nPropType = GetPropertyId( PropertyName );
7274 switch (nPropType)
7275 {
7277 {
7278 aReturn <<= pField->getCurrencySymbol();
7279 }
7280 break;
7282 {
7283 aReturn <<= pField->getPrependCurrSym();
7284 }
7285 break;
7286 default:
7287 return SVTXFormattedField::getProperty(PropertyName);
7288 }
7289 }
7290 return SVTXFormattedField::getProperty(PropertyName);
7291}
7292
7293void SVTXCurrencyField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
7294{
7295 PushPropertyIds( rIds,
7329 0);
7331}
7332
7334{
7335}
7336
7338{
7339}
7340
7341
7342css::uno::Reference<accessibility::XAccessibleContext> SVTXNumericField::CreateAccessibleContext()
7343{
7344 return getAccessibleFactory().createAccessibleContext(this);
7345}
7346
7347
7348void SVTXNumericField::setValue( double Value )
7349{
7350 SolarMutexGuard aGuard;
7351
7352 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7353 if ( pField )
7354 pField->GetFormatter().SetValue( Value );
7355}
7356
7358{
7359 SolarMutexGuard aGuard;
7360
7361 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7362 return pField ? pField->GetFormatter().GetValue() : 0;
7363}
7364
7365void SVTXNumericField::setMin( double Value )
7366{
7367 SolarMutexGuard aGuard;
7368
7369 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7370 if ( pField )
7371 pField->GetFormatter().SetMinValue( Value );
7372}
7373
7375{
7376 SolarMutexGuard aGuard;
7377
7378 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7379 return pField ? pField->GetFormatter().GetMinValue() : 0;
7380}
7381
7382void SVTXNumericField::setMax( double Value )
7383{
7384 SolarMutexGuard aGuard;
7385
7386 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7387 if ( pField )
7388 pField->GetFormatter().SetMaxValue( Value );
7389}
7390
7392{
7393 SolarMutexGuard aGuard;
7394
7395 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7396 return pField ? pField->GetFormatter().GetMaxValue() : 0;
7397}
7398
7399void SVTXNumericField::setFirst( double Value )
7400{
7401 SolarMutexGuard aGuard;
7402
7403 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7404 if ( pField )
7405 pField->GetFormatter().SetSpinFirst( Value );
7406}
7407
7409{
7410 SolarMutexGuard aGuard;
7411
7412 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7413 return pField ? pField->GetFormatter().GetSpinFirst() : 0;
7414}
7415
7416void SVTXNumericField::setLast( double Value )
7417{
7418 SolarMutexGuard aGuard;
7419
7420 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7421 if ( pField )
7422 pField->GetFormatter().SetSpinLast( Value );
7423}
7424
7426{
7427 SolarMutexGuard aGuard;
7428
7429 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7430 return pField ? pField->GetFormatter().GetSpinLast() : 0;
7431}
7432
7434{
7435 SolarMutexGuard aGuard;
7436
7437 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7438 if ( pField )
7439 pField->GetFormatter().SetSpinSize( Value );
7440}
7441
7443{
7444 SolarMutexGuard aGuard;
7445
7446 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7447 return pField ? pField->GetFormatter().GetSpinSize() : 0;
7448}
7449
7451{
7452 SolarMutexGuard aGuard;
7453
7454 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7455 if ( pField )
7456 pField->GetFormatter().SetDecimalDigits( Value );
7457}
7458
7460{
7461 SolarMutexGuard aGuard;
7462
7463 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7464 return pField ? pField->GetFormatter().GetDecimalDigits() : 0;
7465}
7466
7468{
7469 SolarMutexGuard aGuard;
7470
7471 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7472 if ( pField )
7473 pField->GetFormatter().SetStrictFormat( bStrict );
7474}
7475
7477{
7478 SolarMutexGuard aGuard;
7479
7480 VclPtr<FormattedField> pField = GetAs< FormattedField >();
7481 return pField && pField->GetFormatter().IsStrictFormat();
7482}
7483
7484void SVTXNumericField::GetPropertyIds( std::vector< sal_uInt16 > &rIds )
7485{
7487}
7488
7490{
7491}
7492
7494{
7495}
7496
7497void SAL_CALL SVTXDateField::setProperty( const OUString& PropertyName, const css::uno::Any& Value )
7498{
7499 VCLXDateField::setProperty( PropertyName, Value );
7500
7501 // some properties need to be forwarded to the sub edit, too
7503 VclPtr< Edit > pSubEdit = GetWindow() ? GetAs<Edit>()->GetSubEdit() : nullptr;
7504 if ( !pSubEdit )
7505 return;
7506
7507 switch ( GetPropertyId( PropertyName ) )
7508 {
7510 if ( !Value.hasValue() )
7511 pSubEdit->SetTextLineColor();
7512 else
7513 {
7514 Color nColor;
7515 if ( Value >>= nColor )
7516 pSubEdit->SetTextLineColor( nColor );
7517 }
7518 break;
7519 }
7520}
7521
7522void SVTXDateField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
7523{
7524 PushPropertyIds( rIds,
7526 0);
7528}
7529
7531 :maTextListeners( *this )
7532 ,meLineEndType( LINEEND_LF ) // default behavior before introducing this property: LF (unix-like)
7533{
7534}
7535
7537{
7538}
7539
7540void VCLXMultiLineEdit::addTextListener( const css::uno::Reference< css::awt::XTextListener > & l )
7541{
7542 maTextListeners.addInterface( l );
7543}
7544
7545void VCLXMultiLineEdit::removeTextListener( const css::uno::Reference< css::awt::XTextListener > & l )
7546{
7547 maTextListeners.removeInterface( l );
7548}
7549
7550void VCLXMultiLineEdit::setText( const OUString& aText )
7551{
7552 SolarMutexGuard aGuard;
7553
7554 VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >();
7555 if ( pEdit )
7556 {
7557 pEdit->SetText( aText );
7558
7559 // #107218# Call same listeners like VCL would do after user interaction
7560 SetSynthesizingVCLEvent( true );
7561 pEdit->SetModifyFlag();
7562 pEdit->Modify();
7563 SetSynthesizingVCLEvent( false );
7564 }
7565}
7566
7567void VCLXMultiLineEdit::insertText( const css::awt::Selection& rSel, const OUString& aText )
7568{
7569 SolarMutexGuard aGuard;
7570
7571 VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >();
7572 if ( pEdit )
7573 {
7574 setSelection( rSel );
7575 pEdit->ReplaceSelected( aText );
7576 }
7577}
7578
7580{
7581 SolarMutexGuard aGuard;
7582
7583 OUString aText;
7584 VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >();
7585 if ( pEdit )
7586 aText = pEdit->GetText( meLineEndType );
7587 return aText;
7588}
7589
7591{
7592 SolarMutexGuard aGuard;
7593
7594 OUString aText;
7595 VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >();
7596 if ( pMultiLineEdit)
7597 aText = pMultiLineEdit->GetSelected( meLineEndType );
7598 return aText;
7599
7600}
7601
7602void VCLXMultiLineEdit::setSelection( const css::awt::Selection& aSelection )
7603{
7604 SolarMutexGuard aGuard;
7605
7606 VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >();
7607 if ( pMultiLineEdit )
7608 {
7609 pMultiLineEdit->SetSelection( Selection( aSelection.Min, aSelection.Max ) );
7610 }
7611}
7612
7614{
7615 SolarMutexGuard aGuard;
7616
7617 css::awt::Selection aSel;
7618 VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >();
7619 if ( pMultiLineEdit )
7620 {
7621 aSel.Min = pMultiLineEdit->GetSelection().Min();
7622 aSel.Max = pMultiLineEdit->GetSelection().Max();
7623 }
7624 return aSel;
7625}
7626
7628{
7629 SolarMutexGuard aGuard;
7630
7631 VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >();
7632 return pMultiLineEdit && !pMultiLineEdit->IsReadOnly() && pMultiLineEdit->IsEnabled();
7633}
7634
7636{
7637 SolarMutexGuard aGuard;
7638
7639 VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >();
7640 if ( pMultiLineEdit )
7641 pMultiLineEdit->SetReadOnly( !bEditable );
7642}
7643
7645{
7646 SolarMutexGuard aGuard;
7647
7648 VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >();
7649 if ( pMultiLineEdit )
7650 pMultiLineEdit->SetMaxTextLen( nLen );
7651}
7652
7654{
7655 SolarMutexGuard aGuard;
7656
7657 VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >();
7658 return pMultiLineEdit ? static_cast<sal_Int16>(pMultiLineEdit->GetMaxTextLen()) : sal_Int16(0);
7659}
7660
7662{
7663 SolarMutexGuard aGuard;
7664
7665 OUString aText;
7666 VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >();
7667 if ( pEdit )
7668 aText = pEdit->GetTextLines( meLineEndType );
7669 return aText;
7670}
7671
7673{
7674 SolarMutexGuard aGuard;
7675
7676 css::awt::Size aSz;
7677 VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >();
7678 if ( pEdit )
7679 aSz = AWTSize(pEdit->CalcMinimumSize());
7680 return aSz;
7681}
7682
7684{
7685 return getMinimumSize();
7686}
7687
7688css::awt::Size VCLXMultiLineEdit::calcAdjustedSize( const css::awt::Size& rNewSize )
7689{
7690 SolarMutexGuard aGuard;
7691
7692 css::awt::Size aSz = rNewSize;
7693 VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >();
7694 if ( pEdit )
7695 aSz = AWTSize(pEdit->CalcAdjustedSize( VCLSize(rNewSize )));
7696 return aSz;
7697}
7698
7699css::awt::Size VCLXMultiLineEdit::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines )
7700{
7701 SolarMutexGuard aGuard;
7702
7703 css::awt::Size aSz;
7704 VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >();
7705 if ( pEdit )
7706 aSz = AWTSize(pEdit->CalcBlockSize( nCols, nLines ));
7707 return aSz;
7708}
7709
7710void VCLXMultiLineEdit::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines )
7711{
7712 SolarMutexGuard aGuard;
7713
7714 nCols = nLines = 0;
7715 VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >();
7716 if ( pEdit )
7717 {
7718 sal_uInt16 nC, nL;
7719 pEdit->GetMaxVisColumnsAndLines( nC, nL );
7720 nCols = nC;
7721 nLines = nL;
7722 }
7723}
7724
7726{
7727 switch ( rVclWindowEvent.GetId() )
7728 {
7729 case VclEventId::EditModify:
7730 {
7731 if ( maTextListeners.getLength() )
7732 {
7733 css::awt::TextEvent aEvent;
7734 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
7735 maTextListeners.textChanged( aEvent );
7736 }
7737 }
7738 break;
7739 default:
7740 {
7741 VCLXWindow::ProcessWindowEvent( rVclWindowEvent );
7742 }
7743 break;
7744 }
7745}
7746
7747void VCLXMultiLineEdit::setProperty( const OUString& PropertyName, const css::uno::Any& Value)
7748{
7749 SolarMutexGuard aGuard;
7750
7751 VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >();
7752 if ( !pMultiLineEdit )
7753 return;
7754
7755 sal_uInt16 nPropType = GetPropertyId( PropertyName );
7756 switch ( nPropType )
7757 {
7759 {
7760 sal_Int16 nLineEndType = css::awt::LineEndFormat::LINE_FEED;
7761 OSL_VERIFY( Value >>= nLineEndType );
7762 switch ( nLineEndType )
7763 {
7764 case css::awt::LineEndFormat::CARRIAGE_RETURN: meLineEndType = LINEEND_CR; break;
7765 case css::awt::LineEndFormat::LINE_FEED: meLineEndType = LINEEND_LF; break;
7766 case css::awt::LineEndFormat::CARRIAGE_RETURN_LINE_FEED: meLineEndType = LINEEND_CRLF; break;
7767 default: OSL_FAIL( "VCLXMultiLineEdit::setProperty: invalid line end value!" ); break;
7768 }
7769 }
7770 break;
7771
7773 {
7774 bool b;
7775 if ( Value >>= b )
7776 pMultiLineEdit->SetReadOnly( b );
7777 }
7778 break;
7780 {
7781 sal_Int16 n = sal_Int16();
7782 if ( Value >>= n )
7783 pMultiLineEdit->SetMaxTextLen( n );
7784 }
7785 break;
7787 {
7788 bool b;
7789 if ( Value >>= b )
7790 {
7791 pMultiLineEdit->EnableFocusSelectionHide( b );
7792 lcl_setWinBits( pMultiLineEdit, WB_NOHIDESELECTION, !b );
7793 }
7794 }
7795 break;
7796 default:
7797 {
7798 VCLXWindow::setProperty( PropertyName, Value );
7799 }
7800 }
7801}
7802
7803css::uno::Any VCLXMultiLineEdit::getProperty( const OUString& PropertyName )
7804{
7805 SolarMutexGuard aGuard;
7806
7807 css::uno::Any aProp;
7808 VclPtr< MultiLineEdit > pMultiLineEdit = GetAs< MultiLineEdit >();
7809 if ( pMultiLineEdit )
7810 {
7811 sal_uInt16 nPropType = GetPropertyId( PropertyName );
7812 switch ( nPropType )
7813 {
7815 {
7816 sal_Int16 nLineEndType = css::awt::LineEndFormat::LINE_FEED;
7817 switch ( meLineEndType )
7818 {
7819 case LINEEND_CR: nLineEndType = css::awt::LineEndFormat::CARRIAGE_RETURN; break;
7820 case LINEEND_LF: nLineEndType = css::awt::LineEndFormat::LINE_FEED; break;
7821 case LINEEND_CRLF: nLineEndType = css::awt::LineEndFormat::CARRIAGE_RETURN_LINE_FEED; break;
7822 default: OSL_FAIL( "VCLXMultiLineEdit::getProperty: invalid line end value!" ); break;
7823 }
7824 aProp <<= nLineEndType;
7825 }
7826 break;
7827
7829 {
7830 aProp <<= pMultiLineEdit->IsReadOnly();
7831 }
7832 break;
7834 {
7835 aProp <<= static_cast<sal_Int16>(pMultiLineEdit->GetMaxTextLen());
7836 }
7837 break;
7838 default:
7839 {
7840 aProp = VCLXWindow::getProperty( PropertyName );
7841 }
7842 }
7843 }
7844 return aProp;
7845}
7846
7848{
7849 SolarMutexGuard aGuard;
7850
7851 // don't grab the focus if we already have it. Reason is that the only thing which the edit
7852 // does is forwarding the focus to its text window. This text window then does a "select all".
7853 // So if the text window already has the focus, and we give the focus to the multi line
7854 // edit, then all which happens is that everything is selected.
7855 // #i27072#
7856 if ( GetWindow() && !GetWindow()->HasChildPathFocus() )
7857 GetWindow()->GrabFocus();
7858}
7859
7860void VCLXMultiLineEdit::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds )
7861{
7862 PushPropertyIds( rIds,
7863 // FIXME: elide duplication ?
7868 0);
7869 VCLXWindow::ImplGetPropertyIds( rIds, true );
7870}
7871
7872/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XPropertyListType t
AnyEventRef aEvent
double d
const StyleSettings & GetStyleSettings() const
void SetStyleSettings(const StyleSettings &rSet)
static const AllSettings & GetSettings()
sal_uInt8 GetLuminance() const
sal_uInt8 GetBlue() const
void DecreaseLuminance(sal_uInt8 cLumDec)
void SetGreen(sal_uInt8 nGreen)
void SetRed(sal_uInt8 nRed)
void IncreaseLuminance(sal_uInt8 cLumInc)
sal_uInt8 GetRed() const
sal_uInt8 GetGreen() const
void SetBlue(sal_uInt8 nBlue)
void SetEditModifyHdl(const Link< Edit &, void > &rLink)
Definition: filectrl.cxx:183
bool IsStrictFormat() const
void SetStrictFormat(bool bStrict)
void SetTextValue(const OUString &rText)
void SetValue(double dVal)
const OUString & GetDefaultText() const
void SetDefaultText(const OUString &rDefault)
void SetDecimalDigits(sal_uInt16 _nPrecision)
void SetThousandsSep(bool _bUseSeparator)
double GetSpinSize() const
bool TreatingAsNumber() const
void SetAutoColor(bool _bAutomatic)
sal_uInt16 GetDecimalDigits() const
double GetMinValue() const
void EnableEmptyField(bool bEnable)
void SetTextFormatted(const OUString &rText)
virtual void ClearMinValue()
void SetFormatter(SvNumberFormatter *pFormatter, bool bResetFormat=true)
double GetMaxValue() const
void SetFormatKey(sal_uLong nFormatKey)
SvNumberFormatter * StandardFormatter()
OUString const & GetTextValue() const
virtual void SetMaxValue(double dMax)
void SetDefaultValue(double dDefault)
virtual void ClearMaxValue()
void EnableNotANumber(bool _bEnable)
bool IsEmptyFieldEnabled() const
virtual void SetMinValue(double dMin)
bool HasMinValue() const
double GetDefaultValue() const
bool HasMaxValue() const
virtual void SetSpinSize(double dStep)
SvNumberFormatter * GetFormatter() const
double GetValue()
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
BitmapEx GetBitmapEx() const
Size GetSizePixel() const
sal_Int64 GetValue(FieldUnit eOutUnit) const
sal_Int64 GetCorrectedValue(FieldUnit eOutUnit) const
void SetValue(sal_Int64 nNewValue, FieldUnit eInUnit)
void SetUserValue(sal_Int64 nNewValue, FieldUnit eInUnit)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
TriState GetState() const
void SAL_CALL setLast(double Value) override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
double SAL_CALL getValue() override
double SAL_CALL getMin() override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
void SAL_CALL setValue(double Value) override
sal_Int16 SAL_CALL getDecimalDigits() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL setSpinSize(double Value) override
void SAL_CALL setDecimalDigits(sal_Int16 nDigits) override
double SAL_CALL getFirst() override
sal_Bool SAL_CALL isStrictFormat() override
virtual ~SVTXCurrencyField() override
void SAL_CALL setMax(double Value) override
void SAL_CALL setFirst(double Value) override
double SAL_CALL getSpinSize() override
void SAL_CALL setMin(double Value) override
double SAL_CALL getLast() override
double SAL_CALL getMax() override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
virtual ~SVTXDateField() override
void SetTreatAsNumber(bool bSet)
void setFormatKey(sal_Int32 nKey)
sal_Int32 getFormatKey() const
rtl::Reference< SvNumberFormatsSupplierObj > m_xCurrentSupplier
virtual void SetWindow(const VclPtr< vcl::Window > &_pWindow) override
virtual ~SVTXFormattedField() override
css::uno::Any GetMaxValue() const
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
css::uno::Any GetMinValue() const
void SetMinValue(const css::uno::Any &rValue)
void SetValue(const css::uno::Any &rValue)
void setFormatsSupplier(const css::uno::Reference< css::util::XNumberFormatsSupplier > &xSupplier)
css::uno::Any convertEffectiveValue(const css::uno::Any &rValue) const
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
css::uno::Any GetDefaultValue() const
void SetDefaultValue(const css::uno::Any &rValue)
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
css::uno::Any GetValue() const
bool GetTreatAsNumber() const
void SetMaxValue(const css::uno::Any &rValue)
double SAL_CALL getFirst() override
void SAL_CALL setValue(double Value) override
virtual ~SVTXNumericField() override
void SAL_CALL setLast(double Value) override
void SAL_CALL setMax(double Value) override
void SAL_CALL setFirst(double Value) override
void SAL_CALL setSpinSize(double Value) override
void SAL_CALL setDecimalDigits(sal_Int16 nDigits) override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
virtual void GetPropertyIds(std::vector< sal_uInt16 > &aIds) override
double SAL_CALL getSpinSize() override
sal_Int16 SAL_CALL getDecimalDigits() override
void SAL_CALL setMin(double Value) override
sal_Bool SAL_CALL isStrictFormat() override
double SAL_CALL getMax() override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
double SAL_CALL getValue() override
double SAL_CALL getMin() override
double SAL_CALL getLast() override
tools::Long Min() const
tools::Long Max() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void SetLightBorderColor(const Color &rColor)
const Color & GetDarkShadowColor() const
void SetFaceColor(const Color &rColor)
void SetShadowColor(const Color &rColor)
const Color & GetShadowColor() const
StyleSettingsOptions GetOptions() const
const Color & GetCheckedColor() const
void SetCheckedColor(const Color &rColor)
const Color & GetLightBorderColor() const
const Color & GetLightColor() const
DragFullOptions GetDragFullOptions() const
void SetDragFullOptions(DragFullOptions nOptions)
const Color & GetHighlightColor() const
const Color & GetFaceColor() const
void SetDarkShadowColor(const Color &rColor)
const Color & GetHighlightTextColor() const
void SetLightColor(const Color &rColor)
void SetOptions(StyleSettingsOptions nOptions)
void GetOutputString(const double &fOutNumber, sal_uInt32 nFIndex, OUString &sOutString, const Color **ppColor, bool bUseStarFormat=false)
bool IsNumberFormat(const OUString &sString, sal_uInt32 &F_Index, double &fOutNumber, SvNumInputOptions eInputOptions=SvNumInputOptions::NONE)
void SetTabPage(sal_uInt16 nPageId, TabPage *pPage)
sal_uInt16 GetPagePos(sal_uInt16 nPageId) const
TabPage * GetTabPage(sal_uInt16 nPageId) const
void SelectTabPage(sal_uInt16 nPageId)
void InsertPage(sal_uInt16 nPageId, const OUString &rText, sal_uInt16 nPos=TAB_APPEND)
sal_uInt16 GetCurPageId() const
OUString const & GetPageText(sal_uInt16 nPageId) const
void SetPageText(sal_uInt16 nPageId, const OUString &rText)
void RemovePage(sal_uInt16 nPageId)
static OutputDevice * GetOutputDevice(const css::uno::Reference< css::awt::XDevice > &rxDevice)
static css::awt::Size ConvertToAWTSize(::Size const &_aSize)
::Size ConvertToVCLSize(css::awt::Size const &_aSize)
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
void SAL_CALL setActionCommand(const OUString &Command) override
void SAL_CALL dispose() override
css::awt::Size SAL_CALL getMinimumSize() override
css::awt::Size SAL_CALL getPreferredSize() override
void SAL_CALL setLabel(const OUString &Label) override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
ActionListenerMultiplexer maActionListeners
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &rNewSize) override
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
ItemListenerMultiplexer maItemListeners
virtual ~VCLXButton() 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
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
ActionListenerMultiplexer maActionListeners
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 getProperty(const OUString &PropertyName) override
css::awt::Size SAL_CALL getMinimumSize() override
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
void SAL_CALL setActionCommand(const OUString &Command) override
void SAL_CALL removeItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
void SAL_CALL setLabel(const OUString &Label) override
void SAL_CALL enableTriState(sal_Bool b) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &rNewSize) override
ItemListenerMultiplexer maItemListeners
void SAL_CALL setState(sal_Int16 n) override
css::awt::Size SAL_CALL getPreferredSize() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
void SAL_CALL dispose() override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
sal_Int16 SAL_CALL getState() override
ActionListenerMultiplexer maActionListeners
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
css::awt::Size SAL_CALL getPreferredSize() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
void SAL_CALL dispose() override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
ItemListenerMultiplexer maItemListeners
void SAL_CALL removeItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
OUString SAL_CALL getItem(sal_Int16 nPos) override
sal_Int16 SAL_CALL getItemCount() override
void SAL_CALL getColumnsAndLines(sal_Int16 &nCols, sal_Int16 &nLines) override
void SAL_CALL removeItems(sal_Int16 nPos, sal_Int16 nCount) override
virtual void SAL_CALL disposing(const css::lang::EventObject &i_rEvent) override
void SAL_CALL addItem(const OUString &aItem, sal_Int16 nPos) override
virtual ~VCLXComboBox() override
virtual void SAL_CALL listItemModified(const css::awt::ItemListEvent &Event) override
virtual void SAL_CALL listItemRemoved(const css::awt::ItemListEvent &Event) 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
virtual void SAL_CALL listItemInserted(const css::awt::ItemListEvent &Event) override
void SAL_CALL setDropDownLineCount(sal_Int16 nLines) override
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
css::awt::Size SAL_CALL getMinimumSize() override
virtual void SAL_CALL allItemsRemoved(const css::lang::EventObject &Event) override
css::uno::Sequence< OUString > SAL_CALL getItems() override
void SAL_CALL addItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
sal_Int16 SAL_CALL getDropDownLineCount() override
void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &rNewSize) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
css::util::Date SAL_CALL getMax() override
css::util::Date SAL_CALL getMin() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
css::util::Date SAL_CALL getFirst() override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL setMax(const css::util::Date &Date) override
void SAL_CALL setMin(const css::util::Date &Date) override
sal_Bool SAL_CALL isStrictFormat() override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
void SAL_CALL setFirst(const css::util::Date &Date) override
void SAL_CALL setLast(const css::util::Date &Date) override
void SAL_CALL setDate(const css::util::Date &Date) override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
virtual ~VCLXDateField() override
sal_Bool SAL_CALL isEmpty() override
sal_Bool SAL_CALL isLongFormat() override
css::util::Date SAL_CALL getDate() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
css::util::Date SAL_CALL getLast() override
void SAL_CALL setLongFormat(sal_Bool bLong) override
void SAL_CALL setEmpty() override
css::awt::DeviceInfo SAL_CALL getInfo() override
Definition: vclxdevice.cxx:77
void SAL_CALL setTitle(const OUString &Title) override
virtual void SAL_CALL endDialog(::sal_Int32 Result) override
void SAL_CALL endExecute() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
OUString SAL_CALL getTitle() override
virtual void SAL_CALL setHelpId(const OUString &Id) override
void SAL_CALL draw(sal_Int32 nX, sal_Int32 nY) override
sal_Int16 SAL_CALL execute() override
css::awt::DeviceInfo SAL_CALL getInfo() override
virtual ~VCLXDialog() override
virtual void GetPropertyIds(std::vector< sal_uInt16 > &aIds) override
void SAL_CALL setEditable(sal_Bool bEditable) override
void SAL_CALL setText(const OUString &aText) override
void SAL_CALL addTextListener(const css::uno::Reference< css::awt::XTextListener > &l) override
void SAL_CALL dispose() override
void SAL_CALL setEchoChar(sal_Unicode cEcho) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL removeTextListener(const css::uno::Reference< css::awt::XTextListener > &l) override
css::awt::Size SAL_CALL getPreferredSize() override
TextListenerMultiplexer & GetTextListeners()
TextListenerMultiplexer maTextListeners
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &rNewSize) override
void SAL_CALL getColumnsAndLines(sal_Int16 &nCols, sal_Int16 &nLines) override
css::awt::Size SAL_CALL getMinimumSize() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
void SAL_CALL setSelection(const css::awt::Selection &aSelection) override
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
css::awt::Selection SAL_CALL getSelection() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
void SAL_CALL insertText(const css::awt::Selection &Sel, const OUString &Text) override
void SAL_CALL setMaxTextLen(sal_Int16 nLen) override
OUString SAL_CALL getText() override
sal_Bool SAL_CALL isEditable() override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
sal_Int16 SAL_CALL getMaxTextLen() override
OUString SAL_CALL getSelectedText() override
void SAL_CALL insertText(const css::awt::Selection &Sel, const OUString &Text) override
OUString SAL_CALL getText() override
void SAL_CALL setEditable(sal_Bool bEditable) override
void SAL_CALL removeTextListener(const css::uno::Reference< css::awt::XTextListener > &l) override
sal_Bool SAL_CALL isEditable() override
void SAL_CALL getColumnsAndLines(sal_Int16 &nCols, sal_Int16 &nLines) override
TextListenerMultiplexer maTextListeners
css::awt::Size SAL_CALL getMinimumSize() override
void SAL_CALL addTextListener(const css::uno::Reference< css::awt::XTextListener > &l) override
sal_Int16 SAL_CALL getMaxTextLen() override
void SAL_CALL setText(const OUString &aText) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &aNewSize) override
virtual ~VCLXFileControl() override
virtual void SetWindow(const VclPtr< vcl::Window > &pWindow) override
OUString SAL_CALL getSelectedText() override
void SAL_CALL setSelection(const css::awt::Selection &aSelection) override
css::awt::Selection SAL_CALL getSelection() override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
css::awt::Size SAL_CALL getPreferredSize() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
void SAL_CALL setMaxTextLen(sal_Int16 nLen) override
void SAL_CALL setAlignment(sal_Int16 nAlign) override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &rNewSize) override
OUString SAL_CALL getText() override
css::awt::Size SAL_CALL getPreferredSize() override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
css::awt::Size SAL_CALL getMinimumSize() override
void SAL_CALL setText(const OUString &Text) override
sal_Int16 SAL_CALL getAlignment() override
virtual ~VCLXFixedText() override
virtual ~VCLXFormattedSpinField() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
bool isStrictFormat() const
FormatterBase * GetFormatter() const
void setStrictFormat(bool bStrict)
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
virtual ~VCLXFrame() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL draw(sal_Int32 nX, sal_Int32 nY) override
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
Image maImage
the image we currently display
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
virtual void ImplSetNewImage()
forward our bitmap to our window @precond our mutex is locked @precond GetWindow is not <NULL>
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
void SAL_CALL setPosSize(sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags) override
virtual ~VCLXHeaderBar() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
css::awt::Size SAL_CALL getMinimumSize() override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
css::awt::Size SAL_CALL getPreferredSize() override
virtual ~VCLXImageControl() override
virtual void ImplSetNewImage() override
forward our bitmap to our window @precond our mutex is locked @precond GetWindow is not <NULL>
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &rNewSize) override
void SAL_CALL getColumnsAndLines(sal_Int16 &nCols, sal_Int16 &nLines) override
void SAL_CALL selectItem(const OUString &aItem, sal_Bool bSelect) override
sal_Bool SAL_CALL isMutipleMode() override
void SAL_CALL removeItems(sal_Int16 nPos, sal_Int16 nCount) override
void SAL_CALL addItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
css::uno::Sequence< OUString > SAL_CALL getSelectedItems() override
void SAL_CALL removeItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
virtual void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &rNewSize) override
virtual void SAL_CALL listItemModified(const css::awt::ItemListEvent &Event) override
void SAL_CALL setDropDownLineCount(sal_Int16 nLines) override
void SAL_CALL addItems(const css::uno::Sequence< OUString > &aItems, sal_Int16 nPos) override
ActionListenerMultiplexer maActionListeners
void SAL_CALL setMultipleMode(sal_Bool bMulti) override
css::awt::Size SAL_CALL getPreferredSize() override
OUString SAL_CALL getSelectedItem() override
css::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos() override
virtual void SAL_CALL itemListChanged(const css::lang::EventObject &Event) override
virtual void SAL_CALL allItemsRemoved(const css::lang::EventObject &Event) override
void SAL_CALL selectItemPos(sal_Int16 nPos, sal_Bool bSelect) override
sal_Int16 SAL_CALL getDropDownLineCount() override
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
ItemListenerMultiplexer maItemListeners
void SAL_CALL makeVisible(sal_Int16 nEntry) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
void SAL_CALL addItem(const OUString &aItem, sal_Int16 nPos) override
virtual void SAL_CALL listItemRemoved(const css::awt::ItemListEvent &Event) override
OUString SAL_CALL getItem(sal_Int16 nPos) override
virtual void SAL_CALL disposing(const css::lang::EventObject &i_rEvent) override
sal_Int16 SAL_CALL getSelectedItemPos() override
void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
css::uno::Sequence< OUString > SAL_CALL getItems() override
virtual void SAL_CALL listItemInserted(const css::awt::ItemListEvent &Event) override
void ImplCallItemListeners()
sal_Int16 SAL_CALL getItemCount() override
css::awt::Size SAL_CALL getMinimumSize() override
void SAL_CALL dispose() override
void SAL_CALL selectItemsPos(const css::uno::Sequence< sal_Int16 > &aPositions, sal_Bool bSelect) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL setCaptionText(const OUString &aText) override
void SAL_CALL setMessageText(const OUString &aText) override
OUString SAL_CALL getCaptionText() override
sal_Int16 SAL_CALL execute() override
virtual ~VCLXMessageBox() override
virtual void GetPropertyIds(std::vector< sal_uInt16 > &aIds) override
css::awt::Size SAL_CALL getMinimumSize() override
OUString SAL_CALL getMessageText() override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
MetricField * GetMetricField()
virtual ::sal_Int64 SAL_CALL getCorrectedValue(::sal_Int16 Unit) override
virtual void SAL_CALL setUserValue(::sal_Int64 Value, ::sal_Int16 Unit) override
virtual ::sal_Int64 SAL_CALL getSpinSize() override
virtual void SAL_CALL setStrictFormat(sal_Bool bStrict) override
virtual ::sal_Int16 SAL_CALL getDecimalDigits() override
virtual void SAL_CALL setDecimalDigits(::sal_Int16 nDigits) override
virtual sal_Bool SAL_CALL isStrictFormat() override
virtual void SAL_CALL setValue(::sal_Int64 Value, ::sal_Int16 Unit) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
virtual ~VCLXMetricField() override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
virtual ::sal_Int64 SAL_CALL getValue(::sal_Int16 Unit) override
virtual void SAL_CALL setSpinSize(::sal_Int64 Value) override
MetricFormatter * GetMetricFormatter()
css::awt::Size SAL_CALL getPreferredSize() override
void SAL_CALL setMaxTextLen(sal_Int16 nLen) override
OUString SAL_CALL getSelectedText() override
void SAL_CALL removeTextListener(const css::uno::Reference< css::awt::XTextListener > &l) override
void SAL_CALL getColumnsAndLines(sal_Int16 &nCols, sal_Int16 &nLines) override
TextListenerMultiplexer maTextListeners
OUString SAL_CALL getTextLines() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
void SAL_CALL setEditable(sal_Bool bEditable) override
sal_Bool SAL_CALL isEditable() override
css::awt::Size SAL_CALL getMinimumSize() override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
void SAL_CALL setSelection(const css::awt::Selection &aSelection) override
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &aNewSize) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
OUString SAL_CALL getText() override
sal_Int16 SAL_CALL getMaxTextLen() override
void SAL_CALL insertText(const css::awt::Selection &Sel, const OUString &Text) override
virtual ~VCLXMultiLineEdit() override
css::awt::Selection SAL_CALL getSelection() override
void SAL_CALL addTextListener(const css::uno::Reference< css::awt::XTextListener > &l) override
void SAL_CALL setFocus() override
void SAL_CALL setText(const OUString &aText) override
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
virtual void SAL_CALL setTabProps(::sal_Int32 ID, const css::uno::Sequence< css::beans::NamedValue > &Properties) override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
virtual ::sal_Int32 SAL_CALL getActiveTabID() override
virtual ::sal_Int32 SAL_CALL insertTab() override
TabListenerMultiplexer maTabListeners
virtual css::uno::Sequence< css::beans::NamedValue > SAL_CALL getTabProps(::sal_Int32 ID) override
void SAL_CALL draw(sal_Int32 nX, sal_Int32 nY) override
TabControl * getTabControl() const
virtual void SAL_CALL removeTab(::sal_Int32 ID) override
virtual void SAL_CALL addTabListener(const css::uno::Reference< css::awt::XTabListener > &Listener) override
virtual void SAL_CALL removeTabListener(const css::uno::Reference< css::awt::XTabListener > &Listener) override
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
virtual ~VCLXMultiPage() override
void SAL_CALL dispose() override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
virtual void SAL_CALL activateTab(::sal_Int32 ID) override
void SAL_CALL setDecimalDigits(sal_Int16 nDigits) override
double SAL_CALL getLast() override
void SAL_CALL setMax(double Value) override
sal_Int16 SAL_CALL getDecimalDigits() override
double SAL_CALL getFirst() override
void SAL_CALL setFirst(double Value) override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
sal_Bool SAL_CALL isStrictFormat() override
void SAL_CALL setLast(double Value) override
double SAL_CALL getValue() override
double SAL_CALL getSpinSize() override
double SAL_CALL getMin() override
void SAL_CALL setValue(double Value) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL setMin(double Value) override
virtual ~VCLXNumericField() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
double SAL_CALL getMax() override
void SAL_CALL setSpinSize(double Value) override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
void SAL_CALL getMasks(OUString &EditMask, OUString &LiteralMask) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
void SAL_CALL setString(const OUString &Str) override
virtual ~VCLXPatternField() override
void SAL_CALL setMasks(const OUString &EditMask, const OUString &LiteralMask) override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
OUString SAL_CALL getString() override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
sal_Bool SAL_CALL isStrictFormat() override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL setForegroundColor(sal_Int32 nColor) override
void SAL_CALL setValue(sal_Int32 nValue) override
virtual ~VCLXProgressBar() override
sal_Int32 SAL_CALL getValue() override
void SAL_CALL setRange(sal_Int32 nMin, sal_Int32 nMax) override
void SAL_CALL setBackgroundColor(sal_Int32 nColor) override
css::awt::Size SAL_CALL getPreferredSize() override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
void SAL_CALL setActionCommand(const OUString &Command) override
void SAL_CALL setState(sal_Bool b) override
void SAL_CALL dispose() override
void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
css::awt::Size SAL_CALL getMinimumSize() override
ItemListenerMultiplexer maItemListeners
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
void SAL_CALL setLabel(const OUString &Label) override
ActionListenerMultiplexer maActionListeners
css::awt::Size SAL_CALL calcAdjustedSize(const css::awt::Size &rNewSize) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void ImplClickedOrToggled(bool bToggled)
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
void SAL_CALL addItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
void SAL_CALL removeActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
void SAL_CALL removeItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
sal_Bool SAL_CALL getState() override
css::awt::Size SAL_CALL getMinimumSize() override
void SAL_CALL removeAdjustmentListener(const css::uno::Reference< css::awt::XAdjustmentListener > &l) override
sal_Int32 SAL_CALL getOrientation() override
sal_Int32 SAL_CALL getLineIncrement() override
static css::awt::Size implGetMinimumSize(vcl::Window const *p)
void SAL_CALL setOrientation(sal_Int32 n) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
sal_Int32 SAL_CALL getMaximum() override
void SAL_CALL setVisibleSize(sal_Int32 n) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
void SAL_CALL setValues(sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 nMax) override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
AdjustmentListenerMultiplexer maAdjustmentListeners
sal_Int32 SAL_CALL getBlockIncrement() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
void SAL_CALL dispose() override
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
sal_Int32 SAL_CALL getValue() override
void SAL_CALL setLineIncrement(sal_Int32 n) override
sal_Int32 getMinimum() const
void SAL_CALL setMaximum(sal_Int32 n) override
void SAL_CALL addAdjustmentListener(const css::uno::Reference< css::awt::XAdjustmentListener > &l) override
void SAL_CALL setValue(sal_Int32 n) override
void setMinimum(sal_Int32 n)
sal_Int32 SAL_CALL getVisibleSize() override
void SAL_CALL setBlockIncrement(sal_Int32 n) override
void SAL_CALL last() override
void SAL_CALL removeSpinListener(const css::uno::Reference< css::awt::XSpinListener > &l) override
void SAL_CALL first() override
void SAL_CALL down() override
void SAL_CALL enableRepeat(sal_Bool bRepeat) override
SpinListenerMultiplexer maSpinListeners
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL addSpinListener(const css::uno::Reference< css::awt::XSpinListener > &l) override
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
void SAL_CALL up() override
TabPage * getTabPage() const
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
virtual ~VCLXTabPage() override
void SAL_CALL draw(sal_Int32 nX, sal_Int32 nY) override
sal_Bool SAL_CALL isEmpty() override
css::util::Time SAL_CALL getMin() override
void SAL_CALL setStrictFormat(sal_Bool bStrict) override
virtual ~VCLXTimeField() override
void SAL_CALL setEmpty() override
sal_Bool SAL_CALL isStrictFormat() override
void SAL_CALL setTime(const css::util::Time &Time) override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
void SAL_CALL setMax(const css::util::Time &Time) override
css::util::Time SAL_CALL getMax() override
void SAL_CALL setMin(const css::util::Time &Time) override
void SAL_CALL setLast(const css::util::Time &Time) override
css::util::Time SAL_CALL getTime() override
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
void SAL_CALL setFirst(const css::util::Time &Time) override
css::util::Time SAL_CALL getLast() override
css::util::Time SAL_CALL getFirst() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
virtual ~VCLXToolBox() override
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds)
vcl::Window * GetWindow() const
Definition: vclxwindow.hxx:131
virtual void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent)
Definition: vclxwindow.cxx:426
void SAL_CALL setPosSize(sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags) override
Definition: vclxwindow.cxx:964
virtual void SetWindow(const VclPtr< vcl::Window > &pWindow)
Definition: vclxwindow.cxx:353
Size ImplCalcWindowSize(const Size &rOutSz) const
Definition: vclxwindow.cxx:890
static void ImplGetPropertyIds(std::vector< sal_uInt16 > &aIds, bool bWithDefaults=false)
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
static void PushPropertyIds(std::vector< sal_uInt16 > &aIds, int nFirstId,...)
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
::toolkit::IAccessibleFactory & getAccessibleFactory()
Definition: vclxwindow.cxx:348
void SAL_CALL dispose() override
Definition: vclxwindow.cxx:907
reference_type * get() const
VclEventId GetId() const
void * GetData() const
vcl::Window * GetWindow() const
void SetStyle(WallpaperStyle eStyle)
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
virtual css::uno::Reference< css::accessibility::XAccessibleContext > createAccessibleContext(VCLXButton *_pXWindow)=0
creates an accessible context for a button window
void SetStyle(WinBits nStyle)
bool IsReallyVisible() const
WindowType GetType() const
WinBits GetStyle() const
const AllSettings & GetSettings() const
void SetSettings(const AllSettings &rSettings)
virtual Size GetSizePixel() const
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
ColorTransparency
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
Any value
css::awt::Size AWTSize(const Size &rVCLSize)
Definition: convert.hxx:29
inline ::Size VCLSize(const css::awt::Size &rAWTSize)
Definition: convert.hxx:34
int nCount
#define DBG_ASSERT(sCon, aError)
#define DBG_UNHANDLED_EXCEPTION(...)
#define ENSURE_OR_RETURN_VOID(c, m)
sal_Int32 nState
FieldUnit
DocumentType eType
sal_Int16 nValue
TriState
TRISTATE_FALSE
TRISTATE_INDET
TRISTATE_TRUE
const char * name
void * p
sal_Int64 n
LINEEND_LF
LINEEND_CRLF
LINEEND_CR
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
#define SAL_INFO(area, stream)
aStr
Flags
Image getImageFromURL(const OUString &i_rImageURL)
Definition: tkresmgr.cxx:35
tools::Long const nBorder
double getLength(const B2DPolygon &rCandidate)
Value
Title
Unit
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
dictionary props
Any getButtonLikeFaceColor(const vcl::Window *_pWindow)
sal_Int16 translateImagePosition(ImageAlign _eVCLAlign)
translates a VCL ImageAlign value into a css.awt.ImagePosition value
Definition: imagealign.cxx:33
static void adjustBooleanWindowStyle(const Any &_rValue, vcl::Window *_pWindow, WinBits _nBits, bool _bInverseSemantics)
void setButtonLikeFaceColor(vcl::Window *_pWindow, const css::uno::Any &_rColorValue)
sets the "face color" for button like controls (scroll bar, spin button)
Definition: vclxwindows.cxx:99
static Any getVisualEffect(vcl::Window const *_pWindow)
sal_Int16 getCompatibleImageAlign(ImageAlign _eAlign)
translates a VCL ImageAlign value into a compatible css.awt.ImageAlign value
Definition: imagealign.cxx:81
static void setVisualEffect(const Any &_rValue, vcl::Window *_pWindow)
long Long
sal_Int16 nId
#define Y
sal_uInt16 GetPropertyId(const OUString &rPropertyName)
Definition: property.cxx:278
#define BASEPROPERTY_DEFAULTBUTTON
Definition: property.hxx:90
#define BASEPROPERTY_MULTILINE
Definition: property.hxx:43
#define BASEPROPERTY_SCROLLVALUE_MIN
Definition: property.hxx:127
#define BASEPROPERTY_UNIT
Definition: property.hxx:170
#define BASEPROPERTY_LITERALMASK
Definition: property.hxx:74
#define BASEPROPERTY_LINEINCREMENT
Definition: property.hxx:112
#define BASEPROPERTY_LINE_END_FORMAT
Definition: property.hxx:137
#define BASEPROPERTY_TEXTLINECOLOR
Definition: property.hxx:118
#define BASEPROPERTY_CURRENCYSYMBOL
Definition: property.hxx:59
#define BASEPROPERTY_VISIBLESIZE
Definition: property.hxx:114
#define BASEPROPERTY_EDITMASK
Definition: property.hxx:73
#define BASEPROPERTY_BORDER
Definition: property.hxx:39
#define BASEPROPERTY_SPIN
Definition: property.hxx:60
#define BASEPROPERTY_HSCROLL
Definition: property.hxx:45
#define BASEPROPERTY_VISUALEFFECT
Definition: property.hxx:144
#define BASEPROPERTY_PAINTTRANSPARENT
Definition: property.hxx:153
#define BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR
Definition: property.hxx:149
#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_ECHOCHAR
Definition: property.hxx:79
#define BASEPROPERTY_URL
Definition: property.hxx:169
#define BASEPROPERTY_CONTEXT_WRITING_MODE
Definition: property.hxx:174
#define BASEPROPERTY_HIGHLIGHT_COLOR
Definition: property.hxx:205
#define BASEPROPERTY_DATESHOWCENTURY
Definition: property.hxx:56
#define BASEPROPERTY_EXTTIMEFORMAT
Definition: property.hxx:57
#define BASEPROPERTY_TIMEMIN
Definition: property.hxx:67
#define BASEPROPERTY_TEXT
Definition: property.hxx:34
#define BASEPROPERTY_BLOCKINCREMENT
Definition: property.hxx:113
#define BASEPROPERTY_READONLY
Definition: property.hxx:76
#define BASEPROPERTY_DATEMAX
Definition: property.hxx:65
#define BASEPROPERTY_MULTIPAGEVALUE
Definition: property.hxx:191
#define BASEPROPERTY_TITLE
Definition: property.hxx:102
#define BASEPROPERTY_SCROLLVALUE_MAX
Definition: property.hxx:111
#define BASEPROPERTY_ALIGN
Definition: property.hxx:40
#define BASEPROPERTY_IMAGEPOSITION
Definition: property.hxx:146
#define BASEPROPERTY_EFFECTIVE_MAX
Definition: property.hxx:100
#define BASEPROPERTY_TOGGLE
Definition: property.hxx:141
#define BASEPROPERTY_HELPURL
Definition: property.hxx:91
#define BASEPROPERTY_EXTDATEFORMAT
Definition: property.hxx:55
#define BASEPROPERTY_AUTOCOMPLETE
Definition: property.hxx:82
#define BASEPROPERTY_REPEAT
Definition: property.hxx:134
#define BASEPROPERTY_LINECOUNT
Definition: property.hxx:54
#define BASEPROPERTY_TIME
Definition: property.hxx:66
#define BASEPROPERTY_PROGRESSVALUE_MIN
Definition: property.hxx:108
#define BASEPROPERTY_GROUPNAME
Definition: property.hxx:190
#define BASEPROPERTY_SYMBOL_COLOR
Definition: property.hxx:129
#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_FORMATKEY
Definition: property.hxx:94
#define BASEPROPERTY_LIVE_SCROLL
Definition: property.hxx:136
#define BASEPROPERTY_MULTISELECTION_SIMPLEMODE
Definition: property.hxx:188
#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_DROPDOWN
Definition: property.hxx:42
#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_ITEM_SEPARATOR_POS
Definition: property.hxx:189
#define BASEPROPERTY_SCROLLVALUE
Definition: property.hxx:110
#define BASEPROPERTY_WRITING_MODE
Definition: property.hxx:173
#define BASEPROPERTY_HIGHLIGHT_TEXT_COLOR
Definition: property.hxx:206
#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_EFFECTIVE_DEFAULT
Definition: property.hxx:98
#define BASEPROPERTY_BORDERCOLOR
Definition: property.hxx:145
#define BASEPROPERTY_CURSYM_POSITION
Definition: property.hxx:101
#define BASEPROPERTY_FONTDESCRIPTOR
Definition: property.hxx:41
#define BASEPROPERTY_NUMSHOWTHOUSANDSEP
Definition: property.hxx:58
#define BASEPROPERTY_FORMATSSUPPLIER
Definition: property.hxx:95
#define BASEPROPERTY_MAXTEXTLEN
Definition: property.hxx:80
#define BASEPROPERTY_DATEMIN
Definition: property.hxx:64
#define BASEPROPERTY_DECIMALACCURACY
Definition: property.hxx:62
#define BASEPROPERTY_VSCROLL
Definition: property.hxx:46
#define BASEPROPERTY_ENABLEVISIBLE
Definition: property.hxx:180
#define BASEPROPERTY_NOLABEL
Definition: property.hxx:168
#define BASEPROPERTY_AUTOHSCROLL
Definition: property.hxx:154
#define BASEPROPERTY_AUTOVSCROLL
Definition: property.hxx:155
#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_EFFECTIVE_VALUE
Definition: property.hxx:96
#define BASEPROPERTY_REFERENCE_DEVICE
Definition: property.hxx:181
#define BASEPROPERTY_EFFECTIVE_MIN
Definition: property.hxx:99
#define BASEPROPERTY_CUSTOMUNITTEXT
Definition: property.hxx:171
#define BASEPROPERTY_HARDLINEBREAKS
Definition: property.hxx:81
#define BASEPROPERTY_IMAGEALIGN
Definition: property.hxx:119
#define BASEPROPERTY_TIMEMAX
Definition: property.hxx:68
#define BASEPROPERTY_REPEAT_DELAY
Definition: property.hxx:128
#define BASEPROPERTY_IMAGE_SCALE_MODE
Definition: property.hxx:172
#define BASEPROPERTY_TEXTCOLOR
Definition: property.hxx:37
#define BASEPROPERTY_PUSHBUTTONTYPE
Definition: property.hxx:121
#define BASEPROPERTY_PRINTABLE
Definition: property.hxx:78
#define BASEPROPERTY_TREATASNUMBER
Definition: property.hxx:97
#define BASEPROPERTY_VALUESTEP_DOUBLE
Definition: property.hxx:88
DragFullOptions
sal_uIntPtr sal_uLong
unsigned char sal_uInt8
unsigned char sal_Bool
sal_uInt16 sal_Unicode
ScrollType
ExtDateFieldFormat
WindowBorderStyle
ExtTimeFieldFormat
#define MetricUnitUnoToVcl(a)
#define METRIC_MAP_PAIR(method, parent)
static double ImplCalcLongValue(double nValue, sal_uInt16 nDigits)
Definition: vclxwindows.cxx:79
static double ImplCalcDoubleValue(double nValue, sal_uInt16 nDigits)
Definition: vclxwindows.cxx:87
IMPL_LINK_NOARG(VCLXFileControl, ModifyHdl, Edit &, void)
sal_Int64 WinBits
WinBits const WB_VERT
WinBits const WB_CENTER
WinBits const WB_DROPDOWN
WindowType
WinBits const WB_TOGGLE
WinBits const WB_REPEAT
WinBits const WB_NOPOINTERFOCUS
WinBits const WB_SIMPLEMODE
ImageAlign
WinBits const WB_HORZ
WinBits const WB_RIGHT
WinBits const WB_SPIN
WinBits const WB_DEFBUTTON
WinBits const WB_LEFT
WinBits const WB_NOHIDESELECTION