/src/libreoffice/include/toolkit/controls/unocontrols.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | |
20 | | #pragma once |
21 | | |
22 | | #include <config_options.h> |
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/interfacecontainer4.hxx> |
52 | | #include <comphelper/uno3.hxx> |
53 | | #include <rtl/ref.hxx> |
54 | | #include <tools/gen.hxx> |
55 | | |
56 | | #include <memory> |
57 | | #include <vector> |
58 | | |
59 | | #include <optional> |
60 | | |
61 | | namespace com::sun::star::graphic { class XGraphic; } |
62 | | namespace com::sun::star::graphic { class XGraphicObject; } |
63 | | |
64 | | class ImageHelper |
65 | | { |
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 ); |
74 | | |
75 | | }; |
76 | | |
77 | | |
78 | | |
79 | | class UnoControlEditModel final : public UnoControlModel |
80 | | { |
81 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
82 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
83 | | |
84 | | public: |
85 | | UnoControlEditModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
86 | 0 | UnoControlEditModel( const UnoControlEditModel& rModel ) : UnoControlModel( rModel ) {} |
87 | | |
88 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlEditModel( *this ); } |
89 | | |
90 | | // css::io::XPersistObject |
91 | | OUString SAL_CALL getServiceName() override; |
92 | | |
93 | | // css::beans::XMultiPropertySet |
94 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
95 | | |
96 | | |
97 | | // XServiceInfo |
98 | | OUString SAL_CALL getImplementationName() override; |
99 | | |
100 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
101 | | }; |
102 | | |
103 | | |
104 | | |
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 |
112 | | { |
113 | | private: |
114 | | TextListenerMultiplexer maTextListeners; |
115 | | |
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; |
121 | | |
122 | | bool mbSetTextInPeer; |
123 | | bool mbSetMaxTextLenInPeer; |
124 | | bool mbHasTextProperty; |
125 | | |
126 | | public: |
127 | | |
128 | | UnoEditControl(); |
129 | | OUString GetComponentServiceName() const override; |
130 | 0 | TextListenerMultiplexer& GetTextListeners() { return maTextListeners; } |
131 | | |
132 | | void ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override; |
133 | | |
134 | | void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override; |
135 | 0 | void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); } |
136 | | void SAL_CALL dispose( ) override; |
137 | | |
138 | | // disambiguate XInterface |
139 | | DECLARE_XINTERFACE() |
140 | | |
141 | | // XAggregation |
142 | | css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; |
143 | | |
144 | | // XTypeProvider |
145 | | DECLARE_XTYPEPROVIDER() |
146 | | |
147 | | // XTextListener |
148 | | void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override; |
149 | | |
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; |
163 | | |
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; |
168 | | |
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; |
172 | | |
173 | | // XServiceInfo |
174 | | OUString SAL_CALL getImplementationName( ) override; |
175 | | css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
176 | | |
177 | | sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel >& Model) override; |
178 | | }; |
179 | | |
180 | | |
181 | | |
182 | | class UnoControlFileControlModel final : public UnoControlModel |
183 | | { |
184 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
185 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
186 | | |
187 | | public: |
188 | | UnoControlFileControlModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
189 | 0 | UnoControlFileControlModel( const UnoControlFileControlModel& rModel ) : UnoControlModel( rModel ) {} |
190 | | |
191 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlFileControlModel( *this ); } |
192 | | |
193 | | // css::io::XPersistObject |
194 | | OUString SAL_CALL getServiceName() override; |
195 | | |
196 | | // css::beans::XMultiPropertySet |
197 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
198 | | |
199 | | // css::lang::XServiceInfo |
200 | | OUString SAL_CALL getImplementationName() override; |
201 | | |
202 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
203 | | }; |
204 | | |
205 | | |
206 | | |
207 | | class UnoFileControl final : public UnoEditControl |
208 | | { |
209 | | public: |
210 | | UnoFileControl(); |
211 | | OUString GetComponentServiceName() const override; |
212 | | |
213 | | // css::lang::XServiceInfo |
214 | | OUString SAL_CALL getImplementationName() override; |
215 | | |
216 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
217 | | }; |
218 | | |
219 | | |
220 | | |
221 | | class GraphicControlModel : public UnoControlModel |
222 | | { |
223 | | private: |
224 | | bool mbAdjustingImagePosition; |
225 | | bool mbAdjustingGraphic; |
226 | | |
227 | | protected: |
228 | | GraphicControlModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) |
229 | 0 | :UnoControlModel( rxContext ) |
230 | 0 | ,mbAdjustingImagePosition( false ) |
231 | 0 | ,mbAdjustingGraphic( false ) |
232 | 0 | { |
233 | 0 | } |
234 | 0 | GraphicControlModel( const GraphicControlModel& _rSource ) : UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { } |
235 | | |
236 | | // ::comphelper::OPropertySetHelper |
237 | | void setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override; |
238 | | |
239 | | // UnoControlModel |
240 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
241 | | |
242 | | private: |
243 | | GraphicControlModel& operator=( const GraphicControlModel& ) = delete; |
244 | | }; |
245 | | |
246 | | |
247 | | |
248 | | class TOOLKIT_DLLPUBLIC UnoControlButtonModel final : public GraphicControlModel |
249 | | { |
250 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
251 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
252 | | |
253 | | public: |
254 | | UnoControlButtonModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
255 | 0 | UnoControlButtonModel( const UnoControlButtonModel& rModel ) : GraphicControlModel( rModel ) {} |
256 | | |
257 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlButtonModel( *this ); } |
258 | | |
259 | | // css::beans::XMultiPropertySet |
260 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
261 | | |
262 | | // css::io::XPersistObject |
263 | | OUString SAL_CALL getServiceName() override; |
264 | | |
265 | | // css::lang::XServiceInfo |
266 | | OUString SAL_CALL getImplementationName() override; |
267 | | |
268 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
269 | | }; |
270 | | |
271 | | |
272 | | |
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 TOOLKIT_DLLPUBLIC UnoButtonControl final : public UnoButtonControl_Base |
280 | | { |
281 | | private: |
282 | | ActionListenerMultiplexer maActionListeners; |
283 | | ItemListenerMultiplexer maItemListeners; |
284 | | OUString maActionCommand; |
285 | | |
286 | | public: |
287 | | |
288 | | UnoButtonControl(); |
289 | | OUString GetComponentServiceName() const override; |
290 | | |
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; |
293 | | |
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; |
299 | | |
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; |
304 | | |
305 | | // css::lang::XEventListener |
306 | | virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; |
307 | | |
308 | | // XItemListener |
309 | | virtual void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override; |
310 | | |
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; |
315 | | |
316 | | // css::lang::XServiceInfo |
317 | | OUString SAL_CALL getImplementationName() override; |
318 | | |
319 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
320 | | }; |
321 | | |
322 | | |
323 | | |
324 | | class UnoControlImageControlModel final : public GraphicControlModel |
325 | | { |
326 | | private: |
327 | | bool mbAdjustingImageScaleMode; |
328 | | |
329 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
330 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
331 | | |
332 | | public: |
333 | | UnoControlImageControlModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
334 | 0 | UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : GraphicControlModel( rModel ), mbAdjustingImageScaleMode( false ) { } |
335 | | |
336 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlImageControlModel( *this ); } |
337 | | |
338 | | // css::beans::XMultiPropertySet |
339 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
340 | | |
341 | | // css::io::XPersistObject |
342 | | OUString SAL_CALL getServiceName() override; |
343 | | |
344 | | // css::lang::XServiceInfo |
345 | | OUString SAL_CALL getImplementationName() override; |
346 | | |
347 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
348 | | |
349 | | // ::cppu::OPropertySetHelper |
350 | | void setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override; |
351 | | }; |
352 | | |
353 | | |
354 | | |
355 | | typedef ::cppu::AggImplInheritanceHelper1 < UnoControlBase |
356 | | , css::awt::XLayoutConstrains |
357 | | > UnoImageControlControl_Base; |
358 | | class UnoImageControlControl final : public UnoImageControlControl_Base |
359 | | { |
360 | | private: |
361 | | ActionListenerMultiplexer maActionListeners; |
362 | | |
363 | | public: |
364 | | |
365 | | UnoImageControlControl(); |
366 | | OUString GetComponentServiceName() const override; |
367 | | |
368 | | void SAL_CALL dispose( ) override; |
369 | | |
370 | | // css::awt::XControl |
371 | | sal_Bool SAL_CALL isTransparent( ) override; |
372 | | |
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; |
377 | | |
378 | | // css::lang::XServiceInfo |
379 | | OUString SAL_CALL getImplementationName() override; |
380 | | |
381 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
382 | | }; |
383 | | |
384 | | |
385 | | |
386 | | class UnoControlRadioButtonModel final : public GraphicControlModel |
387 | | { |
388 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
389 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
390 | | |
391 | | public: |
392 | | UnoControlRadioButtonModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
393 | 0 | UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : GraphicControlModel( rModel ) {} |
394 | | |
395 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlRadioButtonModel( *this ); } |
396 | | |
397 | | // css::io::XPersistObject |
398 | | OUString SAL_CALL getServiceName() override; |
399 | | |
400 | | // css::beans::XMultiPropertySet |
401 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
402 | | |
403 | | // css::lang::XServiceInfo |
404 | | OUString SAL_CALL getImplementationName() override; |
405 | | |
406 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
407 | | }; |
408 | | |
409 | | |
410 | | |
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 |
418 | | { |
419 | | private: |
420 | | ItemListenerMultiplexer maItemListeners; |
421 | | ActionListenerMultiplexer maActionListeners; |
422 | | OUString maActionCommand; |
423 | | |
424 | | public: |
425 | | |
426 | | UnoRadioButtonControl(); |
427 | | OUString GetComponentServiceName() const override; |
428 | | |
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 | 0 | void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); } |
432 | | |
433 | | // css::awt::XControl |
434 | | sal_Bool SAL_CALL isTransparent( ) override; |
435 | | |
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; |
440 | | |
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; |
447 | | |
448 | | // css::awt::XItemListener |
449 | | void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override; |
450 | | |
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; |
455 | | |
456 | | // css::lang::XServiceInfo |
457 | | OUString SAL_CALL getImplementationName() override; |
458 | | |
459 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
460 | | }; |
461 | | |
462 | | |
463 | | |
464 | | class UnoControlCheckBoxModel final : public GraphicControlModel |
465 | | { |
466 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
467 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
468 | | |
469 | | public: |
470 | | UnoControlCheckBoxModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
471 | 0 | UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : GraphicControlModel( rModel ) {} |
472 | | |
473 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlCheckBoxModel( *this ); } |
474 | | |
475 | | // css::io::XPersistObject |
476 | | OUString SAL_CALL getServiceName() override; |
477 | | |
478 | | // css::beans::XMultiPropertySet |
479 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
480 | | |
481 | | // css::lang::XServiceInfo |
482 | | OUString SAL_CALL getImplementationName() override; |
483 | | |
484 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
485 | | }; |
486 | | |
487 | | |
488 | | |
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 |
496 | | { |
497 | | private: |
498 | | ItemListenerMultiplexer maItemListeners; |
499 | | ActionListenerMultiplexer maActionListeners; |
500 | | OUString maActionCommand; |
501 | | |
502 | | public: |
503 | | |
504 | | UnoCheckBoxControl(); |
505 | | OUString GetComponentServiceName() const override; |
506 | | |
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 | 0 | void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); } |
510 | | |
511 | | // css::awt::XControl |
512 | | sal_Bool SAL_CALL isTransparent( ) override; |
513 | | |
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; |
518 | | |
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; |
521 | | |
522 | | |
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; |
527 | | |
528 | | // css::awt::XItemListener |
529 | | void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override; |
530 | | |
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; |
535 | | |
536 | | // css::lang::XServiceInfo |
537 | | OUString SAL_CALL getImplementationName() override; |
538 | | |
539 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
540 | | }; |
541 | | |
542 | | |
543 | | |
544 | | class UnoControlFixedHyperlinkModel final : public UnoControlModel |
545 | | { |
546 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
547 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
548 | | |
549 | | public: |
550 | | UnoControlFixedHyperlinkModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
551 | 0 | UnoControlFixedHyperlinkModel( const UnoControlFixedHyperlinkModel& rModel ) : UnoControlModel( rModel ) {} |
552 | | |
553 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlFixedHyperlinkModel( *this ); } |
554 | | |
555 | | // css::io::XPersistObject |
556 | | OUString SAL_CALL getServiceName() override; |
557 | | |
558 | | // css::beans::XMultiPropertySet |
559 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
560 | | |
561 | | // css::lang::XServiceInfo |
562 | | DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedHyperlinkModel, UnoControlModel, "com.sun.star.awt.UnoControlFixedHyperlinkModel" ) |
563 | | }; |
564 | | |
565 | | |
566 | | |
567 | | class UnoFixedHyperlinkControl final : public UnoControlBase, |
568 | | public css::awt::XFixedHyperlink, |
569 | | public css::awt::XLayoutConstrains |
570 | | { |
571 | | private: |
572 | | ActionListenerMultiplexer maActionListeners; |
573 | | |
574 | | public: |
575 | | UnoFixedHyperlinkControl(); |
576 | | |
577 | | OUString GetComponentServiceName() const override; |
578 | | |
579 | 0 | 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 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
582 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
583 | | |
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; |
586 | | |
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; |
590 | | |
591 | | // css::awt::XControl |
592 | | sal_Bool SAL_CALL isTransparent( ) override; |
593 | | |
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; |
603 | | |
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; |
608 | | |
609 | | // css::lang::XServiceInfo |
610 | | DECLIMPL_SERVICEINFO_DERIVED( UnoFixedHyperlinkControl, UnoControlBase, "com.sun.star.awt.UnoControlFixedHyperlink" ) |
611 | | }; |
612 | | |
613 | | |
614 | | |
615 | | class TOOLKIT_DLLPUBLIC UnoControlFixedTextModel final : public UnoControlModel |
616 | | { |
617 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
618 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
619 | | |
620 | | public: |
621 | | UnoControlFixedTextModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
622 | 0 | UnoControlFixedTextModel( const UnoControlFixedTextModel& rModel ) : UnoControlModel( rModel ) {} |
623 | | |
624 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlFixedTextModel( *this ); } |
625 | | |
626 | | // css::io::XPersistObject |
627 | | OUString SAL_CALL getServiceName() override; |
628 | | |
629 | | // css::beans::XMultiPropertySet |
630 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
631 | | |
632 | | // css::lang::XServiceInfo |
633 | | OUString SAL_CALL getImplementationName() override; |
634 | | |
635 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
636 | | }; |
637 | | |
638 | | |
639 | | |
640 | | class TOOLKIT_DLLPUBLIC UnoFixedTextControl final : public UnoControlBase, |
641 | | public css::awt::XFixedText, |
642 | | public css::awt::XLayoutConstrains |
643 | | { |
644 | | public: |
645 | | UnoFixedTextControl(); |
646 | | OUString GetComponentServiceName() const override; |
647 | | |
648 | 0 | 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 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
651 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
652 | | |
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; |
656 | | |
657 | | // css::awt::XControl |
658 | | sal_Bool SAL_CALL isTransparent( ) override; |
659 | | |
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; |
665 | | |
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; |
670 | | |
671 | | // css::lang::XServiceInfo |
672 | | OUString SAL_CALL getImplementationName() override; |
673 | | |
674 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
675 | | }; |
676 | | |
677 | | |
678 | | |
679 | | class UnoControlGroupBoxModel final : public UnoControlModel |
680 | | { |
681 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
682 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
683 | | |
684 | | public: |
685 | | UnoControlGroupBoxModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
686 | 0 | UnoControlGroupBoxModel( const UnoControlGroupBoxModel& rModel ) : UnoControlModel( rModel ) {} |
687 | | |
688 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlGroupBoxModel( *this ); } |
689 | | |
690 | | // css::io::XPersistObject |
691 | | OUString SAL_CALL getServiceName() override; |
692 | | |
693 | | // css::beans::XMultiPropertySet |
694 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
695 | | |
696 | | // css::lang::XServiceInfo |
697 | | OUString SAL_CALL getImplementationName() override; |
698 | | |
699 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
700 | | }; |
701 | | |
702 | | |
703 | | |
704 | | class UnoGroupBoxControl final : public UnoControlBase |
705 | | { |
706 | | public: |
707 | | UnoGroupBoxControl(); |
708 | | OUString GetComponentServiceName() const override; |
709 | | |
710 | | sal_Bool SAL_CALL isTransparent( ) override; |
711 | | |
712 | | // css::lang::XServiceInfo |
713 | | OUString SAL_CALL getImplementationName() override; |
714 | | |
715 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
716 | | }; |
717 | | |
718 | | |
719 | | |
720 | | struct UnoControlListBoxModel_Data; |
721 | | typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel |
722 | | , css::awt::XItemList |
723 | | > UnoControlListBoxModel_Base; |
724 | | class UnoControlListBoxModel : public UnoControlListBoxModel_Base |
725 | | { |
726 | | protected: |
727 | | enum ConstructorMode |
728 | | { |
729 | | ConstructDefault, |
730 | | ConstructWithoutProperties |
731 | | }; |
732 | | |
733 | | public: |
734 | | UnoControlListBoxModel( |
735 | | const css::uno::Reference< css::uno::XComponentContext >& rxContext, |
736 | | ConstructorMode const i_mode = ConstructDefault |
737 | | ); |
738 | | UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ); |
739 | | virtual ~UnoControlListBoxModel() override; |
740 | | |
741 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlListBoxModel( *this ); } |
742 | | |
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; |
749 | | |
750 | | // css::beans::XMultiPropertySet |
751 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
752 | | |
753 | | // css::io::XPersistObject |
754 | | OUString SAL_CALL getServiceName() override; |
755 | | |
756 | | // css::lang::XServiceInfo |
757 | | OUString SAL_CALL getImplementationName( ) override; |
758 | | css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
759 | | |
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; |
778 | | |
779 | | // OPropertySetHelper |
780 | | void setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override; |
781 | | |
782 | | protected: |
783 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
784 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
785 | | |
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& ) |
793 | | ); |
794 | | |
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 |
800 | | ); |
801 | | |
802 | | void impl_handleRemove( |
803 | | const sal_Int32 i_nItemPosition, |
804 | | std::unique_lock<std::mutex>& i_rClearBeforeNotify |
805 | | ); |
806 | | |
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 |
812 | | ); |
813 | | |
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 ); |
816 | | |
817 | | protected: |
818 | | std::unique_ptr<UnoControlListBoxModel_Data> m_xData; |
819 | | ::comphelper::OInterfaceContainerHelper4<css::awt::XItemListListener> m_aItemListListeners; |
820 | | }; |
821 | | |
822 | | |
823 | | |
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 |
832 | | { |
833 | | public: |
834 | | UnoListBoxControl(); |
835 | | OUString GetComponentServiceName() const override; |
836 | | |
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 | 0 | void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); } |
840 | | |
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; |
864 | | |
865 | | // css::awt::XItemListener |
866 | | void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override; |
867 | | |
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; |
872 | | |
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; |
876 | | |
877 | | // XUnoControl |
878 | | sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel >& Model) override; |
879 | | |
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; |
886 | | |
887 | | // css::lang::XServiceInfo |
888 | | OUString SAL_CALL getImplementationName( ) override; |
889 | | css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
890 | | |
891 | | private: |
892 | | void ImplUpdateSelectedItemsProperty(); |
893 | | virtual void ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override; |
894 | | virtual void updateFromModel() override; |
895 | | |
896 | | ActionListenerMultiplexer maActionListeners; |
897 | | ItemListenerMultiplexer maItemListeners; |
898 | | }; |
899 | | |
900 | | |
901 | | |
902 | | class UnoControlComboBoxModel final : public UnoControlListBoxModel |
903 | | { |
904 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
905 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
906 | | |
907 | | public: |
908 | | UnoControlComboBoxModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
909 | 0 | UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {} |
910 | | |
911 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlComboBoxModel( *this ); } |
912 | | |
913 | | // css::io::XPersistObject |
914 | | OUString SAL_CALL getServiceName() override; |
915 | | |
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; |
920 | | |
921 | | // css::lang::XServiceInfo |
922 | | OUString SAL_CALL getImplementationName( ) override; |
923 | | css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
924 | | |
925 | | }; |
926 | | |
927 | | |
928 | | |
929 | | class UnoComboBoxControl final : public UnoEditControl |
930 | | , public css::awt::XComboBox |
931 | | , public css::awt::XItemListener |
932 | | , public css::awt::XItemListListener |
933 | | { |
934 | | private: |
935 | | ActionListenerMultiplexer maActionListeners; |
936 | | ItemListenerMultiplexer maItemListeners; |
937 | | |
938 | | public: |
939 | | |
940 | | UnoComboBoxControl(); |
941 | | OUString GetComponentServiceName() const override; |
942 | | |
943 | | void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override; |
944 | 0 | void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoEditControl::disposing( Source ); } |
945 | | void SAL_CALL dispose( ) override; |
946 | | |
947 | 0 | 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 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
950 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
951 | | |
952 | | |
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; |
956 | | |
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; |
970 | | |
971 | | // XUnoControl |
972 | | virtual sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel >& Model) override; |
973 | | |
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; |
980 | | |
981 | | // XItemListener |
982 | | virtual void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override; |
983 | | |
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; |
990 | | |
991 | | }; |
992 | | |
993 | | |
994 | | |
995 | | class UnoSpinFieldControl : public UnoEditControl, |
996 | | public css::awt::XSpinField |
997 | | { |
998 | | private: |
999 | | SpinListenerMultiplexer maSpinListeners; |
1000 | | bool mbRepeat; |
1001 | | |
1002 | | public: |
1003 | | UnoSpinFieldControl(); |
1004 | | |
1005 | 0 | 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 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
1008 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
1009 | | |
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; |
1013 | | |
1014 | | void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override; |
1015 | | |
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; |
1024 | | |
1025 | | |
1026 | | // css::lang::XServiceInfo |
1027 | | // No service info, only base class for other fields. |
1028 | | }; |
1029 | | |
1030 | | |
1031 | | |
1032 | | class UnoControlDateFieldModel final : public UnoControlModel |
1033 | | { |
1034 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
1035 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
1036 | | |
1037 | | public: |
1038 | | UnoControlDateFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
1039 | 0 | UnoControlDateFieldModel( const UnoControlDateFieldModel& rModel ) : UnoControlModel( rModel ) {} |
1040 | | |
1041 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlDateFieldModel( *this ); } |
1042 | | |
1043 | | // css::io::XPersistObject |
1044 | | OUString SAL_CALL getServiceName() override; |
1045 | | |
1046 | | // css::beans::XMultiPropertySet |
1047 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
1048 | | |
1049 | | // css::lang::XServiceInfo |
1050 | | OUString SAL_CALL getImplementationName() override; |
1051 | | |
1052 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1053 | | }; |
1054 | | |
1055 | | |
1056 | | |
1057 | | class UnoDateFieldControl final : public UnoSpinFieldControl, |
1058 | | public css::awt::XDateField |
1059 | | { |
1060 | | private: |
1061 | | css::util::Date mnFirst; |
1062 | | css::util::Date mnLast; |
1063 | | TriState mbLongFormat; |
1064 | | public: |
1065 | | UnoDateFieldControl(); |
1066 | | OUString GetComponentServiceName() const override; |
1067 | | |
1068 | 0 | 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 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
1071 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
1072 | | |
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; |
1076 | | |
1077 | | void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override; |
1078 | | |
1079 | | // css::awt::XTextListener |
1080 | | void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override; |
1081 | | |
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; |
1099 | | |
1100 | | // css::lang::XServiceInfo |
1101 | | OUString SAL_CALL getImplementationName() override; |
1102 | | |
1103 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1104 | | }; |
1105 | | |
1106 | | |
1107 | | |
1108 | | class UnoControlTimeFieldModel final : public UnoControlModel |
1109 | | { |
1110 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
1111 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
1112 | | |
1113 | | public: |
1114 | | UnoControlTimeFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
1115 | 0 | UnoControlTimeFieldModel( const UnoControlTimeFieldModel& rModel ) : UnoControlModel( rModel ) {} |
1116 | | |
1117 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlTimeFieldModel( *this ); } |
1118 | | |
1119 | | // css::io::XPersistObject |
1120 | | OUString SAL_CALL getServiceName() override; |
1121 | | |
1122 | | // css::beans::XMultiPropertySet |
1123 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
1124 | | |
1125 | | // css::lang::XServiceInfo |
1126 | | OUString SAL_CALL getImplementationName() override; |
1127 | | |
1128 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1129 | | }; |
1130 | | |
1131 | | |
1132 | | |
1133 | | class UnoTimeFieldControl final : public UnoSpinFieldControl, |
1134 | | public css::awt::XTimeField |
1135 | | { |
1136 | | private: |
1137 | | css::util::Time mnFirst; |
1138 | | css::util::Time mnLast; |
1139 | | |
1140 | | public: |
1141 | | UnoTimeFieldControl(); |
1142 | | OUString GetComponentServiceName() const override; |
1143 | | |
1144 | 0 | 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 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
1147 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
1148 | | |
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; |
1152 | | |
1153 | | void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override; |
1154 | | |
1155 | | // css::awt::XTextListener |
1156 | | void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override; |
1157 | | |
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; |
1173 | | |
1174 | | // css::lang::XServiceInfo |
1175 | | OUString SAL_CALL getImplementationName() override; |
1176 | | |
1177 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1178 | | }; |
1179 | | |
1180 | | |
1181 | | |
1182 | | class UnoControlNumericFieldModel final : public UnoControlModel |
1183 | | { |
1184 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
1185 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
1186 | | |
1187 | | public: |
1188 | | UnoControlNumericFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
1189 | 0 | UnoControlNumericFieldModel( const UnoControlNumericFieldModel& rModel ) : UnoControlModel( rModel ) {} |
1190 | | |
1191 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlNumericFieldModel( *this ); } |
1192 | | |
1193 | | // css::io::XPersistObject |
1194 | | OUString SAL_CALL getServiceName() override; |
1195 | | |
1196 | | // css::beans::XMultiPropertySet |
1197 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
1198 | | |
1199 | | // css::lang::XServiceInfo |
1200 | | OUString SAL_CALL getImplementationName() override; |
1201 | | |
1202 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1203 | | }; |
1204 | | |
1205 | | |
1206 | | |
1207 | | class UnoNumericFieldControl final : public UnoSpinFieldControl, |
1208 | | public css::awt::XNumericField |
1209 | | { |
1210 | | private: |
1211 | | double mnFirst; |
1212 | | double mnLast; |
1213 | | |
1214 | | public: |
1215 | | UnoNumericFieldControl(); |
1216 | | OUString GetComponentServiceName() const override; |
1217 | | |
1218 | 0 | 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 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
1221 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
1222 | | |
1223 | | void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override; |
1224 | | |
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; |
1228 | | |
1229 | | // css::awt::XTextListener |
1230 | | void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override; |
1231 | | |
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; |
1249 | | |
1250 | | // css::lang::XServiceInfo |
1251 | | OUString SAL_CALL getImplementationName() override; |
1252 | | |
1253 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1254 | | }; |
1255 | | |
1256 | | |
1257 | | |
1258 | | class UnoControlCurrencyFieldModel final : public UnoControlModel |
1259 | | { |
1260 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
1261 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
1262 | | |
1263 | | public: |
1264 | | UnoControlCurrencyFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
1265 | 0 | UnoControlCurrencyFieldModel( const UnoControlCurrencyFieldModel& rModel ) : UnoControlModel( rModel ) {} |
1266 | | |
1267 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlCurrencyFieldModel( *this ); } |
1268 | | |
1269 | | // css::io::XPersistObject |
1270 | | OUString SAL_CALL getServiceName() override; |
1271 | | |
1272 | | // css::beans::XMultiPropertySet |
1273 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
1274 | | |
1275 | | // css::lang::XServiceInfo |
1276 | | OUString SAL_CALL getImplementationName() override; |
1277 | | |
1278 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1279 | | }; |
1280 | | |
1281 | | |
1282 | | |
1283 | | class UnoCurrencyFieldControl final : public UnoSpinFieldControl, |
1284 | | public css::awt::XCurrencyField |
1285 | | { |
1286 | | private: |
1287 | | double mnFirst; |
1288 | | double mnLast; |
1289 | | |
1290 | | public: |
1291 | | UnoCurrencyFieldControl(); |
1292 | | OUString GetComponentServiceName() const override; |
1293 | | |
1294 | 0 | 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 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
1297 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
1298 | | |
1299 | | void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override; |
1300 | | |
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; |
1304 | | |
1305 | | // css::awt::XTextListener |
1306 | | void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override; |
1307 | | |
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; |
1325 | | |
1326 | | // css::lang::XServiceInfo |
1327 | | OUString SAL_CALL getImplementationName() override; |
1328 | | |
1329 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1330 | | }; |
1331 | | |
1332 | | |
1333 | | |
1334 | | class UnoControlPatternFieldModel final : public UnoControlModel |
1335 | | { |
1336 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
1337 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
1338 | | |
1339 | | public: |
1340 | | UnoControlPatternFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
1341 | 0 | UnoControlPatternFieldModel( const UnoControlPatternFieldModel& rModel ) : UnoControlModel( rModel ) {} |
1342 | | |
1343 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlPatternFieldModel( *this ); } |
1344 | | |
1345 | | // css::io::XPersistObject |
1346 | | OUString SAL_CALL getServiceName() override; |
1347 | | |
1348 | | // css::beans::XMultiPropertySet |
1349 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
1350 | | |
1351 | | // css::lang::XServiceInfo |
1352 | | OUString SAL_CALL getImplementationName() override; |
1353 | | |
1354 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1355 | | }; |
1356 | | |
1357 | | |
1358 | | |
1359 | | class UnoPatternFieldControl final : public UnoSpinFieldControl, |
1360 | | public css::awt::XPatternField |
1361 | | { |
1362 | | void ImplSetPeerProperty( const OUString& rPropName, const css::uno::Any& rVal ) override; |
1363 | | |
1364 | | public: |
1365 | | UnoPatternFieldControl(); |
1366 | | OUString GetComponentServiceName() const override; |
1367 | | |
1368 | 0 | 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 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
1371 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
1372 | | |
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; |
1376 | | |
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; |
1384 | | |
1385 | | // css::lang::XServiceInfo |
1386 | | OUString SAL_CALL getImplementationName() override; |
1387 | | |
1388 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1389 | | }; |
1390 | | |
1391 | | |
1392 | | |
1393 | | class UnoControlProgressBarModel final : public UnoControlModel |
1394 | | { |
1395 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
1396 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
1397 | | |
1398 | | public: |
1399 | | UnoControlProgressBarModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
1400 | 0 | UnoControlProgressBarModel( const UnoControlProgressBarModel& rModel ) : UnoControlModel( rModel ) {} |
1401 | | |
1402 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlProgressBarModel( *this ); } |
1403 | | |
1404 | | // css::beans::XMultiPropertySet |
1405 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
1406 | | |
1407 | | // css::io::XPersistObject |
1408 | | OUString SAL_CALL getServiceName() override; |
1409 | | |
1410 | | // XServiceInfo |
1411 | | OUString SAL_CALL getImplementationName() override; |
1412 | | |
1413 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1414 | | }; |
1415 | | |
1416 | | |
1417 | | |
1418 | | class UnoProgressBarControl final : public UnoControlBase, |
1419 | | public css::awt::XProgressBar |
1420 | | { |
1421 | | public: |
1422 | | UnoProgressBarControl(); |
1423 | | OUString GetComponentServiceName() const override; |
1424 | | |
1425 | 0 | 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 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
1428 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
1429 | | |
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; |
1433 | | |
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; |
1440 | | |
1441 | | // css::lang::XServiceInfo |
1442 | | OUString SAL_CALL getImplementationName() override; |
1443 | | |
1444 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1445 | | }; |
1446 | | |
1447 | | |
1448 | | |
1449 | | class UnoControlFixedLineModel final : public UnoControlModel |
1450 | | { |
1451 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
1452 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
1453 | | |
1454 | | public: |
1455 | | UnoControlFixedLineModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); |
1456 | 0 | UnoControlFixedLineModel( const UnoControlFixedLineModel& rModel ) : UnoControlModel( rModel ) {} |
1457 | | |
1458 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlFixedLineModel( *this ); } |
1459 | | |
1460 | | // css::beans::XMultiPropertySet |
1461 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
1462 | | |
1463 | | // css::io::XPersistObject |
1464 | | OUString SAL_CALL getServiceName() override; |
1465 | | |
1466 | | // css::lang::XServiceInfo |
1467 | | OUString SAL_CALL getImplementationName() override; |
1468 | | |
1469 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1470 | | }; |
1471 | | |
1472 | | |
1473 | | |
1474 | | class UnoFixedLineControl final : public UnoControlBase |
1475 | | { |
1476 | | public: |
1477 | | UnoFixedLineControl(); |
1478 | | OUString GetComponentServiceName() const override; |
1479 | | |
1480 | | sal_Bool SAL_CALL isTransparent( ) override; |
1481 | | |
1482 | | // css::lang::XServiceInfo |
1483 | | OUString SAL_CALL getImplementationName() override; |
1484 | | |
1485 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
1486 | | }; |
1487 | | |
1488 | | |
1489 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |