1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_SOURCE_INC_GRIDCELL_HXX
21 #define INCLUDED_SVX_SOURCE_INC_GRIDCELL_HXX
24 #include <svx/gridctrl.hxx>
26 #include "sqlparserclient.hxx"
28 #include <com/sun/star/sdb/XColumn.hpp>
29 #include <com/sun/star/form/XBoundControl.hpp>
30 #include <com/sun/star/awt/XTextComponent.hpp>
31 #include <com/sun/star/awt/XListBox.hpp>
32 #include <com/sun/star/awt/XComboBox.hpp>
33 #include <com/sun/star/awt/TextAlign.hpp>
34 #include <com/sun/star/awt/XControlModel.hpp>
35 #include <com/sun/star/awt/XControl.hpp>
36 #include <com/sun/star/awt/XCheckBox.hpp>
37 #include <com/sun/star/awt/XButton.hpp>
38 #include <com/sun/star/form/XChangeBroadcaster.hpp>
39 #include <com/sun/star/awt/XWindow.hpp>
40 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
42 #include <comphelper/propmultiplex.hxx>
43 #include <comphelper/interfacecontainer3.hxx>
44 #include <comphelper/uno3.hxx>
45 #include <connectivity/formattedcolumnvalue.hxx>
46 #include <cppuhelper/basemutex.hxx>
47 #include <cppuhelper/component.hxx>
48 #include <cppuhelper/implbase1.hxx>
49 #include <cppuhelper/implbase2.hxx>
50 #include <comphelper/diagnose_ex.hxx>
56 class FormattedColumnValue
;
59 // DbGridColumn, column description
63 friend class DbGridControl
;
65 css::uno::Reference
< css::beans::XPropertySet
> m_xModel
;
66 css::uno::Reference
< css::beans::XPropertySet
> m_xField
; // connection to the database field
67 ::svt::CellControllerRef m_xController
; // structure for managing the controls for a column
68 // this is positioned by the DbBrowseBox on the respective
70 rtl::Reference
<FmXGridCell
> m_pCell
;
71 DbGridControl
& m_rParent
;
72 sal_Int32 m_nLastVisibleWidth
; // only valid if m_bHidden == sal_True
73 sal_Int32 m_nFormatKey
;
74 sal_Int16 m_nFieldType
;
77 sal_Int16 m_nFieldPos
;
78 sal_Int16 m_nAlign
; // specified with TXT_ALIGN_LEFT...
80 bool m_bAutoValue
: 1;
83 bool m_bObject
: 1; // does the column reference an object datatype?
87 static ::svt::CellControllerRef s_xEmptyController
;
88 // used by locked columns
90 DbGridColumn(sal_uInt16 _nId
, DbGridControl
& rParent
)
92 ,m_nLastVisibleWidth(-1)
98 ,m_nAlign(css::awt::TextAlign::LEFT
)
111 const css::uno::Reference
< css::beans::XPropertySet
>& getModel() const { return m_xModel
; }
112 void setModel(const css::uno::Reference
< css::beans::XPropertySet
>& _xModel
);
115 sal_uInt16
GetId() const {return m_nId
;}
116 bool IsReadOnly() const {return m_bReadOnly
;}
117 bool IsAutoValue() const {return m_bAutoValue
;}
118 sal_Int16
GetAlignment() const {return m_nAlign
;}
119 sal_Int16
GetFieldPos() const {return m_nFieldPos
; }
120 bool IsNumeric() const {return m_bNumeric
;}
121 bool IsHidden() const {return m_bHidden
;}
122 sal_Int32
GetKey() const {return m_nFormatKey
;}
123 const ::svt::CellControllerRef
& GetController() const {return m_bLocked
? s_xEmptyController
: m_xController
;}
124 const css::uno::Reference
< css::beans::XPropertySet
>& GetField() const {return m_xField
;}
125 DbGridControl
& GetParent() const {return m_rParent
;}
126 FmXGridCell
* GetCell() const {return m_pCell
.get();}
128 css::uno::Reference
< css::sdb::XColumn
> GetCurrentFieldValue() const;
130 // Drawing a field at a position. If a view is set, it takes over the drawing,
131 // e.g., for checkboxes.
132 void Paint(OutputDevice
& rDev
,
133 const tools::Rectangle
& rRect
,
134 const DbGridRow
* pRow
,
135 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
);
138 // Initializing in the alive mode.
139 // If no ColumnController is set, a default initialization is performed.
140 void CreateControl(sal_Int32 _nFieldPos
, const css::uno::Reference
< css::beans::XPropertySet
>& xField
, sal_Int32 nTypeId
);
143 css::uno::Reference
< css::beans::XPropertySet
> xField(m_xField
);
144 CreateControl(m_nFieldPos
, xField
, m_nTypeId
);
148 void UpdateFromField(const DbGridRow
* pRow
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
);
151 // releasing all the data required for the AliveMode
154 OUString
GetCellText(const DbGridRow
* pRow
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) const;
155 OUString
GetCellText(const css::uno::Reference
< css::sdb::XColumn
>& xField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) const;
157 void SetReadOnly(bool bRead
){m_bReadOnly
= bRead
;}
158 void SetObject(sal_Int16 nPos
) {m_bObject
= m_bReadOnly
= true; m_nFieldPos
= nPos
;}
160 void ImplInitWindow( vcl::Window
const & rParent
, const InitWindowFacet _eInitWhat
);
162 // properties that can bleed through onto the css::frame::Controller
163 sal_Int16
SetAlignment(sal_Int16 _nAlign
);
164 // if _nAlign is -1, the alignment is calculated from the type of the field we are bound to
165 // the value really set is returned
166 sal_Int16
SetAlignmentFromModel(sal_Int16 nStandardAlign
);
167 // set the alignment according to the "Align"-property of m_xModel, use the given standard
168 // alignment if the property if void, return the really set alignment
171 bool isLocked() const { return m_bLocked
; }
172 void setLock(bool _bLock
);
175 /** attaches or detaches our cell object to the SctriptEventAttacherManager implemented
176 by our model's parent
178 void impl_toggleScriptManager_nothrow( bool _bAttach
);
182 // DbCellControl, provides the data for a CellController.
183 // Is usually only required for complex controls such as combo boxes.
186 :public cppu::BaseMutex
// _before_ the listener, so the listener is to be destroyed first!
187 ,public ::comphelper::OPropertyChangeListener
190 rtl::Reference
<::comphelper::OPropertyChangeMultiplexer
> m_pModelChangeBroadcaster
;
191 rtl::Reference
<::comphelper::OPropertyChangeMultiplexer
> m_pFieldChangeBroadcaster
;
194 bool m_bTransparent
: 1;
195 bool m_bAlignedController
: 1;
196 bool m_bAccessingValueProperty
: 1;
198 css::uno::Reference
< css::sdbc::XRowSet
>
202 DbGridColumn
& m_rColumn
;
203 VclPtr
<svt::ControlBase
> m_pPainter
;
204 VclPtr
<svt::ControlBase
> m_pWindow
;
208 const css::uno::Reference
< css::sdbc::XRowSet
>& getCursor() const { return m_xCursor
; }
210 // control transparency
211 bool isTransparent( ) const { return m_bTransparent
; }
212 void setTransparent( bool _bSet
) { m_bTransparent
= _bSet
; }
215 void setAlignedController( bool _bAlign
) { m_bAlignedController
= _bAlign
; }
218 /** determined whether or not the value property is locked
219 @see lockValueProperty
221 inline bool isValuePropertyLocked() const;
223 /** locks the listening at the value property.
224 <p>This means that every subsequent change now done on the value property of the model ("Text", or "Value",
225 or whatever) is then ignored.<br/>
226 This base class uses this setting in <method>Commit</method>.</p>
228 Value locking can't be nested
229 @see unlockValueProperty
231 inline void lockValueProperty();
232 /** unlocks the listening at the value property
233 @see lockValueProperty
235 inline void unlockValueProperty();
238 // adds the given property to the list of properties which we listen for
239 void doPropertyListening( const OUString
& _rPropertyName
);
241 // called whenever a property which affects field settings in general is called
242 // you should overwrite this method for every property you add yourself as listener to
243 // with doPropertyListening
244 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
);
246 // called by _propertyChanged if a property which denotes the column value has changed
247 void implValuePropertyChanged( );
251 DbCellControl(DbGridColumn
& _rColumn
);
252 virtual ~DbCellControl() override
;
254 svt::ControlBase
& GetWindow() const
256 ENSURE_OR_THROW( m_pWindow
, "no window" );
261 bool isAlignedController() const { return m_bAlignedController
; }
262 void AlignControl(sal_Int16 nAlignment
);
264 void SetTextLineColor();
265 void SetTextLineColor(const Color
& _rColor
);
267 // initializing before a control is displayed
268 virtual void Init( BrowserDataWin
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
);
269 virtual ::svt::CellControllerRef
CreateController() const = 0;
271 // writing the value into the model
274 // Formatting the field data to output text
275 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) = 0;
277 virtual void Update(){}
278 // Refresh the control by the field data
279 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) = 0;
281 // painting a cell content in the specified rectangle
282 virtual void PaintFieldToCell( OutputDevice
& rDev
, const tools::Rectangle
& rRect
, const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
);
283 virtual void PaintCell( OutputDevice
& _rDev
, const tools::Rectangle
& _rRect
);
285 void ImplInitWindow( vcl::Window
const & rParent
, const InitWindowFacet _eInitWhat
);
287 double GetValue(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) const;
290 void invalidatedController();
292 /** commits the content of the control (e.g. the text of an edit field) into the column model
293 (e.g. the "Text" property of the model).
294 <p>To be overwritten in derived classes.</p>
297 virtual bool commitControl( ) = 0;
299 /** updates the current content of the control (e.g. the text of an edit field) from the column model
300 (e.g. the "Text" property of the model).
301 <p>To be overwritten in derived classes.</p>
309 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) = 0;
312 // OPropertyChangeListener
313 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& evt
) override
;
316 void implDoPropertyListening( const OUString
& _rPropertyName
, bool _bWarnIfNotExistent
);
318 /// updates the "readonly" setting on m_pWindow, according to the respective property value in the given model
319 void implAdjustReadOnly( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
,bool i_bReadOnly
);
321 /// updates the "enabled" setting on m_pWindow, according to the respective property value in the given model
322 void implAdjustEnabled( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
);
326 inline bool DbCellControl::isValuePropertyLocked() const
328 return m_bAccessingValueProperty
;
332 inline void DbCellControl::lockValueProperty()
334 OSL_ENSURE( !isValuePropertyLocked(), "DbCellControl::lockValueProperty: not to be nested!" );
335 m_bAccessingValueProperty
= true;
339 inline void DbCellControl::unlockValueProperty()
341 OSL_ENSURE( isValuePropertyLocked(), "DbCellControl::lockValueProperty: not locked so far!" );
342 m_bAccessingValueProperty
= false;
346 /** a field which is bound to a column which supports the MaxTextLen property
348 class DbLimitedLengthField
: public DbCellControl
353 DbLimitedLengthField( DbGridColumn
& _rColumn
);
357 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
360 void implSetMaxTextLen( sal_Int16 _nMaxLen
)
362 implSetEffectiveMaxTextLen(_nMaxLen
);
364 virtual void implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen
);
368 class DbTextField final
: public DbLimitedLengthField
370 std::unique_ptr
<::svt::IEditImplementation
> m_pEdit
;
371 std::unique_ptr
<::svt::IEditImplementation
> m_pPainterImplementation
;
372 bool m_bIsMultiLineEdit
;
374 virtual ~DbTextField( ) override
;
377 DbTextField(DbGridColumn
& _rColumn
);
379 ::svt::IEditImplementation
* GetEditImplementation() { return m_pEdit
.get(); }
380 bool IsMultiLineEdit() const { return m_bIsMultiLineEdit
; }
382 virtual void Init( BrowserDataWin
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
383 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
384 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
385 virtual ::svt::CellControllerRef
CreateController() const override
;
386 virtual void PaintFieldToCell( OutputDevice
& _rDev
, const tools::Rectangle
& _rRect
,
387 const css::uno::Reference
< css::sdb::XColumn
>& _rxField
,
388 const css::uno::Reference
< css::util::XNumberFormatter
>& _rxFormatter
) override
;
392 virtual bool commitControl( ) override
;
393 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
394 // DbLimitedLengthField
395 virtual void implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen
) override
;
399 class DbFormattedField final
: public DbLimitedLengthField
402 DbFormattedField(DbGridColumn
& _rColumn
);
403 virtual ~DbFormattedField() override
;
405 virtual void Init( BrowserDataWin
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
406 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
407 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
408 virtual ::svt::CellControllerRef
CreateController() const override
;
412 virtual bool commitControl( ) override
;
413 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
415 // OPropertyChangeListener
416 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& evt
) override
;
418 css::uno::Reference
< css::util::XNumberFormatsSupplier
> m_xSupplier
;
422 class DbCheckBox final
: public DbCellControl
425 DbCheckBox(DbGridColumn
& _rColumn
);
427 virtual void Init( BrowserDataWin
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
428 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
429 virtual ::svt::CellControllerRef
CreateController() const override
;
430 virtual void PaintFieldToCell(OutputDevice
& rDev
, const tools::Rectangle
& rRect
,
431 const css::uno::Reference
< css::sdb::XColumn
>& _rxField
,
432 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
433 virtual void PaintCell(OutputDevice
& rDev
, const tools::Rectangle
& rRect
) override
;
434 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
438 virtual bool commitControl( ) override
;
439 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
443 class DbComboBox final
: public DbCellControl
447 DbComboBox(DbGridColumn
& _rColumn
);
449 virtual void Init( BrowserDataWin
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
450 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
451 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
452 virtual ::svt::CellControllerRef
CreateController() const override
;
454 void SetList(const css::uno::Any
& rItems
);
458 virtual bool commitControl( ) override
;
459 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
461 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
463 // OPropertyChangeListener
464 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& evt
) override
;
468 class DbListBox final
: public DbCellControl
471 css::uno::Sequence
< OUString
> m_aValueList
;
474 DbListBox(DbGridColumn
& _rColumn
);
476 virtual void Init( BrowserDataWin
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
477 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
478 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
479 virtual ::svt::CellControllerRef
CreateController() const override
;
481 void SetList(const css::uno::Any
& rItems
);
485 virtual bool commitControl( ) override
;
486 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
488 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
490 // OPropertyChangeListener
491 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& evt
) override
;
495 class DbPatternField final
: public DbCellControl
498 DbPatternField( DbGridColumn
& _rColumn
, const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
);
499 virtual void Init( BrowserDataWin
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
500 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
501 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
502 virtual ::svt::CellControllerRef
CreateController() const override
;
506 virtual bool commitControl( ) override
;
507 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
509 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
511 OUString
impl_formatText(const OUString
& _rText
);
513 ::std::unique_ptr
< ::dbtools::FormattedColumnValue
> m_pValueFormatter
;
514 ::std::unique_ptr
< ::dbtools::FormattedColumnValue
> m_pPaintFormatter
;
515 css::uno::Reference
<css::uno::XComponentContext
> m_xContext
;
519 class DbSpinField
: public DbCellControl
522 sal_Int16 m_nStandardAlign
;
527 DbSpinField( DbGridColumn
& _rColumn
, sal_Int16 _nStandardAlign
= css::awt::TextAlign::RIGHT
);
530 virtual void Init( BrowserDataWin
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& _rxCursor
) override
;
531 virtual ::svt::CellControllerRef
CreateController() const override
;
534 virtual VclPtr
<svt::ControlBase
> createField(
535 BrowserDataWin
* _pParent
,
537 const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
541 class DbDateField final
: public DbSpinField
544 DbDateField(DbGridColumn
& _rColumn
);
545 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
546 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
550 virtual bool commitControl( ) override
;
551 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
554 virtual VclPtr
<svt::ControlBase
> createField(
555 BrowserDataWin
* _pParent
,
557 const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
560 /// initializes everything which relates to the properties describing the numeric behaviour
561 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
564 class DbTimeField final
: public DbSpinField
567 DbTimeField(DbGridColumn
& _rColumn
);
568 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
569 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
573 virtual bool commitControl( ) override
;
574 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
577 virtual VclPtr
<svt::ControlBase
> createField(
578 BrowserDataWin
* _pParent
,
580 const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
583 /// initializes everything which relates to the properties describing the numeric behaviour
584 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
587 class DbCurrencyField final
: public DbSpinField
590 DbCurrencyField(DbGridColumn
& _rColumn
);
591 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
592 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
596 virtual bool commitControl( ) override
;
597 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
600 virtual VclPtr
<svt::ControlBase
> createField(
601 BrowserDataWin
* _pParent
,
603 const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
606 /// initializes everything which relates to the properties describing the numeric behaviour
607 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
610 class DbNumericField final
: public DbSpinField
613 DbNumericField(DbGridColumn
& _rColumn
);
615 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
616 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
620 virtual bool commitControl( ) override
;
621 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
624 virtual VclPtr
<svt::ControlBase
> createField(
625 BrowserDataWin
* _pParent
,
627 const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
630 /// initializes everything which relates to the properties describing the numeric behaviour
631 void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
634 class DbFilterField final
635 :public DbCellControl
636 ,public ::svxform::OSQLParserClient
639 DbFilterField(const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
, DbGridColumn
& _rColumn
);
640 virtual ~DbFilterField() override
;
642 virtual void Init( BrowserDataWin
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
643 virtual ::svt::CellControllerRef
CreateController() const override
;
644 virtual void PaintCell(OutputDevice
& rDev
, const tools::Rectangle
& rRect
) override
;
645 virtual void Update() override
;
646 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, const Color
** ppColor
= nullptr) override
;
647 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
649 const OUString
& GetText() const {return m_aText
;}
650 void SetText(const OUString
& rText
);
652 void SetCommitHdl( const Link
<DbFilterField
&,void>& rLink
) { m_aCommitLink
= rLink
; }
656 virtual bool commitControl( ) override
;
657 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
659 void SetList(const css::uno::Any
& rItems
, bool bComboBox
);
660 void CreateControl(BrowserDataWin
* pParent
, const css::uno::Reference
< css::beans::XPropertySet
>& xModel
);
661 DECL_LINK(OnToggle
, weld::CheckButton
&, void);
663 css::uno::Sequence
< OUString
> m_aValueList
;
665 Link
<DbFilterField
&,void> m_aCommitLink
;
666 sal_Int16 m_nControlClass
;
667 bool m_bFilterList
: 1;
668 bool m_bFilterListFilled
: 1;
672 // Base class providing the access to a grid cell
674 typedef ::cppu::ImplHelper2
< css::awt::XControl
675 , css::form::XBoundControl
677 typedef ::cppu::ImplHelper1
< css::awt::XWindow
678 > FmXGridCell_WindowBase
;
679 class FmXGridCell
:public ::cppu::OComponentHelper
680 ,public FmXGridCell_Base
681 ,public FmXGridCell_WindowBase
684 ::osl::Mutex m_aMutex
;
685 DbGridColumn
* m_pColumn
;
686 std::unique_ptr
<DbCellControl
> m_pCellControl
;
689 ::comphelper::OInterfaceContainerHelper3
<css::awt::XWindowListener
> m_aWindowListeners
;
690 ::comphelper::OInterfaceContainerHelper3
<css::awt::XFocusListener
> m_aFocusListeners
;
691 ::comphelper::OInterfaceContainerHelper3
<css::awt::XKeyListener
> m_aKeyListeners
;
692 ::comphelper::OInterfaceContainerHelper3
<css::awt::XMouseListener
> m_aMouseListeners
;
693 ::comphelper::OInterfaceContainerHelper3
<css::awt::XMouseMotionListener
> m_aMouseMotionListeners
;
696 virtual ~FmXGridCell() override
;
699 FmXGridCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
702 DECLARE_UNO3_AGG_DEFAULTS(FmXGridCell
, OComponentHelper
)
703 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
705 void SetTextLineColor();
706 void SetTextLineColor(const Color
& _rColor
);
709 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
710 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
713 virtual void SAL_CALL
disposing() override
;
715 // css::lang::XComponent
716 virtual void SAL_CALL
dispose() override
{OComponentHelper::dispose();}
717 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
>& aListener
) override
{ OComponentHelper::addEventListener(aListener
);}
718 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
>& aListener
) override
{ OComponentHelper::removeEventListener(aListener
);}
720 // css::awt::XControl
721 virtual void SAL_CALL
setContext(const css::uno::Reference
< css::uno::XInterface
>& /*Context*/) override
{}
722 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getContext() override
;
723 virtual void SAL_CALL
createPeer(const css::uno::Reference
< css::awt::XToolkit
>& /*Toolkit*/, const css::uno::Reference
< css::awt::XWindowPeer
>& /*Parent*/) override
{}
725 virtual css::uno::Reference
< css::awt::XWindowPeer
> SAL_CALL
getPeer() override
{return css::uno::Reference
< css::awt::XWindowPeer
> ();}
726 virtual sal_Bool SAL_CALL
setModel(const css::uno::Reference
< css::awt::XControlModel
>& /*Model*/) override
{return false;}
727 virtual css::uno::Reference
< css::awt::XControlModel
> SAL_CALL
getModel() override
;
728 virtual css::uno::Reference
< css::awt::XView
> SAL_CALL
getView() override
{return css::uno::Reference
< css::awt::XView
> ();}
729 virtual void SAL_CALL
setDesignMode(sal_Bool
/*bOn*/) override
{}
730 virtual sal_Bool SAL_CALL
isDesignMode() override
{return false;}
731 virtual sal_Bool SAL_CALL
isTransparent() override
{return false;}
733 // css::form::XBoundControl
734 virtual sal_Bool SAL_CALL
getLock() override
;
735 virtual void SAL_CALL
setLock(sal_Bool _bLock
) override
;
738 virtual void SAL_CALL
setPosSize( ::sal_Int32 X
, ::sal_Int32 Y
, ::sal_Int32 Width
, ::sal_Int32 Height
, ::sal_Int16 Flags
) override
;
739 virtual css::awt::Rectangle SAL_CALL
getPosSize( ) override
;
740 virtual void SAL_CALL
setVisible( sal_Bool Visible
) override
;
741 virtual void SAL_CALL
setEnable( sal_Bool Enable
) override
;
742 virtual void SAL_CALL
setFocus( ) override
;
743 virtual void SAL_CALL
addWindowListener( const css::uno::Reference
< css::awt::XWindowListener
>& xListener
) override
;
744 virtual void SAL_CALL
removeWindowListener( const css::uno::Reference
< css::awt::XWindowListener
>& xListener
) override
;
745 virtual void SAL_CALL
addFocusListener( const css::uno::Reference
< css::awt::XFocusListener
>& xListener
) override
;
746 virtual void SAL_CALL
removeFocusListener( const css::uno::Reference
< css::awt::XFocusListener
>& xListener
) override
;
747 virtual void SAL_CALL
addKeyListener( const css::uno::Reference
< css::awt::XKeyListener
>& xListener
) override
;
748 virtual void SAL_CALL
removeKeyListener( const css::uno::Reference
< css::awt::XKeyListener
>& xListener
) override
;
749 virtual void SAL_CALL
addMouseListener( const css::uno::Reference
< css::awt::XMouseListener
>& xListener
) override
;
750 virtual void SAL_CALL
removeMouseListener( const css::uno::Reference
< css::awt::XMouseListener
>& xListener
) override
;
751 virtual void SAL_CALL
addMouseMotionListener( const css::uno::Reference
< css::awt::XMouseMotionListener
>& xListener
) override
;
752 virtual void SAL_CALL
removeMouseMotionListener( const css::uno::Reference
< css::awt::XMouseMotionListener
>& xListener
) override
;
753 virtual void SAL_CALL
addPaintListener( const css::uno::Reference
< css::awt::XPaintListener
>& xListener
) override
;
754 virtual void SAL_CALL
removePaintListener( const css::uno::Reference
< css::awt::XPaintListener
>& xListener
) override
;
756 bool Commit() {return m_pCellControl
->Commit();}
757 void ImplInitWindow( vcl::Window
const & rParent
, const InitWindowFacet _eInitWhat
)
758 { m_pCellControl
->ImplInitWindow( rParent
, _eInitWhat
); }
760 bool isAlignedController() const { return m_pCellControl
->isAlignedController(); }
761 void AlignControl(sal_Int16 nAlignment
)
762 { m_pCellControl
->AlignControl(nAlignment
);}
765 // default implementations call our focus listeners, don't forget to call them if you override this
766 virtual void onFocusGained( const css::awt::FocusEvent
& _rEvent
);
767 virtual void onFocusLost( const css::awt::FocusEvent
& _rEvent
);
770 svt::ControlBase
* getEventWindow() const;
771 DECL_LINK(OnFocusGained
, LinkParamNone
*, void);
772 DECL_LINK(OnFocusLost
, LinkParamNone
*, void);
773 DECL_LINK(OnMousePress
, const MouseEvent
&, void);
774 DECL_LINK(OnMouseRelease
, const MouseEvent
&, void);
775 DECL_LINK(OnMouseMove
, const MouseEvent
&, void);
776 DECL_LINK(OnKeyInput
, const KeyEvent
&, void);
777 DECL_LINK(OnKeyRelease
, const KeyEvent
&, void);
781 class FmXDataCell
: public FmXGridCell
784 FmXDataCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
)
785 :FmXGridCell( pColumn
, std::move(pControl
) )
789 virtual void PaintFieldToCell(OutputDevice
& rDev
,
790 const tools::Rectangle
& rRect
,
791 const css::uno::Reference
< css::sdb::XColumn
>& xField
,
792 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
);
794 void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& xField
,
795 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
)
796 { m_pCellControl
->UpdateFromField(xField
, xFormatter
); }
799 void UpdateFromColumn();
803 class FmXTextCell
: public FmXDataCell
806 bool m_bIsMultiLineText
;
809 FmXTextCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
811 virtual void PaintFieldToCell(OutputDevice
& rDev
,
812 const tools::Rectangle
& rRect
,
813 const css::uno::Reference
< css::sdb::XColumn
>& xField
,
814 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
816 OUString
GetText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
,
817 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
,
818 const Color
** ppColor
= nullptr)
819 {return m_pCellControl
->GetFormatText(_rxField
, xFormatter
, ppColor
);}
823 typedef ::cppu::ImplHelper2
< css::awt::XTextComponent
824 , css::form::XChangeBroadcaster
826 class FmXEditCell final
: public FmXTextCell
,
827 public FmXEditCell_Base
830 FmXEditCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
832 DECLARE_UNO3_AGG_DEFAULTS(FmXEditCell
, FmXTextCell
)
833 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
836 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
837 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
840 virtual void SAL_CALL
disposing() override
;
842 // css::awt::XTextComponent
843 virtual void SAL_CALL
addTextListener(const css::uno::Reference
< css::awt::XTextListener
>& l
) override
;
844 virtual void SAL_CALL
removeTextListener(const css::uno::Reference
< css::awt::XTextListener
>& l
) override
;
845 virtual void SAL_CALL
setText(const OUString
& aText
) override
;
846 virtual void SAL_CALL
insertText(const css::awt::Selection
& Sel
, const OUString
& Text
) override
;
847 virtual OUString SAL_CALL
getText() override
;
848 virtual OUString SAL_CALL
getSelectedText() override
;
849 virtual void SAL_CALL
setSelection(const css::awt::Selection
& aSelection
) override
;
850 virtual css::awt::Selection SAL_CALL
getSelection() override
;
851 virtual sal_Bool SAL_CALL
isEditable() override
;
852 virtual void SAL_CALL
setEditable(sal_Bool bEditable
) override
;
853 virtual void SAL_CALL
setMaxTextLen(sal_Int16 nLen
) override
;
854 virtual sal_Int16 SAL_CALL
getMaxTextLen() override
;
856 // XChangeBroadcaster
857 virtual void SAL_CALL
addChangeListener( const css::uno::Reference
< css::form::XChangeListener
>& aListener
) override
;
858 virtual void SAL_CALL
removeChangeListener( const css::uno::Reference
< css::form::XChangeListener
>& aListener
) override
;
861 virtual ~FmXEditCell() override
;
863 virtual void onFocusGained( const css::awt::FocusEvent
& _rEvent
) override
;
864 virtual void onFocusLost( const css::awt::FocusEvent
& _rEvent
) override
;
866 DECL_LINK(ModifyHdl
, LinkParamNone
*, void);
868 void onTextChanged();
870 OUString m_sValueOnEnter
;
871 ::comphelper::OInterfaceContainerHelper3
<css::awt::XTextListener
> m_aTextListeners
;
872 ::comphelper::OInterfaceContainerHelper3
<css::form::XChangeListener
> m_aChangeListeners
;
873 ::svt::IEditImplementation
* m_pEditImplementation
;
874 bool m_bOwnEditImplementation
;
877 typedef ::cppu::ImplHelper2
< css::awt::XCheckBox
879 > FmXCheckBoxCell_Base
;
880 class FmXCheckBoxCell final
: public FmXDataCell
,
881 public FmXCheckBoxCell_Base
883 ::comphelper::OInterfaceContainerHelper3
<css::awt::XItemListener
> m_aItemListeners
;
884 ::comphelper::OInterfaceContainerHelper3
<css::awt::XActionListener
> m_aActionListeners
;
885 OUString m_aActionCommand
;
886 VclPtr
<::svt::CheckBoxControl
> m_pBox
;
888 DECL_LINK(ModifyHdl
, LinkParamNone
*, void);
890 virtual ~FmXCheckBoxCell() override
;
893 FmXCheckBoxCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
896 DECLARE_UNO3_AGG_DEFAULTS(FmXCheckBoxCell
, FmXDataCell
)
897 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
898 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
899 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
902 virtual void SAL_CALL
disposing() override
;
904 // css::awt::XCheckBox
905 virtual void SAL_CALL
addItemListener(const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
906 virtual void SAL_CALL
removeItemListener(const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
907 virtual sal_Int16 SAL_CALL
getState() override
;
908 virtual void SAL_CALL
setState(sal_Int16 n
) override
;
909 virtual void SAL_CALL
setLabel(const OUString
& Label
) override
;
910 virtual void SAL_CALL
enableTriState(sal_Bool b
) override
;
913 virtual void SAL_CALL
addActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
914 virtual void SAL_CALL
removeActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
915 //virtual void SAL_CALL setLabel( const OUString& Label ) throw (css::uno::RuntimeException);
916 virtual void SAL_CALL
setActionCommand( const OUString
& Command
) override
;
919 typedef ::cppu::ImplHelper1
< css::awt::XListBox
920 > FmXListBoxCell_Base
;
921 class FmXListBoxCell final
: public FmXTextCell
922 , public FmXListBoxCell_Base
925 FmXListBoxCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
927 DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell
, FmXTextCell
)
928 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
929 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
930 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
933 virtual void SAL_CALL
disposing() override
;
935 // css::awt::XListBox
936 virtual void SAL_CALL
addItemListener(const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
937 virtual void SAL_CALL
removeItemListener(const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
938 virtual void SAL_CALL
addActionListener(const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
939 virtual void SAL_CALL
removeActionListener(const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
940 virtual void SAL_CALL
addItem(const OUString
& aItem
, sal_Int16 nPos
) override
;
941 virtual void SAL_CALL
addItems(const css::uno::Sequence
< OUString
>& aItems
, sal_Int16 nPos
) override
;
942 virtual void SAL_CALL
removeItems(sal_Int16 nPos
, sal_Int16 nCount
) override
;
943 virtual sal_Int16 SAL_CALL
getItemCount() override
;
944 virtual OUString SAL_CALL
getItem(sal_Int16 nPos
) override
;
945 virtual css::uno::Sequence
< OUString
> SAL_CALL
getItems() override
;
946 virtual sal_Int16 SAL_CALL
getSelectedItemPos() override
;
947 virtual css::uno::Sequence
< sal_Int16
> SAL_CALL
getSelectedItemsPos() override
;
948 virtual OUString SAL_CALL
getSelectedItem() override
;
949 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSelectedItems() override
;
950 virtual void SAL_CALL
selectItemPos(sal_Int16 nPos
, sal_Bool bSelect
) override
;
951 virtual void SAL_CALL
selectItemsPos(const css::uno::Sequence
< sal_Int16
>& aPositions
, sal_Bool bSelect
) override
;
952 virtual void SAL_CALL
selectItem(const OUString
& aItem
, sal_Bool bSelect
) override
;
953 virtual sal_Bool SAL_CALL
isMutipleMode() override
;
954 virtual void SAL_CALL
setMultipleMode(sal_Bool bMulti
) override
;
955 virtual sal_Int16 SAL_CALL
getDropDownLineCount() override
;
956 virtual void SAL_CALL
setDropDownLineCount(sal_Int16 nLines
) override
;
957 virtual void SAL_CALL
makeVisible(sal_Int16 nEntry
) override
;
960 virtual ~FmXListBoxCell() override
;
962 DECL_LINK(ChangedHdl
, bool, void);
964 void OnDoubleClick();
966 ::comphelper::OInterfaceContainerHelper3
<css::awt::XItemListener
> m_aItemListeners
;
967 ::comphelper::OInterfaceContainerHelper3
<css::awt::XActionListener
> m_aActionListeners
;
968 VclPtr
<::svt::ListBoxControl
> m_pBox
;
974 typedef ::cppu::ImplHelper1
< css::awt::XComboBox
975 > FmXComboBoxCell_Base
;
976 class FmXComboBoxCell final
: public FmXTextCell
977 , public FmXComboBoxCell_Base
980 ::comphelper::OInterfaceContainerHelper3
<css::awt::XItemListener
> m_aItemListeners
;
981 ::comphelper::OInterfaceContainerHelper3
<css::awt::XActionListener
> m_aActionListeners
;
982 VclPtr
<::svt::ComboBoxControl
> m_pComboBox
;
985 DECL_LINK(ChangedHdl
, bool, void);
987 virtual ~FmXComboBoxCell() override
;
990 FmXComboBoxCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
992 DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell
, FmXTextCell
)
993 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
994 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
995 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
998 virtual void SAL_CALL
disposing() override
;
1001 virtual void SAL_CALL
addItemListener( const css::uno::Reference
< css::awt::XItemListener
>& Listener
) override
;
1002 virtual void SAL_CALL
removeItemListener( const css::uno::Reference
< css::awt::XItemListener
>& Listener
) override
;
1003 virtual void SAL_CALL
addActionListener( const css::uno::Reference
< css::awt::XActionListener
>& Listener
) override
;
1004 virtual void SAL_CALL
removeActionListener( const css::uno::Reference
< css::awt::XActionListener
>& Listener
) override
;
1005 virtual void SAL_CALL
addItem( const OUString
& Item
, ::sal_Int16 Pos
) override
;
1006 virtual void SAL_CALL
addItems( const css::uno::Sequence
< OUString
>& Items
, ::sal_Int16 Pos
) override
;
1007 virtual void SAL_CALL
removeItems( ::sal_Int16 nPos
, ::sal_Int16 nCount
) override
;
1008 virtual ::sal_Int16 SAL_CALL
getItemCount( ) override
;
1009 virtual OUString SAL_CALL
getItem( ::sal_Int16 Pos
) override
;
1010 virtual css::uno::Sequence
< OUString
> SAL_CALL
getItems( ) override
;
1011 virtual ::sal_Int16 SAL_CALL
getDropDownLineCount( ) override
;
1012 virtual void SAL_CALL
setDropDownLineCount( ::sal_Int16 Lines
) override
;
1015 typedef ::cppu::ImplHelper1
< css::awt::XTextComponent
1016 > FmXFilterCell_Base
;
1017 class FmXFilterCell final
: public FmXGridCell
1018 ,public FmXFilterCell_Base
1021 FmXFilterCell(DbGridColumn
* pColumn
, std::unique_ptr
<DbFilterField
> pControl
);
1024 DECLARE_UNO3_AGG_DEFAULTS(FmXFilterCell
, FmXGridCell
)
1025 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
1026 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
1027 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
1029 // painting the filter text
1030 void PaintCell(OutputDevice
& rDev
, const tools::Rectangle
& rRect
);
1031 void Update(){m_pCellControl
->Update();}
1034 virtual void SAL_CALL
disposing() override
;
1036 // css::awt::XTextComponent
1037 virtual void SAL_CALL
addTextListener(const css::uno::Reference
< css::awt::XTextListener
>& l
) override
;
1038 virtual void SAL_CALL
removeTextListener(const css::uno::Reference
< css::awt::XTextListener
>& l
) override
;
1039 virtual void SAL_CALL
setText(const OUString
& aText
) override
;
1040 virtual void SAL_CALL
insertText(const css::awt::Selection
& Sel
, const OUString
& Text
) override
;
1041 virtual OUString SAL_CALL
getText() override
;
1042 virtual OUString SAL_CALL
getSelectedText() override
;
1043 virtual void SAL_CALL
setSelection(const css::awt::Selection
& aSelection
) override
;
1044 virtual css::awt::Selection SAL_CALL
getSelection() override
;
1045 virtual sal_Bool SAL_CALL
isEditable() override
;
1046 virtual void SAL_CALL
setEditable(sal_Bool bEditable
) override
;
1047 virtual void SAL_CALL
setMaxTextLen(sal_Int16 nLen
) override
;
1048 virtual sal_Int16 SAL_CALL
getMaxTextLen() override
;
1051 DECL_LINK( OnCommit
, DbFilterField
&, void );
1052 virtual ~FmXFilterCell() override
;
1054 ::comphelper::OInterfaceContainerHelper3
<css::awt::XTextListener
> m_aTextListeners
;
1057 #endif // INCLUDED_SVX_SOURCE_INC_GRIDCELL_HXX
1059 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */