tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / include / toolkit / controls / unocontrols.hxx
blob7c5c424fe276945d87aaff0520567f0d01198c6e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_TOOLKIT_CONTROLS_UNOCONTROLS_HXX
21 #define INCLUDED_TOOLKIT_CONTROLS_UNOCONTROLS_HXX
23 #include <config_options.h>
24 #include <toolkit/dllapi.h>
25 #include <com/sun/star/awt/XTextComponent.hpp>
26 #include <com/sun/star/awt/XTextListener.hpp>
27 #include <com/sun/star/awt/XLayoutConstrains.hpp>
28 #include <com/sun/star/awt/XTextLayoutConstrains.hpp>
29 #include <com/sun/star/awt/XButton.hpp>
30 #include <com/sun/star/awt/XToggleButton.hpp>
31 #include <com/sun/star/awt/XRadioButton.hpp>
32 #include <com/sun/star/awt/XItemListener.hpp>
33 #include <com/sun/star/awt/XCheckBox.hpp>
34 #include <com/sun/star/awt/XFixedHyperlink.hpp>
35 #include <com/sun/star/awt/XFixedText.hpp>
36 #include <com/sun/star/awt/XListBox.hpp>
37 #include <com/sun/star/awt/XComboBox.hpp>
38 #include <com/sun/star/awt/XDateField.hpp>
39 #include <com/sun/star/awt/XSpinField.hpp>
40 #include <com/sun/star/awt/XTimeField.hpp>
41 #include <com/sun/star/awt/XNumericField.hpp>
42 #include <com/sun/star/awt/XCurrencyField.hpp>
43 #include <com/sun/star/awt/XPatternField.hpp>
44 #include <com/sun/star/awt/XProgressBar.hpp>
45 #include <com/sun/star/awt/XItemList.hpp>
46 #include <toolkit/controls/unocontrolmodel.hxx>
47 #include <toolkit/controls/unocontrolbase.hxx>
48 #include <toolkit/helper/macros.hxx>
49 #include <cppuhelper/implbase5.hxx>
50 #include <cppuhelper/implbase4.hxx>
51 #include <cppuhelper/implbase1.hxx>
52 #include <comphelper/interfacecontainer4.hxx>
53 #include <comphelper/uno3.hxx>
54 #include <tools/gen.hxx>
56 #include <memory>
57 #include <vector>
59 #include <optional>
61 namespace com::sun::star::graphic { class XGraphic; }
62 namespace com::sun::star::graphic { class XGraphicObject; }
64 class ImageHelper
66 public:
67 // The routine will always attempt to return a valid XGraphic for the
68 // passed _rURL, additionally xOutGraphicObject will contain the
69 // associated XGraphicObject ( if url is valid for that ) and is set
70 // appropriately ( e.g. NULL if non GraphicObject scheme ) or a valid
71 // object if the rURL points to a valid object
72 static css::uno::Reference< css::graphic::XGraphic > getGraphicAndGraphicObjectFromURL_nothrow( css::uno::Reference< css::graphic::XGraphicObject >& xOutGraphicObject, const OUString& _rURL );
73 static css::uno::Reference< css::graphic::XGraphic > getGraphicFromURL_nothrow( const OUString& _rURL, OUString const & referer );
79 class UnoControlEditModel final : public UnoControlModel
81 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
82 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
84 public:
85 UnoControlEditModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
86 UnoControlEditModel( const UnoControlEditModel& rModel ) : UnoControlModel( rModel ) {}
88 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlEditModel( *this ); }
90 // css::io::XPersistObject
91 OUString SAL_CALL getServiceName() override;
93 // css::beans::XMultiPropertySet
94 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
97 // XServiceInfo
98 OUString SAL_CALL getImplementationName() override;
100 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
105 typedef ::cppu::ImplHelper4 < css::awt::XTextComponent
106 , css::awt::XTextListener
107 , css::awt::XLayoutConstrains
108 , css::awt::XTextLayoutConstrains
109 > UnoEditControl_Base;
110 class UNLESS_MERGELIBS(TOOLKIT_DLLPUBLIC) UnoEditControl :public UnoControlBase
111 ,public UnoEditControl_Base
113 private:
114 TextListenerMultiplexer maTextListeners;
116 // Not all fields derived from UnoEditCOntrol have the property "Text"
117 // They only support XTextComponent, so keep the text
118 // here, maybe there is no Peer when calling setText()...
119 OUString maText;
120 sal_uInt16 mnMaxTextLen;
122 bool mbSetTextInPeer;
123 bool mbSetMaxTextLenInPeer;
124 bool mbHasTextProperty;
126 public:
128 UnoEditControl();
129 OUString GetComponentServiceName() const override;
130 TextListenerMultiplexer& GetTextListeners() { return maTextListeners; }
132 void ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override;
134 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
135 void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); }
136 void SAL_CALL dispose( ) override;
138 // disambiguate XInterface
139 DECLARE_XINTERFACE()
141 // XAggregation
142 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
144 // XTypeProvider
145 DECLARE_XTYPEPROVIDER()
147 // XTextListener
148 void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override;
150 // XTextComponent
151 void SAL_CALL addTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override;
152 void SAL_CALL removeTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override;
153 void SAL_CALL setText( const OUString& aText ) override;
154 void SAL_CALL insertText( const css::awt::Selection& Sel, const OUString& Text ) override;
155 OUString SAL_CALL getText( ) override;
156 OUString SAL_CALL getSelectedText( ) override;
157 void SAL_CALL setSelection( const css::awt::Selection& aSelection ) override;
158 css::awt::Selection SAL_CALL getSelection( ) override;
159 sal_Bool SAL_CALL isEditable( ) override;
160 void SAL_CALL setEditable( sal_Bool bEditable ) override;
161 void SAL_CALL setMaxTextLen( sal_Int16 nLen ) override;
162 sal_Int16 SAL_CALL getMaxTextLen( ) override;
164 // XLayoutConstrains
165 css::awt::Size SAL_CALL getMinimumSize( ) override;
166 css::awt::Size SAL_CALL getPreferredSize( ) override;
167 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
169 // XTextLayoutConstrains
170 css::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) override;
171 void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) override;
173 // XServiceInfo
174 OUString SAL_CALL getImplementationName( ) override;
175 css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
177 sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel >& Model) override;
182 class UnoControlFileControlModel final : public UnoControlModel
184 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
185 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
187 public:
188 UnoControlFileControlModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
189 UnoControlFileControlModel( const UnoControlFileControlModel& rModel ) : UnoControlModel( rModel ) {}
191 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlFileControlModel( *this ); }
193 // css::io::XPersistObject
194 OUString SAL_CALL getServiceName() override;
196 // css::beans::XMultiPropertySet
197 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
199 // css::lang::XServiceInfo
200 OUString SAL_CALL getImplementationName() override;
202 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
207 class UnoFileControl final : public UnoEditControl
209 public:
210 UnoFileControl();
211 OUString GetComponentServiceName() const override;
213 // css::lang::XServiceInfo
214 OUString SAL_CALL getImplementationName() override;
216 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
221 class GraphicControlModel : public UnoControlModel
223 private:
224 bool mbAdjustingImagePosition;
225 bool mbAdjustingGraphic;
227 protected:
228 GraphicControlModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
229 :UnoControlModel( rxContext )
230 ,mbAdjustingImagePosition( false )
231 ,mbAdjustingGraphic( false )
234 GraphicControlModel( const GraphicControlModel& _rSource ) : UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
236 // ::comphelper::OPropertySetHelper
237 void setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override;
239 // UnoControlModel
240 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
242 private:
243 GraphicControlModel& operator=( const GraphicControlModel& ) = delete;
248 class UnoControlButtonModel final : public GraphicControlModel
250 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
251 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
253 public:
254 UnoControlButtonModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
255 UnoControlButtonModel( const UnoControlButtonModel& rModel ) : GraphicControlModel( rModel ) {}
257 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlButtonModel( *this ); }
259 // css::beans::XMultiPropertySet
260 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
262 // css::io::XPersistObject
263 OUString SAL_CALL getServiceName() override;
265 // css::lang::XServiceInfo
266 OUString SAL_CALL getImplementationName() override;
268 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
273 typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
274 , css::awt::XButton
275 , css::awt::XToggleButton
276 , css::awt::XLayoutConstrains
277 , css::awt::XItemListener
278 > UnoButtonControl_Base;
279 class UnoButtonControl final : public UnoButtonControl_Base
281 private:
282 ActionListenerMultiplexer maActionListeners;
283 ItemListenerMultiplexer maItemListeners;
284 OUString maActionCommand;
286 public:
288 UnoButtonControl();
289 OUString GetComponentServiceName() const override;
291 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
292 void SAL_CALL dispose( ) override;
294 // css::awt::XButton
295 void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
296 void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
297 void SAL_CALL setLabel( const OUString& Label ) override;
298 void SAL_CALL setActionCommand( const OUString& Command ) override;
300 // css::awt::XToggleButton
301 // css::awt::XItemEventBroadcaster
302 void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
303 void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
305 // css::lang::XEventListener
306 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
308 // XItemListener
309 virtual void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override;
311 // css::awt::XLayoutConstrains
312 css::awt::Size SAL_CALL getMinimumSize( ) override;
313 css::awt::Size SAL_CALL getPreferredSize( ) override;
314 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
316 // css::lang::XServiceInfo
317 OUString SAL_CALL getImplementationName() override;
319 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
324 class UnoControlImageControlModel final : public GraphicControlModel
326 private:
327 bool mbAdjustingImageScaleMode;
329 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
330 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
332 public:
333 UnoControlImageControlModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
334 UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : GraphicControlModel( rModel ), mbAdjustingImageScaleMode( false ) { }
336 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlImageControlModel( *this ); }
338 // css::beans::XMultiPropertySet
339 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
341 // css::io::XPersistObject
342 OUString SAL_CALL getServiceName() override;
344 // css::lang::XServiceInfo
345 OUString SAL_CALL getImplementationName() override;
347 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
349 // ::cppu::OPropertySetHelper
350 void setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override;
355 typedef ::cppu::AggImplInheritanceHelper1 < UnoControlBase
356 , css::awt::XLayoutConstrains
357 > UnoImageControlControl_Base;
358 class UnoImageControlControl final : public UnoImageControlControl_Base
360 private:
361 ActionListenerMultiplexer maActionListeners;
363 public:
365 UnoImageControlControl();
366 OUString GetComponentServiceName() const override;
368 void SAL_CALL dispose( ) override;
370 // css::awt::XControl
371 sal_Bool SAL_CALL isTransparent( ) override;
373 // css::awt::XLayoutConstrains
374 css::awt::Size SAL_CALL getMinimumSize( ) override;
375 css::awt::Size SAL_CALL getPreferredSize( ) override;
376 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
378 // css::lang::XServiceInfo
379 OUString SAL_CALL getImplementationName() override;
381 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
386 class UnoControlRadioButtonModel final : public GraphicControlModel
388 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
389 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
391 public:
392 UnoControlRadioButtonModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
393 UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : GraphicControlModel( rModel ) {}
395 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlRadioButtonModel( *this ); }
397 // css::io::XPersistObject
398 OUString SAL_CALL getServiceName() override;
400 // css::beans::XMultiPropertySet
401 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
403 // css::lang::XServiceInfo
404 OUString SAL_CALL getImplementationName() override;
406 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
411 typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
412 , css::awt::XButton
413 , css::awt::XRadioButton
414 , css::awt::XItemListener
415 , css::awt::XLayoutConstrains
416 > UnoRadioButtonControl_Base;
417 class UnoRadioButtonControl final : public UnoRadioButtonControl_Base
419 private:
420 ItemListenerMultiplexer maItemListeners;
421 ActionListenerMultiplexer maActionListeners;
422 OUString maActionCommand;
424 public:
426 UnoRadioButtonControl();
427 OUString GetComponentServiceName() const override;
429 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
430 void SAL_CALL dispose( ) override;
431 void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); }
433 // css::awt::XControl
434 sal_Bool SAL_CALL isTransparent( ) override;
436 // css::awt::XButton
437 void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
438 void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
439 void SAL_CALL setActionCommand( const OUString& Command ) override;
441 // css::awt::XRadioButton
442 void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
443 void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
444 sal_Bool SAL_CALL getState( ) override;
445 void SAL_CALL setState( sal_Bool b ) override;
446 void SAL_CALL setLabel( const OUString& Label ) override;
448 // css::awt::XItemListener
449 void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override;
451 // css::awt::XLayoutConstrains
452 css::awt::Size SAL_CALL getMinimumSize( ) override;
453 css::awt::Size SAL_CALL getPreferredSize( ) override;
454 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
456 // css::lang::XServiceInfo
457 OUString SAL_CALL getImplementationName() override;
459 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
464 class UnoControlCheckBoxModel final : public GraphicControlModel
466 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
467 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
469 public:
470 UnoControlCheckBoxModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
471 UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : GraphicControlModel( rModel ) {}
473 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlCheckBoxModel( *this ); }
475 // css::io::XPersistObject
476 OUString SAL_CALL getServiceName() override;
478 // css::beans::XMultiPropertySet
479 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
481 // css::lang::XServiceInfo
482 OUString SAL_CALL getImplementationName() override;
484 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
489 typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
490 , css::awt::XButton
491 , css::awt::XCheckBox
492 , css::awt::XItemListener
493 , css::awt::XLayoutConstrains
494 > UnoCheckBoxControl_Base;
495 class UnoCheckBoxControl final : public UnoCheckBoxControl_Base
497 private:
498 ItemListenerMultiplexer maItemListeners;
499 ActionListenerMultiplexer maActionListeners;
500 OUString maActionCommand;
502 public:
504 UnoCheckBoxControl();
505 OUString GetComponentServiceName() const override;
507 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
508 void SAL_CALL dispose( ) override;
509 void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); }
511 // css::awt::XControl
512 sal_Bool SAL_CALL isTransparent( ) override;
514 // css::awt::XButton
515 void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
516 void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
517 void SAL_CALL setActionCommand( const OUString& Command ) override;
519 virtual void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
520 virtual void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
523 sal_Int16 SAL_CALL getState( ) override;
524 void SAL_CALL setState( sal_Int16 n ) override;
525 void SAL_CALL setLabel( const OUString& Label ) override;
526 void SAL_CALL enableTriState( sal_Bool b ) override;
528 // css::awt::XItemListener
529 void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override;
531 // css::awt::XLayoutConstrains
532 css::awt::Size SAL_CALL getMinimumSize( ) override;
533 css::awt::Size SAL_CALL getPreferredSize( ) override;
534 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
536 // css::lang::XServiceInfo
537 OUString SAL_CALL getImplementationName() override;
539 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
544 class UnoControlFixedHyperlinkModel final : public UnoControlModel
546 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
547 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
549 public:
550 UnoControlFixedHyperlinkModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
551 UnoControlFixedHyperlinkModel( const UnoControlFixedHyperlinkModel& rModel ) : UnoControlModel( rModel ) {}
553 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlFixedHyperlinkModel( *this ); }
555 // css::io::XPersistObject
556 OUString SAL_CALL getServiceName() override;
558 // css::beans::XMultiPropertySet
559 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
561 // css::lang::XServiceInfo
562 DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedHyperlinkModel, UnoControlModel, "com.sun.star.awt.UnoControlFixedHyperlinkModel" )
567 class UnoFixedHyperlinkControl final : public UnoControlBase,
568 public css::awt::XFixedHyperlink,
569 public css::awt::XLayoutConstrains
571 private:
572 ActionListenerMultiplexer maActionListeners;
574 public:
575 UnoFixedHyperlinkControl();
577 OUString GetComponentServiceName() const override;
579 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoControlBase::queryInterface(rType); }
580 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
581 void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
582 void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
584 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
585 void SAL_CALL dispose( ) override;
587 // css::lang::XTypeProvider
588 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
589 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
591 // css::awt::XControl
592 sal_Bool SAL_CALL isTransparent( ) override;
594 // css::awt::XFixedHyperlink
595 void SAL_CALL setText( const OUString& Text ) override;
596 OUString SAL_CALL getText( ) override;
597 void SAL_CALL setURL( const OUString& URL ) override;
598 OUString SAL_CALL getURL( ) override;
599 void SAL_CALL setAlignment( sal_Int16 nAlign ) override;
600 sal_Int16 SAL_CALL getAlignment( ) override;
601 void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
602 void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
604 // css::awt::XLayoutConstrains
605 css::awt::Size SAL_CALL getMinimumSize( ) override;
606 css::awt::Size SAL_CALL getPreferredSize( ) override;
607 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
609 // css::lang::XServiceInfo
610 DECLIMPL_SERVICEINFO_DERIVED( UnoFixedHyperlinkControl, UnoControlBase, "com.sun.star.awt.UnoControlFixedHyperlink" )
615 class UnoControlFixedTextModel final : public UnoControlModel
617 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
618 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
620 public:
621 UnoControlFixedTextModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
622 UnoControlFixedTextModel( const UnoControlFixedTextModel& rModel ) : UnoControlModel( rModel ) {}
624 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlFixedTextModel( *this ); }
626 // css::io::XPersistObject
627 OUString SAL_CALL getServiceName() override;
629 // css::beans::XMultiPropertySet
630 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
632 // css::lang::XServiceInfo
633 OUString SAL_CALL getImplementationName() override;
635 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
640 class UnoFixedTextControl final : public UnoControlBase,
641 public css::awt::XFixedText,
642 public css::awt::XLayoutConstrains
644 public:
645 UnoFixedTextControl();
646 OUString GetComponentServiceName() const override;
648 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoControlBase::queryInterface(rType); }
649 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
650 void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
651 void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
653 // css::lang::XTypeProvider
654 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
655 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
657 // css::awt::XControl
658 sal_Bool SAL_CALL isTransparent( ) override;
660 // css::awt::XFixedText
661 void SAL_CALL setText( const OUString& Text ) override;
662 OUString SAL_CALL getText( ) override;
663 void SAL_CALL setAlignment( sal_Int16 nAlign ) override;
664 sal_Int16 SAL_CALL getAlignment( ) override;
666 // css::awt::XLayoutConstrains
667 css::awt::Size SAL_CALL getMinimumSize( ) override;
668 css::awt::Size SAL_CALL getPreferredSize( ) override;
669 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
671 // css::lang::XServiceInfo
672 OUString SAL_CALL getImplementationName() override;
674 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
679 class UnoControlGroupBoxModel final : public UnoControlModel
681 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
682 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
684 public:
685 UnoControlGroupBoxModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
686 UnoControlGroupBoxModel( const UnoControlGroupBoxModel& rModel ) : UnoControlModel( rModel ) {}
688 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlGroupBoxModel( *this ); }
690 // css::io::XPersistObject
691 OUString SAL_CALL getServiceName() override;
693 // css::beans::XMultiPropertySet
694 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
696 // css::lang::XServiceInfo
697 OUString SAL_CALL getImplementationName() override;
699 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
704 class UnoGroupBoxControl final : public UnoControlBase
706 public:
707 UnoGroupBoxControl();
708 OUString GetComponentServiceName() const override;
710 sal_Bool SAL_CALL isTransparent( ) override;
712 // css::lang::XServiceInfo
713 OUString SAL_CALL getImplementationName() override;
715 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
720 struct UnoControlListBoxModel_Data;
721 typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
722 , css::awt::XItemList
723 > UnoControlListBoxModel_Base;
724 class UnoControlListBoxModel : public UnoControlListBoxModel_Base
726 protected:
727 enum ConstructorMode
729 ConstructDefault,
730 ConstructWithoutProperties
733 public:
734 UnoControlListBoxModel(
735 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
736 ConstructorMode const i_mode = ConstructDefault
738 UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource );
739 virtual ~UnoControlListBoxModel() override;
741 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlListBoxModel( *this ); }
743 virtual void ImplNormalizePropertySequence(
744 const sal_Int32 _nCount, /// the number of entries in the arrays
745 sal_Int32* _pHandles, /// the handles of the properties to set
746 css::uno::Any* _pValues, /// the values of the properties to set
747 sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted
748 ) const override;
750 // css::beans::XMultiPropertySet
751 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
753 // css::io::XPersistObject
754 OUString SAL_CALL getServiceName() override;
756 // css::lang::XServiceInfo
757 OUString SAL_CALL getImplementationName( ) override;
758 css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
760 // css::awt::XItemList
761 virtual ::sal_Int32 SAL_CALL getItemCount() override;
762 virtual void SAL_CALL insertItem( ::sal_Int32 Position, const OUString& ItemText, const OUString& ItemImageURL ) override;
763 virtual void SAL_CALL insertItemText( ::sal_Int32 Position, const OUString& ItemText ) override;
764 virtual void SAL_CALL insertItemImage( ::sal_Int32 Position, const OUString& ItemImageURL ) override;
765 virtual void SAL_CALL removeItem( ::sal_Int32 Position ) override;
766 virtual void SAL_CALL removeAllItems( ) override;
767 virtual void SAL_CALL setItemText( ::sal_Int32 Position, const OUString& ItemText ) override;
768 virtual void SAL_CALL setItemImage( ::sal_Int32 Position, const OUString& ItemImageURL ) override;
769 virtual void SAL_CALL setItemTextAndImage( ::sal_Int32 Position, const OUString& ItemText, const OUString& ItemImageURL ) override;
770 virtual void SAL_CALL setItemData( ::sal_Int32 Position, const css::uno::Any& DataValue ) override;
771 virtual OUString SAL_CALL getItemText( ::sal_Int32 Position ) override;
772 virtual OUString SAL_CALL getItemImage( ::sal_Int32 Position ) override;
773 virtual css::beans::Pair< OUString, OUString > SAL_CALL getItemTextAndImage( ::sal_Int32 Position ) override;
774 virtual css::uno::Any SAL_CALL getItemData( ::sal_Int32 Position ) override;
775 virtual css::uno::Sequence< css::beans::Pair< OUString, OUString > > SAL_CALL getAllItems( ) override;
776 virtual void SAL_CALL addItemListListener( const css::uno::Reference< css::awt::XItemListListener >& Listener ) override;
777 virtual void SAL_CALL removeItemListListener( const css::uno::Reference< css::awt::XItemListListener >& Listener ) override;
779 // OPropertySetHelper
780 void setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override;
782 protected:
783 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
784 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
786 private:
787 void impl_notifyItemListEvent(
788 std::unique_lock<std::mutex>& rGuard,
789 const sal_Int32 i_nItemPosition,
790 const ::std::optional< OUString >& i_rItemText,
791 const ::std::optional< OUString >& i_rItemImageURL,
792 void ( SAL_CALL css::awt::XItemListListener::*NotificationMethod )( const css::awt::ItemListEvent& )
795 void impl_handleInsert(
796 std::unique_lock<std::mutex>& rGuard,
797 const sal_Int32 i_nItemPosition,
798 const ::std::optional< OUString >& i_rItemText,
799 const ::std::optional< OUString >& i_rItemImageURL
802 void impl_handleRemove(
803 const sal_Int32 i_nItemPosition,
804 std::unique_lock<std::mutex>& i_rClearBeforeNotify
807 void impl_handleModify(
808 const sal_Int32 i_nItemPosition,
809 const ::std::optional< OUString >& i_rItemText,
810 const ::std::optional< OUString >& i_rItemImageURL,
811 std::unique_lock<std::mutex>& i_rClearBeforeNotify
814 void impl_getStringItemList( std::unique_lock<std::mutex>& rGuard, ::std::vector< OUString >& o_rStringItems ) const;
815 void impl_setStringItemList( std::unique_lock<std::mutex>& rGuard, const ::std::vector< OUString >& i_rStringItems );
817 protected:
818 std::unique_ptr<UnoControlListBoxModel_Data> m_xData;
819 ::comphelper::OInterfaceContainerHelper4<css::awt::XItemListListener> m_aItemListListeners;
824 typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase
825 , css::awt::XListBox
826 , css::awt::XItemListener
827 , css::awt::XLayoutConstrains
828 , css::awt::XTextLayoutConstrains
829 , css::awt::XItemListListener
830 > UnoListBoxControl_Base;
831 class UnoListBoxControl final : public UnoListBoxControl_Base
833 public:
834 UnoListBoxControl();
835 OUString GetComponentServiceName() const override;
837 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
838 void SAL_CALL dispose( ) override;
839 void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); }
841 // css::awt::XListBox
842 void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
843 void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
844 void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
845 void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
846 void SAL_CALL addItem( const OUString& aItem, sal_Int16 nPos ) override;
847 void SAL_CALL addItems( const css::uno::Sequence< OUString >& aItems, sal_Int16 nPos ) override;
848 void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) override;
849 sal_Int16 SAL_CALL getItemCount( ) override;
850 OUString SAL_CALL getItem( sal_Int16 nPos ) override;
851 css::uno::Sequence< OUString > SAL_CALL getItems( ) override;
852 sal_Int16 SAL_CALL getSelectedItemPos( ) override;
853 css::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos( ) override;
854 OUString SAL_CALL getSelectedItem( ) override;
855 css::uno::Sequence< OUString > SAL_CALL getSelectedItems( ) override;
856 void SAL_CALL selectItemPos( sal_Int16 nPos, sal_Bool bSelect ) override;
857 void SAL_CALL selectItemsPos( const css::uno::Sequence< sal_Int16 >& aPositions, sal_Bool bSelect ) override;
858 void SAL_CALL selectItem( const OUString& aItem, sal_Bool bSelect ) override;
859 sal_Bool SAL_CALL isMutipleMode( ) override;
860 void SAL_CALL setMultipleMode( sal_Bool bMulti ) override;
861 sal_Int16 SAL_CALL getDropDownLineCount( ) override;
862 void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) override;
863 void SAL_CALL makeVisible( sal_Int16 nEntry ) override;
865 // css::awt::XItemListener
866 void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override;
868 // css::awt::XLayoutConstrains
869 css::awt::Size SAL_CALL getMinimumSize( ) override;
870 css::awt::Size SAL_CALL getPreferredSize( ) override;
871 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
873 // css::awt::XTextLayoutConstrains
874 css::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) override;
875 void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) override;
877 // XUnoControl
878 sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel >& Model) override;
880 // XItemListListener
881 virtual void SAL_CALL listItemInserted( const css::awt::ItemListEvent& Event ) override;
882 virtual void SAL_CALL listItemRemoved( const css::awt::ItemListEvent& Event ) override;
883 virtual void SAL_CALL listItemModified( const css::awt::ItemListEvent& Event ) override;
884 virtual void SAL_CALL allItemsRemoved( const css::lang::EventObject& Event ) override;
885 virtual void SAL_CALL itemListChanged( const css::lang::EventObject& Event ) override;
887 // css::lang::XServiceInfo
888 OUString SAL_CALL getImplementationName( ) override;
889 css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
891 private:
892 void ImplUpdateSelectedItemsProperty();
893 virtual void ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override;
894 virtual void updateFromModel() override;
896 ActionListenerMultiplexer maActionListeners;
897 ItemListenerMultiplexer maItemListeners;
902 class UnoControlComboBoxModel final : public UnoControlListBoxModel
904 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
905 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
907 public:
908 UnoControlComboBoxModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
909 UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {}
911 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlComboBoxModel( *this ); }
913 // css::io::XPersistObject
914 OUString SAL_CALL getServiceName() override;
916 // css::beans::XMultiPropertySet
917 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
918 // OPropertySetHelper
919 void setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override;
921 // css::lang::XServiceInfo
922 OUString SAL_CALL getImplementationName( ) override;
923 css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
929 class UnoComboBoxControl final : public UnoEditControl
930 , public css::awt::XComboBox
931 , public css::awt::XItemListener
932 , public css::awt::XItemListListener
934 private:
935 ActionListenerMultiplexer maActionListeners;
936 ItemListenerMultiplexer maItemListeners;
938 public:
940 UnoComboBoxControl();
941 OUString GetComponentServiceName() const override;
943 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
944 void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoEditControl::disposing( Source ); }
945 void SAL_CALL dispose( ) override;
947 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoEditControl::queryInterface(rType); }
948 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
949 void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
950 void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
953 // css::lang::XTypeProvider
954 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
955 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
957 // css::awt::XComboBox
958 void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
959 void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
960 void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
961 void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override;
962 void SAL_CALL addItem( const OUString& aItem, sal_Int16 nPos ) override;
963 void SAL_CALL addItems( const css::uno::Sequence< OUString >& aItems, sal_Int16 nPos ) override;
964 void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) override;
965 sal_Int16 SAL_CALL getItemCount( ) override;
966 OUString SAL_CALL getItem( sal_Int16 nPos ) override;
967 css::uno::Sequence< OUString > SAL_CALL getItems( ) override;
968 sal_Int16 SAL_CALL getDropDownLineCount( ) override;
969 void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) override;
971 // XUnoControl
972 virtual sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel >& Model) override;
974 // XItemListListener
975 virtual void SAL_CALL listItemInserted( const css::awt::ItemListEvent& Event ) override;
976 virtual void SAL_CALL listItemRemoved( const css::awt::ItemListEvent& Event ) override;
977 virtual void SAL_CALL listItemModified( const css::awt::ItemListEvent& Event ) override;
978 virtual void SAL_CALL allItemsRemoved( const css::lang::EventObject& Event ) override;
979 virtual void SAL_CALL itemListChanged( const css::lang::EventObject& Event ) override;
981 // XItemListener
982 virtual void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override;
984 // css::lang::XServiceInfo
985 OUString SAL_CALL getImplementationName( ) override;
986 css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
987 private:
988 virtual void ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override;
989 virtual void updateFromModel() override;
995 class UnoSpinFieldControl : public UnoEditControl,
996 public css::awt::XSpinField
998 private:
999 SpinListenerMultiplexer maSpinListeners;
1000 bool mbRepeat;
1002 public:
1003 UnoSpinFieldControl();
1005 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoEditControl::queryInterface(rType); }
1006 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
1007 void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
1008 void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
1010 // css::lang::XTypeProvider
1011 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
1012 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
1014 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
1016 // css::awt::XSpinField
1017 void SAL_CALL addSpinListener( const css::uno::Reference< css::awt::XSpinListener >& l ) override;
1018 void SAL_CALL removeSpinListener( const css::uno::Reference< css::awt::XSpinListener >& l ) override;
1019 void SAL_CALL up() override;
1020 void SAL_CALL down() override;
1021 void SAL_CALL first() override;
1022 void SAL_CALL last() override;
1023 void SAL_CALL enableRepeat( sal_Bool bRepeat ) override;
1026 // css::lang::XServiceInfo
1027 // No service info, only base class for other fields.
1032 class UnoControlDateFieldModel final : public UnoControlModel
1034 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
1035 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
1037 public:
1038 UnoControlDateFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1039 UnoControlDateFieldModel( const UnoControlDateFieldModel& rModel ) : UnoControlModel( rModel ) {}
1041 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlDateFieldModel( *this ); }
1043 // css::io::XPersistObject
1044 OUString SAL_CALL getServiceName() override;
1046 // css::beans::XMultiPropertySet
1047 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
1049 // css::lang::XServiceInfo
1050 OUString SAL_CALL getImplementationName() override;
1052 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1057 class UnoDateFieldControl final : public UnoSpinFieldControl,
1058 public css::awt::XDateField
1060 private:
1061 css::util::Date mnFirst;
1062 css::util::Date mnLast;
1063 TriState mbLongFormat;
1064 public:
1065 UnoDateFieldControl();
1066 OUString GetComponentServiceName() const override;
1068 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoSpinFieldControl::queryInterface(rType); }
1069 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
1070 void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
1071 void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
1073 // css::lang::XTypeProvider
1074 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
1075 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
1077 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
1079 // css::awt::XTextListener
1080 void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override;
1082 //XDateField
1083 void SAL_CALL setDate( const css::util::Date& Date ) override;
1084 css::util::Date SAL_CALL getDate( ) override;
1085 void SAL_CALL setMin( const css::util::Date& Date ) override;
1086 css::util::Date SAL_CALL getMin( ) override;
1087 void SAL_CALL setMax( const css::util::Date& Date ) override;
1088 css::util::Date SAL_CALL getMax( ) override;
1089 void SAL_CALL setFirst( const css::util::Date& Date ) override;
1090 css::util::Date SAL_CALL getFirst( ) override;
1091 void SAL_CALL setLast( const css::util::Date& Date ) override;
1092 css::util::Date SAL_CALL getLast( ) override;
1093 void SAL_CALL setLongFormat( sal_Bool bLong ) override;
1094 sal_Bool SAL_CALL isLongFormat( ) override;
1095 void SAL_CALL setEmpty( ) override;
1096 sal_Bool SAL_CALL isEmpty( ) override;
1097 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
1098 sal_Bool SAL_CALL isStrictFormat( ) override;
1100 // css::lang::XServiceInfo
1101 OUString SAL_CALL getImplementationName() override;
1103 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1108 class UnoControlTimeFieldModel final : public UnoControlModel
1110 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
1111 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
1113 public:
1114 UnoControlTimeFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1115 UnoControlTimeFieldModel( const UnoControlTimeFieldModel& rModel ) : UnoControlModel( rModel ) {}
1117 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlTimeFieldModel( *this ); }
1119 // css::io::XPersistObject
1120 OUString SAL_CALL getServiceName() override;
1122 // css::beans::XMultiPropertySet
1123 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
1125 // css::lang::XServiceInfo
1126 OUString SAL_CALL getImplementationName() override;
1128 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1133 class UnoTimeFieldControl final : public UnoSpinFieldControl,
1134 public css::awt::XTimeField
1136 private:
1137 css::util::Time mnFirst;
1138 css::util::Time mnLast;
1140 public:
1141 UnoTimeFieldControl();
1142 OUString GetComponentServiceName() const override;
1144 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoSpinFieldControl::queryInterface(rType); }
1145 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
1146 void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
1147 void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
1149 // css::lang::XTypeProvider
1150 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
1151 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
1153 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
1155 // css::awt::XTextListener
1156 void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override;
1158 //XTimeField
1159 void SAL_CALL setTime( const css::util::Time& Time ) override;
1160 css::util::Time SAL_CALL getTime( ) override;
1161 void SAL_CALL setMin( const css::util::Time& Time ) override;
1162 css::util::Time SAL_CALL getMin( ) override;
1163 void SAL_CALL setMax( const css::util::Time& Time ) override;
1164 css::util::Time SAL_CALL getMax( ) override;
1165 void SAL_CALL setFirst( const css::util::Time& Time ) override;
1166 css::util::Time SAL_CALL getFirst( ) override;
1167 void SAL_CALL setLast( const css::util::Time& Time ) override;
1168 css::util::Time SAL_CALL getLast( ) override;
1169 void SAL_CALL setEmpty( ) override;
1170 sal_Bool SAL_CALL isEmpty( ) override;
1171 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
1172 sal_Bool SAL_CALL isStrictFormat( ) override;
1174 // css::lang::XServiceInfo
1175 OUString SAL_CALL getImplementationName() override;
1177 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1182 class UnoControlNumericFieldModel final : public UnoControlModel
1184 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
1185 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
1187 public:
1188 UnoControlNumericFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1189 UnoControlNumericFieldModel( const UnoControlNumericFieldModel& rModel ) : UnoControlModel( rModel ) {}
1191 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlNumericFieldModel( *this ); }
1193 // css::io::XPersistObject
1194 OUString SAL_CALL getServiceName() override;
1196 // css::beans::XMultiPropertySet
1197 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
1199 // css::lang::XServiceInfo
1200 OUString SAL_CALL getImplementationName() override;
1202 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1207 class UnoNumericFieldControl final : public UnoSpinFieldControl,
1208 public css::awt::XNumericField
1210 private:
1211 double mnFirst;
1212 double mnLast;
1214 public:
1215 UnoNumericFieldControl();
1216 OUString GetComponentServiceName() const override;
1218 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoSpinFieldControl::queryInterface(rType); }
1219 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
1220 void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
1221 void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
1223 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
1225 // css::lang::XTypeProvider
1226 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
1227 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
1229 // css::awt::XTextListener
1230 void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override;
1232 // css::awt::XNumericField
1233 void SAL_CALL setValue( double Value ) override;
1234 double SAL_CALL getValue( ) override;
1235 void SAL_CALL setMin( double Value ) override;
1236 double SAL_CALL getMin( ) override;
1237 void SAL_CALL setMax( double Value ) override;
1238 double SAL_CALL getMax( ) override;
1239 void SAL_CALL setFirst( double Value ) override;
1240 double SAL_CALL getFirst( ) override;
1241 void SAL_CALL setLast( double Value ) override;
1242 double SAL_CALL getLast( ) override;
1243 void SAL_CALL setSpinSize( double Value ) override;
1244 double SAL_CALL getSpinSize( ) override;
1245 void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) override;
1246 sal_Int16 SAL_CALL getDecimalDigits( ) override;
1247 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
1248 sal_Bool SAL_CALL isStrictFormat( ) override;
1250 // css::lang::XServiceInfo
1251 OUString SAL_CALL getImplementationName() override;
1253 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1258 class UnoControlCurrencyFieldModel final : public UnoControlModel
1260 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
1261 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
1263 public:
1264 UnoControlCurrencyFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1265 UnoControlCurrencyFieldModel( const UnoControlCurrencyFieldModel& rModel ) : UnoControlModel( rModel ) {}
1267 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlCurrencyFieldModel( *this ); }
1269 // css::io::XPersistObject
1270 OUString SAL_CALL getServiceName() override;
1272 // css::beans::XMultiPropertySet
1273 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
1275 // css::lang::XServiceInfo
1276 OUString SAL_CALL getImplementationName() override;
1278 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1283 class UnoCurrencyFieldControl final : public UnoSpinFieldControl,
1284 public css::awt::XCurrencyField
1286 private:
1287 double mnFirst;
1288 double mnLast;
1290 public:
1291 UnoCurrencyFieldControl();
1292 OUString GetComponentServiceName() const override;
1294 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoSpinFieldControl::queryInterface(rType); }
1295 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
1296 void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
1297 void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
1299 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
1301 // css::lang::XTypeProvider
1302 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
1303 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
1305 // css::awt::XTextListener
1306 void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override;
1308 // css::awt::XCurrencyField
1309 void SAL_CALL setValue( double Value ) override;
1310 double SAL_CALL getValue( ) override;
1311 void SAL_CALL setMin( double Value ) override;
1312 double SAL_CALL getMin( ) override;
1313 void SAL_CALL setMax( double Value ) override;
1314 double SAL_CALL getMax( ) override;
1315 void SAL_CALL setFirst( double Value ) override;
1316 double SAL_CALL getFirst( ) override;
1317 void SAL_CALL setLast( double Value ) override;
1318 double SAL_CALL getLast( ) override;
1319 void SAL_CALL setSpinSize( double Value ) override;
1320 double SAL_CALL getSpinSize( ) override;
1321 void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) override;
1322 sal_Int16 SAL_CALL getDecimalDigits( ) override;
1323 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
1324 sal_Bool SAL_CALL isStrictFormat( ) override;
1326 // css::lang::XServiceInfo
1327 OUString SAL_CALL getImplementationName() override;
1329 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1334 class UnoControlPatternFieldModel final : public UnoControlModel
1336 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
1337 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
1339 public:
1340 UnoControlPatternFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1341 UnoControlPatternFieldModel( const UnoControlPatternFieldModel& rModel ) : UnoControlModel( rModel ) {}
1343 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlPatternFieldModel( *this ); }
1345 // css::io::XPersistObject
1346 OUString SAL_CALL getServiceName() override;
1348 // css::beans::XMultiPropertySet
1349 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
1351 // css::lang::XServiceInfo
1352 OUString SAL_CALL getImplementationName() override;
1354 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1359 class UnoPatternFieldControl final : public UnoSpinFieldControl,
1360 public css::awt::XPatternField
1362 void ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override;
1364 public:
1365 UnoPatternFieldControl();
1366 OUString GetComponentServiceName() const override;
1368 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoSpinFieldControl::queryInterface(rType); }
1369 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
1370 void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
1371 void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
1373 // css::lang::XTypeProvider
1374 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
1375 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
1377 // css::awt::XPatternField
1378 void SAL_CALL setMasks( const OUString& EditMask, const OUString& LiteralMask ) override;
1379 void SAL_CALL getMasks( OUString& EditMask, OUString& LiteralMask ) override;
1380 void SAL_CALL setString( const OUString& Str ) override;
1381 OUString SAL_CALL getString( ) override;
1382 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
1383 sal_Bool SAL_CALL isStrictFormat( ) override;
1385 // css::lang::XServiceInfo
1386 OUString SAL_CALL getImplementationName() override;
1388 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1393 class UnoControlProgressBarModel final : public UnoControlModel
1395 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
1396 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
1398 public:
1399 UnoControlProgressBarModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1400 UnoControlProgressBarModel( const UnoControlProgressBarModel& rModel ) : UnoControlModel( rModel ) {}
1402 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlProgressBarModel( *this ); }
1404 // css::beans::XMultiPropertySet
1405 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
1407 // css::io::XPersistObject
1408 OUString SAL_CALL getServiceName() override;
1410 // XServiceInfo
1411 OUString SAL_CALL getImplementationName() override;
1413 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1418 class UnoProgressBarControl final : public UnoControlBase,
1419 public css::awt::XProgressBar
1421 public:
1422 UnoProgressBarControl();
1423 OUString GetComponentServiceName() const override;
1425 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoControlBase::queryInterface(rType); }
1426 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
1427 void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
1428 void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
1430 // css::lang::XTypeProvider
1431 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
1432 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
1434 // css::awt::XProgressBar
1435 void SAL_CALL setForegroundColor( sal_Int32 nColor ) override;
1436 void SAL_CALL setBackgroundColor( sal_Int32 nColor ) override;
1437 void SAL_CALL setValue( sal_Int32 nValue ) override;
1438 void SAL_CALL setRange( sal_Int32 nMin, sal_Int32 nMax ) override;
1439 sal_Int32 SAL_CALL getValue() override;
1441 // css::lang::XServiceInfo
1442 OUString SAL_CALL getImplementationName() override;
1444 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1449 class UnoControlFixedLineModel final : public UnoControlModel
1451 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
1452 ::cppu::IPropertyArrayHelper& getInfoHelper() override;
1454 public:
1455 UnoControlFixedLineModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1456 UnoControlFixedLineModel( const UnoControlFixedLineModel& rModel ) : UnoControlModel( rModel ) {}
1458 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlFixedLineModel( *this ); }
1460 // css::beans::XMultiPropertySet
1461 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
1463 // css::io::XPersistObject
1464 OUString SAL_CALL getServiceName() override;
1466 // css::lang::XServiceInfo
1467 OUString SAL_CALL getImplementationName() override;
1469 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1474 class UnoFixedLineControl final : public UnoControlBase
1476 public:
1477 UnoFixedLineControl();
1478 OUString GetComponentServiceName() const override;
1480 sal_Bool SAL_CALL isTransparent( ) override;
1482 // css::lang::XServiceInfo
1483 OUString SAL_CALL getImplementationName() override;
1485 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
1489 #endif // INCLUDED_TOOLKIT_CONTROLS_UNOCONTROLS_HXX
1491 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */