Avoid potential negative array index access to cached text.
[LibreOffice.git] / toolkit / inc / awt / vclxwindows.hxx
blob22367ddcc08be8f33ea2985cb7cc43e92c53b84a
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/XTimeField.hpp>
32 #include <com/sun/star/awt/grid/XGridControl.hpp>
33 #include <com/sun/star/awt/grid/XGridRowSelection.hpp>
34 #include <com/sun/star/awt/grid/XGridDataListener.hpp>
35 #include <com/sun/star/awt/grid/GridDataEvent.hpp>
36 #include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
37 #include <com/sun/star/container/XContainerListener.hpp>
38 #include <com/sun/star/util/Time.hpp>
39 #include <com/sun/star/util/Date.hpp>
41 #include <cppuhelper/implbase.hxx>
43 #include <awt/vclxtopwindow.hxx>
44 #include <toolkit/awt/vclxwindows.hxx>
46 class FormatterBase;
47 class TabControl;
48 class TabPage;
49 class Edit;
51 // class VCLXImageControl
52 class VCLXImageControl final : public VCLXGraphicControl
54 public:
55 VCLXImageControl();
56 virtual ~VCLXImageControl() override;
58 // css::awt::XLayoutConstrains
59 css::awt::Size SAL_CALL getMinimumSize( ) override;
60 css::awt::Size SAL_CALL getPreferredSize( ) override;
61 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& rNewSize ) override;
63 // css::awt::VclWindowPeer
64 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
65 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
67 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
68 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
70 private:
71 virtual void ImplSetNewImage() override;
74 // class VCLXMessageBox
75 class VCLXMessageBox final :
76 public cppu::ImplInheritanceHelper<VCLXTopWindow, css::awt::XMessageBox>
78 public:
79 VCLXMessageBox();
80 virtual ~VCLXMessageBox() override;
83 // css::awt::XMessageBox
84 void SAL_CALL setCaptionText( const OUString& aText ) override;
85 OUString SAL_CALL getCaptionText( ) override;
86 void SAL_CALL setMessageText( const OUString& aText ) override;
87 OUString SAL_CALL getMessageText( ) override;
88 sal_Int16 SAL_CALL execute( ) override;
90 // css::awt::XLayoutConstrains
91 css::awt::Size SAL_CALL getMinimumSize() override;
93 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override;
96 // class VCLXFrame
97 class VCLXFrame final : public VCLXContainer
99 void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
101 public:
102 VCLXFrame();
103 virtual ~VCLXFrame() override;
105 // css::awt::XView
106 void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override;
108 // css::awt::XVclWindowPeer
109 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
111 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
112 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
115 // class VCLXDialog
116 class VCLXDialog final : public cppu::ImplInheritanceHelper<VCLXTopWindow, css::awt::XDialog2>
118 public:
119 VCLXDialog();
120 virtual ~VCLXDialog() override;
122 // css::awt::XDialog2
123 virtual void SAL_CALL endDialog( ::sal_Int32 Result ) override;
124 virtual void SAL_CALL setHelpId( const OUString& Id ) override;
126 // css::awt::XDialog
127 void SAL_CALL setTitle( const OUString& Title ) override;
128 OUString SAL_CALL getTitle( ) override;
129 sal_Int16 SAL_CALL execute( ) override;
130 void SAL_CALL endExecute( ) override;
132 // css::awt::XView
133 void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override;
135 // css::awt::XDevice,
136 css::awt::DeviceInfo SAL_CALL getInfo() override;
138 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override;
140 // css::awt::XVclWindowPeer
141 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
145 // class VCLXTabPage
146 class VCLXTabPage final : public VCLXContainer
148 public:
149 VCLXTabPage();
150 virtual ~VCLXTabPage() override;
152 // css::awt::XView
153 void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override;
155 // css::awt::XVclWindowPeer
156 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
158 /// @throws css::uno::RuntimeException
159 TabPage* getTabPage() const;
160 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
161 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
164 class VCLXMultiPage final :
165 public cppu::ImplInheritanceHelper<VCLXContainer, css::awt::XSimpleTabController>
167 TabListenerMultiplexer maTabListeners;
168 sal_Int32 mTabId;
170 void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
171 public:
172 VCLXMultiPage();
173 virtual ~VCLXMultiPage() override;
175 // css::lang::XComponent
176 void SAL_CALL dispose( ) override;
178 // css::awt::XView
179 void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override;
181 // css::awt::XVclWindowPeer
182 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
183 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
184 // XSimpleTabController
185 virtual ::sal_Int32 SAL_CALL insertTab() override;
186 virtual void SAL_CALL removeTab( ::sal_Int32 ID ) override;
188 virtual void SAL_CALL setTabProps( ::sal_Int32 ID, const css::uno::Sequence< css::beans::NamedValue >& Properties ) override;
189 virtual css::uno::Sequence< css::beans::NamedValue > SAL_CALL getTabProps( ::sal_Int32 ID ) override;
191 virtual void SAL_CALL activateTab( ::sal_Int32 ID ) override;
192 virtual ::sal_Int32 SAL_CALL getActiveTabID() override;
194 virtual void SAL_CALL addTabListener( const css::uno::Reference< css::awt::XTabListener >& Listener ) override;
195 virtual void SAL_CALL removeTabListener( const css::uno::Reference< css::awt::XTabListener >& Listener ) override;
196 // C++
197 /// @throws css::uno::RuntimeException
198 TabControl* getTabControl() const;
199 sal_uInt16 insertTab( TabPage*, OUString const & sTitle );
200 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
201 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
204 // class VCLXProgressBar
205 class VCLXProgressBar final : public cppu::ImplInheritanceHelper<VCLXWindow, css::awt::XProgressBar>
207 private:
208 sal_Int32 m_nValue;
209 sal_Int32 m_nValueMin;
210 sal_Int32 m_nValueMax;
212 void ImplUpdateValue();
214 public:
215 VCLXProgressBar();
216 virtual ~VCLXProgressBar() override;
218 // css::awt::XProgressBar
219 void SAL_CALL setForegroundColor( sal_Int32 nColor ) override;
220 void SAL_CALL setBackgroundColor( sal_Int32 nColor ) override;
221 void SAL_CALL setValue( sal_Int32 nValue ) override;
222 void SAL_CALL setRange( sal_Int32 nMin, sal_Int32 nMax ) override;
223 sal_Int32 SAL_CALL getValue() override;
225 // css::awt::VclWindowPeer
226 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
227 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
229 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
230 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
234 // class VCLXFormattedSpinField
235 class VCLXFormattedSpinField : public VCLXSpinField
237 private:
238 FormatterBase* mpFormatter;
240 protected:
241 FormatterBase* GetFormatter() const { return GetWindow() ? mpFormatter : nullptr; }
243 public:
244 VCLXFormattedSpinField();
245 virtual ~VCLXFormattedSpinField() override;
247 void SetFormatter( FormatterBase* pFormatter ) { mpFormatter = pFormatter; }
249 void setStrictFormat( bool bStrict );
250 bool isStrictFormat() const;
252 // css::awt::VclWindowPeer
253 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
254 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
256 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
257 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
261 // class VCLXDateField
263 class VCLXDateField :
264 public cppu::ImplInheritanceHelper<VCLXFormattedSpinField, css::awt::XDateField>
266 protected:
267 virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override;
268 public:
269 VCLXDateField();
270 virtual ~VCLXDateField() override;
273 // css::awt::XDateField
274 void SAL_CALL setDate( const css::util::Date& Date ) override;
275 css::util::Date SAL_CALL getDate( ) override;
276 void SAL_CALL setMin( const css::util::Date& Date ) override;
277 css::util::Date SAL_CALL getMin( ) override;
278 void SAL_CALL setMax( const css::util::Date& Date ) override;
279 css::util::Date SAL_CALL getMax( ) override;
280 void SAL_CALL setFirst( const css::util::Date& Date ) override;
281 css::util::Date SAL_CALL getFirst( ) override;
282 void SAL_CALL setLast( const css::util::Date& Date ) override;
283 css::util::Date SAL_CALL getLast( ) override;
284 void SAL_CALL setLongFormat( sal_Bool bLong ) override;
285 sal_Bool SAL_CALL isLongFormat( ) override;
286 void SAL_CALL setEmpty( ) override;
287 sal_Bool SAL_CALL isEmpty( ) override;
288 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
289 sal_Bool SAL_CALL isStrictFormat( ) override;
291 // css::awt::VclWindowPeer
292 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
293 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
295 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
296 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
300 // class VCLXTimeField
302 class VCLXTimeField final :
303 public cppu::ImplInheritanceHelper<VCLXFormattedSpinField, css::awt::XTimeField>
305 virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override;
306 public:
307 VCLXTimeField();
308 virtual ~VCLXTimeField() override;
310 // css::awt::XTimeField
311 void SAL_CALL setTime( const css::util::Time& Time ) override;
312 css::util::Time SAL_CALL getTime( ) override;
313 void SAL_CALL setMin( const css::util::Time& Time ) override;
314 css::util::Time SAL_CALL getMin( ) override;
315 void SAL_CALL setMax( const css::util::Time& Time ) override;
316 css::util::Time SAL_CALL getMax( ) override;
317 void SAL_CALL setFirst( const css::util::Time& Time ) override;
318 css::util::Time SAL_CALL getFirst( ) override;
319 void SAL_CALL setLast( const css::util::Time& Time ) override;
320 css::util::Time SAL_CALL getLast( ) override;
321 void SAL_CALL setEmpty( ) override;
322 sal_Bool SAL_CALL isEmpty( ) override;
323 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
324 sal_Bool SAL_CALL isStrictFormat( ) override;
326 // css::awt::VclWindowPeer
327 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
328 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
330 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
331 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
335 // class VCLXNumericField
337 class VCLXNumericField final :
338 public cppu::ImplInheritanceHelper<VCLXFormattedSpinField, css::awt::XNumericField>
340 public:
341 VCLXNumericField();
342 virtual ~VCLXNumericField() override;
344 // css::awt::XNumericField
345 void SAL_CALL setValue( double Value ) override;
346 double SAL_CALL getValue( ) override;
347 void SAL_CALL setMin( double Value ) override;
348 double SAL_CALL getMin( ) override;
349 void SAL_CALL setMax( double Value ) override;
350 double SAL_CALL getMax( ) override;
351 void SAL_CALL setFirst( double Value ) override;
352 double SAL_CALL getFirst( ) override;
353 void SAL_CALL setLast( double Value ) override;
354 double SAL_CALL getLast( ) override;
355 void SAL_CALL setSpinSize( double Value ) override;
356 double SAL_CALL getSpinSize( ) override;
357 void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) override;
358 sal_Int16 SAL_CALL getDecimalDigits( ) override;
359 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
360 sal_Bool SAL_CALL isStrictFormat( ) override;
362 // css::awt::VclWindowPeer
363 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
364 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
366 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
367 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
371 // class VCLXMetricField
373 class MetricFormatter;
374 class MetricField;
375 class VCLXMetricField final :
376 public cppu::ImplInheritanceHelper<VCLXFormattedSpinField, css::awt::XMetricField>
378 /// @throws css::uno::RuntimeException
379 MetricFormatter *GetMetricFormatter();
380 /// @throws css::uno::RuntimeException
381 MetricField *GetMetricField();
382 void CallListeners();
383 public:
384 VCLXMetricField();
385 virtual ~VCLXMetricField() override;
387 // css::awt::XMetricField
388 virtual void SAL_CALL setValue( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
389 virtual void SAL_CALL setUserValue( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
390 virtual ::sal_Int64 SAL_CALL getValue( ::sal_Int16 Unit ) override;
391 virtual ::sal_Int64 SAL_CALL getCorrectedValue( ::sal_Int16 Unit ) override;
392 virtual void SAL_CALL setMin( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
393 virtual ::sal_Int64 SAL_CALL getMin( ::sal_Int16 Unit ) override;
394 virtual void SAL_CALL setMax( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
395 virtual ::sal_Int64 SAL_CALL getMax( ::sal_Int16 Unit ) override;
396 virtual void SAL_CALL setFirst( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
397 virtual ::sal_Int64 SAL_CALL getFirst( ::sal_Int16 Unit ) override;
398 virtual void SAL_CALL setLast( ::sal_Int64 Value, ::sal_Int16 Unit ) override;
399 virtual ::sal_Int64 SAL_CALL getLast( ::sal_Int16 Unit ) override;
400 virtual void SAL_CALL setSpinSize( ::sal_Int64 Value ) override;
401 virtual ::sal_Int64 SAL_CALL getSpinSize( ) override;
402 virtual void SAL_CALL setDecimalDigits( ::sal_Int16 nDigits ) override;
403 virtual ::sal_Int16 SAL_CALL getDecimalDigits( ) override;
404 virtual void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
405 virtual sal_Bool SAL_CALL isStrictFormat( ) override;
407 // css::awt::VclWindowPeer
408 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
409 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
411 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
412 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
415 // class VCLXPatternField
416 class VCLXPatternField final :
417 public cppu::ImplInheritanceHelper<VCLXFormattedSpinField, css::awt::XPatternField>
419 public:
420 VCLXPatternField();
421 virtual ~VCLXPatternField() override;
424 // css::awt::XPatternField
425 void SAL_CALL setMasks( const OUString& EditMask, const OUString& LiteralMask ) override;
426 void SAL_CALL getMasks( OUString& EditMask, OUString& LiteralMask ) override;
427 void SAL_CALL setString( const OUString& Str ) override;
428 OUString SAL_CALL getString( ) override;
429 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
430 sal_Bool SAL_CALL isStrictFormat( ) override;
432 // css::awt::VclWindowPeer
433 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
434 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
436 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
437 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
441 class VCLXFileControl final : public cppu::ImplInheritanceHelper<VCLXWindow, css::awt::XTextComponent, css::awt::XTextLayoutConstrains>
443 DECL_LINK(ModifyHdl, Edit&, void);
444 void ModifyHdl();
445 TextListenerMultiplexer maTextListeners;
447 public:
448 VCLXFileControl();
449 virtual ~VCLXFileControl() override;
451 virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ) override;
453 // css::awt::XTextComponent
454 void SAL_CALL addTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override;
455 void SAL_CALL removeTextListener( const css::uno::Reference< css::awt::XTextListener >& l ) override;
456 void SAL_CALL setText( const OUString& aText ) override;
457 void SAL_CALL insertText( const css::awt::Selection& Sel, const OUString& Text ) override;
458 OUString SAL_CALL getText( ) override;
459 OUString SAL_CALL getSelectedText( ) override;
460 void SAL_CALL setSelection( const css::awt::Selection& aSelection ) override;
461 css::awt::Selection SAL_CALL getSelection( ) override;
462 sal_Bool SAL_CALL isEditable( ) override;
463 void SAL_CALL setEditable( sal_Bool bEditable ) override;
464 void SAL_CALL setMaxTextLen( sal_Int16 nLen ) override;
465 sal_Int16 SAL_CALL getMaxTextLen( ) override;
467 // css::awt::XLayoutConstrains
468 css::awt::Size SAL_CALL getMinimumSize( ) override;
469 css::awt::Size SAL_CALL getPreferredSize( ) override;
470 css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
472 // css::awt::XTextLayoutConstrains
473 css::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) override;
474 void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) override;
476 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value) override;
478 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
479 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
482 class SVTXCurrencyField final :
483 public cppu::ImplInheritanceHelper<SVTXFormattedField, css::awt::XCurrencyField>
485 public:
486 SVTXCurrencyField();
487 virtual ~SVTXCurrencyField() override;
489 // css::awt::XVclWindowPeer
490 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
491 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
493 // css::awt::XCurrencyField
494 void SAL_CALL setValue( double Value ) override;
495 double SAL_CALL getValue( ) override;
496 void SAL_CALL setMin( double Value ) override;
497 double SAL_CALL getMin( ) override;
498 void SAL_CALL setMax( double Value ) override;
499 double SAL_CALL getMax( ) override;
500 void SAL_CALL setFirst( double Value ) override;
501 double SAL_CALL getFirst( ) override;
502 void SAL_CALL setLast( double Value ) override;
503 double SAL_CALL getLast( ) override;
504 void SAL_CALL setSpinSize( double Value ) override;
505 double SAL_CALL getSpinSize( ) override;
506 void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) override;
507 sal_Int16 SAL_CALL getDecimalDigits( ) override;
508 void SAL_CALL setStrictFormat( sal_Bool bStrict ) override;
509 sal_Bool SAL_CALL isStrictFormat( ) override;
511 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
512 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
516 class SVTXDateField final : public VCLXDateField
518 public:
519 SVTXDateField();
520 virtual ~SVTXDateField() override;
522 // css::awt::VclWindowPeer
523 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
525 static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
526 virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
529 namespace svt::table {
530 class TableControl;
531 class UnoControlTableModel;
534 typedef ::cppu::ImplInheritanceHelper < VCLXWindow
535 , css::awt::grid::XGridControl
536 , css::awt::grid::XGridRowSelection
537 , css::awt::grid::XGridDataListener
538 , css::container::XContainerListener
539 > SVTXGridControl_Base;
540 class SVTXGridControl final : public SVTXGridControl_Base
542 public:
543 SVTXGridControl();
544 virtual ~SVTXGridControl() override;
546 // XGridDataListener
547 virtual void SAL_CALL rowsInserted( const css::awt::grid::GridDataEvent& Event ) override;
548 virtual void SAL_CALL rowsRemoved( const css::awt::grid::GridDataEvent& Event ) override;
549 virtual void SAL_CALL dataChanged( const css::awt::grid::GridDataEvent& Event ) override;
550 virtual void SAL_CALL rowHeadingChanged( const css::awt::grid::GridDataEvent& Event ) override;
552 // XContainerListener
553 virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& Event ) override;
554 virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) override;
555 virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override;
557 // XEventListener
558 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
560 // XGridControl
561 virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) override;
562 virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) override;
563 virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) override;
564 virtual ::sal_Int32 SAL_CALL getCurrentRow( ) override;
565 virtual void SAL_CALL goToCell( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) override;
567 // XGridRowSelection
568 virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) override;
569 virtual void SAL_CALL selectAllRows() override;
570 virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) override;
571 virtual void SAL_CALL deselectAllRows() override;
572 virtual css::uno::Sequence< ::sal_Int32 > SAL_CALL getSelectedRows() override;
573 virtual sal_Bool SAL_CALL hasSelectedRows() override;
574 virtual sal_Bool SAL_CALL isRowSelected(::sal_Int32 index) override;
575 virtual void SAL_CALL addSelectionListener(const css::uno::Reference< css::awt::grid::XGridSelectionListener > & listener) override;
576 virtual void SAL_CALL removeSelectionListener(const css::uno::Reference< css::awt::grid::XGridSelectionListener > & listener) override;
578 void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
579 css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
581 // css::lang::XComponent
582 void SAL_CALL dispose( ) override;
584 // XWindow
585 void SAL_CALL setEnable( sal_Bool bEnable ) override;
587 private:
588 // VCLXWindow
589 virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ) override;
591 void impl_updateColumnsFromModel_nothrow();
592 void impl_checkTableModelInit();
594 void impl_checkColumnIndex_throw( ::svt::table::TableControl const & i_table, sal_Int32 const i_columnIndex ) const;
595 void impl_checkRowIndex_throw( ::svt::table::TableControl const & i_table, sal_Int32 const i_rowIndex ) const;
597 virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
598 void ImplCallItemListeners();
600 std::shared_ptr< ::svt::table::UnoControlTableModel > m_xTableModel;
601 bool m_bTableModelInitCompleted;
602 SelectionListenerMultiplexer m_aSelectionListeners;
605 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */