1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <toolkit/dllapi.h>
24 #include <com/sun/star/awt/XTextComponent.hpp>
25 #include <com/sun/star/awt/XTextListener.hpp>
26 #include <com/sun/star/awt/XLayoutConstrains.hpp>
27 #include <com/sun/star/awt/XTextLayoutConstrains.hpp>
28 #include <com/sun/star/awt/XButton.hpp>
29 #include <com/sun/star/awt/XToggleButton.hpp>
30 #include <com/sun/star/awt/XRadioButton.hpp>
31 #include <com/sun/star/awt/XItemListener.hpp>
32 #include <com/sun/star/awt/XCheckBox.hpp>
33 #include <com/sun/star/awt/XFixedHyperlink.hpp>
34 #include <com/sun/star/awt/XFixedText.hpp>
35 #include <com/sun/star/awt/XListBox.hpp>
36 #include <com/sun/star/awt/XComboBox.hpp>
37 #include <com/sun/star/awt/XDateField.hpp>
38 #include <com/sun/star/awt/XSpinField.hpp>
39 #include <com/sun/star/awt/XTimeField.hpp>
40 #include <com/sun/star/awt/XNumericField.hpp>
41 #include <com/sun/star/awt/XCurrencyField.hpp>
42 #include <com/sun/star/awt/XPatternField.hpp>
43 #include <com/sun/star/awt/XProgressBar.hpp>
44 #include <com/sun/star/awt/XItemList.hpp>
45 #include <toolkit/controls/unocontrolmodel.hxx>
46 #include <toolkit/controls/unocontrolbase.hxx>
47 #include <toolkit/helper/macros.hxx>
48 #include <cppuhelper/implbase5.hxx>
49 #include <cppuhelper/implbase4.hxx>
50 #include <cppuhelper/implbase1.hxx>
51 #include <comphelper/uno3.hxx>
52 #include <tools/gen.hxx>
57 namespace boost
{ template <class T
> class optional
; }
58 namespace com
{ namespace sun
{ namespace star
{ namespace graphic
{ class XGraphic
; } } } }
59 namespace com
{ namespace sun
{ namespace star
{ namespace graphic
{ class XGraphicObject
; } } } }
64 // The routine will always attempt to return a valid XGraphic for the
65 // passed _rURL, additionally xOutGraphicObject will contain the
66 // associated XGraphicObject ( if url is valid for that ) and is set
67 // appropriately ( e.g. NULL if non GraphicObject scheme ) or a valid
68 // object if the rURL points to a valid object
69 static css::uno::Reference
< css::graphic::XGraphic
> getGraphicAndGraphicObjectFromURL_nothrow( css::uno::Reference
< css::graphic::XGraphicObject
>& xOutGraphicObject
, const OUString
& _rURL
);
70 static css::uno::Reference
< css::graphic::XGraphic
> getGraphicFromURL_nothrow( const OUString
& _rURL
);
75 // class UnoControlEditModel
77 class UnoControlEditModel final
: public UnoControlModel
79 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
80 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
83 UnoControlEditModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
84 UnoControlEditModel( const UnoControlEditModel
& rModel
) : UnoControlModel( rModel
) {}
86 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlEditModel( *this ); }
88 // css::io::XPersistObject
89 OUString SAL_CALL
getServiceName() override
;
91 // css::beans::XMultiPropertySet
92 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
96 OUString SAL_CALL
getImplementationName() override
;
98 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
102 // class UnoEditControl
104 typedef ::cppu::ImplHelper4
< css::awt::XTextComponent
105 , css::awt::XTextListener
106 , css::awt::XLayoutConstrains
107 , css::awt::XTextLayoutConstrains
108 > UnoEditControl_Base
;
109 class TOOLKIT_DLLPUBLIC UnoEditControl
:public UnoControlBase
110 ,public UnoEditControl_Base
113 TextListenerMultiplexer maTextListeners
;
115 // Not all fields derived from UnoEditCOntrol have the property "Text"
116 // They only support XTextComponent, so keep the text
117 // here, maybe there is no Peer when calling setText()...
119 sal_uInt16 mnMaxTextLen
;
121 bool mbSetTextInPeer
;
122 bool mbSetMaxTextLenInPeer
;
123 bool mbHasTextProperty
;
128 OUString
GetComponentServiceName() override
;
129 TextListenerMultiplexer
& GetTextListeners() { return maTextListeners
; }
131 void ImplSetPeerProperty( const OUString
& rPropName
, const css::uno::Any
& rVal
) override
;
133 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
134 void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
{ UnoControlBase::disposing( Source
); }
135 void SAL_CALL
dispose( ) override
;
137 // disambiguate XInterface
141 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
144 DECLARE_XTYPEPROVIDER()
147 void SAL_CALL
textChanged( const css::awt::TextEvent
& rEvent
) override
;
150 void SAL_CALL
addTextListener( const css::uno::Reference
< css::awt::XTextListener
>& l
) override
;
151 void SAL_CALL
removeTextListener( const css::uno::Reference
< css::awt::XTextListener
>& l
) override
;
152 void SAL_CALL
setText( const OUString
& aText
) override
;
153 void SAL_CALL
insertText( const css::awt::Selection
& Sel
, const OUString
& Text
) override
;
154 OUString SAL_CALL
getText( ) override
;
155 OUString SAL_CALL
getSelectedText( ) override
;
156 void SAL_CALL
setSelection( const css::awt::Selection
& aSelection
) override
;
157 css::awt::Selection SAL_CALL
getSelection( ) override
;
158 sal_Bool SAL_CALL
isEditable( ) override
;
159 void SAL_CALL
setEditable( sal_Bool bEditable
) override
;
160 void SAL_CALL
setMaxTextLen( sal_Int16 nLen
) override
;
161 sal_Int16 SAL_CALL
getMaxTextLen( ) override
;
164 css::awt::Size SAL_CALL
getMinimumSize( ) override
;
165 css::awt::Size SAL_CALL
getPreferredSize( ) override
;
166 css::awt::Size SAL_CALL
calcAdjustedSize( const css::awt::Size
& aNewSize
) override
;
168 // XTextLayoutConstrains
169 css::awt::Size SAL_CALL
getMinimumSize( sal_Int16 nCols
, sal_Int16 nLines
) override
;
170 void SAL_CALL
getColumnsAndLines( sal_Int16
& nCols
, sal_Int16
& nLines
) override
;
173 OUString SAL_CALL
getImplementationName( ) override
;
174 css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
176 sal_Bool SAL_CALL
setModel(const css::uno::Reference
< css::awt::XControlModel
>& Model
) override
;
180 // class UnoControlFileControlModel
182 class UnoControlFileControlModel final
: public UnoControlModel
184 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
185 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
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
;
206 // class UnoFileControl
208 class UnoFileControl final
: public UnoEditControl
212 OUString
GetComponentServiceName() override
;
214 // css::lang::XServiceInfo
215 OUString SAL_CALL
getImplementationName() override
;
217 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
221 // class GraphicControlModel
223 class GraphicControlModel
: public UnoControlModel
226 bool mbAdjustingImagePosition
;
227 bool mbAdjustingGraphic
;
230 GraphicControlModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
)
231 :UnoControlModel( rxContext
)
232 ,mbAdjustingImagePosition( false )
233 ,mbAdjustingGraphic( false )
236 GraphicControlModel( const GraphicControlModel
& _rSource
) : UnoControlModel( _rSource
), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
238 // ::cppu::OPropertySetHelper
239 void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
, const css::uno::Any
& rValue
) override
;
242 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
245 GraphicControlModel
& operator=( const GraphicControlModel
& ) = delete;
249 // class UnoControlButtonModel
251 class UnoControlButtonModel final
: public GraphicControlModel
253 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
254 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
257 UnoControlButtonModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
258 UnoControlButtonModel( const UnoControlButtonModel
& rModel
) : GraphicControlModel( rModel
) {}
260 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlButtonModel( *this ); }
262 // css::beans::XMultiPropertySet
263 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
265 // css::io::XPersistObject
266 OUString SAL_CALL
getServiceName() override
;
268 // css::lang::XServiceInfo
269 OUString SAL_CALL
getImplementationName() override
;
271 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
275 // class UnoButtonControl
277 typedef ::cppu::AggImplInheritanceHelper4
< UnoControlBase
279 , css::awt::XToggleButton
280 , css::awt::XLayoutConstrains
281 , css::awt::XItemListener
282 > UnoButtonControl_Base
;
283 class UnoButtonControl final
: public UnoButtonControl_Base
286 ActionListenerMultiplexer maActionListeners
;
287 ItemListenerMultiplexer maItemListeners
;
288 OUString maActionCommand
;
293 OUString
GetComponentServiceName() override
;
295 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
296 void SAL_CALL
dispose( ) override
;
299 void SAL_CALL
addActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
300 void SAL_CALL
removeActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
301 void SAL_CALL
setLabel( const OUString
& Label
) override
;
302 void SAL_CALL
setActionCommand( const OUString
& Command
) override
;
304 // css::awt::XToggleButton
305 // css::awt::XItemEventBroadcaster
306 void SAL_CALL
addItemListener( const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
307 void SAL_CALL
removeItemListener( const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
309 // css::lang::XEventListener
310 virtual void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
;
313 virtual void SAL_CALL
itemStateChanged( const css::awt::ItemEvent
& rEvent
) override
;
315 // css::awt::XLayoutConstrains
316 css::awt::Size SAL_CALL
getMinimumSize( ) override
;
317 css::awt::Size SAL_CALL
getPreferredSize( ) override
;
318 css::awt::Size SAL_CALL
calcAdjustedSize( const css::awt::Size
& aNewSize
) override
;
320 // css::lang::XServiceInfo
321 OUString SAL_CALL
getImplementationName() override
;
323 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
327 // class UnoControlImageControlModel
329 class UnoControlImageControlModel final
: public GraphicControlModel
332 bool mbAdjustingImageScaleMode
;
334 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
335 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
338 UnoControlImageControlModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
339 UnoControlImageControlModel( const UnoControlImageControlModel
& rModel
) : GraphicControlModel( rModel
), mbAdjustingImageScaleMode( false ) { }
341 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlImageControlModel( *this ); }
343 // css::beans::XMultiPropertySet
344 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
346 // css::io::XPersistObject
347 OUString SAL_CALL
getServiceName() override
;
349 // css::lang::XServiceInfo
350 OUString SAL_CALL
getImplementationName() override
;
352 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
354 // ::cppu::OPropertySetHelper
355 void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
, const css::uno::Any
& rValue
) override
;
359 // class UnoImageControlControl
361 typedef ::cppu::AggImplInheritanceHelper1
< UnoControlBase
362 , css::awt::XLayoutConstrains
363 > UnoImageControlControl_Base
;
364 class UnoImageControlControl final
: public UnoImageControlControl_Base
367 ActionListenerMultiplexer maActionListeners
;
371 UnoImageControlControl();
372 OUString
GetComponentServiceName() override
;
374 void SAL_CALL
dispose( ) override
;
376 // css::awt::XControl
377 sal_Bool SAL_CALL
isTransparent( ) override
;
379 // css::awt::XLayoutConstrains
380 css::awt::Size SAL_CALL
getMinimumSize( ) override
;
381 css::awt::Size SAL_CALL
getPreferredSize( ) override
;
382 css::awt::Size SAL_CALL
calcAdjustedSize( const css::awt::Size
& aNewSize
) override
;
384 // css::lang::XServiceInfo
385 OUString SAL_CALL
getImplementationName() override
;
387 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
391 // class UnoControlRadioButtonModel
393 class UnoControlRadioButtonModel final
: public GraphicControlModel
395 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
396 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
399 UnoControlRadioButtonModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
400 UnoControlRadioButtonModel( const UnoControlRadioButtonModel
& rModel
) : GraphicControlModel( rModel
) {}
402 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlRadioButtonModel( *this ); }
404 // css::io::XPersistObject
405 OUString SAL_CALL
getServiceName() override
;
407 // css::beans::XMultiPropertySet
408 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
410 // css::lang::XServiceInfo
411 OUString SAL_CALL
getImplementationName() override
;
413 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
417 // class UnoRadioButtonControl
419 typedef ::cppu::AggImplInheritanceHelper4
< UnoControlBase
421 , css::awt::XRadioButton
422 , css::awt::XItemListener
423 , css::awt::XLayoutConstrains
424 > UnoRadioButtonControl_Base
;
425 class UnoRadioButtonControl final
: public UnoRadioButtonControl_Base
428 ItemListenerMultiplexer maItemListeners
;
429 ActionListenerMultiplexer maActionListeners
;
430 OUString maActionCommand
;
434 UnoRadioButtonControl();
435 OUString
GetComponentServiceName() override
;
437 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
438 void SAL_CALL
dispose( ) override
;
439 void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
{ UnoControlBase::disposing( Source
); }
441 // css::awt::XControl
442 sal_Bool SAL_CALL
isTransparent( ) override
;
445 void SAL_CALL
addActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
446 void SAL_CALL
removeActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
447 void SAL_CALL
setActionCommand( const OUString
& Command
) override
;
449 // css::awt::XRadioButton
450 void SAL_CALL
addItemListener( const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
451 void SAL_CALL
removeItemListener( const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
452 sal_Bool SAL_CALL
getState( ) override
;
453 void SAL_CALL
setState( sal_Bool b
) override
;
454 void SAL_CALL
setLabel( const OUString
& Label
) override
;
456 // css::awt::XItemListener
457 void SAL_CALL
itemStateChanged( const css::awt::ItemEvent
& rEvent
) override
;
459 // css::awt::XLayoutConstrains
460 css::awt::Size SAL_CALL
getMinimumSize( ) override
;
461 css::awt::Size SAL_CALL
getPreferredSize( ) override
;
462 css::awt::Size SAL_CALL
calcAdjustedSize( const css::awt::Size
& aNewSize
) override
;
464 // css::lang::XServiceInfo
465 OUString SAL_CALL
getImplementationName() override
;
467 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
471 // class UnoControlCheckBoxModel
473 class UnoControlCheckBoxModel final
: public GraphicControlModel
475 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
476 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
479 UnoControlCheckBoxModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
480 UnoControlCheckBoxModel( const UnoControlCheckBoxModel
& rModel
) : GraphicControlModel( rModel
) {}
482 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlCheckBoxModel( *this ); }
484 // css::io::XPersistObject
485 OUString SAL_CALL
getServiceName() override
;
487 // css::beans::XMultiPropertySet
488 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
490 // css::lang::XServiceInfo
491 OUString SAL_CALL
getImplementationName() override
;
493 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
497 // class UnoCheckBoxControl
499 typedef ::cppu::AggImplInheritanceHelper4
< UnoControlBase
501 , css::awt::XCheckBox
502 , css::awt::XItemListener
503 , css::awt::XLayoutConstrains
504 > UnoCheckBoxControl_Base
;
505 class UnoCheckBoxControl final
: public UnoCheckBoxControl_Base
508 ItemListenerMultiplexer maItemListeners
;
509 ActionListenerMultiplexer maActionListeners
;
510 OUString maActionCommand
;
514 UnoCheckBoxControl();
515 OUString
GetComponentServiceName() override
;
517 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
518 void SAL_CALL
dispose( ) override
;
519 void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
{ UnoControlBase::disposing( Source
); }
521 // css::awt::XControl
522 sal_Bool SAL_CALL
isTransparent( ) override
;
525 void SAL_CALL
addActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
526 void SAL_CALL
removeActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
527 void SAL_CALL
setActionCommand( const OUString
& Command
) override
;
529 virtual void SAL_CALL
addItemListener( const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
530 virtual void SAL_CALL
removeItemListener( const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
533 sal_Int16 SAL_CALL
getState( ) override
;
534 void SAL_CALL
setState( sal_Int16 n
) override
;
535 void SAL_CALL
setLabel( const OUString
& Label
) override
;
536 void SAL_CALL
enableTriState( sal_Bool b
) override
;
538 // css::awt::XItemListener
539 void SAL_CALL
itemStateChanged( const css::awt::ItemEvent
& rEvent
) override
;
541 // css::awt::XLayoutConstrains
542 css::awt::Size SAL_CALL
getMinimumSize( ) override
;
543 css::awt::Size SAL_CALL
getPreferredSize( ) override
;
544 css::awt::Size SAL_CALL
calcAdjustedSize( const css::awt::Size
& aNewSize
) override
;
546 // css::lang::XServiceInfo
547 OUString SAL_CALL
getImplementationName() override
;
549 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
553 // class UnoControlFixedTextModel
555 class UnoControlFixedHyperlinkModel final
: public UnoControlModel
557 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
558 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
561 UnoControlFixedHyperlinkModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
562 UnoControlFixedHyperlinkModel( const UnoControlFixedHyperlinkModel
& rModel
) : UnoControlModel( rModel
) {}
564 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlFixedHyperlinkModel( *this ); }
566 // css::io::XPersistObject
567 OUString SAL_CALL
getServiceName() override
;
569 // css::beans::XMultiPropertySet
570 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
572 // css::lang::XServiceInfo
573 DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedHyperlinkModel
, UnoControlModel
, "com.sun.star.awt.UnoControlFixedHyperlinkModel" )
577 // class UnoFixedHyperlinkControl
579 class UnoFixedHyperlinkControl final
: public UnoControlBase
,
580 public css::awt::XFixedHyperlink
,
581 public css::awt::XLayoutConstrains
584 ActionListenerMultiplexer maActionListeners
;
587 UnoFixedHyperlinkControl();
589 OUString
GetComponentServiceName() override
;
591 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return UnoControlBase::queryInterface(rType
); }
592 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
593 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
594 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
596 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
597 void SAL_CALL
dispose( ) override
;
599 // css::lang::XTypeProvider
600 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
601 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
603 // css::awt::XControl
604 sal_Bool SAL_CALL
isTransparent( ) override
;
606 // css::awt::XFixedHyperlink
607 void SAL_CALL
setText( const OUString
& Text
) override
;
608 OUString SAL_CALL
getText( ) override
;
609 void SAL_CALL
setURL( const OUString
& URL
) override
;
610 OUString SAL_CALL
getURL( ) override
;
611 void SAL_CALL
setAlignment( sal_Int16 nAlign
) override
;
612 sal_Int16 SAL_CALL
getAlignment( ) override
;
613 void SAL_CALL
addActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
614 void SAL_CALL
removeActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
616 // css::awt::XLayoutConstrains
617 css::awt::Size SAL_CALL
getMinimumSize( ) override
;
618 css::awt::Size SAL_CALL
getPreferredSize( ) override
;
619 css::awt::Size SAL_CALL
calcAdjustedSize( const css::awt::Size
& aNewSize
) override
;
621 // css::lang::XServiceInfo
622 DECLIMPL_SERVICEINFO_DERIVED( UnoFixedHyperlinkControl
, UnoControlBase
, "com.sun.star.awt.UnoControlFixedHyperlink" )
626 // class UnoControlFixedTextModel
628 class UnoControlFixedTextModel final
: public UnoControlModel
630 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
631 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
634 UnoControlFixedTextModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
635 UnoControlFixedTextModel( const UnoControlFixedTextModel
& rModel
) : UnoControlModel( rModel
) {}
637 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlFixedTextModel( *this ); }
639 // css::io::XPersistObject
640 OUString SAL_CALL
getServiceName() override
;
642 // css::beans::XMultiPropertySet
643 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
645 // css::lang::XServiceInfo
646 OUString SAL_CALL
getImplementationName() override
;
648 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
652 // class UnoFixedTextControl
654 class UnoFixedTextControl final
: public UnoControlBase
,
655 public css::awt::XFixedText
,
656 public css::awt::XLayoutConstrains
659 UnoFixedTextControl();
660 OUString
GetComponentServiceName() override
;
662 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return UnoControlBase::queryInterface(rType
); }
663 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
664 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
665 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
667 // css::lang::XTypeProvider
668 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
669 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
671 // css::awt::XControl
672 sal_Bool SAL_CALL
isTransparent( ) override
;
674 // css::awt::XFixedText
675 void SAL_CALL
setText( const OUString
& Text
) override
;
676 OUString SAL_CALL
getText( ) override
;
677 void SAL_CALL
setAlignment( sal_Int16 nAlign
) override
;
678 sal_Int16 SAL_CALL
getAlignment( ) override
;
680 // css::awt::XLayoutConstrains
681 css::awt::Size SAL_CALL
getMinimumSize( ) override
;
682 css::awt::Size SAL_CALL
getPreferredSize( ) override
;
683 css::awt::Size SAL_CALL
calcAdjustedSize( const css::awt::Size
& aNewSize
) override
;
685 // css::lang::XServiceInfo
686 OUString SAL_CALL
getImplementationName() override
;
688 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
692 // class UnoControlGroupBoxModel
694 class UnoControlGroupBoxModel final
: public UnoControlModel
696 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
697 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
700 UnoControlGroupBoxModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
701 UnoControlGroupBoxModel( const UnoControlGroupBoxModel
& rModel
) : UnoControlModel( rModel
) {}
703 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlGroupBoxModel( *this ); }
705 // css::io::XPersistObject
706 OUString SAL_CALL
getServiceName() override
;
708 // css::beans::XMultiPropertySet
709 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
711 // css::lang::XServiceInfo
712 OUString SAL_CALL
getImplementationName() override
;
714 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
718 // class UnoGroupBoxControl
720 class UnoGroupBoxControl final
: public UnoControlBase
723 UnoGroupBoxControl();
724 OUString
GetComponentServiceName() override
;
726 sal_Bool SAL_CALL
isTransparent( ) override
;
728 // css::lang::XServiceInfo
729 OUString SAL_CALL
getImplementationName() override
;
731 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
735 // class UnoControlListBoxModel
737 struct UnoControlListBoxModel_Data
;
738 typedef ::cppu::AggImplInheritanceHelper1
< UnoControlModel
739 , css::awt::XItemList
740 > UnoControlListBoxModel_Base
;
741 class TOOLKIT_DLLPUBLIC UnoControlListBoxModel
: public UnoControlListBoxModel_Base
747 ConstructWithoutProperties
751 UnoControlListBoxModel(
752 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
753 ConstructorMode
const i_mode
= ConstructDefault
755 UnoControlListBoxModel( const UnoControlListBoxModel
& i_rSource
);
756 virtual ~UnoControlListBoxModel() override
;
758 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlListBoxModel( *this ); }
760 virtual void ImplNormalizePropertySequence(
761 const sal_Int32 _nCount
, /// the number of entries in the arrays
762 sal_Int32
* _pHandles
, /// the handles of the properties to set
763 css::uno::Any
* _pValues
, /// the values of the properties to set
764 sal_Int32
* _pValidHandles
/// pointer to the valid handles, allowed to be adjusted
767 // css::beans::XMultiPropertySet
768 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
770 // css::io::XPersistObject
771 OUString SAL_CALL
getServiceName() override
;
773 // css::lang::XServiceInfo
774 OUString SAL_CALL
getImplementationName( ) override
;
775 css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
777 // css::awt::XItemList
778 virtual ::sal_Int32 SAL_CALL
getItemCount() override
;
779 virtual void SAL_CALL
insertItem( ::sal_Int32 Position
, const OUString
& ItemText
, const OUString
& ItemImageURL
) override
;
780 virtual void SAL_CALL
insertItemText( ::sal_Int32 Position
, const OUString
& ItemText
) override
;
781 virtual void SAL_CALL
insertItemImage( ::sal_Int32 Position
, const OUString
& ItemImageURL
) override
;
782 virtual void SAL_CALL
removeItem( ::sal_Int32 Position
) override
;
783 virtual void SAL_CALL
removeAllItems( ) override
;
784 virtual void SAL_CALL
setItemText( ::sal_Int32 Position
, const OUString
& ItemText
) override
;
785 virtual void SAL_CALL
setItemImage( ::sal_Int32 Position
, const OUString
& ItemImageURL
) override
;
786 virtual void SAL_CALL
setItemTextAndImage( ::sal_Int32 Position
, const OUString
& ItemText
, const OUString
& ItemImageURL
) override
;
787 virtual void SAL_CALL
setItemData( ::sal_Int32 Position
, const css::uno::Any
& DataValue
) override
;
788 virtual OUString SAL_CALL
getItemText( ::sal_Int32 Position
) override
;
789 virtual OUString SAL_CALL
getItemImage( ::sal_Int32 Position
) override
;
790 virtual css::beans::Pair
< OUString
, OUString
> SAL_CALL
getItemTextAndImage( ::sal_Int32 Position
) override
;
791 virtual css::uno::Any SAL_CALL
getItemData( ::sal_Int32 Position
) override
;
792 virtual css::uno::Sequence
< css::beans::Pair
< OUString
, OUString
> > SAL_CALL
getAllItems( ) override
;
793 virtual void SAL_CALL
addItemListListener( const css::uno::Reference
< css::awt::XItemListListener
>& Listener
) override
;
794 virtual void SAL_CALL
removeItemListListener( const css::uno::Reference
< css::awt::XItemListListener
>& Listener
) override
;
796 // OPropertySetHelper
797 void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
, const css::uno::Any
& rValue
) override
;
800 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
801 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
804 void impl_notifyItemListEvent_nolck(
805 const sal_Int32 i_nItemPosition
,
806 const ::boost::optional
< OUString
>& i_rItemText
,
807 const ::boost::optional
< OUString
>& i_rItemImageURL
,
808 void ( SAL_CALL
css::awt::XItemListListener::*NotificationMethod
)( const css::awt::ItemListEvent
& )
811 void impl_handleInsert(
812 const sal_Int32 i_nItemPosition
,
813 const ::boost::optional
< OUString
>& i_rItemText
,
814 const ::boost::optional
< OUString
>& i_rItemImageURL
,
815 ::osl::ClearableMutexGuard
& i_rClearBeforeNotify
818 void impl_handleRemove(
819 const sal_Int32 i_nItemPosition
,
820 ::osl::ClearableMutexGuard
& i_rClearBeforeNotify
823 void impl_handleModify(
824 const sal_Int32 i_nItemPosition
,
825 const ::boost::optional
< OUString
>& i_rItemText
,
826 const ::boost::optional
< OUString
>& i_rItemImageURL
,
827 ::osl::ClearableMutexGuard
& i_rClearBeforeNotify
830 void impl_getStringItemList( ::std::vector
< OUString
>& o_rStringItems
) const;
831 void impl_setStringItemList_nolck( const ::std::vector
< OUString
>& i_rStringItems
);
834 std::unique_ptr
<UnoControlListBoxModel_Data
> m_xData
;
835 ::comphelper::OInterfaceContainerHelper2 m_aItemListListeners
;
839 // class UnoListBoxControl
841 typedef ::cppu::AggImplInheritanceHelper5
< UnoControlBase
843 , css::awt::XItemListener
844 , css::awt::XLayoutConstrains
845 , css::awt::XTextLayoutConstrains
846 , css::awt::XItemListListener
847 > UnoListBoxControl_Base
;
848 class TOOLKIT_DLLPUBLIC UnoListBoxControl final
: public UnoListBoxControl_Base
852 OUString
GetComponentServiceName() override
;
854 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
855 void SAL_CALL
dispose( ) override
;
856 void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
{ UnoControlBase::disposing( Source
); }
858 // css::awt::XListBox
859 void SAL_CALL
addItemListener( const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
860 void SAL_CALL
removeItemListener( const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
861 void SAL_CALL
addActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
862 void SAL_CALL
removeActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
863 void SAL_CALL
addItem( const OUString
& aItem
, sal_Int16 nPos
) override
;
864 void SAL_CALL
addItems( const css::uno::Sequence
< OUString
>& aItems
, sal_Int16 nPos
) override
;
865 void SAL_CALL
removeItems( sal_Int16 nPos
, sal_Int16 nCount
) override
;
866 sal_Int16 SAL_CALL
getItemCount( ) override
;
867 OUString SAL_CALL
getItem( sal_Int16 nPos
) override
;
868 css::uno::Sequence
< OUString
> SAL_CALL
getItems( ) override
;
869 sal_Int16 SAL_CALL
getSelectedItemPos( ) override
;
870 css::uno::Sequence
< sal_Int16
> SAL_CALL
getSelectedItemsPos( ) override
;
871 OUString SAL_CALL
getSelectedItem( ) override
;
872 css::uno::Sequence
< OUString
> SAL_CALL
getSelectedItems( ) override
;
873 void SAL_CALL
selectItemPos( sal_Int16 nPos
, sal_Bool bSelect
) override
;
874 void SAL_CALL
selectItemsPos( const css::uno::Sequence
< sal_Int16
>& aPositions
, sal_Bool bSelect
) override
;
875 void SAL_CALL
selectItem( const OUString
& aItem
, sal_Bool bSelect
) override
;
876 sal_Bool SAL_CALL
isMutipleMode( ) override
;
877 void SAL_CALL
setMultipleMode( sal_Bool bMulti
) override
;
878 sal_Int16 SAL_CALL
getDropDownLineCount( ) override
;
879 void SAL_CALL
setDropDownLineCount( sal_Int16 nLines
) override
;
880 void SAL_CALL
makeVisible( sal_Int16 nEntry
) override
;
882 // css::awt::XItemListener
883 void SAL_CALL
itemStateChanged( const css::awt::ItemEvent
& rEvent
) override
;
885 // css::awt::XLayoutConstrains
886 css::awt::Size SAL_CALL
getMinimumSize( ) override
;
887 css::awt::Size SAL_CALL
getPreferredSize( ) override
;
888 css::awt::Size SAL_CALL
calcAdjustedSize( const css::awt::Size
& aNewSize
) override
;
890 // css::awt::XTextLayoutConstrains
891 css::awt::Size SAL_CALL
getMinimumSize( sal_Int16 nCols
, sal_Int16 nLines
) override
;
892 void SAL_CALL
getColumnsAndLines( sal_Int16
& nCols
, sal_Int16
& nLines
) override
;
895 sal_Bool SAL_CALL
setModel(const css::uno::Reference
< css::awt::XControlModel
>& Model
) override
;
898 virtual void SAL_CALL
listItemInserted( const css::awt::ItemListEvent
& Event
) override
;
899 virtual void SAL_CALL
listItemRemoved( const css::awt::ItemListEvent
& Event
) override
;
900 virtual void SAL_CALL
listItemModified( const css::awt::ItemListEvent
& Event
) override
;
901 virtual void SAL_CALL
allItemsRemoved( const css::lang::EventObject
& Event
) override
;
902 virtual void SAL_CALL
itemListChanged( const css::lang::EventObject
& Event
) override
;
904 // css::lang::XServiceInfo
905 OUString SAL_CALL
getImplementationName( ) override
;
906 css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
909 void ImplUpdateSelectedItemsProperty();
910 virtual void ImplSetPeerProperty( const OUString
& rPropName
, const css::uno::Any
& rVal
) override
;
911 virtual void updateFromModel() override
;
913 ActionListenerMultiplexer maActionListeners
;
914 ItemListenerMultiplexer maItemListeners
;
918 // class UnoControlComboBoxModel
920 class UnoControlComboBoxModel final
: public UnoControlListBoxModel
922 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
923 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
926 UnoControlComboBoxModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
927 UnoControlComboBoxModel( const UnoControlComboBoxModel
& rModel
) : UnoControlListBoxModel( rModel
) {}
929 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlComboBoxModel( *this ); }
931 // css::io::XPersistObject
932 OUString SAL_CALL
getServiceName() override
;
934 // css::beans::XMultiPropertySet
935 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
936 // OPropertySetHelper
937 void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
, const css::uno::Any
& rValue
) override
;
939 // css::lang::XServiceInfo
940 OUString SAL_CALL
getImplementationName( ) override
;
941 css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
946 // class UnoComboBoxControl
948 class UnoComboBoxControl final
: public UnoEditControl
949 , public css::awt::XComboBox
950 , public css::awt::XItemListener
951 , public css::awt::XItemListListener
954 ActionListenerMultiplexer maActionListeners
;
955 ItemListenerMultiplexer maItemListeners
;
959 UnoComboBoxControl();
960 OUString
GetComponentServiceName() override
;
962 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
963 void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
{ UnoEditControl::disposing( Source
); }
964 void SAL_CALL
dispose( ) override
;
966 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return UnoEditControl::queryInterface(rType
); }
967 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
968 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
969 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
972 // css::lang::XTypeProvider
973 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
974 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
976 // css::awt::XComboBox
977 void SAL_CALL
addItemListener( const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
978 void SAL_CALL
removeItemListener( const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
979 void SAL_CALL
addActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
980 void SAL_CALL
removeActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
981 void SAL_CALL
addItem( const OUString
& aItem
, sal_Int16 nPos
) override
;
982 void SAL_CALL
addItems( const css::uno::Sequence
< OUString
>& aItems
, sal_Int16 nPos
) override
;
983 void SAL_CALL
removeItems( sal_Int16 nPos
, sal_Int16 nCount
) override
;
984 sal_Int16 SAL_CALL
getItemCount( ) override
;
985 OUString SAL_CALL
getItem( sal_Int16 nPos
) override
;
986 css::uno::Sequence
< OUString
> SAL_CALL
getItems( ) override
;
987 sal_Int16 SAL_CALL
getDropDownLineCount( ) override
;
988 void SAL_CALL
setDropDownLineCount( sal_Int16 nLines
) override
;
991 virtual sal_Bool SAL_CALL
setModel(const css::uno::Reference
< css::awt::XControlModel
>& Model
) override
;
994 virtual void SAL_CALL
listItemInserted( const css::awt::ItemListEvent
& Event
) override
;
995 virtual void SAL_CALL
listItemRemoved( const css::awt::ItemListEvent
& Event
) override
;
996 virtual void SAL_CALL
listItemModified( const css::awt::ItemListEvent
& Event
) override
;
997 virtual void SAL_CALL
allItemsRemoved( const css::lang::EventObject
& Event
) override
;
998 virtual void SAL_CALL
itemListChanged( const css::lang::EventObject
& Event
) override
;
1001 virtual void SAL_CALL
itemStateChanged( const css::awt::ItemEvent
& rEvent
) override
;
1003 // css::lang::XServiceInfo
1004 OUString SAL_CALL
getImplementationName( ) override
;
1005 css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
1007 virtual void ImplSetPeerProperty( const OUString
& rPropName
, const css::uno::Any
& rVal
) override
;
1008 virtual void updateFromModel() override
;
1013 // class UnoSpinFieldControl
1015 class UnoSpinFieldControl
: public UnoEditControl
,
1016 public css::awt::XSpinField
1019 SpinListenerMultiplexer maSpinListeners
;
1023 UnoSpinFieldControl();
1025 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return UnoEditControl::queryInterface(rType
); }
1026 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
1027 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
1028 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
1030 // css::lang::XTypeProvider
1031 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
1032 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
1034 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
1036 // css::awt::XSpinField
1037 void SAL_CALL
addSpinListener( const css::uno::Reference
< css::awt::XSpinListener
>& l
) override
;
1038 void SAL_CALL
removeSpinListener( const css::uno::Reference
< css::awt::XSpinListener
>& l
) override
;
1039 void SAL_CALL
up() override
;
1040 void SAL_CALL
down() override
;
1041 void SAL_CALL
first() override
;
1042 void SAL_CALL
last() override
;
1043 void SAL_CALL
enableRepeat( sal_Bool bRepeat
) override
;
1046 // css::lang::XServiceInfo
1047 // No service info, only base class for other fields.
1051 // class UnoControlDateFieldModel
1053 class UnoControlDateFieldModel final
: public UnoControlModel
1055 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
1056 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
1059 UnoControlDateFieldModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
1060 UnoControlDateFieldModel( const UnoControlDateFieldModel
& rModel
) : UnoControlModel( rModel
) {}
1062 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlDateFieldModel( *this ); }
1064 // css::io::XPersistObject
1065 OUString SAL_CALL
getServiceName() override
;
1067 // css::beans::XMultiPropertySet
1068 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
1070 // css::lang::XServiceInfo
1071 OUString SAL_CALL
getImplementationName() override
;
1073 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1077 // class UnoDateFieldControl
1079 class UnoDateFieldControl final
: public UnoSpinFieldControl
,
1080 public css::awt::XDateField
1083 css::util::Date mnFirst
;
1084 css::util::Date mnLast
;
1085 TriState mbLongFormat
;
1087 UnoDateFieldControl();
1088 OUString
GetComponentServiceName() override
;
1090 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return UnoSpinFieldControl::queryInterface(rType
); }
1091 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
1092 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
1093 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
1095 // css::lang::XTypeProvider
1096 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
1097 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
1099 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
1101 // css::awt::XTextListener
1102 void SAL_CALL
textChanged( const css::awt::TextEvent
& rEvent
) override
;
1105 void SAL_CALL
setDate( const css::util::Date
& Date
) override
;
1106 css::util::Date SAL_CALL
getDate( ) override
;
1107 void SAL_CALL
setMin( const css::util::Date
& Date
) override
;
1108 css::util::Date SAL_CALL
getMin( ) override
;
1109 void SAL_CALL
setMax( const css::util::Date
& Date
) override
;
1110 css::util::Date SAL_CALL
getMax( ) override
;
1111 void SAL_CALL
setFirst( const css::util::Date
& Date
) override
;
1112 css::util::Date SAL_CALL
getFirst( ) override
;
1113 void SAL_CALL
setLast( const css::util::Date
& Date
) override
;
1114 css::util::Date SAL_CALL
getLast( ) override
;
1115 void SAL_CALL
setLongFormat( sal_Bool bLong
) override
;
1116 sal_Bool SAL_CALL
isLongFormat( ) override
;
1117 void SAL_CALL
setEmpty( ) override
;
1118 sal_Bool SAL_CALL
isEmpty( ) override
;
1119 void SAL_CALL
setStrictFormat( sal_Bool bStrict
) override
;
1120 sal_Bool SAL_CALL
isStrictFormat( ) override
;
1122 // css::lang::XServiceInfo
1123 OUString SAL_CALL
getImplementationName() override
;
1125 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1129 // class UnoControlTimeFieldModel
1131 class UnoControlTimeFieldModel final
: public UnoControlModel
1133 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
1134 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
1137 UnoControlTimeFieldModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
1138 UnoControlTimeFieldModel( const UnoControlTimeFieldModel
& rModel
) : UnoControlModel( rModel
) {}
1140 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlTimeFieldModel( *this ); }
1142 // css::io::XPersistObject
1143 OUString SAL_CALL
getServiceName() override
;
1145 // css::beans::XMultiPropertySet
1146 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
1148 // css::lang::XServiceInfo
1149 OUString SAL_CALL
getImplementationName() override
;
1151 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1155 // class UnoTimeFieldControl
1157 class UnoTimeFieldControl final
: public UnoSpinFieldControl
,
1158 public css::awt::XTimeField
1161 css::util::Time mnFirst
;
1162 css::util::Time mnLast
;
1165 UnoTimeFieldControl();
1166 OUString
GetComponentServiceName() override
;
1168 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return UnoSpinFieldControl::queryInterface(rType
); }
1169 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
1170 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
1171 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
1173 // css::lang::XTypeProvider
1174 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
1175 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
1177 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
1179 // css::awt::XTextListener
1180 void SAL_CALL
textChanged( const css::awt::TextEvent
& rEvent
) override
;
1183 void SAL_CALL
setTime( const css::util::Time
& Time
) override
;
1184 css::util::Time SAL_CALL
getTime( ) override
;
1185 void SAL_CALL
setMin( const css::util::Time
& Time
) override
;
1186 css::util::Time SAL_CALL
getMin( ) override
;
1187 void SAL_CALL
setMax( const css::util::Time
& Time
) override
;
1188 css::util::Time SAL_CALL
getMax( ) override
;
1189 void SAL_CALL
setFirst( const css::util::Time
& Time
) override
;
1190 css::util::Time SAL_CALL
getFirst( ) override
;
1191 void SAL_CALL
setLast( const css::util::Time
& Time
) override
;
1192 css::util::Time SAL_CALL
getLast( ) override
;
1193 void SAL_CALL
setEmpty( ) override
;
1194 sal_Bool SAL_CALL
isEmpty( ) override
;
1195 void SAL_CALL
setStrictFormat( sal_Bool bStrict
) override
;
1196 sal_Bool SAL_CALL
isStrictFormat( ) override
;
1198 // css::lang::XServiceInfo
1199 OUString SAL_CALL
getImplementationName() override
;
1201 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1205 // class UnoControlNumericFieldModel
1207 class UnoControlNumericFieldModel final
: public UnoControlModel
1209 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
1210 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
1213 UnoControlNumericFieldModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
1214 UnoControlNumericFieldModel( const UnoControlNumericFieldModel
& rModel
) : UnoControlModel( rModel
) {}
1216 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlNumericFieldModel( *this ); }
1218 // css::io::XPersistObject
1219 OUString SAL_CALL
getServiceName() override
;
1221 // css::beans::XMultiPropertySet
1222 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
1224 // css::lang::XServiceInfo
1225 OUString SAL_CALL
getImplementationName() override
;
1227 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1231 // class UnoNumericFieldControl
1233 class UnoNumericFieldControl final
: public UnoSpinFieldControl
,
1234 public css::awt::XNumericField
1241 UnoNumericFieldControl();
1242 OUString
GetComponentServiceName() override
;
1244 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return UnoSpinFieldControl::queryInterface(rType
); }
1245 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
1246 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
1247 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
1249 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
1251 // css::lang::XTypeProvider
1252 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
1253 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
1255 // css::awt::XTextListener
1256 void SAL_CALL
textChanged( const css::awt::TextEvent
& rEvent
) override
;
1258 // css::awt::XNumericField
1259 void SAL_CALL
setValue( double Value
) override
;
1260 double SAL_CALL
getValue( ) override
;
1261 void SAL_CALL
setMin( double Value
) override
;
1262 double SAL_CALL
getMin( ) override
;
1263 void SAL_CALL
setMax( double Value
) override
;
1264 double SAL_CALL
getMax( ) override
;
1265 void SAL_CALL
setFirst( double Value
) override
;
1266 double SAL_CALL
getFirst( ) override
;
1267 void SAL_CALL
setLast( double Value
) override
;
1268 double SAL_CALL
getLast( ) override
;
1269 void SAL_CALL
setSpinSize( double Value
) override
;
1270 double SAL_CALL
getSpinSize( ) override
;
1271 void SAL_CALL
setDecimalDigits( sal_Int16 nDigits
) override
;
1272 sal_Int16 SAL_CALL
getDecimalDigits( ) override
;
1273 void SAL_CALL
setStrictFormat( sal_Bool bStrict
) override
;
1274 sal_Bool SAL_CALL
isStrictFormat( ) override
;
1276 // css::lang::XServiceInfo
1277 OUString SAL_CALL
getImplementationName() override
;
1279 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1283 // class UnoControlCurrencyFieldModel
1285 class UnoControlCurrencyFieldModel final
: public UnoControlModel
1287 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
1288 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
1291 UnoControlCurrencyFieldModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
1292 UnoControlCurrencyFieldModel( const UnoControlCurrencyFieldModel
& rModel
) : UnoControlModel( rModel
) {}
1294 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlCurrencyFieldModel( *this ); }
1296 // css::io::XPersistObject
1297 OUString SAL_CALL
getServiceName() override
;
1299 // css::beans::XMultiPropertySet
1300 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
1302 // css::lang::XServiceInfo
1303 OUString SAL_CALL
getImplementationName() override
;
1305 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1309 // class UnoCurrencyFieldControl
1311 class UnoCurrencyFieldControl final
: public UnoSpinFieldControl
,
1312 public css::awt::XCurrencyField
1319 UnoCurrencyFieldControl();
1320 OUString
GetComponentServiceName() override
;
1322 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return UnoSpinFieldControl::queryInterface(rType
); }
1323 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
1324 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
1325 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
1327 void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& Toolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& Parent
) override
;
1329 // css::lang::XTypeProvider
1330 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
1331 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
1333 // css::awt::XTextListener
1334 void SAL_CALL
textChanged( const css::awt::TextEvent
& rEvent
) override
;
1336 // css::awt::XCurrencyField
1337 void SAL_CALL
setValue( double Value
) override
;
1338 double SAL_CALL
getValue( ) override
;
1339 void SAL_CALL
setMin( double Value
) override
;
1340 double SAL_CALL
getMin( ) override
;
1341 void SAL_CALL
setMax( double Value
) override
;
1342 double SAL_CALL
getMax( ) override
;
1343 void SAL_CALL
setFirst( double Value
) override
;
1344 double SAL_CALL
getFirst( ) override
;
1345 void SAL_CALL
setLast( double Value
) override
;
1346 double SAL_CALL
getLast( ) override
;
1347 void SAL_CALL
setSpinSize( double Value
) override
;
1348 double SAL_CALL
getSpinSize( ) override
;
1349 void SAL_CALL
setDecimalDigits( sal_Int16 nDigits
) override
;
1350 sal_Int16 SAL_CALL
getDecimalDigits( ) override
;
1351 void SAL_CALL
setStrictFormat( sal_Bool bStrict
) override
;
1352 sal_Bool SAL_CALL
isStrictFormat( ) override
;
1354 // css::lang::XServiceInfo
1355 OUString SAL_CALL
getImplementationName() override
;
1357 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1361 // class UnoControlPatternFieldModel
1363 class UnoControlPatternFieldModel final
: public UnoControlModel
1365 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
1366 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
1369 UnoControlPatternFieldModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
1370 UnoControlPatternFieldModel( const UnoControlPatternFieldModel
& rModel
) : UnoControlModel( rModel
) {}
1372 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlPatternFieldModel( *this ); }
1374 // css::io::XPersistObject
1375 OUString SAL_CALL
getServiceName() override
;
1377 // css::beans::XMultiPropertySet
1378 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
1380 // css::lang::XServiceInfo
1381 OUString SAL_CALL
getImplementationName() override
;
1383 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1387 // class UnoPatternFieldControl
1389 class UnoPatternFieldControl final
: public UnoSpinFieldControl
,
1390 public css::awt::XPatternField
1392 void ImplSetPeerProperty( const OUString
& rPropName
, const css::uno::Any
& rVal
) override
;
1395 UnoPatternFieldControl();
1396 OUString
GetComponentServiceName() override
;
1398 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return UnoSpinFieldControl::queryInterface(rType
); }
1399 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
1400 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
1401 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
1403 // css::lang::XTypeProvider
1404 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
1405 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
1407 // css::awt::XPatternField
1408 void SAL_CALL
setMasks( const OUString
& EditMask
, const OUString
& LiteralMask
) override
;
1409 void SAL_CALL
getMasks( OUString
& EditMask
, OUString
& LiteralMask
) override
;
1410 void SAL_CALL
setString( const OUString
& Str
) override
;
1411 OUString SAL_CALL
getString( ) override
;
1412 void SAL_CALL
setStrictFormat( sal_Bool bStrict
) override
;
1413 sal_Bool SAL_CALL
isStrictFormat( ) override
;
1415 // css::lang::XServiceInfo
1416 OUString SAL_CALL
getImplementationName() override
;
1418 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1422 // class UnoControlProgressBarModel
1424 class UnoControlProgressBarModel final
: public UnoControlModel
1426 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
1427 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
1430 UnoControlProgressBarModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
1431 UnoControlProgressBarModel( const UnoControlProgressBarModel
& rModel
) : UnoControlModel( rModel
) {}
1433 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlProgressBarModel( *this ); }
1435 // css::beans::XMultiPropertySet
1436 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
1438 // css::io::XPersistObject
1439 OUString SAL_CALL
getServiceName() override
;
1442 OUString SAL_CALL
getImplementationName() override
;
1444 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1448 // class UnoProgressBarControl
1450 class UnoProgressBarControl final
: public UnoControlBase
,
1451 public css::awt::XProgressBar
1454 UnoProgressBarControl();
1455 OUString
GetComponentServiceName() override
;
1457 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return UnoControlBase::queryInterface(rType
); }
1458 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
1459 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
1460 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
1462 // css::lang::XTypeProvider
1463 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
1464 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
1466 // css::awt::XProgressBar
1467 void SAL_CALL
setForegroundColor( sal_Int32 nColor
) override
;
1468 void SAL_CALL
setBackgroundColor( sal_Int32 nColor
) override
;
1469 void SAL_CALL
setValue( sal_Int32 nValue
) override
;
1470 void SAL_CALL
setRange( sal_Int32 nMin
, sal_Int32 nMax
) override
;
1471 sal_Int32 SAL_CALL
getValue() override
;
1473 // css::lang::XServiceInfo
1474 OUString SAL_CALL
getImplementationName() override
;
1476 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1480 // class UnoControlFixedLineModel
1482 class UnoControlFixedLineModel final
: public UnoControlModel
1484 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
1485 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
1488 UnoControlFixedLineModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
1489 UnoControlFixedLineModel( const UnoControlFixedLineModel
& rModel
) : UnoControlModel( rModel
) {}
1491 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlFixedLineModel( *this ); }
1493 // css::beans::XMultiPropertySet
1494 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
1496 // css::io::XPersistObject
1497 OUString SAL_CALL
getServiceName() override
;
1499 // css::lang::XServiceInfo
1500 OUString SAL_CALL
getImplementationName() override
;
1502 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1506 // class UnoFixedLineControl
1508 class UnoFixedLineControl final
: public UnoControlBase
1511 UnoFixedLineControl();
1512 OUString
GetComponentServiceName() override
;
1514 sal_Bool SAL_CALL
isTransparent( ) override
;
1516 // css::lang::XServiceInfo
1517 OUString SAL_CALL
getImplementationName() override
;
1519 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
1523 #endif // INCLUDED_TOOLKIT_CONTROLS_UNOCONTROLS_HXX
1525 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */