/src/libreoffice/include/toolkit/awt/vclxwindows.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 | | |
25 | | #include <com/sun/star/awt/XTextArea.hpp> |
26 | | #include <com/sun/star/awt/XTextComponent.hpp> |
27 | | #include <com/sun/star/awt/XListBox.hpp> |
28 | | #include <com/sun/star/awt/XNumericField.hpp> |
29 | | #include <com/sun/star/awt/XScrollBar.hpp> |
30 | | #include <com/sun/star/awt/XTextEditField.hpp> |
31 | | #include <com/sun/star/awt/XSpinField.hpp> |
32 | | #include <com/sun/star/awt/XTextLayoutConstrains.hpp> |
33 | | #include <com/sun/star/awt/XButton.hpp> |
34 | | #include <com/sun/star/awt/XToggleButton.hpp> |
35 | | #include <com/sun/star/awt/XFixedHyperlink.hpp> |
36 | | #include <com/sun/star/awt/XFixedText.hpp> |
37 | | #include <com/sun/star/awt/XRadioButton.hpp> |
38 | | #include <com/sun/star/awt/XComboBox.hpp> |
39 | | #include <com/sun/star/awt/XCheckBox.hpp> |
40 | | #include <com/sun/star/awt/XItemListListener.hpp> |
41 | | #include <cppuhelper/implbase.hxx> |
42 | | |
43 | | #include <toolkit/awt/vclxwindow.hxx> |
44 | | #include <toolkit/helper/listenermultiplexer.hxx> |
45 | | #include <tools/lineend.hxx> |
46 | | |
47 | | #include <vcl/image.hxx> |
48 | | |
49 | | class SvNumberFormatsSupplierObj; |
50 | | |
51 | | namespace com::sun::star::util { class XNumberFormatsSupplier; } |
52 | | |
53 | | // class VCLXGraphicControl |
54 | | // deriving from VCLXWindow, drawing the graphic which exists as "Graphic" at the model |
55 | | |
56 | | class VCLXGraphicControl : public VCLXWindow |
57 | | { |
58 | | private: |
59 | | /// the image we currently display |
60 | | Image maImage; |
61 | | |
62 | | protected: |
63 | 0 | const Image& GetImage() const { return maImage; } |
64 | | |
65 | | protected: |
66 | | // css::awt::XWindow |
67 | | void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) override; |
68 | | |
69 | | // css::awt::VclWindowPeer |
70 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
71 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
72 | | |
73 | | protected: |
74 | | /** forward our bitmap to our window |
75 | | @precond |
76 | | our mutex is locked |
77 | | @precond |
78 | | GetWindow is not <NULL/> |
79 | | @see GetBitmap |
80 | | */ |
81 | | virtual void ImplSetNewImage(); |
82 | | |
83 | | public: |
84 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
85 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
86 | | |
87 | | }; |
88 | | |
89 | | |
90 | | // class VCLXButton |
91 | | |
92 | | typedef cppu::ImplInheritanceHelper< VCLXGraphicControl, |
93 | | css::awt::XButton, |
94 | | css::awt::XToggleButton |
95 | | > VCLXButton_Base; |
96 | | class VCLXButton final : public VCLXButton_Base |
97 | | { |
98 | | private: |
99 | | OUString maActionCommand; |
100 | | ActionListenerMultiplexer maActionListeners; |
101 | | ItemListenerMultiplexer maItemListeners; |
102 | | |
103 | | void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
104 | | |
105 | | public: |
106 | | VCLXButton(); |
107 | | virtual ~VCLXButton() override; |
108 | | |
109 | | // css::lang::XComponent |
110 | | void SAL_CALL dispose( ) override; |
111 | | |
112 | | // css::awt::XButton |
113 | | void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
114 | | void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
115 | | void SAL_CALL setLabel( const OUString& Label ) override; |
116 | | void SAL_CALL setActionCommand( const OUString& Command ) override; |
117 | | |
118 | | // css::awt::XToggleButton |
119 | | // css::awt::XItemEventBroadcaster |
120 | | void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override; |
121 | | void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override; |
122 | | |
123 | | // css::awt::XLayoutConstrains |
124 | | css::awt::Size SAL_CALL getMinimumSize( ) override; |
125 | | css::awt::Size SAL_CALL getPreferredSize( ) override; |
126 | | css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& rNewSize ) override; |
127 | | |
128 | | // css::awt::VclWindowPeer |
129 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
130 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
131 | | |
132 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
133 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
134 | | }; |
135 | | |
136 | | // class VCLXCheckBox |
137 | | |
138 | | class UNLESS_MERGELIBS_MORE(TOOLKIT_DLLPUBLIC) VCLXCheckBox final : public cppu::ImplInheritanceHelper< |
139 | | VCLXGraphicControl, |
140 | | css::awt::XCheckBox, |
141 | | css::awt::XButton> |
142 | | { |
143 | | private: |
144 | | ActionListenerMultiplexer maActionListeners; |
145 | | OUString maActionCommand; |
146 | | ItemListenerMultiplexer maItemListeners; |
147 | | |
148 | | void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
149 | | |
150 | | public: |
151 | | VCLXCheckBox(); |
152 | | |
153 | | |
154 | | // css::lang::XComponent |
155 | | void SAL_CALL dispose( ) override; |
156 | | |
157 | | // css::awt::XCheckBox |
158 | | void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override; |
159 | | void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override; |
160 | | sal_Int16 SAL_CALL getState( ) override; |
161 | | void SAL_CALL setState( sal_Int16 n ) override; |
162 | | void SAL_CALL setLabel( const OUString& Label ) override; |
163 | | void SAL_CALL enableTriState( sal_Bool b ) override; |
164 | | |
165 | | // css::awt::XButton: |
166 | | void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
167 | | void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
168 | | void SAL_CALL setActionCommand( const OUString& Command ) override; |
169 | | |
170 | | // css::awt::XLayoutConstrains |
171 | | css::awt::Size SAL_CALL getMinimumSize( ) override; |
172 | | css::awt::Size SAL_CALL getPreferredSize( ) override; |
173 | | css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& rNewSize ) override; |
174 | | |
175 | | // css::awt::VclWindowPeer |
176 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
177 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
178 | | |
179 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
180 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
181 | | }; |
182 | | |
183 | | |
184 | | // class VCLXRadioButton |
185 | | |
186 | | class UNLESS_MERGELIBS_MORE(TOOLKIT_DLLPUBLIC) VCLXRadioButton final : public cppu::ImplInheritanceHelper< |
187 | | VCLXGraphicControl, |
188 | | css::awt::XRadioButton, |
189 | | css::awt::XButton> |
190 | | { |
191 | | private: |
192 | | ItemListenerMultiplexer maItemListeners; |
193 | | ActionListenerMultiplexer maActionListeners; |
194 | | OUString maActionCommand; |
195 | | |
196 | | void ImplClickedOrToggled( bool bToggled ); |
197 | | void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
198 | | |
199 | | public: |
200 | | VCLXRadioButton(); |
201 | | |
202 | | // css::lang::XComponent |
203 | | void SAL_CALL dispose( ) override; |
204 | | |
205 | | // css::awt::XRadioButton |
206 | | void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override; |
207 | | void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override; |
208 | | sal_Bool SAL_CALL getState( ) override; |
209 | | void SAL_CALL setState( sal_Bool b ) override; |
210 | | void SAL_CALL setLabel( const OUString& Label ) override; |
211 | | |
212 | | // css::awt::XButton: |
213 | | void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
214 | | void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
215 | | void SAL_CALL setActionCommand( const OUString& Command ) override; |
216 | | |
217 | | // css::awt::XLayoutConstrains |
218 | | css::awt::Size SAL_CALL getMinimumSize( ) override; |
219 | | css::awt::Size SAL_CALL getPreferredSize( ) override; |
220 | | css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& rNewSize ) override; |
221 | | |
222 | | // css::awt::VclWindowPeer |
223 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
224 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
225 | | |
226 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
227 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
228 | | |
229 | | }; |
230 | | |
231 | | // class VCLXFixedHyperlink |
232 | | class VCLXFixedHyperlink final : |
233 | | public cppu::ImplInheritanceHelper<VCLXWindow, css::awt::XFixedHyperlink> |
234 | | { |
235 | | private: |
236 | | ActionListenerMultiplexer maActionListeners; |
237 | | |
238 | | void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
239 | | |
240 | | public: |
241 | | VCLXFixedHyperlink(); |
242 | | virtual ~VCLXFixedHyperlink() override; |
243 | | |
244 | | // css::lang::XComponent |
245 | | void SAL_CALL dispose( ) override; |
246 | | |
247 | | // css::awt::XFixedHyperlink |
248 | | void SAL_CALL setText( const OUString& Text ) override; |
249 | | OUString SAL_CALL getText( ) override; |
250 | | void SAL_CALL setURL( const OUString& URL ) override; |
251 | | OUString SAL_CALL getURL( ) override; |
252 | | void SAL_CALL setAlignment( sal_Int16 nAlign ) override; |
253 | | sal_Int16 SAL_CALL getAlignment( ) override; |
254 | | void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
255 | | void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
256 | | |
257 | | // css::awt::XLayoutConstrains |
258 | | css::awt::Size SAL_CALL getMinimumSize( ) override; |
259 | | css::awt::Size SAL_CALL getPreferredSize( ) override; |
260 | | css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& rNewSize ) override; |
261 | | |
262 | | // css::awt::VclWindowPeer |
263 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
264 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
265 | | |
266 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
267 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
268 | | }; |
269 | | |
270 | | |
271 | | // class VCLXFixedText |
272 | | |
273 | | class VCLXFixedText final : public cppu::ImplInheritanceHelper<VCLXWindow, css::awt::XFixedText> |
274 | | { |
275 | | public: |
276 | | VCLXFixedText(); |
277 | | virtual ~VCLXFixedText() override; |
278 | | |
279 | | // css::awt::XFixedText |
280 | | void SAL_CALL setText( const OUString& Text ) override; |
281 | | OUString SAL_CALL getText( ) override; |
282 | | void SAL_CALL setAlignment( sal_Int16 nAlign ) override; |
283 | | sal_Int16 SAL_CALL getAlignment( ) override; |
284 | | |
285 | | // css::awt::XLayoutConstrains |
286 | | css::awt::Size SAL_CALL getMinimumSize( ) override; |
287 | | css::awt::Size SAL_CALL getPreferredSize( ) override; |
288 | | css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& rNewSize ) override; |
289 | | |
290 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
291 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
292 | | }; |
293 | | |
294 | | |
295 | | // class VCLXScrollBar |
296 | | |
297 | | class UNLESS_MERGELIBS_MORE(TOOLKIT_DLLPUBLIC) VCLXScrollBar final : |
298 | | public cppu::ImplInheritanceHelper<VCLXWindow, css::awt::XScrollBar> |
299 | | { |
300 | | private: |
301 | | AdjustmentListenerMultiplexer maAdjustmentListeners; |
302 | | |
303 | | void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
304 | | |
305 | | public: |
306 | | VCLXScrollBar(); |
307 | | |
308 | | |
309 | | // css::lang::XComponent |
310 | | void SAL_CALL dispose( ) override; |
311 | | |
312 | | // css::awt::XScrollbar |
313 | | void SAL_CALL addAdjustmentListener( const css::uno::Reference< css::awt::XAdjustmentListener >& l ) override; |
314 | | void SAL_CALL removeAdjustmentListener( const css::uno::Reference< css::awt::XAdjustmentListener >& l ) override; |
315 | | void SAL_CALL setValue( sal_Int32 n ) override; |
316 | | void SAL_CALL setValues( sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 nMax ) override; |
317 | | sal_Int32 SAL_CALL getValue( ) override; |
318 | | void SAL_CALL setMaximum( sal_Int32 n ) override; |
319 | | sal_Int32 SAL_CALL getMaximum( ) override; |
320 | | void SAL_CALL setLineIncrement( sal_Int32 n ) override; |
321 | | sal_Int32 SAL_CALL getLineIncrement( ) override; |
322 | | void SAL_CALL setBlockIncrement( sal_Int32 n ) override; |
323 | | sal_Int32 SAL_CALL getBlockIncrement( ) override; |
324 | | void SAL_CALL setVisibleSize( sal_Int32 n ) override; |
325 | | sal_Int32 SAL_CALL getVisibleSize( ) override; |
326 | | void SAL_CALL setOrientation( sal_Int32 n ) override; |
327 | | sal_Int32 SAL_CALL getOrientation( ) override; |
328 | | |
329 | | // why isn't this part of the XScrollbar? |
330 | | /// @throws css::uno::RuntimeException |
331 | | void setMinimum( sal_Int32 n ); |
332 | | /// @throws css::uno::RuntimeException |
333 | | sal_Int32 getMinimum( ) const; |
334 | | |
335 | | // css::awt::VclWindowPeer |
336 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
337 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
338 | | |
339 | | // css::awt::XLayoutConstrains |
340 | | css::awt::Size SAL_CALL getMinimumSize() override; |
341 | | /// @throws css::uno::RuntimeException |
342 | | static css::awt::Size implGetMinimumSize( vcl::Window const * p ); |
343 | | |
344 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
345 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
346 | | }; |
347 | | |
348 | | |
349 | | // class VCLXEdit |
350 | | |
351 | | class SAL_DLLPUBLIC_RTTI VCLXEdit : public cppu::ImplInheritanceHelper< |
352 | | VCLXWindow, |
353 | | css::awt::XTextComponent, |
354 | | css::awt::XTextEditField, |
355 | | css::awt::XTextLayoutConstrains> |
356 | | { |
357 | | private: |
358 | | TextListenerMultiplexer maTextListeners; |
359 | | |
360 | | protected: |
361 | | void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
362 | | |
363 | | public: |
364 | | VCLXEdit(); |
365 | | |
366 | 0 | TextListenerMultiplexer& GetTextListeners() { return maTextListeners; } |
367 | | |
368 | | |
369 | | // css::lang::XComponent |
370 | | void SAL_CALL dispose( ) override; |
371 | | |
372 | | // css::awt::XTextComponent |
373 | | void SAL_CALL addTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override; |
374 | | void SAL_CALL removeTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override; |
375 | | void SAL_CALL setText( const OUString& aText ) override; |
376 | | void SAL_CALL insertText( const css::awt::Selection& Sel, const OUString& Text ) override; |
377 | | OUString SAL_CALL getText( ) override; |
378 | | OUString SAL_CALL getSelectedText( ) override; |
379 | | void SAL_CALL setSelection( const css::awt::Selection& aSelection ) override; |
380 | | css::awt::Selection SAL_CALL getSelection( ) override; |
381 | | sal_Bool SAL_CALL isEditable( ) override; |
382 | | void SAL_CALL setEditable( sal_Bool bEditable ) override; |
383 | | void SAL_CALL setMaxTextLen( sal_Int16 nLen ) override; |
384 | | sal_Int16 SAL_CALL getMaxTextLen( ) override; |
385 | | |
386 | | // css::awt::XTextEditField: |
387 | | void SAL_CALL setEchoChar( sal_Unicode cEcho ) override; |
388 | | |
389 | | // css::awt::XLayoutConstrains |
390 | | css::awt::Size SAL_CALL getMinimumSize( ) override; |
391 | | css::awt::Size SAL_CALL getPreferredSize( ) override; |
392 | | css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& rNewSize ) override; |
393 | | |
394 | | // css::awt::XTextLayoutConstrains |
395 | | css::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) override; |
396 | | void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) override; |
397 | | |
398 | | // css::awt::VclWindowPeer |
399 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
400 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
401 | | |
402 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
403 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
404 | | }; |
405 | | |
406 | | class VCLXMultiLineEdit final : public cppu::ImplInheritanceHelper< |
407 | | VCLXWindow, |
408 | | css::awt::XTextComponent, |
409 | | css::awt::XTextArea, |
410 | | css::awt::XTextLayoutConstrains> |
411 | | { |
412 | | private: |
413 | | TextListenerMultiplexer maTextListeners; |
414 | | LineEnd meLineEndType; |
415 | | |
416 | | void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
417 | | |
418 | | public: |
419 | | VCLXMultiLineEdit(); |
420 | | virtual ~VCLXMultiLineEdit() override; |
421 | | |
422 | | // css::awt::XTextComponent |
423 | | void SAL_CALL addTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override; |
424 | | void SAL_CALL removeTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override; |
425 | | void SAL_CALL setText( const OUString& aText ) override; |
426 | | void SAL_CALL insertText( const css::awt::Selection& Sel, const OUString& Text ) override; |
427 | | OUString SAL_CALL getText( ) override; |
428 | | OUString SAL_CALL getSelectedText( ) override; |
429 | | void SAL_CALL setSelection( const css::awt::Selection& aSelection ) override; |
430 | | css::awt::Selection SAL_CALL getSelection( ) override; |
431 | | sal_Bool SAL_CALL isEditable( ) override; |
432 | | void SAL_CALL setEditable( sal_Bool bEditable ) override; |
433 | | void SAL_CALL setMaxTextLen( sal_Int16 nLen ) override; |
434 | | sal_Int16 SAL_CALL getMaxTextLen( ) override; |
435 | | |
436 | | //XTextArea |
437 | | OUString SAL_CALL getTextLines( ) override; |
438 | | |
439 | | // css::awt::XLayoutConstrains |
440 | | css::awt::Size SAL_CALL getMinimumSize( ) override; |
441 | | css::awt::Size SAL_CALL getPreferredSize( ) override; |
442 | | css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override; |
443 | | |
444 | | // css::awt::XTextLayoutConstrains |
445 | | css::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) override; |
446 | | void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) override; |
447 | | |
448 | | // css::awt::XVclWindowPeer |
449 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
450 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
451 | | |
452 | | // css::awt::XWindow |
453 | | void SAL_CALL setFocus( ) override; |
454 | | |
455 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
456 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
457 | | }; |
458 | | |
459 | | // class VCLXSpinField |
460 | | class VCLXSpinField : public cppu::ImplInheritanceHelper<VCLXEdit, css::awt::XSpinField> |
461 | | { |
462 | | private: |
463 | | SpinListenerMultiplexer maSpinListeners; |
464 | | |
465 | | protected: |
466 | | void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
467 | | |
468 | | public: |
469 | | VCLXSpinField(); |
470 | | |
471 | | |
472 | | // css::awt::XSpinField |
473 | | void SAL_CALL addSpinListener( const css::uno::Reference< css::awt::XSpinListener >& l ) override; |
474 | | void SAL_CALL removeSpinListener( const css::uno::Reference< css::awt::XSpinListener >& l ) override; |
475 | | void SAL_CALL up( ) override; |
476 | | void SAL_CALL down( ) override; |
477 | | void SAL_CALL first( ) override; |
478 | | void SAL_CALL last( ) override; |
479 | | void SAL_CALL enableRepeat( sal_Bool bRepeat ) override; |
480 | | |
481 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
482 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
483 | | }; |
484 | | |
485 | | class SVTXFormattedField : public VCLXSpinField |
486 | | { |
487 | | rtl::Reference<SvNumberFormatsSupplierObj> m_xCurrentSupplier; |
488 | | bool bIsStandardSupplier; |
489 | | sal_Int32 nKeyToSetDelayed; |
490 | | |
491 | | public: |
492 | | SVTXFormattedField(); |
493 | | virtual ~SVTXFormattedField() override; |
494 | | |
495 | | // css::awt::XVclWindowPeer |
496 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
497 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
498 | | |
499 | | protected: |
500 | | void setFormatsSupplier(const css::uno::Reference< css::util::XNumberFormatsSupplier > & xSupplier); |
501 | | sal_Int32 getFormatKey() const; |
502 | | void setFormatKey(sal_Int32 nKey); |
503 | | |
504 | | void SetValue(const css::uno::Any& rValue); |
505 | | css::uno::Any GetValue() const; |
506 | | |
507 | | void SetTreatAsNumber(bool bSet); |
508 | | bool GetTreatAsNumber() const; |
509 | | |
510 | | void SetDefaultValue(const css::uno::Any& rValue); |
511 | | css::uno::Any GetDefaultValue() const; |
512 | | |
513 | | void SetMinValue(const css::uno::Any& rValue); |
514 | | css::uno::Any GetMinValue() const; |
515 | | |
516 | | void SetMaxValue(const css::uno::Any& rValue); |
517 | | css::uno::Any GetMaxValue() const; |
518 | | |
519 | | void NotifyTextListeners(); |
520 | | css::uno::Any convertEffectiveValue(const css::uno::Any& rValue) const; |
521 | | |
522 | | virtual void SetWindow( const VclPtr< vcl::Window > &_pWindow) override; |
523 | | |
524 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
525 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
526 | | }; |
527 | | |
528 | | class UNLESS_MERGELIBS_MORE(TOOLKIT_DLLPUBLIC) SVTXNumericField final : public cppu::ImplInheritanceHelper<SVTXFormattedField, css::awt::XNumericField> |
529 | | { |
530 | | public: |
531 | | SVTXNumericField(); |
532 | | virtual ~SVTXNumericField() override; |
533 | | |
534 | | // css::awt::XNumericField |
535 | | void SAL_CALL setValue( double Value ) override; |
536 | | double SAL_CALL getValue( ) override; |
537 | | void SAL_CALL setMin( double Value ) override; |
538 | | double SAL_CALL getMin( ) override; |
539 | | void SAL_CALL setMax( double Value ) override; |
540 | | double SAL_CALL getMax( ) override; |
541 | | void SAL_CALL setFirst( double Value ) override; |
542 | | double SAL_CALL getFirst( ) override; |
543 | | void SAL_CALL setLast( double Value ) override; |
544 | | double SAL_CALL getLast( ) override; |
545 | | void SAL_CALL setSpinSize( double Value ) override; |
546 | | double SAL_CALL getSpinSize( ) override; |
547 | | void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) override; |
548 | | sal_Int16 SAL_CALL getDecimalDigits( ) override; |
549 | | void SAL_CALL setStrictFormat( sal_Bool bStrict ) override; |
550 | | sal_Bool SAL_CALL isStrictFormat( ) override; |
551 | | |
552 | | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override; |
553 | | }; |
554 | | |
555 | | // class VCLXListBox |
556 | | |
557 | | typedef cppu::ImplInheritanceHelper< VCLXWindow, |
558 | | css::awt::XListBox, |
559 | | css::awt::XTextLayoutConstrains, |
560 | | css::awt::XItemListListener |
561 | | > VCLXListBox_Base; |
562 | | class VCLXListBox final : public VCLXListBox_Base |
563 | | { |
564 | | private: |
565 | | ActionListenerMultiplexer maActionListeners; |
566 | | ItemListenerMultiplexer maItemListeners; |
567 | | |
568 | | virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
569 | | void ImplCallItemListeners(); |
570 | | |
571 | | public: |
572 | | VCLXListBox(); |
573 | | |
574 | | // css::lang::XComponent |
575 | | void SAL_CALL dispose( ) override; |
576 | | |
577 | | // css::awt::XListBox |
578 | | void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override; |
579 | | void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override; |
580 | | void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
581 | | void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
582 | | void SAL_CALL addItem( const OUString& aItem, sal_Int16 nPos ) override; |
583 | | void SAL_CALL addItems( const css::uno::Sequence< OUString >& aItems, sal_Int16 nPos ) override; |
584 | | void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) override; |
585 | | sal_Int16 SAL_CALL getItemCount( ) override; |
586 | | OUString SAL_CALL getItem( sal_Int16 nPos ) override; |
587 | | css::uno::Sequence< OUString > SAL_CALL getItems( ) override; |
588 | | sal_Int16 SAL_CALL getSelectedItemPos( ) override; |
589 | | css::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos( ) override; |
590 | | OUString SAL_CALL getSelectedItem( ) override; |
591 | | css::uno::Sequence< OUString > SAL_CALL getSelectedItems( ) override; |
592 | | void SAL_CALL selectItemPos( sal_Int16 nPos, sal_Bool bSelect ) override; |
593 | | void SAL_CALL selectItemsPos( const css::uno::Sequence< sal_Int16 >& aPositions, sal_Bool bSelect ) override; |
594 | | void SAL_CALL selectItem( const OUString& aItem, sal_Bool bSelect ) override; |
595 | | sal_Bool SAL_CALL isMutipleMode( ) override; |
596 | | void SAL_CALL setMultipleMode( sal_Bool bMulti ) override; |
597 | | sal_Int16 SAL_CALL getDropDownLineCount( ) override; |
598 | | void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) override; |
599 | | void SAL_CALL makeVisible( sal_Int16 nEntry ) override; |
600 | | |
601 | | // css::awt::XLayoutConstrains |
602 | | css::awt::Size SAL_CALL getMinimumSize( ) override; |
603 | | css::awt::Size SAL_CALL getPreferredSize( ) override; |
604 | | css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& rNewSize ) override; |
605 | | |
606 | | // css::awt::XTextLayoutConstrains |
607 | | css::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) override; |
608 | | void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) override; |
609 | | |
610 | | // css::awt::VclWindowPeer |
611 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
612 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
613 | | |
614 | | // XItemListListener |
615 | | virtual void SAL_CALL listItemInserted( const css::awt::ItemListEvent& Event ) override; |
616 | | virtual void SAL_CALL listItemRemoved( const css::awt::ItemListEvent& Event ) override; |
617 | | virtual void SAL_CALL listItemModified( const css::awt::ItemListEvent& Event ) override; |
618 | | virtual void SAL_CALL allItemsRemoved( const css::lang::EventObject& Event ) override; |
619 | | virtual void SAL_CALL itemListChanged( const css::lang::EventObject& Event ) override; |
620 | | |
621 | | // XEventListener |
622 | | virtual void SAL_CALL disposing( const css::lang::EventObject& i_rEvent ) override; |
623 | | |
624 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
625 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
626 | | }; |
627 | | |
628 | | |
629 | | // class VCLXComboBox |
630 | | |
631 | | typedef cppu::ImplInheritanceHelper< VCLXEdit, |
632 | | css::awt::XComboBox, |
633 | | css::awt::XItemListListener |
634 | | > VCLXComboBox_Base; |
635 | | class VCLXComboBox final : public VCLXComboBox_Base |
636 | | { |
637 | | private: |
638 | | ActionListenerMultiplexer maActionListeners; |
639 | | ItemListenerMultiplexer maItemListeners; |
640 | | |
641 | | void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
642 | | |
643 | | public: |
644 | | VCLXComboBox(); |
645 | | virtual ~VCLXComboBox() override; |
646 | | |
647 | | // css::lang::XComponent |
648 | | void SAL_CALL dispose( ) override; |
649 | | |
650 | | // css::awt::XComboBox |
651 | | void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override; |
652 | | void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override; |
653 | | void SAL_CALL addActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
654 | | void SAL_CALL removeActionListener( const css::uno::Reference< css::awt::XActionListener >& l ) override; |
655 | | void SAL_CALL addItem( const OUString& aItem, sal_Int16 nPos ) override; |
656 | | void SAL_CALL addItems( const css::uno::Sequence< OUString >& aItems, sal_Int16 nPos ) override; |
657 | | void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) override; |
658 | | sal_Int16 SAL_CALL getItemCount( ) override; |
659 | | OUString SAL_CALL getItem( sal_Int16 nPos ) override; |
660 | | css::uno::Sequence< OUString > SAL_CALL getItems( ) override; |
661 | | sal_Int16 SAL_CALL getDropDownLineCount( ) override; |
662 | | void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) override; |
663 | | |
664 | | // css::awt::XLayoutConstrains |
665 | | css::awt::Size SAL_CALL getMinimumSize( ) override; |
666 | | css::awt::Size SAL_CALL getPreferredSize( ) override; |
667 | | css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& rNewSize ) override; |
668 | | |
669 | | // css::awt::XTextLayoutConstrains |
670 | | css::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) override; |
671 | | void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) override; |
672 | | |
673 | | // css::awt::VclWindowPeer |
674 | | void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; |
675 | | css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; |
676 | | |
677 | | // XItemListListener |
678 | | virtual void SAL_CALL listItemInserted( const css::awt::ItemListEvent& Event ) override; |
679 | | virtual void SAL_CALL listItemRemoved( const css::awt::ItemListEvent& Event ) override; |
680 | | virtual void SAL_CALL listItemModified( const css::awt::ItemListEvent& Event ) override; |
681 | | virtual void SAL_CALL allItemsRemoved( const css::lang::EventObject& Event ) override; |
682 | | virtual void SAL_CALL itemListChanged( const css::lang::EventObject& Event ) override; |
683 | | // XEventListener |
684 | | virtual void SAL_CALL disposing( const css::lang::EventObject& i_rEvent ) override; |
685 | | |
686 | | static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); |
687 | 0 | virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } |
688 | | }; |
689 | | |
690 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |