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/beans/XFastPropertySet.hpp>
39 #include <com/sun/star/lang/XUnoTunnel.hpp>
40 #include <com/sun/star/form/XChangeBroadcaster.hpp>
41 #include <com/sun/star/awt/XWindow.hpp>
42 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
44 #include <comphelper/propmultiplex.hxx>
45 #include <comphelper/interfacecontainer2.hxx>
46 #include <comphelper/uno3.hxx>
47 #include <cppuhelper/component.hxx>
48 #include <cppuhelper/implbase1.hxx>
49 #include <cppuhelper/implbase2.hxx>
50 #include <tools/diagnose_ex.h>
56 class FormattedColumnValue
;
62 ::osl::Mutex m_aMutex
;
66 // DbGridColumn, column description
70 friend class DbGridControl
;
72 css::uno::Reference
< css::beans::XPropertySet
> m_xModel
;
73 css::uno::Reference
< css::beans::XPropertySet
> m_xField
; // connection to the database field
74 ::svt::CellControllerRef m_xController
; // structure for managing the controls for a column
75 // this is positioned by the DbBrowseBox on the respective
77 rtl::Reference
<FmXGridCell
> m_pCell
;
80 DbGridControl
& m_rParent
;
83 sal_Int32 m_nLastVisibleWidth
; // only valid if m_bHidden == sal_True
84 sal_Int32 m_nFormatKey
;
85 sal_Int16 m_nFieldType
;
87 sal_uInt16
const m_nId
;
88 sal_Int16 m_nFieldPos
;
89 sal_Int16 m_nAlign
; // specified with TXT_ALIGN_LEFT...
91 bool m_bAutoValue
: 1;
94 bool m_bObject
: 1; // does the column reference an object datatype?
98 static ::svt::CellControllerRef s_xEmptyController
;
99 // used by locked columns
101 DbGridColumn(sal_uInt16 _nId
, DbGridControl
& rParent
)
103 ,m_nLastVisibleWidth(-1)
109 ,m_nAlign(css::awt::TextAlign::LEFT
)
122 const css::uno::Reference
< css::beans::XPropertySet
>& getModel() const { return m_xModel
; }
123 void setModel(const css::uno::Reference
< css::beans::XPropertySet
>& _xModel
);
126 sal_uInt16
GetId() const {return m_nId
;}
127 bool IsReadOnly() const {return m_bReadOnly
;}
128 bool IsAutoValue() const {return m_bAutoValue
;}
129 sal_Int16
GetAlignment() const {return m_nAlign
;}
130 sal_Int16
GetFieldPos() const {return m_nFieldPos
; }
131 bool IsNumeric() const {return m_bNumeric
;}
132 bool IsHidden() const {return m_bHidden
;}
133 sal_Int32
GetKey() const {return m_nFormatKey
;}
134 const ::svt::CellControllerRef
& GetController() const {return m_bLocked
? s_xEmptyController
: m_xController
;}
135 const css::uno::Reference
< css::beans::XPropertySet
>& GetField() const {return m_xField
;}
136 DbGridControl
& GetParent() const {return m_rParent
;}
137 FmXGridCell
* GetCell() const {return m_pCell
.get();}
139 css::uno::Reference
< css::sdb::XColumn
> GetCurrentFieldValue() const;
141 // Drawing a field at a position. If a view is set, it takes over the drawing,
142 // e.g., for checkboxes.
143 void Paint(OutputDevice
& rDev
,
144 const tools::Rectangle
& rRect
,
145 const DbGridRow
* pRow
,
146 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
);
149 // Initializing in the alive mode.
150 // If no ColumnController is set, a default initialization is performed.
151 void CreateControl(sal_Int32 _nFieldPos
, const css::uno::Reference
< css::beans::XPropertySet
>& xField
, sal_Int32 nTypeId
);
154 css::uno::Reference
< css::beans::XPropertySet
> xField(m_xField
);
155 CreateControl(m_nFieldPos
, xField
, m_nTypeId
);
159 void UpdateFromField(const DbGridRow
* pRow
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
);
162 // releasing all the data required for the AliveMode
165 OUString
GetCellText(const DbGridRow
* pRow
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) const;
166 OUString
GetCellText(const css::uno::Reference
< css::sdb::XColumn
>& xField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) const;
168 void SetReadOnly(bool bRead
){m_bReadOnly
= bRead
;}
169 void SetObject(sal_Int16 nPos
) {m_bObject
= m_bReadOnly
= true; m_nFieldPos
= nPos
;}
171 void ImplInitWindow( vcl::Window
const & rParent
, const InitWindowFacet _eInitWhat
);
173 // properties that can bleed through onto the css::frame::Controller
174 sal_Int16
SetAlignment(sal_Int16 _nAlign
);
175 // if _nAlign is -1, the alignment is calculated from the type of the field we are bound to
176 // the value really set is returned
177 sal_Int16
SetAlignmentFromModel(sal_Int16 nStandardAlign
);
178 // set the alignment according to the "Align"-property of m_xModel, use the given standard
179 // alignment if the property if void, return the really set alignment
182 bool isLocked() const { return m_bLocked
; }
183 void setLock(bool _bLock
);
186 /** attaches or detaches our cell object to the SctriptEventAttacherManager implemented
187 by our model's parent
189 void impl_toggleScriptManager_nothrow( bool _bAttach
);
193 // DbCellControl, provides the data for a CellController.
194 // Is usually only required for complex controls such as combo boxes.
197 :public FmMutexHelper
// _before_ the listener, so the listener is to be destroyed first!
198 ,public ::comphelper::OPropertyChangeListener
201 rtl::Reference
<::comphelper::OPropertyChangeMultiplexer
> m_pModelChangeBroadcaster
;
202 rtl::Reference
<::comphelper::OPropertyChangeMultiplexer
> m_pFieldChangeBroadcaster
;
205 bool m_bTransparent
: 1;
206 bool m_bAlignedController
: 1;
207 bool m_bAccessingValueProperty
: 1;
209 css::uno::Reference
< css::sdbc::XRowSet
>
213 DbGridColumn
& m_rColumn
;
214 VclPtr
<vcl::Window
> m_pPainter
;
215 VclPtr
<vcl::Window
> m_pWindow
;
219 const css::uno::Reference
< css::sdbc::XRowSet
>& getCursor() const { return m_xCursor
; }
221 // control transparency
222 bool isTransparent( ) const { return m_bTransparent
; }
223 void setTransparent( bool _bSet
) { m_bTransparent
= _bSet
; }
226 void setAlignedController( bool _bAlign
) { m_bAlignedController
= _bAlign
; }
229 /** determined whether or not the value property is locked
230 @see lockValueProperty
232 inline bool isValuePropertyLocked() const;
234 /** locks the listening at the value property.
235 <p>This means that every subsequent change now done on the value property of the model ("Text", or "Value",
236 or whatever) is then ignored.<br/>
237 This base class uses this setting in <method>Commit</method>.</p>
239 Value locking can't be nested
240 @see unlockValueProperty
242 inline void lockValueProperty();
243 /** unlocks the listening at the value property
244 @see lockValueProperty
246 inline void unlockValueProperty();
249 // adds the given property to the list of properties which we listen for
250 void doPropertyListening( const OUString
& _rPropertyName
);
252 // called whenever a property which affects field settings in general is called
253 // you should overwrite this method for every property you add yourself as listener to
254 // with doPropertyListening
255 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
);
257 // called by _propertyChanged if a property which denotes the column value has changed
258 void implValuePropertyChanged( );
262 DbCellControl(DbGridColumn
& _rColumn
);
263 virtual ~DbCellControl() override
;
266 vcl::Window
& GetWindow() const
268 ENSURE_OR_THROW( m_pWindow
, "no window" );
273 bool isAlignedController() const { return m_bAlignedController
; }
274 void AlignControl(sal_Int16 nAlignment
);
276 void SetTextLineColor();
277 void SetTextLineColor(const Color
& _rColor
);
279 // initializing before a control is displayed
280 virtual void Init( vcl::Window
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
);
281 virtual ::svt::CellControllerRef
CreateController() const = 0;
283 // writing the value into the model
286 // Formatting the field data to output text
287 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) = 0;
289 virtual void Update(){}
290 // Refresh the control by the field data
291 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) = 0;
293 // painting a cell content in the specified rectangle
294 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
);
295 virtual void PaintCell( OutputDevice
& _rDev
, const tools::Rectangle
& _rRect
);
297 void ImplInitWindow( vcl::Window
const & rParent
, const InitWindowFacet _eInitWhat
);
299 double GetValue(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) const;
302 void invalidatedController();
304 /** commits the content of the control (e.g. the text of an edit field) into the column model
305 (e.g. the "Text" property of the model).
306 <p>To be overwritten in derived classes.</p>
309 virtual bool commitControl( ) = 0;
311 /** updates the current content of the control (e.g. the text of an edit field) from the column model
312 (e.g. the "Text" property of the model).
313 <p>To be overwritten in derived classes.</p>
321 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) = 0;
324 // OPropertyChangeListener
325 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& evt
) override
;
328 void implDoPropertyListening( const OUString
& _rPropertyName
, bool _bWarnIfNotExistent
);
330 /// updates the "readonly" setting on m_pWindow, according to the respective property value in the given model
331 void implAdjustReadOnly( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
,bool i_bReadOnly
);
333 /// updates the "enabled" setting on m_pWindow, according to the respective property value in the given model
334 void implAdjustEnabled( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
);
338 inline bool DbCellControl::isValuePropertyLocked() const
340 return m_bAccessingValueProperty
;
344 inline void DbCellControl::lockValueProperty()
346 OSL_ENSURE( !isValuePropertyLocked(), "DbCellControl::lockValueProperty: not to be nested!" );
347 m_bAccessingValueProperty
= true;
351 inline void DbCellControl::unlockValueProperty()
353 OSL_ENSURE( isValuePropertyLocked(), "DbCellControl::lockValueProperty: not locked so far!" );
354 m_bAccessingValueProperty
= false;
358 /** a field which is bound to a column which supports the MaxTextLen property
360 class DbLimitedLengthField
: public DbCellControl
365 DbLimitedLengthField( DbGridColumn
& _rColumn
);
369 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
372 void implSetMaxTextLen( sal_Int16 _nMaxLen
)
374 implSetEffectiveMaxTextLen( _nMaxLen
? _nMaxLen
: EDIT_NOLIMIT
);
376 virtual void implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen
);
380 class DbTextField
: public DbLimitedLengthField
382 std::unique_ptr
<::svt::IEditImplementation
> m_pEdit
;
383 std::unique_ptr
<::svt::IEditImplementation
> m_pPainterImplementation
;
384 bool m_bIsSimpleEdit
;
387 virtual ~DbTextField( ) override
;
390 DbTextField(DbGridColumn
& _rColumn
);
392 ::svt::IEditImplementation
* GetEditImplementation() { return m_pEdit
.get(); }
393 bool IsSimpleEdit() const { return m_bIsSimpleEdit
; }
395 virtual void Init( vcl::Window
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
396 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
397 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
398 virtual ::svt::CellControllerRef
CreateController() const override
;
399 virtual void PaintFieldToCell( OutputDevice
& _rDev
, const tools::Rectangle
& _rRect
,
400 const css::uno::Reference
< css::sdb::XColumn
>& _rxField
,
401 const css::uno::Reference
< css::util::XNumberFormatter
>& _rxFormatter
) override
;
405 virtual bool commitControl( ) override
;
406 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
407 // DbLimitedLengthField
408 virtual void implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen
) override
;
412 class DbFormattedField final
: public DbLimitedLengthField
415 DbFormattedField(DbGridColumn
& _rColumn
);
416 virtual ~DbFormattedField() override
;
418 virtual void Init( vcl::Window
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
419 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
420 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
421 virtual ::svt::CellControllerRef
CreateController() const override
;
425 virtual bool commitControl( ) override
;
426 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
428 // OPropertyChangeListener
429 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& evt
) override
;
431 css::uno::Reference
< css::util::XNumberFormatsSupplier
> m_xSupplier
;
435 class DbCheckBox
: public DbCellControl
438 DbCheckBox(DbGridColumn
& _rColumn
);
440 virtual void Init( vcl::Window
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
441 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
442 virtual ::svt::CellControllerRef
CreateController() const override
;
443 virtual void PaintFieldToCell(OutputDevice
& rDev
, const tools::Rectangle
& rRect
,
444 const css::uno::Reference
< css::sdb::XColumn
>& _rxField
,
445 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
446 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
450 virtual bool commitControl( ) override
;
451 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
455 class DbComboBox
: public DbCellControl
459 DbComboBox(DbGridColumn
& _rColumn
);
461 virtual void Init( vcl::Window
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
462 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
463 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
464 virtual ::svt::CellControllerRef
CreateController() const override
;
466 void SetList(const css::uno::Any
& rItems
);
470 virtual bool commitControl( ) override
;
471 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
473 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
475 // OPropertyChangeListener
476 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& evt
) override
;
480 class DbListBox
:public DbCellControl
483 css::uno::Sequence
< OUString
> m_aValueList
;
486 DbListBox(DbGridColumn
& _rColumn
);
488 virtual void Init( vcl::Window
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
489 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
490 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
491 virtual ::svt::CellControllerRef
CreateController() const override
;
493 void SetList(const css::uno::Any
& rItems
);
497 virtual bool commitControl( ) override
;
498 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
500 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
502 // OPropertyChangeListener
503 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& evt
) override
;
507 class DbPatternField
: public DbCellControl
510 DbPatternField( DbGridColumn
& _rColumn
, const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
);
511 virtual void Init( vcl::Window
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
512 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
513 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
514 virtual ::svt::CellControllerRef
CreateController() const override
;
518 virtual bool commitControl( ) override
;
519 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
521 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
524 OUString
impl_formatText(const OUString
& _rText
);
527 ::std::unique_ptr
< ::dbtools::FormattedColumnValue
> m_pValueFormatter
;
528 ::std::unique_ptr
< ::dbtools::FormattedColumnValue
> m_pPaintFormatter
;
529 css::uno::Reference
<css::uno::XComponentContext
> m_xContext
;
533 class DbSpinField
: public DbCellControl
536 sal_Int16
const m_nStandardAlign
;
541 DbSpinField( DbGridColumn
& _rColumn
, sal_Int16 _nStandardAlign
= css::awt::TextAlign::RIGHT
);
544 virtual void Init( vcl::Window
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& _rxCursor
) override
;
545 virtual ::svt::CellControllerRef
CreateController() const override
;
548 virtual VclPtr
<SpinField
> createField(
549 vcl::Window
* _pParent
,
550 WinBits _nFieldStyle
,
551 const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
556 class DbDateField
: public DbSpinField
559 DbDateField(DbGridColumn
& _rColumn
);
560 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
561 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
565 virtual bool commitControl( ) override
;
566 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
569 virtual VclPtr
<SpinField
> createField(
570 vcl::Window
* _pParent
,
571 WinBits _nFieldStyle
,
572 const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
575 /// initializes everything which relates to the properties describing the numeric behaviour
576 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
580 class DbTimeField
: public DbSpinField
583 DbTimeField(DbGridColumn
& _rColumn
);
584 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
585 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
589 virtual bool commitControl( ) override
;
590 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
593 virtual VclPtr
<SpinField
> createField(
594 vcl::Window
* _pParent
,
595 WinBits _nFieldStyle
,
596 const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
599 /// initializes everything which relates to the properties describing the numeric behaviour
600 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
604 class DbCurrencyField
: public DbSpinField
609 DbCurrencyField(DbGridColumn
& _rColumn
);
610 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
611 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
613 double GetCurrency(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) const;
617 virtual bool commitControl( ) override
;
618 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
621 virtual VclPtr
<SpinField
> createField(
622 vcl::Window
* _pParent
,
623 WinBits _nFieldStyle
,
624 const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
627 /// initializes everything which relates to the properties describing the numeric behaviour
628 virtual void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
632 class DbNumericField
: public DbSpinField
635 DbNumericField(DbGridColumn
& _rColumn
);
636 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
637 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
641 virtual bool commitControl( ) override
;
642 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
645 virtual VclPtr
<SpinField
> createField(
646 vcl::Window
* _pParent
,
647 WinBits _nFieldStyle
,
648 const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
651 /// initializes everything which relates to the properties describing the numeric behaviour
652 void implAdjustGenericFieldSetting( const css::uno::Reference
< css::beans::XPropertySet
>& _rxModel
) override
;
656 class DbFilterField final
657 :public DbCellControl
658 ,public ::svxform::OSQLParserClient
661 DbFilterField(const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
, DbGridColumn
& _rColumn
);
662 virtual ~DbFilterField() override
;
664 virtual void Init( vcl::Window
& rParent
, const css::uno::Reference
< css::sdbc::XRowSet
>& xCursor
) override
;
665 virtual ::svt::CellControllerRef
CreateController() const override
;
666 virtual void PaintCell(OutputDevice
& rDev
, const tools::Rectangle
& rRect
) override
;
667 virtual void Update() override
;
668 virtual OUString
GetFormatText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
, Color
** ppColor
= nullptr) override
;
669 virtual void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
, const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
671 const OUString
& GetText() const {return m_aText
;}
672 void SetText(const OUString
& rText
);
674 void SetCommitHdl( const Link
<DbFilterField
&,void>& rLink
) { m_aCommitLink
= rLink
; }
678 virtual bool commitControl( ) override
;
679 virtual void updateFromModel( css::uno::Reference
< css::beans::XPropertySet
> _rxModel
) override
;
681 void SetList(const css::uno::Any
& rItems
, bool bComboBox
);
682 void CreateControl(vcl::Window
* pParent
, const css::uno::Reference
< css::beans::XPropertySet
>& xModel
);
683 DECL_LINK( OnClick
, VclPtr
<CheckBox
>, void );
685 css::uno::Sequence
< OUString
> m_aValueList
;
687 Link
<DbFilterField
&,void> m_aCommitLink
;
688 sal_Int16 m_nControlClass
;
689 bool m_bFilterList
: 1;
690 bool m_bFilterListFilled
: 1;
694 // Base class providing the access to a grid cell
696 typedef ::cppu::ImplHelper2
< css::awt::XControl
697 , css::form::XBoundControl
699 typedef ::cppu::ImplHelper1
< css::awt::XWindow
700 > FmXGridCell_WindowBase
;
701 class FmXGridCell
:public ::cppu::OComponentHelper
702 ,public FmXGridCell_Base
703 ,public FmXGridCell_WindowBase
706 ::osl::Mutex m_aMutex
;
707 DbGridColumn
* m_pColumn
;
708 std::unique_ptr
<DbCellControl
> m_pCellControl
;
711 ::comphelper::OInterfaceContainerHelper2 m_aWindowListeners
;
712 ::comphelper::OInterfaceContainerHelper2 m_aFocusListeners
;
713 ::comphelper::OInterfaceContainerHelper2 m_aKeyListeners
;
714 ::comphelper::OInterfaceContainerHelper2 m_aMouseListeners
;
715 ::comphelper::OInterfaceContainerHelper2 m_aMouseMotionListeners
;
718 virtual ~FmXGridCell() override
;
721 FmXGridCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
724 DECLARE_UNO3_AGG_DEFAULTS(FmXGridCell
, OComponentHelper
)
725 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
727 void SetTextLineColor();
728 void SetTextLineColor(const Color
& _rColor
);
731 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
732 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
735 virtual void SAL_CALL
disposing() override
;
737 // css::lang::XComponent
738 virtual void SAL_CALL
dispose() override
{OComponentHelper::dispose();}
739 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
>& aListener
) override
{ OComponentHelper::addEventListener(aListener
);}
740 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
>& aListener
) override
{ OComponentHelper::removeEventListener(aListener
);}
742 // css::awt::XControl
743 virtual void SAL_CALL
setContext(const css::uno::Reference
< css::uno::XInterface
>& /*Context*/) override
{}
744 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getContext() override
;
745 virtual void SAL_CALL
createPeer(const css::uno::Reference
< css::awt::XToolkit
>& /*Toolkit*/, const css::uno::Reference
< css::awt::XWindowPeer
>& /*Parent*/) override
{}
747 virtual css::uno::Reference
< css::awt::XWindowPeer
> SAL_CALL
getPeer() override
{return css::uno::Reference
< css::awt::XWindowPeer
> ();}
748 virtual sal_Bool SAL_CALL
setModel(const css::uno::Reference
< css::awt::XControlModel
>& /*Model*/) override
{return false;}
749 virtual css::uno::Reference
< css::awt::XControlModel
> SAL_CALL
getModel() override
;
750 virtual css::uno::Reference
< css::awt::XView
> SAL_CALL
getView() override
{return css::uno::Reference
< css::awt::XView
> ();}
751 virtual void SAL_CALL
setDesignMode(sal_Bool
/*bOn*/) override
{}
752 virtual sal_Bool SAL_CALL
isDesignMode() override
{return false;}
753 virtual sal_Bool SAL_CALL
isTransparent() override
{return false;}
755 // css::form::XBoundControl
756 virtual sal_Bool SAL_CALL
getLock() override
;
757 virtual void SAL_CALL
setLock(sal_Bool _bLock
) override
;
760 virtual void SAL_CALL
setPosSize( ::sal_Int32 X
, ::sal_Int32 Y
, ::sal_Int32 Width
, ::sal_Int32 Height
, ::sal_Int16 Flags
) override
;
761 virtual css::awt::Rectangle SAL_CALL
getPosSize( ) override
;
762 virtual void SAL_CALL
setVisible( sal_Bool Visible
) override
;
763 virtual void SAL_CALL
setEnable( sal_Bool Enable
) override
;
764 virtual void SAL_CALL
setFocus( ) override
;
765 virtual void SAL_CALL
addWindowListener( const css::uno::Reference
< css::awt::XWindowListener
>& xListener
) override
;
766 virtual void SAL_CALL
removeWindowListener( const css::uno::Reference
< css::awt::XWindowListener
>& xListener
) override
;
767 virtual void SAL_CALL
addFocusListener( const css::uno::Reference
< css::awt::XFocusListener
>& xListener
) override
;
768 virtual void SAL_CALL
removeFocusListener( const css::uno::Reference
< css::awt::XFocusListener
>& xListener
) override
;
769 virtual void SAL_CALL
addKeyListener( const css::uno::Reference
< css::awt::XKeyListener
>& xListener
) override
;
770 virtual void SAL_CALL
removeKeyListener( const css::uno::Reference
< css::awt::XKeyListener
>& xListener
) override
;
771 virtual void SAL_CALL
addMouseListener( const css::uno::Reference
< css::awt::XMouseListener
>& xListener
) override
;
772 virtual void SAL_CALL
removeMouseListener( const css::uno::Reference
< css::awt::XMouseListener
>& xListener
) override
;
773 virtual void SAL_CALL
addMouseMotionListener( const css::uno::Reference
< css::awt::XMouseMotionListener
>& xListener
) override
;
774 virtual void SAL_CALL
removeMouseMotionListener( const css::uno::Reference
< css::awt::XMouseMotionListener
>& xListener
) override
;
775 virtual void SAL_CALL
addPaintListener( const css::uno::Reference
< css::awt::XPaintListener
>& xListener
) override
;
776 virtual void SAL_CALL
removePaintListener( const css::uno::Reference
< css::awt::XPaintListener
>& xListener
) override
;
778 bool Commit() {return m_pCellControl
->Commit();}
779 void ImplInitWindow( vcl::Window
const & rParent
, const InitWindowFacet _eInitWhat
)
780 { m_pCellControl
->ImplInitWindow( rParent
, _eInitWhat
); }
782 bool isAlignedController() const { return m_pCellControl
->isAlignedController(); }
783 void AlignControl(sal_Int16 nAlignment
)
784 { m_pCellControl
->AlignControl(nAlignment
);}
787 virtual vcl::Window
* getEventWindow() const;
788 virtual void onWindowEvent( const VclEventId _nEventId
, const vcl::Window
& _rWindow
, const void* _pEventData
);
790 // default implementations call our focus listeners, don't forget to call them if you override this
791 virtual void onFocusGained( const css::awt::FocusEvent
& _rEvent
);
792 virtual void onFocusLost( const css::awt::FocusEvent
& _rEvent
);
795 DECL_LINK( OnWindowEvent
, VclWindowEvent
&, void );
799 class FmXDataCell
: public FmXGridCell
802 FmXDataCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
)
803 :FmXGridCell( pColumn
, std::move(pControl
) )
807 virtual void PaintFieldToCell(OutputDevice
& rDev
,
808 const tools::Rectangle
& rRect
,
809 const css::uno::Reference
< css::sdb::XColumn
>& xField
,
810 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
);
812 void UpdateFromField(const css::uno::Reference
< css::sdb::XColumn
>& xField
,
813 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
)
814 { m_pCellControl
->UpdateFromField(xField
, xFormatter
); }
817 void UpdateFromColumn();
821 class FmXTextCell
: public FmXDataCell
824 /** determines whether the text of this cell can be painted directly, without
825 using the painter control
827 If this is <TRUE/>, the <member>PaintCell</member> method will simply use the text as returned
828 by <member>GetText</member>, and draw it onto the device passed to <member>PaintFieldToCell</member>,
829 while respecting the current alignment settings.
831 If this is <FALSE/>, the <member>PaintFieldToCell</member> request will be forwarded to the painter
832 control (<member>m_pPainter</member>). This is more expensive, but the only option
833 if your painting involves more that a simple DrawText.
835 This member is <TRUE/> by default, and can be modified by derived classes.
840 FmXTextCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
842 virtual void PaintFieldToCell(OutputDevice
& rDev
,
843 const tools::Rectangle
& rRect
,
844 const css::uno::Reference
< css::sdb::XColumn
>& xField
,
845 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
) override
;
847 OUString
GetText(const css::uno::Reference
< css::sdb::XColumn
>& _rxField
,
848 const css::uno::Reference
< css::util::XNumberFormatter
>& xFormatter
,
849 Color
** ppColor
= nullptr)
850 {return m_pCellControl
->GetFormatText(_rxField
, xFormatter
, ppColor
);}
854 typedef ::cppu::ImplHelper2
< css::awt::XTextComponent
855 , css::form::XChangeBroadcaster
857 class FmXEditCell final
: public FmXTextCell
,
858 public FmXEditCell_Base
861 FmXEditCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
863 DECLARE_UNO3_AGG_DEFAULTS(FmXEditCell
, FmXTextCell
)
864 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
867 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
868 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
871 virtual void SAL_CALL
disposing() override
;
873 // css::awt::XTextComponent
874 virtual void SAL_CALL
addTextListener(const css::uno::Reference
< css::awt::XTextListener
>& l
) override
;
875 virtual void SAL_CALL
removeTextListener(const css::uno::Reference
< css::awt::XTextListener
>& l
) override
;
876 virtual void SAL_CALL
setText(const OUString
& aText
) override
;
877 virtual void SAL_CALL
insertText(const css::awt::Selection
& Sel
, const OUString
& Text
) override
;
878 virtual OUString SAL_CALL
getText() override
;
879 virtual OUString SAL_CALL
getSelectedText() override
;
880 virtual void SAL_CALL
setSelection(const css::awt::Selection
& aSelection
) override
;
881 virtual css::awt::Selection SAL_CALL
getSelection() override
;
882 virtual sal_Bool SAL_CALL
isEditable() override
;
883 virtual void SAL_CALL
setEditable(sal_Bool bEditable
) override
;
884 virtual void SAL_CALL
setMaxTextLen(sal_Int16 nLen
) override
;
885 virtual sal_Int16 SAL_CALL
getMaxTextLen() override
;
887 // XChangeBroadcaster
888 virtual void SAL_CALL
addChangeListener( const css::uno::Reference
< css::form::XChangeListener
>& aListener
) override
;
889 virtual void SAL_CALL
removeChangeListener( const css::uno::Reference
< css::form::XChangeListener
>& aListener
) override
;
892 virtual ~FmXEditCell() override
;
894 virtual void onWindowEvent( const VclEventId _nEventId
, const vcl::Window
& _rWindow
, const void* _pEventData
) override
;
896 virtual void onFocusGained( const css::awt::FocusEvent
& _rEvent
) override
;
897 virtual void onFocusLost( const css::awt::FocusEvent
& _rEvent
) override
;
899 void onTextChanged();
901 OUString m_sValueOnEnter
;
902 ::comphelper::OInterfaceContainerHelper2 m_aTextListeners
;
903 ::comphelper::OInterfaceContainerHelper2 m_aChangeListeners
;
904 ::svt::IEditImplementation
* m_pEditImplementation
;
905 bool m_bOwnEditImplementation
;
909 typedef ::cppu::ImplHelper2
< css::awt::XCheckBox
911 > FmXCheckBoxCell_Base
;
912 class FmXCheckBoxCell
: public FmXDataCell
,
913 public FmXCheckBoxCell_Base
915 ::comphelper::OInterfaceContainerHelper2 m_aItemListeners
;
916 ::comphelper::OInterfaceContainerHelper2 m_aActionListeners
;
917 OUString m_aActionCommand
;
918 VclPtr
<CheckBox
> m_pBox
;
921 virtual ~FmXCheckBoxCell() override
;
924 FmXCheckBoxCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
927 DECLARE_UNO3_AGG_DEFAULTS(FmXCheckBoxCell
, FmXDataCell
)
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::XCheckBox
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 sal_Int16 SAL_CALL
getState() override
;
939 virtual void SAL_CALL
setState(sal_Int16 n
) override
;
940 virtual void SAL_CALL
setLabel(const OUString
& Label
) override
;
941 virtual void SAL_CALL
enableTriState(sal_Bool b
) override
;
944 virtual void SAL_CALL
addActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
945 virtual void SAL_CALL
removeActionListener( const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
946 //virtual void SAL_CALL setLabel( const OUString& Label ) throw (css::uno::RuntimeException);
947 virtual void SAL_CALL
setActionCommand( const OUString
& Command
) override
;
950 virtual vcl::Window
* getEventWindow() const override
;
951 virtual void onWindowEvent( const VclEventId _nEventId
, const vcl::Window
& _rWindow
, const void* _pEventData
) override
;
955 typedef ::cppu::ImplHelper1
< css::awt::XListBox
956 > FmXListBoxCell_Base
;
957 class FmXListBoxCell final
:public FmXTextCell
958 ,public FmXListBoxCell_Base
961 FmXListBoxCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
963 DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell
, FmXTextCell
)
964 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
965 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
966 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
969 virtual void SAL_CALL
disposing() override
;
971 // css::awt::XListBox
972 virtual void SAL_CALL
addItemListener(const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
973 virtual void SAL_CALL
removeItemListener(const css::uno::Reference
< css::awt::XItemListener
>& l
) override
;
974 virtual void SAL_CALL
addActionListener(const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
975 virtual void SAL_CALL
removeActionListener(const css::uno::Reference
< css::awt::XActionListener
>& l
) override
;
976 virtual void SAL_CALL
addItem(const OUString
& aItem
, sal_Int16 nPos
) override
;
977 virtual void SAL_CALL
addItems(const css::uno::Sequence
< OUString
>& aItems
, sal_Int16 nPos
) override
;
978 virtual void SAL_CALL
removeItems(sal_Int16 nPos
, sal_Int16 nCount
) override
;
979 virtual sal_Int16 SAL_CALL
getItemCount() override
;
980 virtual OUString SAL_CALL
getItem(sal_Int16 nPos
) override
;
981 virtual css::uno::Sequence
< OUString
> SAL_CALL
getItems() override
;
982 virtual sal_Int16 SAL_CALL
getSelectedItemPos() override
;
983 virtual css::uno::Sequence
< sal_Int16
> SAL_CALL
getSelectedItemsPos() override
;
984 virtual OUString SAL_CALL
getSelectedItem() override
;
985 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSelectedItems() override
;
986 virtual void SAL_CALL
selectItemPos(sal_Int16 nPos
, sal_Bool bSelect
) override
;
987 virtual void SAL_CALL
selectItemsPos(const css::uno::Sequence
< sal_Int16
>& aPositions
, sal_Bool bSelect
) override
;
988 virtual void SAL_CALL
selectItem(const OUString
& aItem
, sal_Bool bSelect
) override
;
989 virtual sal_Bool SAL_CALL
isMutipleMode() override
;
990 virtual void SAL_CALL
setMultipleMode(sal_Bool bMulti
) override
;
991 virtual sal_Int16 SAL_CALL
getDropDownLineCount() override
;
992 virtual void SAL_CALL
setDropDownLineCount(sal_Int16 nLines
) override
;
993 virtual void SAL_CALL
makeVisible(sal_Int16 nEntry
) override
;
996 virtual void onWindowEvent( const VclEventId _nEventId
, const vcl::Window
& _rWindow
, const void* _pEventData
) override
;
997 virtual ~FmXListBoxCell() override
;
999 DECL_LINK( OnDoubleClick
, ListBox
&, void );
1001 ::comphelper::OInterfaceContainerHelper2 m_aItemListeners
,
1003 VclPtr
<ListBox
> m_pBox
;
1007 typedef ::cppu::ImplHelper1
< css::awt::XComboBox
1008 > FmXComboBoxCell_Base
;
1009 class FmXComboBoxCell
:public FmXTextCell
1010 ,public FmXComboBoxCell_Base
1013 ::comphelper::OInterfaceContainerHelper2 m_aItemListeners
,
1015 VclPtr
<ComboBox
> m_pComboBox
;
1018 virtual ~FmXComboBoxCell() override
;
1021 FmXComboBoxCell( DbGridColumn
* pColumn
, std::unique_ptr
<DbCellControl
> pControl
);
1023 DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell
, FmXTextCell
)
1024 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
1025 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
1026 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
1029 virtual void SAL_CALL
disposing() override
;
1032 virtual void SAL_CALL
addItemListener( const css::uno::Reference
< css::awt::XItemListener
>& Listener
) override
;
1033 virtual void SAL_CALL
removeItemListener( const css::uno::Reference
< css::awt::XItemListener
>& Listener
) override
;
1034 virtual void SAL_CALL
addActionListener( const css::uno::Reference
< css::awt::XActionListener
>& Listener
) override
;
1035 virtual void SAL_CALL
removeActionListener( const css::uno::Reference
< css::awt::XActionListener
>& Listener
) override
;
1036 virtual void SAL_CALL
addItem( const OUString
& Item
, ::sal_Int16 Pos
) override
;
1037 virtual void SAL_CALL
addItems( const css::uno::Sequence
< OUString
>& Items
, ::sal_Int16 Pos
) override
;
1038 virtual void SAL_CALL
removeItems( ::sal_Int16 nPos
, ::sal_Int16 nCount
) override
;
1039 virtual ::sal_Int16 SAL_CALL
getItemCount( ) override
;
1040 virtual OUString SAL_CALL
getItem( ::sal_Int16 Pos
) override
;
1041 virtual css::uno::Sequence
< OUString
> SAL_CALL
getItems( ) override
;
1042 virtual ::sal_Int16 SAL_CALL
getDropDownLineCount( ) override
;
1043 virtual void SAL_CALL
setDropDownLineCount( ::sal_Int16 Lines
) override
;
1046 virtual void onWindowEvent( const VclEventId _nEventId
, const vcl::Window
& _rWindow
, const void* _pEventData
) override
;
1050 typedef ::cppu::ImplHelper2
< css::awt::XTextComponent
1051 , css::lang::XUnoTunnel
1052 > FmXFilterCell_Base
;
1053 class FmXFilterCell final
: public FmXGridCell
1054 ,public FmXFilterCell_Base
1057 FmXFilterCell(DbGridColumn
* pColumn
, std::unique_ptr
<DbFilterField
> pControl
);
1060 DECLARE_UNO3_AGG_DEFAULTS(FmXFilterCell
, FmXGridCell
)
1061 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
1062 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
1063 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
1066 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
1068 // helpers for XUnoTunnel
1069 static const css::uno::Sequence
<sal_Int8
>& getUnoTunnelId();
1071 // painting the filter text
1072 void PaintCell(OutputDevice
& rDev
, const tools::Rectangle
& rRect
);
1073 void Update(){m_pCellControl
->Update();}
1076 virtual void SAL_CALL
disposing() override
;
1078 // css::awt::XTextComponent
1079 virtual void SAL_CALL
addTextListener(const css::uno::Reference
< css::awt::XTextListener
>& l
) override
;
1080 virtual void SAL_CALL
removeTextListener(const css::uno::Reference
< css::awt::XTextListener
>& l
) override
;
1081 virtual void SAL_CALL
setText(const OUString
& aText
) override
;
1082 virtual void SAL_CALL
insertText(const css::awt::Selection
& Sel
, const OUString
& Text
) override
;
1083 virtual OUString SAL_CALL
getText() override
;
1084 virtual OUString SAL_CALL
getSelectedText() override
;
1085 virtual void SAL_CALL
setSelection(const css::awt::Selection
& aSelection
) override
;
1086 virtual css::awt::Selection SAL_CALL
getSelection() override
;
1087 virtual sal_Bool SAL_CALL
isEditable() override
;
1088 virtual void SAL_CALL
setEditable(sal_Bool bEditable
) override
;
1089 virtual void SAL_CALL
setMaxTextLen(sal_Int16 nLen
) override
;
1090 virtual sal_Int16 SAL_CALL
getMaxTextLen() override
;
1093 DECL_LINK( OnCommit
, DbFilterField
&, void );
1094 virtual ~FmXFilterCell() override
;
1096 ::comphelper::OInterfaceContainerHelper2 m_aTextListeners
;
1099 #endif // INCLUDED_SVX_SOURCE_INC_GRIDCELL_HXX
1101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */