Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / toolkit / inc / awt / vclxwindows.hxx
blobce96248494ea104f0b56f1619593fa65ecc79796
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <com/sun/star/awt/XCurrencyField.hpp>
23 #include <com/sun/star/awt/XDateField.hpp>
24 #include <com/sun/star/awt/XDialog2.hpp>
25 #include <com/sun/star/awt/XMessageBox.hpp>
26 #include <com/sun/star/awt/XMetricField.hpp>
27 #include <com/sun/star/awt/XNumericField.hpp>
28 #include <com/sun/star/awt/XPatternField.hpp>
29 #include <com/sun/star/awt/XProgressBar.hpp>
30 #include <com/sun/star/awt/XSimpleTabController.hpp>
31 #include <com/sun/star/awt/XTextArea.hpp>
32 #include <com/sun/star/awt/XTimeField.hpp>
33 #include <com/sun/star/awt/grid/XGridControl.hpp>
34 #include <com/sun/star/awt/grid/XGridRowSelection.hpp>
35 #include <com/sun/star/awt/grid/XGridDataListener.hpp>
36 #include <com/sun/star/awt/grid/GridDataEvent.hpp>
37 #include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
38 #include <com/sun/star/container/XContainerListener.hpp>
39 #include <com/sun/star/util/Time.hpp>
40 #include <com/sun/star/util/Date.hpp>
42 #include <cppuhelper/implbase.hxx>
43 #include <tools/lineend.hxx>
45 #include <awt/vclxtopwindow.hxx>
46 #include <toolkit/awt/vclxwindows.hxx>
48 class FormatterBase;
49 class TabControl;
50 class TabPage;
51 class Edit;
53 // class VCLXImageControl
54 class VCLXImageControl final : public VCLXGraphicControl
56 public:
57 VCLXImageControl();
58 virtual ~VCLXImageControl() override;
60 // css::awt::XLayoutConstrains
61 css::awt::Size SAL_CALL getMinimumSize( ) override;
62 css::awt::Size SAL_CALL getPreferredSize( ) override;
63 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& rNewSize ) override;
65 // css::awt::VclWindowPeer
66 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
67 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
69 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
70 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
72 private:
73 virtual void ImplSetNewImage() override;
76 // class VCLXMessageBox
77 class VCLXMessageBox final :
78 public cppu::ImplInheritanceHelper<VCLXTopWindow, css::awt::XMessageBox>
80 public:
81 VCLXMessageBox();
82 virtual ~VCLXMessageBox() override;
85 // css::awt::XMessageBox
86 void SAL_CALL setCaptionText( const OUString& aText ) override;
87 OUString SAL_CALL getCaptionText( ) override;
88 void SAL_CALL setMessageText( const OUString& aText ) override;
89 OUString SAL_CALL getMessageText( ) override;
90 sal_Int16 SAL_CALL execute( ) override;
92 // css::awt::XLayoutConstrains
93 css::awt::Size SAL_CALL getMinimumSize() override;
95 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override;
98 // class VCLXFrame
99 class VCLXFrame final : public VCLXContainer
101 void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
103 public:
104 VCLXFrame();
105 virtual ~VCLXFrame() override;
107 // css::awt::XView
108 void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override;
110 // css::awt::XVclWindowPeer
111 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
113 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
114 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
117 // class VCLXDialog
118 class VCLXDialog final : public cppu::ImplInheritanceHelper<VCLXTopWindow, css::awt::XDialog2>
120 public:
121 VCLXDialog();
122 virtual ~VCLXDialog() override;
124 // css::awt::XDialog2
125 virtual void SAL_CALL endDialog( ::sal_Int32 Result ) override;
126 virtual void SAL_CALL setHelpId( const OUString& Id ) override;
128 // css::awt::XDialog
129 void SAL_CALL setTitle( const OUString& Title ) override;
130 OUString SAL_CALL getTitle( ) override;
131 sal_Int16 SAL_CALL execute( ) override;
132 void SAL_CALL endExecute( ) override;
134 // css::awt::XView
135 void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override;
137 // css::awt::XDevice,
138 css::awt::DeviceInfo SAL_CALL getInfo() override;
140 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override;
142 // css::awt::XVclWindowPeer
143 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
147 // class VCLXTabPage
148 class VCLXTabPage final : public VCLXContainer
150 public:
151 VCLXTabPage();
152 virtual ~VCLXTabPage() override;
154 // css::awt::XView
155 void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override;
157 // css::awt::XVclWindowPeer
158 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
160 /// @throws css::uno::RuntimeException
161 TabPage* getTabPage() const;
162 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
163 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
166 class VCLXMultiPage final :
167 public cppu::ImplInheritanceHelper<VCLXContainer, css::awt::XSimpleTabController>
169 TabListenerMultiplexer maTabListeners;
170 sal_Int32 mTabId;
172 void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
173 public:
174 VCLXMultiPage();
175 virtual ~VCLXMultiPage() override;
177 // css::lang::XComponent
178 void SAL_CALL dispose( ) override;
180 // css::awt::XView
181 void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override;
183 // css::awt::XVclWindowPeer
184 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
185 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
186 // XSimpleTabController
187 virtual ::sal_Int32 SAL_CALL insertTab() override;
188 virtual void SAL_CALL removeTab( ::sal_Int32 ID ) override;
190 virtual void SAL_CALL setTabProps( ::sal_Int32 ID, const css::uno::Sequence< css::beans::NamedValue >& Properties ) override;
191 virtual css::uno::Sequence< css::beans::NamedValue > SAL_CALL getTabProps( ::sal_Int32 ID ) override;
193 virtual void SAL_CALL activateTab( ::sal_Int32 ID ) override;
194 virtual ::sal_Int32 SAL_CALL getActiveTabID() override;
196 virtual void SAL_CALL addTabListener( const css::uno::Reference< css::awt::XTabListener >& Listener ) override;
197 virtual void SAL_CALL removeTabListener( const css::uno::Reference< css::awt::XTabListener >& Listener ) override;
198 // C++
199 /// @throws css::uno::RuntimeException
200 TabControl* getTabControl() const;
201 sal_uInt16 insertTab( TabPage*, OUString const & sTitle );
202 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
203 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
206 class VCLXMultiLineEdit final : public cppu::ImplInheritanceHelper<
207 VCLXWindow,
208 css::awt::XTextComponent,
209 css::awt::XTextArea,
210 css::awt::XTextLayoutConstrains>
212 private:
213 TextListenerMultiplexer maTextListeners;
214 LineEnd meLineEndType;
216 void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
218 public:
219 VCLXMultiLineEdit();
220 virtual ~VCLXMultiLineEdit() override;
222 // css::awt::XTextComponent
223 void SAL_CALL addTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override;
224 void SAL_CALL removeTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override;
225 void SAL_CALL setText( const OUString& aText ) override;
226 void SAL_CALL insertText( const css::awt::Selection& Sel, const OUString& Text ) override;
227 OUString SAL_CALL getText( ) override;
228 OUString SAL_CALL getSelectedText( ) override;
229 void SAL_CALL setSelection( const css::awt::Selection& aSelection ) override;
230 css::awt::Selection SAL_CALL getSelection( ) override;
231 sal_Bool SAL_CALL isEditable( ) override;
232 void SAL_CALL setEditable( sal_Bool bEditable ) override;
233 void SAL_CALL setMaxTextLen( sal_Int16 nLen ) override;
234 sal_Int16 SAL_CALL getMaxTextLen( ) override;
236 //XTextArea
237 OUString SAL_CALL getTextLines( ) override;
239 // css::awt::XLayoutConstrains
240 css::awt::Size SAL_CALL getMinimumSize( ) override;
241 css::awt::Size SAL_CALL getPreferredSize( ) override;
242 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
244 // css::awt::XTextLayoutConstrains
245 css::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) override;
246 void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) override;
248 // css::awt::XVclWindowPeer
249 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
250 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
252 // css::awt::XWindow
253 void SAL_CALL setFocus( ) override;
255 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
256 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
259 // class VCLXProgressBar
260 class VCLXProgressBar final : public cppu::ImplInheritanceHelper<VCLXWindow, css::awt::XProgressBar>
262 private:
263 sal_Int32 m_nValue;
264 sal_Int32 m_nValueMin;
265 sal_Int32 m_nValueMax;
267 void ImplUpdateValue();
269 public:
270 VCLXProgressBar();
271 virtual ~VCLXProgressBar() override;
273 // css::awt::XProgressBar
274 void SAL_CALL setForegroundColor( sal_Int32 nColor ) override;
275 void SAL_CALL setBackgroundColor( sal_Int32 nColor ) override;
276 void SAL_CALL setValue( sal_Int32 nValue ) override;
277 void SAL_CALL setRange( sal_Int32 nMin, sal_Int32 nMax ) override;
278 sal_Int32 SAL_CALL getValue() override;
280 // css::awt::VclWindowPeer
281 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
282 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
284 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
285 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
289 // class VCLXFormattedSpinField
290 class VCLXFormattedSpinField : public VCLXSpinField
292 private:
293 FormatterBase* mpFormatter;
295 protected:
296 FormatterBase* GetFormatter() const { return GetWindow() ? mpFormatter : nullptr; }
298 public:
299 VCLXFormattedSpinField();
300 virtual ~VCLXFormattedSpinField() override;
302 void SetFormatter( FormatterBase* pFormatter ) { mpFormatter = pFormatter; }
304 void setStrictFormat( bool bStrict );
305 bool isStrictFormat() const;
307 // css::awt::VclWindowPeer
308 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
309 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
311 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
312 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
316 // class VCLXDateField
318 class VCLXDateField :
319 public cppu::ImplInheritanceHelper<VCLXFormattedSpinField, css::awt::XDateField>
321 protected:
322 virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override;
323 public:
324 VCLXDateField();
325 virtual ~VCLXDateField() override;
328 // css::awt::XDateField
329 void SAL_CALL setDate( const css::util::Date& Date ) override;
330 css::util::Date SAL_CALL getDate( ) override;
331 void SAL_CALL setMin( const css::util::Date& Date ) override;
332 css::util::Date SAL_CALL getMin( ) override;
333 void SAL_CALL setMax( const css::util::Date& Date ) override;
334 css::util::Date SAL_CALL getMax( ) override;
335 void SAL_CALL setFirst( const css::util::Date& Date ) override;
336 css::util::Date SAL_CALL getFirst( ) override;
337 void SAL_CALL setLast( const css::util::Date& Date ) override;
338 css::util::Date SAL_CALL getLast( ) override;
339 void SAL_CALL setLongFormat( sal_Bool bLong ) override;
340 sal_Bool SAL_CALL isLongFormat( ) override;
341 void SAL_CALL setEmpty( ) override;
342 sal_Bool SAL_CALL isEmpty( ) override;
343 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
344 sal_Bool SAL_CALL isStrictFormat( ) override;
346 // css::awt::VclWindowPeer
347 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
348 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
350 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
351 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
355 // class VCLXTimeField
357 class VCLXTimeField final :
358 public cppu::ImplInheritanceHelper<VCLXFormattedSpinField, css::awt::XTimeField>
360 virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override;
361 public:
362 VCLXTimeField();
363 virtual ~VCLXTimeField() override;
365 // css::awt::XTimeField
366 void SAL_CALL setTime( const css::util::Time& Time ) override;
367 css::util::Time SAL_CALL getTime( ) override;
368 void SAL_CALL setMin( const css::util::Time& Time ) override;
369 css::util::Time SAL_CALL getMin( ) override;
370 void SAL_CALL setMax( const css::util::Time& Time ) override;
371 css::util::Time SAL_CALL getMax( ) override;
372 void SAL_CALL setFirst( const css::util::Time& Time ) override;
373 css::util::Time SAL_CALL getFirst( ) override;
374 void SAL_CALL setLast( const css::util::Time& Time ) override;
375 css::util::Time SAL_CALL getLast( ) override;
376 void SAL_CALL setEmpty( ) override;
377 sal_Bool SAL_CALL isEmpty( ) override;
378 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
379 sal_Bool SAL_CALL isStrictFormat( ) override;
381 // css::awt::VclWindowPeer
382 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
383 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
385 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
386 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
390 // class VCLXNumericField
392 class VCLXNumericField final :
393 public cppu::ImplInheritanceHelper<VCLXFormattedSpinField, css::awt::XNumericField>
395 public:
396 VCLXNumericField();
397 virtual ~VCLXNumericField() override;
399 // css::awt::XNumericField
400 void SAL_CALL setValue( double Value ) override;
401 double SAL_CALL getValue( ) override;
402 void SAL_CALL setMin( double Value ) override;
403 double SAL_CALL getMin( ) override;
404 void SAL_CALL setMax( double Value ) override;
405 double SAL_CALL getMax( ) override;
406 void SAL_CALL setFirst( double Value ) override;
407 double SAL_CALL getFirst( ) override;
408 void SAL_CALL setLast( double Value ) override;
409 double SAL_CALL getLast( ) override;
410 void SAL_CALL setSpinSize( double Value ) override;
411 double SAL_CALL getSpinSize( ) override;
412 void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) override;
413 sal_Int16 SAL_CALL getDecimalDigits( ) override;
414 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
415 sal_Bool SAL_CALL isStrictFormat( ) override;
417 // css::awt::VclWindowPeer
418 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
419 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
421 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
422 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
426 // class VCLXMetricField
428 class MetricFormatter;
429 class MetricField;
430 class VCLXMetricField final :
431 public cppu::ImplInheritanceHelper<VCLXFormattedSpinField, css::awt::XMetricField>
433 /// @throws css::uno::RuntimeException
434 MetricFormatter *GetMetricFormatter();
435 /// @throws css::uno::RuntimeException
436 MetricField *GetMetricField();
437 void CallListeners();
438 public:
439 VCLXMetricField();
440 virtual ~VCLXMetricField() override;
442 // css::awt::XMetricField
443 virtual void SAL_CALL setValue( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
444 virtual void SAL_CALL setUserValue( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
445 virtual ::sal_Int64 SAL_CALL getValue( ::sal_Int16 Unit ) override;
446 virtual ::sal_Int64 SAL_CALL getCorrectedValue( ::sal_Int16 Unit ) override;
447 virtual void SAL_CALL setMin( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
448 virtual ::sal_Int64 SAL_CALL getMin( ::sal_Int16 Unit ) override;
449 virtual void SAL_CALL setMax( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
450 virtual ::sal_Int64 SAL_CALL getMax( ::sal_Int16 Unit ) override;
451 virtual void SAL_CALL setFirst( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
452 virtual ::sal_Int64 SAL_CALL getFirst( ::sal_Int16 Unit ) override;
453 virtual void SAL_CALL setLast( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
454 virtual ::sal_Int64 SAL_CALL getLast( ::sal_Int16 Unit ) override;
455 virtual void SAL_CALL setSpinSize( ::sal_Int64 Value ) override;
456 virtual ::sal_Int64 SAL_CALL getSpinSize( ) override;
457 virtual void SAL_CALL setDecimalDigits( ::sal_Int16 nDigits ) override;
458 virtual ::sal_Int16 SAL_CALL getDecimalDigits( ) override;
459 virtual void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
460 virtual sal_Bool SAL_CALL isStrictFormat( ) override;
462 // css::awt::VclWindowPeer
463 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
464 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
466 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
467 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
470 // class VCLXPatternField
471 class VCLXPatternField final :
472 public cppu::ImplInheritanceHelper<VCLXFormattedSpinField, css::awt::XPatternField>
474 public:
475 VCLXPatternField();
476 virtual ~VCLXPatternField() override;
479 // css::awt::XPatternField
480 void SAL_CALL setMasks( const OUString& EditMask, const OUString& LiteralMask ) override;
481 void SAL_CALL getMasks( OUString& EditMask, OUString& LiteralMask ) override;
482 void SAL_CALL setString( const OUString& Str ) override;
483 OUString SAL_CALL getString( ) override;
484 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
485 sal_Bool SAL_CALL isStrictFormat( ) override;
487 // css::awt::VclWindowPeer
488 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
489 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
491 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
492 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
496 class VCLXFileControl final : public cppu::ImplInheritanceHelper<VCLXWindow, css::awt::XTextComponent, css::awt::XTextLayoutConstrains>
498 DECL_LINK(ModifyHdl, Edit&, void);
499 void ModifyHdl();
500 TextListenerMultiplexer maTextListeners;
502 public:
503 VCLXFileControl();
504 virtual ~VCLXFileControl() override;
506 virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ) override;
508 // css::awt::XTextComponent
509 void SAL_CALL addTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override;
510 void SAL_CALL removeTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override;
511 void SAL_CALL setText( const OUString& aText ) override;
512 void SAL_CALL insertText( const css::awt::Selection& Sel, const OUString& Text ) override;
513 OUString SAL_CALL getText( ) override;
514 OUString SAL_CALL getSelectedText( ) override;
515 void SAL_CALL setSelection( const css::awt::Selection& aSelection ) override;
516 css::awt::Selection SAL_CALL getSelection( ) override;
517 sal_Bool SAL_CALL isEditable( ) override;
518 void SAL_CALL setEditable( sal_Bool bEditable ) override;
519 void SAL_CALL setMaxTextLen( sal_Int16 nLen ) override;
520 sal_Int16 SAL_CALL getMaxTextLen( ) override;
522 // css::awt::XLayoutConstrains
523 css::awt::Size SAL_CALL getMinimumSize( ) override;
524 css::awt::Size SAL_CALL getPreferredSize( ) override;
525 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
527 // css::awt::XTextLayoutConstrains
528 css::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) override;
529 void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) override;
531 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value) override;
533 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
534 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
537 class SVTXCurrencyField final :
538 public cppu::ImplInheritanceHelper<SVTXFormattedField, css::awt::XCurrencyField>
540 public:
541 SVTXCurrencyField();
542 virtual ~SVTXCurrencyField() override;
544 // css::awt::XVclWindowPeer
545 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
546 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
548 // css::awt::XCurrencyField
549 void SAL_CALL setValue( double Value ) override;
550 double SAL_CALL getValue( ) override;
551 void SAL_CALL setMin( double Value ) override;
552 double SAL_CALL getMin( ) override;
553 void SAL_CALL setMax( double Value ) override;
554 double SAL_CALL getMax( ) override;
555 void SAL_CALL setFirst( double Value ) override;
556 double SAL_CALL getFirst( ) override;
557 void SAL_CALL setLast( double Value ) override;
558 double SAL_CALL getLast( ) override;
559 void SAL_CALL setSpinSize( double Value ) override;
560 double SAL_CALL getSpinSize( ) override;
561 void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) override;
562 sal_Int16 SAL_CALL getDecimalDigits( ) override;
563 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
564 sal_Bool SAL_CALL isStrictFormat( ) override;
566 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
567 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
571 class SVTXDateField final : public VCLXDateField
573 public:
574 SVTXDateField();
575 virtual ~SVTXDateField() override;
577 // css::awt::VclWindowPeer
578 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
580 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
581 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
584 namespace svt::table {
585 class TableControl;
586 class UnoControlTableModel;
589 typedef ::cppu::ImplInheritanceHelper < VCLXWindow
590 , css::awt::grid::XGridControl
591 , css::awt::grid::XGridRowSelection
592 , css::awt::grid::XGridDataListener
593 , css::container::XContainerListener
594 > SVTXGridControl_Base;
595 class SVTXGridControl final : public SVTXGridControl_Base
597 public:
598 SVTXGridControl();
599 virtual ~SVTXGridControl() override;
601 // XGridDataListener
602 virtual void SAL_CALL rowsInserted( const css::awt::grid::GridDataEvent& Event ) override;
603 virtual void SAL_CALL rowsRemoved( const css::awt::grid::GridDataEvent& Event ) override;
604 virtual void SAL_CALL dataChanged( const css::awt::grid::GridDataEvent& Event ) override;
605 virtual void SAL_CALL rowHeadingChanged( const css::awt::grid::GridDataEvent& Event ) override;
607 // XContainerListener
608 virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& Event ) override;
609 virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) override;
610 virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override;
612 // XEventListener
613 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
615 // XGridControl
616 virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) override;
617 virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) override;
618 virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) override;
619 virtual ::sal_Int32 SAL_CALL getCurrentRow( ) override;
620 virtual void SAL_CALL goToCell( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) override;
622 // XGridRowSelection
623 virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) override;
624 virtual void SAL_CALL selectAllRows() override;
625 virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) override;
626 virtual void SAL_CALL deselectAllRows() override;
627 virtual css::uno::Sequence< ::sal_Int32 > SAL_CALL getSelectedRows() override;
628 virtual sal_Bool SAL_CALL hasSelectedRows() override;
629 virtual sal_Bool SAL_CALL isRowSelected(::sal_Int32 index) override;
630 virtual void SAL_CALL addSelectionListener(const css::uno::Reference< css::awt::grid::XGridSelectionListener > & listener) override;
631 virtual void SAL_CALL removeSelectionListener(const css::uno::Reference< css::awt::grid::XGridSelectionListener > & listener) override;
633 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
634 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
636 // css::lang::XComponent
637 void SAL_CALL dispose( ) override;
639 // XWindow
640 void SAL_CALL setEnable( sal_Bool bEnable ) override;
642 private:
643 // VCLXWindow
644 virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ) override;
646 void impl_updateColumnsFromModel_nothrow();
647 void impl_checkTableModelInit();
649 void impl_checkColumnIndex_throw( ::svt::table::TableControl const & i_table, sal_Int32 const i_columnIndex ) const;
650 void impl_checkRowIndex_throw( ::svt::table::TableControl const & i_table, sal_Int32 const i_rowIndex ) const;
652 virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
653 void ImplCallItemListeners();
655 std::shared_ptr< ::svt::table::UnoControlTableModel > m_xTableModel;
656 bool m_bTableModelInitCompleted;
657 SelectionListenerMultiplexer m_aSelectionListeners;
660 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */