24 #include <svx/strings.hrc>
30 #include <com/sun/star/awt/LineEndFormat.hpp>
31 #include <com/sun/star/awt/MouseWheelBehavior.hpp>
32 #include <com/sun/star/awt/VisualEffect.hpp>
33 #include <com/sun/star/container/XChild.hpp>
34 #include <com/sun/star/container/XIndexAccess.hpp>
35 #include <com/sun/star/form/FormComponentType.hpp>
36 #include <com/sun/star/form/XBoundComponent.hpp>
37 #include <com/sun/star/script/XEventAttacherManager.hpp>
38 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
39 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
40 #include <com/sun/star/sdbc/DataType.hpp>
41 #include <com/sun/star/sdbc/SQLException.hpp>
42 #include <com/sun/star/sdbc/XRowSet.hpp>
43 #include <com/sun/star/sdbc/XStatement.hpp>
44 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
45 #include <com/sun/star/util/XNumberFormatter.hpp>
46 #include <com/sun/star/util/Time.hpp>
47 #include <com/sun/star/util/Date.hpp>
72 using namespace ::
svt;
83 using ::com::sun::star::util::XNumberFormatter;
99 sal_Int16 nLineEndFormat = awt::LineEndFormat::LINE_FEED;
101 Reference< XPropertySetInfo > xPSI;
103 xPSI = _rxModel->getPropertySetInfo();
105 OSL_ENSURE( xPSI.is(),
"getModelLineEndSetting: invalid column model!" );
110 switch ( nLineEndFormat )
112 case awt::LineEndFormat::CARRIAGE_RETURN: eFormat =
LINEEND_CR;
break;
113 case awt::LineEndFormat::LINE_FEED: eFormat =
LINEEND_LF;
break;
114 case awt::LineEndFormat::CARRIAGE_RETURN_LINE_FEED: eFormat =
LINEEND_CRLF;
break;
116 OSL_FAIL(
"getModelLineEndSetting: what's this?" );
139 m_nTypeId =
static_cast<sal_Int16
>(nTypeId);
150 switch (m_nFieldType)
154 case DataType::TIMESTAMP:
156 case DataType::BOOLEAN:
157 case DataType::TINYINT:
158 case DataType::SMALLINT:
159 case DataType::INTEGER:
160 case DataType::BIGINT:
161 case DataType::FLOAT:
163 case DataType::DOUBLE:
164 case DataType::NUMERIC:
165 case DataType::DECIMAL:
166 m_nAlign = css::awt::TextAlign::RIGHT;
170 m_nAlign = css::awt::TextAlign::LEFT;
175 std::unique_ptr<DbCellControl> pCellControl;
196 OSL_FAIL(
"DbGridColumn::CreateControl: Unknown Column");
201 Reference< XRowSet > xCur;
209 auto pTempCellControl = pCellControl.get();
211 m_pCell =
new FmXFilterCell(
this, std::unique_ptr<DbFilterField>(static_cast<DbFilterField*>(pCellControl.release())));
238 Reference< container::XChild > xChild(
m_xModel, UNO_QUERY_THROW );
239 Reference< script::XEventAttacherManager > xManager( xChild->getParent(), UNO_QUERY_THROW );
240 Reference< container::XIndexAccess > xContainer( xChild->getParent(), UNO_QUERY_THROW );
244 Reference< XInterface > xCellInterface( *
m_pCell, UNO_QUERY );
246 xManager->attach( nIndexInParent, xCellInterface,
makeAny( xCellInterface ) );
248 xManager->detach( nIndexInParent, xCellInterface );
276 if (bResult && pDataCell)
278 Reference< css::form::XBoundComponent > xComp(
m_xModel, UNO_QUERY);
280 bResult = xComp->commit();
336 case DataType::NUMERIC:
337 case DataType::DECIMAL:
338 case DataType::DOUBLE:
340 case DataType::BIGINT:
341 case DataType::INTEGER:
342 case DataType::SMALLINT:
343 case DataType::TINYINT:
346 case DataType::TIMESTAMP:
347 _nAlign = css::awt::TextAlign::RIGHT;
350 case DataType::BOOLEAN:
351 _nAlign = css::awt::TextAlign::CENTER;
354 _nAlign = css::awt::TextAlign::LEFT;
359 _nAlign = css::awt::TextAlign::LEFT;
373 if (aAlign.hasValue())
375 sal_Int16 nTest = sal_Int16();
376 if (aAlign >>= nTest)
377 nStandardAlign = nTest;
423 aText = pTextCell->
GetText(xField, xFormatter);
432 Reference< css::sdb::XColumn > xField;
448 || ( static_cast< vcl::Window& >( rDev ).IsEnabled() );
455 DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::Center;
457 nStyle |= DrawTextFlags::Disable;
463 DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::VCenter;
465 nStyle |= DrawTextFlags::Disable;
469 case css::awt::TextAlign::RIGHT:
470 nStyle |= DrawTextFlags::Right;
472 case css::awt::TextAlign::CENTER:
473 nStyle |= DrawTextFlags::Center;
476 nStyle |= DrawTextFlags::Left;
490 DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::Center;
492 nStyle |= DrawTextFlags::Disable;
498 DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::Center;
500 nStyle |= DrawTextFlags::Disable;
504 else if (
auto pFilterCell = dynamic_cast<FmXFilterCell*>(
m_pCell.get() ) )
505 pFilterCell->PaintCell( rDev, rRect );
512 m_pCell->ImplInitWindow( rParent, _eInitWhat );
521 ,m_bTransparent( false )
522 ,m_bAlignedController( true )
523 ,m_bAccessingValueProperty( false )
524 ,m_rColumn( _rColumn )
525 ,m_pPainter( nullptr )
526 ,m_pWindow( nullptr )
529 if ( !xColModelProps.is() )
551 Reference< XPropertySetInfo > xPSI( xColModelProps->getPropertySetInfo(), UNO_SET_THROW );
575 Reference< XPropertySetInfo > xPSI;
576 if ( xColModelProps.is() )
577 xPSI = xColModelProps->getPropertySetInfo();
579 DBG_ASSERT( !_bWarnIfNotExistent || ( xPSI.is() && xPSI->hasPropertyByName( _rPropertyName ) ),
580 "DbCellControl::doPropertyListening: no property set info or non-existent property!" );
582 if ( xPSI.is() && xPSI->hasPropertyByName( _rPropertyName ) )
599 if ( _pBroadcaster.is() )
601 _pBroadcaster->dispose();
602 _pBroadcaster.clear();
619 "DbCellControl::implValuePropertyChanged: not to be called with the value property locked!" );
679 bool bReturn =
false;
714 pWindow->SetZoom(rParent.
GetZoom());
716 const StyleSettings& rStyleSettings = pWindow->GetSettings().GetStyleSettings();
726 pWindow->SetControlFont();
728 pWindow->SetZoomedPointFont(*pWindow, aFont);
743 pWindow->SetTextColor(aTextColor);
745 pWindow->SetControlForeground(aTextColor);
748 pWindow->SetTextLineColor();
750 pWindow->SetTextLineColor(aTextLineColor);
766 pWindow->SetBackground();
769 pWindow->SetBackground(aColor);
770 pWindow->SetControlBackground(aColor);
772 pWindow->SetFillColor(aColor);
799 DBG_ASSERT(
m_pWindow,
"DbCellControl::implAdjustReadOnly: not to be called without window!" );
800 DBG_ASSERT( _rxModel.is(),
"DbCellControl::implAdjustReadOnly: invalid model!" );
804 ControlBase* pEditWindow =
dynamic_cast<ControlBase*
>(
m_pWindow.
get());
812 pEditWindow->SetEditableReadOnly(bReadOnly);
818 DBG_ASSERT(
m_pWindow,
"DbCellControl::implAdjustEnabled: not to be called without window!" );
819 DBG_ASSERT( _rxModel.is(),
"DbCellControl::implAdjustEnabled: invalid model!" );
842 Reference< XPropertySetInfo > xModelPSI(
xModel->getPropertySetInfo(), UNO_SET_THROW );
856 sal_Int16 nWheelBehavior = css::awt::MouseWheelBehavior::SCROLL_FOCUS_ONLY;
859 switch ( nWheelBehavior )
861 case css::awt::MouseWheelBehavior::SCROLL_DISABLED: nVclSetting = MouseWheelBehaviour::Disable;
break;
862 case css::awt::MouseWheelBehavior::SCROLL_FOCUS_ONLY: nVclSetting = MouseWheelBehaviour::FocusOnly;
break;
863 case css::awt::MouseWheelBehavior::SCROLL_ALWAYS: nVclSetting = MouseWheelBehaviour::ALWAYS;
break;
865 OSL_FAIL(
"DbCellControl::Init: invalid MouseWheelBehavior!" );
908 if (EditControlBase* pControl = dynamic_cast<EditControlBase*>(_pWindow))
910 switch (_nAlignmentBit)
913 pControl->get_widget().set_alignment(TxtAlign::Left);
916 pControl->get_widget().set_alignment(TxtAlign::Center);
919 pControl->get_widget().set_alignment(TxtAlign::Right);
927 _pWindow->
SetStyle( nStyle | _nAlignmentBit );
936 case css::awt::TextAlign::RIGHT:
939 case css::awt::TextAlign::CENTER:
946 lcl_implAlign(
m_pWindow, nAlignmentBit );
970 fValue = _rxField->getDouble();
976 bool bSuccess =
false;
979 fValue = _rxField->getDouble();
987 fValue = xFormatter->convertStringToNumber(
m_rColumn.
GetKey(), _rxField->getString());
1011 DBG_ASSERT(
m_pWindow,
"DbLimitedLengthField::implAdjustGenericFieldSetting: not to be called without window!" );
1012 DBG_ASSERT( _rxModel.is(),
"DbLimitedLengthField::implAdjustGenericFieldSetting: invalid model!" );
1015 sal_Int16 nMaxLen = 0;
1023 dynamic_cast<EditControlBase&
>(*m_pWindow).get_widget().set_max_length(nMaxLen);
1025 dynamic_cast<EditControlBase&
>(*m_pPainter).get_widget().set_max_length(nMaxLen);
1030 ,m_bIsSimpleEdit( true )
1046 bool bLeftAlign =
true;
1049 bool bIsMultiLine =
false;
1060 "caught an exception while determining the multi-line capabilities!");
1071 case awt::TextAlign::RIGHT:
1072 xEditControl->get_widget().set_alignment(TxtAlign::Right);
1073 xEditPainter->get_widget().set_alignment(TxtAlign::Right);
1076 case awt::TextAlign::CENTER:
1077 xEditControl->get_widget().set_alignment(TxtAlign::Center);
1078 xEditPainter->get_widget().set_alignment(TxtAlign::Center);
1084 m_pEdit.reset(
new MultiLineEditImplementation(*xEditControl));
1096 case awt::TextAlign::RIGHT:
1097 xEditControl->get_widget().set_alignment(TxtAlign::Right);
1098 xEditPainter->get_widget().set_alignment(TxtAlign::Right);
1101 case awt::TextAlign::CENTER:
1102 xEditControl->get_widget().set_alignment(TxtAlign::Center);
1103 xEditPainter->get_widget().set_alignment(TxtAlign::Center);
1109 m_pEdit.reset(
new EntryImplementation(*xEditControl));
1133 return new EditCellController(
m_pEdit.get() );
1149 const css::uno::Reference<css::beans::XPropertySet> xPS(_rxField, UNO_QUERY);
1150 FormattedColumnValue fmter( xFormatter, xPS );
1154 return fmter.getFormattedValue();
1172 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbTextField::updateFromModel: invalid call!" );
1177 sal_Int32 nMaxTextLen =
m_pEdit->GetMaxTextLen();
1178 if (nMaxTextLen != 0 && sText.getLength() > nMaxTextLen)
1180 sal_Int32 nDiff = sText.getLength() - nMaxTextLen;
1181 sText = sText.replaceAt(sText.getLength() - nDiff,nDiff, OUString());
1193 sal_Int32 nMaxTextLen =
m_pEdit->GetMaxTextLen();
1194 if (nMaxTextLen != 0)
1199 if ( sOldValue.getLength() > nMaxTextLen && sOldValue.compareTo(aText,nMaxTextLen) == 0 )
1209 m_pEdit->SetMaxTextLen( _nMaxLen );
1242 case awt::TextAlign::RIGHT:
1243 xEditControl->get_widget().set_alignment(TxtAlign::Right);
1244 xEditPainter->get_widget().set_alignment(TxtAlign::Right);
1246 case awt::TextAlign::CENTER:
1247 xEditControl->get_widget().set_alignment(TxtAlign::Center);
1248 xEditPainter->get_widget().set_alignment(TxtAlign::Center);
1270 sal_Int32 nFormatKey = -1;
1275 if (aSupplier.hasValue())
1282 if (aFmtKey.hasValue())
1284 DBG_ASSERT(aFmtKey.getValueType().getTypeClass() == TypeClass_LONG,
"DbFormattedField::Init : invalid format key property (no sal_Int32) !");
1285 nFormatKey = ::comphelper::getINT32(aFmtKey);
1289 SAL_INFO(
"svx.fmcomp",
"DbFormattedField::Init : my uno-model has no format-key, but a formats supplier !");
1317 if (pImplementation)
1326 if (pFormatterUsed ==
nullptr)
1329 DBG_ASSERT(pFormatterUsed !=
nullptr,
"DbFormattedField::Init : no standard formatter given by the numeric field !");
1332 if (nFormatKey == -1)
1347 bool bClearMin =
true;
1351 if (aMin.getValueType().getTypeClass() != TypeClass_VOID)
1353 DBG_ASSERT(aMin.getValueType().getTypeClass() == TypeClass_DOUBLE,
"DbFormattedField::Init : the model has an invalid min value !");
1354 double dMin = ::comphelper::getDouble(aMin);
1365 bool bClearMax =
true;
1369 if (aMax.getValueType().getTypeClass() != TypeClass_VOID)
1371 DBG_ASSERT(aMax.getValueType().getTypeClass() == TypeClass_DOUBLE,
"DbFormattedField::Init : the model has an invalid max value !");
1372 double dMax = ::comphelper::getDouble(aMax);
1387 if (aDefault.hasValue())
1389 switch (aDefault.getValueType().getTypeClass())
1391 case TypeClass_DOUBLE:
1399 OUString sConverted;
1400 const Color* pDummy;
1406 case TypeClass_STRING:
1412 sal_uInt32 nTestFormat(0);
1427 OSL_FAIL(
"DbFormattedField::Init: unexpected value type!" );
1436 return new ::svt::FormattedFieldCellController(static_cast<FormattedControlBase*>(
m_pWindow.
get()));
1443 sal_Int32 nNewKey = _rEvent.NewValue.hasValue() ? ::comphelper::getINT32(_rEvent.NewValue) : 0;
1447 static_cast<FormattedControlBase*
>(
m_pWindow.
get())->get_formatter().SetFormatKey(nNewKey);
1449 static_cast<FormattedControlBase*
>(
m_pPainter.
get())->get_formatter().SetFormatKey(nNewKey);
1460 if (ppColor !=
nullptr)
1467 FormattedControlBase* pControl =
static_cast<FormattedControlBase*
>(
m_pPainter.
get());
1481 if (_rxField->wasNull())
1483 rPainterFormatter.
SetValue(dValue);
1489 aText = _rxField->getString();
1490 if (_rxField->wasNull())
1500 aText = pControl->get_widget().get_text();
1501 if (ppColor !=
nullptr)
1511 FormattedControlBase* pEditControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
1528 if (_rxField->wasNull())
1537 OUString sText( _rxField->getString());
1551 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbFormattedField::updateFromModel: invalid call!" );
1553 FormattedControlBase* pEditControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
1559 if ( !aValue.hasValue() || (aValue >>= sText) )
1577 FormattedControlBase* pEditControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
1584 aNewVal <<= rEditFormatter.
GetValue();
1602 void setCheckBoxStyle(
vcl::Window* _pWindow,
bool bMono )
1631 sal_Int16 nStyle = awt::VisualEffect::LOOK3D;
1634 setCheckBoxStyle(
m_pWindow, nStyle == awt::VisualEffect::FLAT );
1635 setCheckBoxStyle(
m_pPainter, nStyle == awt::VisualEffect::FLAT );
1637 bool bTristate =
true;
1639 static_cast< CheckBoxControl*
>(
m_pWindow.
get() )->EnableTriState( bTristate );
1640 static_cast< CheckBoxControl*
>(
m_pPainter.
get() )->EnableTriState( bTristate );
1652 return new CheckBoxCellController(static_cast<CheckBoxControl*>(
m_pWindow.
get()));
1656 CheckBoxControl* _pCheckBoxControl )
1663 bool bValue = _rxField->getBoolean();
1664 if (!_rxField->wasNull())
1672 _pCheckBoxControl->SetState(eState);
1681 const Reference< css::sdb::XColumn >& _rxField,
1684 CheckBoxControl* pControl =
static_cast<CheckBoxControl*
>(
m_pPainter.
get());
1687 Size aBoxSize = pControl->GetBox().get_preferred_size();
1697 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbCheckBox::updateFromModel: invalid call!" );
1701 static_cast< CheckBoxControl*
>(
m_pWindow.
get() )->SetState( static_cast< TriState >( nState ) );
1707 makeAny( static_cast<sal_Int16>( static_cast< CheckBoxControl* >(
m_pWindow.
get() )->GetState() ) ) );
1727 DBG_ASSERT(
m_pWindow,
"DbPatternField::implAdjustGenericFieldSetting: not to be called without window!" );
1728 DBG_ASSERT( _rxModel.is(),
"DbPatternField::implAdjustGenericFieldSetting: invalid model!" );
1734 bool bStrict =
false;
1740 OString aAsciiEditMask(
OUStringToOString(aEditMask, RTL_TEXTENCODING_ASCII_US));
1743 rEditFormatter.
SetMask(aAsciiEditMask, aLitMask);
1747 rPaintFormatter.
SetMask(aAsciiEditMask, aLitMask);
1766 return new EditCellController(static_cast<PatternControl*>(
m_pWindow.
get()));
1784 rpFormatter = std::make_unique< FormattedColumnValue> (
1786 OSL_ENSURE(rpFormatter,
"DbPatternField::Init: no value formatter!");
1789 OSL_ENSURE( rpFormatter->getColumn() == _rxField,
"DbPatternField::GetFormatText: my value formatter is working for another field ...!" );
1794 sText = rpFormatter->getFormattedValue();
1808 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbPatternField::updateFromModel: invalid call!" );
1827 ,m_nStandardAlign( _nStandardAlign )
1838 bool bSpinButton(
false);
1854 return new ::svt::FormattedFieldCellController(static_cast<FormattedControlBase*>(
m_pWindow.
get()));
1870 DBG_ASSERT(
m_pWindow,
"DbNumericField::implAdjustGenericFieldSetting: not to be called without window!" );
1871 DBG_ASSERT( _rxModel.is(),
"DbNumericField::implAdjustGenericFieldSetting: invalid model!" );
1884 rEditFormatter.SetMaxValue(nMax);
1885 rEditFormatter.SetSpinSize(nStep);
1886 rEditFormatter.SetStrictFormat(bStrict);
1895 Reference< css::util::XNumberFormatsSupplier > xSupplier;
1896 Reference< XRowSet > xForm;
1902 if ( xSupplier.is() )
1904 SvNumberFormatsSupplierObj* pImplementation = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( xSupplier );
1907 if (
nullptr == pFormatterUsed )
1909 pFormatterUsed = rEditFormatter.StandardFormatter();
1910 DBG_ASSERT( pFormatterUsed !=
nullptr,
"DbNumericField::implAdjustGenericFieldSetting: no standard formatter given by the numeric field !" );
1912 rEditFormatter.SetFormatter( pFormatterUsed );
1917 OUString sFormatString = pFormatterUsed->
GenerateFormat(0, aAppLanguage, bThousand,
false, nScale);
1919 rEditFormatter.SetFormat( sFormatString, aAppLanguage );
1920 rPaintFormatter.
SetFormat( sFormatString, aAppLanguage );
1930 OUString lcl_setFormattedNumeric_nothrow( FormattedControlBase& _rField,
const DbCellControl& _rControl,
1934 if ( _rxField.is() )
1938 double fValue = _rControl.
GetValue( _rxField, _rxFormatter );
1939 if ( !_rxField->wasNull() )
1941 _rField.get_formatter().SetValue(fValue);
1942 sValue = _rField.get_widget().get_text();
1945 catch(
const Exception& )
1956 return lcl_setFormattedNumeric_nothrow(dynamic_cast<FormattedControlBase&>(*
m_pPainter), *
this, _rxField, _rxFormatter);
1961 lcl_setFormattedNumeric_nothrow(dynamic_cast<FormattedControlBase&>(*
m_pWindow), *
this, _rxField, _rxFormatter);
1966 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbNumericField::updateFromModel: invalid call!" );
1968 FormattedControlBase* pControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
1971 if ( _rxModel->getPropertyValue(
FM_PROP_VALUE ) >>= dValue )
1973 Formatter& rFormatter = pControl->get_formatter();
1977 pControl->get_widget().set_text(OUString());
1982 FormattedControlBase* pControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
1983 OUString aText(pControl->get_widget().get_text());
1986 if (!aText.isEmpty())
1988 Formatter& rFormatter = pControl->get_formatter();
1989 double fValue = rFormatter.
GetValue();
2010 DBG_ASSERT(
m_pWindow,
"DbCurrencyField::implAdjustGenericFieldSetting: not to be called without window!" );
2011 DBG_ASSERT( _rxModel.is(),
"DbCurrencyField::implAdjustGenericFieldSetting: invalid model!" );
2050 OUString lcl_setFormattedCurrency_nothrow( FormattedControlBase& _rField,
const DbCurrencyField& _rControl,
2054 if ( _rxField.is() )
2058 double fValue = _rControl.
GetValue( _rxField, _rxFormatter );
2059 if ( !_rxField->wasNull() )
2061 _rField.get_formatter().SetValue(fValue);
2062 sValue = _rField.get_widget().get_text();
2065 catch(
const Exception& )
2076 return lcl_setFormattedCurrency_nothrow(dynamic_cast<FormattedControlBase&>(*
m_pPainter), *
this, _rxField, _rxFormatter);
2081 lcl_setFormattedCurrency_nothrow(dynamic_cast<FormattedControlBase&>(*
m_pWindow), *
this, _rxField, _rxFormatter);
2086 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbCurrencyField::updateFromModel: invalid call!" );
2088 FormattedControlBase* pControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
2091 if ( _rxModel->getPropertyValue(
FM_PROP_VALUE ) >>= dValue )
2093 Formatter& rFormatter = pControl->get_formatter();
2097 pControl->get_widget().set_text(OUString());
2102 FormattedControlBase* pControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
2103 OUString aText(pControl->get_widget().get_text());
2106 if (!aText.isEmpty())
2108 Formatter& rFormatter = pControl->get_formatter();
2109 double fValue = rFormatter.
GetValue();
2139 DBG_ASSERT(
m_pWindow,
"DbDateField::implAdjustGenericFieldSetting: not to be called without window!" );
2140 DBG_ASSERT( _rxModel.is(),
"DbDateField::implAdjustGenericFieldSetting: invalid model!" );
2151 FormattedControlBase* pControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
2154 FormattedControlBase* pPainter =
static_cast<FormattedControlBase*
>(
m_pPainter.
get());
2158 if ( aCentury.getValueType().getTypeClass() != TypeClass_VOID )
2160 bool bShowDateCentury =
getBOOL( aCentury );
2166 rControlFormatter.
SetExtDateFormat( static_cast<ExtDateFieldFormat>(nFormat) );
2167 rControlFormatter.
SetMin( aMin );
2168 rControlFormatter.
SetMax( aMax );
2172 rPainterFormatter.
SetExtDateFormat( static_cast<ExtDateFieldFormat>(nFormat) );
2173 rPainterFormatter.
SetMin( aMin );
2174 rPainterFormatter.
SetMax( aMax );
2181 OUString lcl_setFormattedDate_nothrow(DateControl& _rField,
const Reference<XColumn>& _rxField)
2184 if ( _rxField.is() )
2188 css::util::Date aValue = _rxField->getDate();
2189 if (!_rxField->wasNull())
2191 _rField.SetDate(::
Date(aValue.Day, aValue.Month, aValue.Year));
2192 sDate = _rField.get_widget().get_text();
2195 catch(
const Exception& )
2206 return lcl_setFormattedDate_nothrow(*static_cast<DateControl*>(
m_pPainter.
get()), _rxField);
2211 lcl_setFormattedDate_nothrow(*static_cast<DateControl*>(
m_pWindow.
get()), _rxField);
2216 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbDateField::updateFromModel: invalid call!" );
2218 DateControl* pControl =
static_cast<DateControl*
>(
m_pWindow.
get());
2221 if ( _rxModel->getPropertyValue(
FM_PROP_DATE ) >>= aDate )
2222 pControl->SetDate(::
Date(aDate));
2224 pControl->get_widget().set_text(OUString());
2229 FormattedControlBase* pControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
2230 OUString aText(pControl->get_widget().get_text());
2233 if (!aText.isEmpty())
2259 DBG_ASSERT(
m_pWindow,
"DbTimeField::implAdjustGenericFieldSetting: not to be called without window!" );
2260 DBG_ASSERT( _rxModel.is(),
"DbTimeField::implAdjustGenericFieldSetting: invalid model!" );
2271 FormattedControlBase* pControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
2274 rControlFormatter.
SetExtFormat(static_cast<ExtTimeFieldFormat>(nFormat));
2275 rControlFormatter.
SetMin(aMin);
2276 rControlFormatter.
SetMax(aMax);
2280 FormattedControlBase* pPainter =
static_cast<FormattedControlBase*
>(
m_pPainter.
get());
2283 rPainterFormatter.
SetExtFormat(static_cast<ExtTimeFieldFormat>(nFormat));
2284 rPainterFormatter.
SetMin(aMin);
2285 rPainterFormatter.
SetMax(aMax);
2292 OUString lcl_setFormattedTime_nothrow(TimeControl& _rField,
const Reference<XColumn>& _rxField)
2295 if ( _rxField.is() )
2299 css::util::Time aValue = _rxField->getTime();
2300 if (!_rxField->wasNull())
2306 catch(
const Exception& )
2317 return lcl_setFormattedTime_nothrow(*static_cast<TimeControl*>(
m_pPainter.
get()), _rxField);
2322 lcl_setFormattedTime_nothrow(*static_cast<TimeControl*>(
m_pWindow.
get()), _rxField);
2327 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbTimeField::updateFromModel: invalid call!" );
2329 FormattedControlBase* pControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
2333 if ( _rxModel->getPropertyValue(
FM_PROP_TIME ) >>= aTime )
2336 pControl->get_widget().set_text(OUString());
2341 FormattedControlBase* pControl =
static_cast<FormattedControlBase*
>(
m_pWindow.
get());
2342 OUString aText(pControl->get_widget().get_text());
2345 if (!aText.isEmpty())
2382 css::uno::Sequence<OUString> aTest;
2383 if (rItems >>= aTest)
2385 for (
const OUString& rString : std::as_const(aTest))
2422 return new ComboBoxCellController(static_cast<ComboBoxControl*>(
m_pWindow.
get()));
2427 const css::uno::Reference<css::beans::XPropertySet> xPS(_rxField, UNO_QUERY);
2441 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbComboBox::updateFromModel: invalid call!" );
2454 pControl->TriggerAuxModify();
2491 ListBoxControl* pField =
static_cast<ListBoxControl*
>(
m_pWindow.
get());
2498 css::uno::Sequence<OUString> aTest;
2499 if (!(rItems >>= aTest))
2502 if (aTest.hasElements())
2504 for (
const OUString& rString : std::as_const(aTest))
2536 return new ListBoxCellController(static_cast<ListBoxControl*>(
m_pWindow.
get()));
2542 if ( _rxField.is() )
2546 sText = _rxField->getString();
2566 OUString sFormattedText(
GetFormatText( _rxField, xFormatter ) );
2568 if (!sFormattedText.isEmpty())
2576 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbListBox::updateFromModel: invalid call!" );
2578 Sequence< sal_Int16 > aSelection;
2581 sal_Int16 nSelection = -1;
2582 if ( aSelection.hasElements() )
2583 nSelection = aSelection[ 0 ];
2585 ListBoxControl* pControl =
static_cast<ListBoxControl*
>(
m_pWindow.
get());
2589 if (nSelection >= 0 && nSelection < rComboBox.
get_count())
2595 pControl->TriggerAuxModify();
2601 Sequence<sal_Int16> aSelectSeq;
2606 aSelectSeq.realloc(1);
2607 *aSelectSeq.getArray() =
static_cast<sal_Int16
>(nActive);
2609 aVal <<= aSelectSeq;
2616 ,OSQLParserClient(rxContext)
2617 ,m_nControlClass(
css::
form::FormComponentType::TEXTFIELD)
2618 ,m_bFilterList(false)
2619 ,m_bFilterListFilled(false)
2634 static const DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::VCenter | DrawTextFlags::Left;
2637 case FormComponentType::CHECKBOX:
2640 CheckBoxControl* pControl =
static_cast<CheckBoxControl*
>(
m_pPainter.
get());
2641 Size aBoxSize = pControl->GetBox().get_preferred_size();
2649 case FormComponentType::LISTBOX:
2650 rDev.
DrawText(rRect, static_cast<ListBoxControl*>(
m_pWindow.
get())->get_widget().get_active_text(), nStyle);
2659 css::uno::Sequence<OUString> aTest;
2661 if (!aTest.hasElements())
2668 for (
const OUString& rString : std::as_const(aTest))
2673 ListBoxControl* pField =
static_cast<ListBoxControl*
>(
m_pWindow.
get());
2675 for (
const OUString& rString : std::as_const(aTest))
2686 case css::form::FormComponentType::CHECKBOX:
2695 case css::form::FormComponentType::LISTBOX:
2701 case css::form::FormComponentType::COMBOBOX:
2747 case FormComponentType::CHECKBOX:
2748 case FormComponentType::LISTBOX:
2749 case FormComponentType::COMBOBOX:
2765 ControlBase* pAsEdit =
dynamic_cast<ControlBase*
>(
m_pWindow.
get());
2767 pAsEdit->SetEditableReadOnly(
false);
2775 case css::form::FormComponentType::CHECKBOX:
2776 xController =
new CheckBoxCellController(static_cast<CheckBoxControl*>(
m_pWindow.
get()));
2778 case css::form::FormComponentType::LISTBOX:
2779 xController =
new ListBoxCellController(static_cast<ListBoxControl*>(
m_pWindow.
get()));
2781 case css::form::FormComponentType::COMBOBOX:
2782 xController =
new ComboBoxCellController(static_cast<ComboBoxControl*>(
m_pWindow.
get()));
2786 xController =
new ComboBoxCellController(static_cast<ComboBoxControl*>(
m_pWindow.
get()));
2788 xController =
new EditCellController(static_cast<EditControlBase*>(
m_pWindow.
get()));
2795 OSL_ENSURE( _rxModel.is() &&
m_pWindow,
"DbFilterField::updateFromModel: invalid call!" );
2797 OSL_FAIL(
"DbFilterField::updateFromModel: not implemented yet (how the hell did you reach this?)!" );
2807 case css::form::FormComponentType::CHECKBOX:
2809 case css::form::FormComponentType::LISTBOX:
2816 sal_Int16
nPos =
static_cast<sal_Int16
>(nActive);
2817 if ( ( nPos >= 0 ) && ( nPos <
m_aValueList.getLength() ) )
2828 case css::form::FormComponentType::COMBOBOX:
2835 aText =
static_cast<EditControlBase*
>(
m_pWindow.
get())->get_widget().get_text();
2844 if (!aNewText.isEmpty())
2849 std::unique_ptr< OSQLParseNode > pParseNode = predicateTree(aErrorMsg, aNewText,xNumberFormatter,
m_rColumn.
GetField());
2850 if (pParseNode !=
nullptr)
2852 OUString aPreparedText;
2856 Reference< XRowSet > xDataSourceRowSet(
2860 pParseNode->parseNodeToPredicateStr(aPreparedText,
2873 SQLException aError;
2874 aError.Message = aErrorMsg;
2896 case css::form::FormComponentType::CHECKBOX:
2901 else if (rText ==
"0")
2906 static_cast<CheckBoxControl*
>(
m_pWindow.
get())->SetState(eState);
2907 static_cast<CheckBoxControl*
>(
m_pPainter.
get())->SetState(eState);
2909 case css::form::FormComponentType::LISTBOX:
2912 static_cast<ListBoxControl*
>(
m_pWindow.
get())->get_widget().set_active(nPos);
2914 case css::form::FormComponentType::COMBOBOX:
2946 Reference< css::container::XChild > xModelAsChild(
m_rColumn.
getModel(), UNO_QUERY);
2948 xModelAsChild.set(xModelAsChild->getParent(),UNO_QUERY);
2949 Reference< XRowSet > xForm(xModelAsChild->getParent(), UNO_QUERY);
2954 Reference< XTablesSupplier > xSupTab;
2955 xFormProp->getPropertyValue(
"SingleSelectQueryComposer") >>= xSupTab;
2962 Reference< XColumnsSupplier > xSupCol(xSupTab,UNO_QUERY);
2963 Reference< css::container::XNameAccess > xFieldNames = xSupCol->getColumns();
2964 if (!xFieldNames->hasByName(aName))
2967 Reference< css::container::XNameAccess > xTablesNames = xSupTab->getTables();
2968 Reference< css::beans::XPropertySet > xComposerFieldAsSet(xFieldNames->getByName(aName),UNO_QUERY);
2970 if (!xComposerFieldAsSet.is() ||
2975 OUString aFieldName;
2976 OUString aTableName;
2982 if (!xTablesNames->hasByName(aTableName))
2987 Reference< XStatement > xStatement;
2988 Reference< XResultSet > xListCursor;
2989 Reference< css::sdb::XColumn > xDataField;
2993 Reference< XDatabaseMetaData > xMeta = xConnection->getMetaData();
2995 OUString aQuote(xMeta->getIdentifierQuoteString());
2996 OUStringBuffer aStatement(
"SELECT DISTINCT ");
2997 aStatement.append(
quoteName(aQuote, aName));
2998 if (!aFieldName.isEmpty() && aName != aFieldName)
3000 aStatement.append(
" AS ");
3001 aStatement.append(
quoteName(aQuote, aFieldName));
3004 aStatement.append(
" FROM ");
3009 xStatement = xConnection->createStatement();
3010 Reference< css::beans::XPropertySet > xStatementProps(xStatement, UNO_QUERY);
3013 xListCursor = xStatement->executeQuery(aStatement.makeStringAndClear());
3015 Reference< css::sdbcx::XColumnsSupplier > xSupplyCols(xListCursor, UNO_QUERY);
3016 Reference< css::container::XIndexAccess > xFields(xSupplyCols->getColumns(), UNO_QUERY);
3017 xDataField.set(xFields->getByIndex(0), css::uno::UNO_QUERY);
3018 if (!xDataField.is())
3023 ::comphelper::disposeComponent(xStatement);
3029 aStringList.reserve(16);
3034 sal_Int16 nKeyType = ::comphelper::getNumberFormatType(xFormatter->getNumberFormatsSupplier()->getNumberFormats(), nFormatKey);
3036 while (!xListCursor->isAfterLast() && i++ < SHRT_MAX)
3038 aStr =
getFormattedValue(xDataField, xFormatter, aNullDate, nFormatKey, nKeyType);
3039 aStringList.push_back(aStr);
3040 (
void)xListCursor->next();
3046 for (
const auto& rString : aStringList)
3057 OSL_FAIL(
"DbFilterField::UpdateFromField: cannot update a filter control from a field!" );
3062 TriState eState =
static_cast<CheckBoxControl*
>(m_pWindow.get())->GetState();
3063 OUStringBuffer aTextBuf;
3065 Reference< XRowSet > xDataSourceRowSet(
3066 Reference< XInterface >(*m_rColumn.GetParent().getDataSource()), UNO_QUERY);
3073 ::dbtools::getBooleanComparisonPredicate(
u"",
true, nBooleanComparisonMode, aTextBuf);
3076 ::dbtools::getBooleanComparisonPredicate(
u"",
false, nBooleanComparisonMode, aTextBuf);
3082 const OUString aText(aTextBuf.makeStringAndClear());
3084 if (m_aText != aText)
3087 m_aCommitLink.Call(*
this);
3095 ,m_pCellControl(
std::move(_pControl) )
3100 ,m_aMouseMotionListeners(
m_aMutex )
3123 if (!OComponentHelper::rBHelper.bDisposed)
3149 Sequence< uno::Type >
aTypes = ::comphelper::concatSequences(
3154 aTypes = ::comphelper::concatSequences(
3168 lang::EventObject
aEvent( *
this );
3169 m_aWindowListeners.disposeAndClear( aEvent );
3170 m_aFocusListeners.disposeAndClear( aEvent );
3171 m_aKeyListeners.disposeAndClear( aEvent );
3172 m_aMouseListeners.disposeAndClear( aEvent );
3173 m_aMouseMotionListeners.disposeAndClear( aEvent );
3175 OComponentHelper::disposing();
3176 m_pColumn =
nullptr;
3177 m_pCellControl.reset();
3183 Any aReturn = OComponentHelper::queryAggregation( _rType );
3185 if ( !aReturn.hasValue() )
3198 return Reference< XInterface > ();
3224 ::osl::MutexGuard aGuard(
m_aMutex);
3232 OSL_FAIL(
"FmXGridCell::setPosSize: not implemented" );
3239 OSL_FAIL(
"FmXGridCell::getPosSize: not implemented" );
3240 return awt::Rectangle();
3246 OSL_FAIL(
"FmXGridCell::setVisible: not implemented" );
3253 OSL_FAIL(
"FmXGridCell::setEnable: not implemented" );
3260 OSL_FAIL(
"FmXGridCell::setFocus: not implemented" );
3337 OSL_FAIL(
"FmXGridCell::addPaintListener: not implemented" );
3343 OSL_FAIL(
"FmXGridCell::removePaintListener: not implemented" );
3350 onWindowEvent( _rEvent.GetId(), *_rEvent.GetWindow(), _rEvent.GetData() );
3370 switch ( _nEventId )
3372 case VclEventId::ControlGetFocus:
3373 case VclEventId::WindowGetFocus:
3374 case VclEventId::ControlLoseFocus:
3375 case VclEventId::WindowLoseFocus:
3378 && ( _nEventId == VclEventId::ControlGetFocus
3379 || _nEventId == VclEventId::ControlLoseFocus
3383 && ( _nEventId == VclEventId::WindowGetFocus
3384 || _nEventId == VclEventId::WindowLoseFocus
3392 bool bFocusGained = ( _nEventId == VclEventId::ControlGetFocus ) || ( _nEventId == VclEventId::WindowGetFocus );
3395 aEvent.Source = *
this;
3397 aEvent.Temporary =
false;
3406 case VclEventId::WindowMouseButtonDown:
3407 case VclEventId::WindowMouseButtonUp:
3412 const bool bButtonDown = ( _nEventId == VclEventId::WindowMouseButtonDown );
3418 case VclEventId::WindowMouseMove:
3434 aEvent.ClickCount = 0;
3435 const bool bSimpleMove = bool( rMouseEvent.
GetMode() & MouseEventModifiers::SIMPLEMOVE );
3441 case VclEventId::WindowKeyInput:
3442 case VclEventId::WindowKeyUp:
3447 const bool bKeyPressed = ( _nEventId == VclEventId::WindowKeyInput );
3458 const Reference< css::sdb::XColumn >& _rxField,
3461 m_pCellControl->PaintFieldToCell( rDev, rRect, _rxField, xFormatter );
3475 ,m_bFastPaint( true )
3482 const Reference< css::sdb::XColumn >& _rxField,
3491 DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::VCenter;
3493 nStyle |= DrawTextFlags::Disable;
3497 case css::awt::TextAlign::RIGHT:
3498 nStyle |= DrawTextFlags::Right;
3500 case css::awt::TextAlign::CENTER:
3501 nStyle |= DrawTextFlags::Center;
3504 nStyle |= DrawTextFlags::Left;
3509 const Color* pColor =
nullptr;
3510 OUString aText =
GetText(_rxField, xFormatter, &pColor);
3511 if (pColor !=
nullptr)
3515 rDev.
DrawText(rRect, aText, nStyle);
3519 rDev.
DrawText(rRect, aText, nStyle);
3531 ,m_pEditImplementation( nullptr )
3532 ,m_bOwnEditImplementation( false )
3553 if (!OComponentHelper::rBHelper.bDisposed)
3563 css::lang::EventObject aEvt(*
this);
3578 if ( !aReturn.hasValue() )
3586 return ::comphelper::concatSequences(
3595 void SAL_CALL
FmXEditCell::addTextListener(const Reference<
css::awt::XTextListener >& l)
3597 m_aTextListeners.addInterface( l );
3608 ::osl::MutexGuard aGuard(
m_aMutex );
3622 ::osl::MutexGuard aGuard(
m_aMutex );
3633 ::osl::MutexGuard aGuard(
m_aMutex );
3656 ::osl::MutexGuard aGuard(
m_aMutex );
3669 ::osl::MutexGuard aGuard(
m_aMutex );
3677 ::osl::MutexGuard aGuard(
m_aMutex );
3683 return css::awt::Selection(aSel.
Min(), aSel.
Max());
3688 ::osl::MutexGuard aGuard(
m_aMutex );
3695 ::osl::MutexGuard aGuard(
m_aMutex );
3703 ::osl::MutexGuard aGuard(
m_aMutex );
3710 ::osl::MutexGuard aGuard(
m_aMutex );
3728 css::awt::TextEvent
aEvent;
3729 aEvent.Source = *
this;
3745 lang::EventObject
aEvent( *
this );
3752 if (m_aTextListeners.getLength())
3760 ,m_pBox( & static_cast< CheckBoxControl& >( m_pCellControl->GetWindow() ) )
3767 if (!OComponentHelper::rBHelper.bDisposed)
3777 css::lang::EventObject aEvt(*
this);
3792 if ( !aReturn.hasValue() )
3801 return ::comphelper::concatSequences(
3812 m_aItemListeners.addInterface( l );
3822 ::osl::MutexGuard aGuard(
m_aMutex );
3833 ::osl::MutexGuard aGuard(
m_aMutex );
3845 ::osl::MutexGuard aGuard(
m_aMutex );
3882 m_pCellControl->Commit();
3884 Reference< XWindow > xKeepAlive(
this );
3885 if ( m_aItemListeners.getLength() && m_pBox )
3888 aEvent.Source = *
this;
3889 aEvent.Highlighted = 0;
3890 aEvent.Selected = m_pBox->GetState();
3891 m_aItemListeners.notifyEach( &awt::XItemListener::itemStateChanged, aEvent );
3893 if ( m_aActionListeners.getLength() )
3896 aEvent.Source = *
this;
3897 aEvent.ActionCommand = m_aActionCommand;
3898 m_aActionListeners.notifyEach( &awt::XActionListener::actionPerformed, aEvent );
3906 , m_pBox(&static_cast<
svt::ListBoxControl&>(m_pCellControl->GetWindow()))
3907 , m_nLines(
Application::GetSettings().GetStyleSettings().GetListBoxMaximumLineCount())
3915 if (!OComponentHelper::rBHelper.bDisposed)
3925 css::lang::EventObject aEvt(*
this);
3939 if ( !aReturn.hasValue() )
3947 return ::comphelper::concatSequences(
3957 m_aItemListeners.addInterface( l );
3977 ::osl::MutexGuard aGuard(
m_aMutex );
3987 ::osl::MutexGuard aGuard(
m_aMutex );
3991 sal_uInt16 nP = nPos;
3992 for (
const auto& rItem : aItems )
4003 ::osl::MutexGuard aGuard(
m_aMutex );
4007 for ( sal_uInt16
n = nCount;
n; )
4014 ::osl::MutexGuard aGuard(
m_aMutex );
4023 ::osl::MutexGuard aGuard(
m_aMutex );
4032 ::osl::MutexGuard aGuard(
m_aMutex );
4034 css::uno::Sequence<OUString>
aSeq;
4038 const sal_Int32 nEntries = rBox.
get_count();
4039 aSeq = css::uno::Sequence<OUString>( nEntries );
4040 for ( sal_Int32
n = nEntries;
n; )
4051 ::osl::MutexGuard aGuard(
m_aMutex );
4057 if (nPos > SHRT_MAX || nPos < SHRT_MIN)
4058 throw std::out_of_range(
"awt::XListBox::getSelectedItemPos can only return a short");
4066 ::osl::MutexGuard aGuard(
m_aMutex );
4067 Sequence<sal_Int16>
aSeq;
4076 aSeq = Sequence<sal_Int16>(1);
4077 aSeq.getArray()[0] = nActive;
4085 ::osl::MutexGuard aGuard(
m_aMutex );
4101 ::osl::MutexGuard aGuard(
m_aMutex );
4103 css::uno::Sequence<OUString>
aSeq;
4112 aSeq = css::uno::Sequence<OUString>(1);
4113 aSeq.getArray()[0] = rBox.
get_text(nActive);
4121 ::osl::MutexGuard aGuard(
m_aMutex );
4135 ::osl::MutexGuard aGuard(
m_aMutex );
4140 for ( sal_uInt16
n = static_cast<sal_uInt16>(aPositions.getLength());
n; )
4142 auto nPos =
static_cast<sal_uInt16
>(aPositions.getConstArray()[--
n]);
4153 ::osl::MutexGuard aGuard(
m_aMutex );
4168 ::osl::MutexGuard aGuard(
m_aMutex );
4175 ::osl::MutexGuard aGuard(
m_aMutex );
4182 ::osl::MutexGuard aGuard(
m_aMutex );
4188 ::osl::MutexGuard aGuard(
m_aMutex );
4209 css::awt::ItemEvent
aEvent;
4210 aEvent.Source = *
this;
4211 aEvent.Highlighted = 0;
4217 m_aItemListeners.notifyEach( &awt::XItemListener::itemStateChanged, aEvent );
4224 css::awt::ActionEvent
aEvent;
4225 aEvent.Source = *
this;
4237 ,m_pComboBox(&static_cast<
ComboBoxControl&>(m_pCellControl->GetWindow()))
4238 ,m_nLines(
Application::GetSettings().GetStyleSettings().GetListBoxMaximumLineCount())
4245 if ( !OComponentHelper::rBHelper.bDisposed )
4255 css::lang::EventObject aEvt(*
this);
4269 if ( !aReturn.hasValue() )
4277 return ::comphelper::concatSequences(
4287 m_aItemListeners.addInterface( l );
4308 ::osl::MutexGuard aGuard(
m_aMutex );
4317 ::osl::MutexGuard aGuard(
m_aMutex );
4321 sal_uInt16 nP = Pos;
4322 for (
const auto& rItem : Items )
4332 ::osl::MutexGuard aGuard(
m_aMutex );
4336 for ( sal_uInt16
n = Count;
n; )
4342 ::osl::MutexGuard aGuard(
m_aMutex );
4351 ::osl::MutexGuard aGuard(
m_aMutex );
4360 ::osl::MutexGuard aGuard(
m_aMutex );
4366 const sal_Int32 nEntries = rBox.
get_count();
4367 aItems.realloc( nEntries );
4368 OUString* pItem = aItems.getArray();
4369 for ( sal_Int32
n=0;
n<nEntries; ++
n, ++pItem )
4377 ::osl::MutexGuard aGuard(
m_aMutex );
4383 ::osl::MutexGuard aGuard(
m_aMutex );
4398 aEvent.Source = *
this;
4399 aEvent.Highlighted = 0;
4402 aEvent.Selected = ( rComboBox.
get_active() != -1 )
4405 m_aItemListeners.notifyEach( &awt::XItemListener::itemStateChanged, aEvent );
4417 if (!OComponentHelper::rBHelper.bDisposed)
4428 sal_Int64 nReturn(0);
4430 if ( isUnoTunnelId<FmXFilterCell>(_rIdentifier) )
4432 nReturn =
reinterpret_cast<sal_Int64
>(
this);
4441 return theFmXFilterCellUnoTunnelId.
getSeq();
4454 css::lang::EventObject aEvt(*
this);
4467 if ( !aReturn.hasValue() )
4476 return ::comphelper::concatSequences(
4489 m_aTextListeners.addInterface( l );
4500 ::osl::MutexGuard aGuard(
m_aMutex );
4510 ::osl::MutexGuard aGuard(
m_aMutex );
4525 return css::awt::Selection();
4549 css::awt::TextEvent aEvt;
4550 aEvt.Source = *
this;
4552 static_cast< css::awt::XTextListener *>(aIt.
next())->
textChanged( aEvt );
virtual void SetText(const OUString &rStr)
OString stripEnd(const OString &rIn, char c)
virtual void SAL_CALL addItems(const css::uno::Sequence< OUString > &Items,::sal_Int16 Pos) override
#define LINK(Instance, Class, Member)
const css::uno::Reference< css::beans::XPropertySet > & getModel() const
const Color & GetTextColor() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
OutDevType GetOutDevType() const
bool IsControlBackground() const
virtual sal_Int16 SAL_CALL getState() override
virtual OUString GetFormatText(const css::uno::Reference< css::sdb::XColumn > &_rxField, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter, const Color **ppColor=nullptr) override
void implValuePropertyChanged()
virtual void SAL_CALL removeMouseListener(const css::uno::Reference< css::awt::XMouseListener > &xListener) override
GetFocusFlags GetGetFocusFlags() const
void ImplInitWindow(vcl::Window const &rParent, const InitWindowFacet _eInitWhat)
virtual ::svt::CellControllerRef CreateController() const override
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
const Wallpaper & GetBackground() const
void SetState(TriState eState)
virtual void SAL_CALL enableTriState(sal_Bool b) override
virtual void Init(BrowserDataWin &rParent, const css::uno::Reference< css::sdbc::XRowSet > &xCursor) override
virtual void SAL_CALL addActionListener(const css::uno::Reference< css::awt::XActionListener > &l) override
virtual void UpdateFromField(const css::uno::Reference< css::sdb::XColumn > &_rxField, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter) override
virtual OUString GetFormatText(const css::uno::Reference< css::sdb::XColumn > &_rxField, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter, const Color **ppColor=nullptr) override
virtual void updateFromModel(css::uno::Reference< css::beans::XPropertySet > _rxModel)=0
updates the current content of the control (e.g.
virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override
#define FM_PROP_DECIMAL_ACCURACY
virtual void SetMinValue(double dMin) override
virtual bool commitControl() override
commits the content of the control (e.g.
DbCurrencyField(DbGridColumn &_rColumn)
std::unique_ptr<::svt::IEditImplementation > m_pEdit
virtual void SAL_CALL setSelection(const css::awt::Selection &aSelection) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
#define FM_PROP_FIELDSOURCE
FmXFilterCell(DbGridColumn *pColumn, std::unique_ptr< DbFilterField > pControl)
FmXTextCell(DbGridColumn *pColumn, std::unique_ptr< DbCellControl > pControl)
void PaintCell(OutputDevice &rDev, const tools::Rectangle &rRect)
#define FM_PROP_FORMATSSUPPLIER
DbComboBox(DbGridColumn &_rColumn)
DECL_LISTENERMULTIPLEXER_END void SAL_CALL textChanged(const css::awt::TextEvent &rEvent) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
::comphelper::OInterfaceContainerHelper2 m_aFocusListeners
#define FM_PROP_FIELDTYPE
virtual OUString GetFormatText(const css::uno::Reference< css::sdb::XColumn > &_rxField, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter, const Color **ppColor=nullptr)=0
a field which is bound to a column which supports the MaxTextLen property
virtual ::svt::CellControllerRef CreateController() const override
virtual void implSetEffectiveMaxTextLen(sal_Int32 _nMaxLen) override
virtual void UpdateFromField(const css::uno::Reference< css::sdb::XColumn > &_rxField, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter) override
virtual void SAL_CALL setText(const OUString &aText) override
virtual void SAL_CALL disposing() override
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
void SetAuxModifyHdl(const Link< bool, void > &rLink)
const LanguageTag & GetUILanguageTag() const
void insert_text(int pos, const OUString &rStr)
virtual void implSetEffectiveMaxTextLen(sal_Int32 _nMaxLen)
void CreateControl(BrowserDataWin *pParent, const css::uno::Reference< css::beans::XPropertySet > &xModel)
DbPatternField(DbGridColumn &_rColumn, const css::uno::Reference< css::uno::XComponentContext > &_rContext)
virtual SelectionOptions GetEntrySelectionOptions() const override
void setLock(bool _bLock)
void SetStyleSettings(const StyleSettings &rSet)
::comphelper::OInterfaceContainerHelper2 m_aItemListeners
virtual void SAL_CALL makeVisible(sal_Int16 nEntry) override
const Color & GetTextLineColor() const
#define FM_PROP_VALUE_SEQ
virtual void SAL_CALL selectItem(const OUString &aItem, sal_Bool bSelect) override
sal_Int16 m_nControlClass
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
LanguageType getLanguageType(bool bResolveSystem=true) const
bool hasMoreElements() const
virtual void Init(BrowserDataWin &rParent, const css::uno::Reference< css::sdbc::XRowSet > &xCursor) override
void SetList(const css::uno::Any &rItems)
virtual OUString SAL_CALL getText() override
SelectionOptions GetSelectionOptions() const
virtual OUString get_text(int pos) const =0
virtual void UpdateFromField(const css::uno::Reference< css::sdb::XColumn > &_rxField, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter) override
FmXEditCell(DbGridColumn *pColumn, std::unique_ptr< DbCellControl > pControl)
MouseEventModifiers GetMode() const
virtual sal_Int16 SAL_CALL getDropDownLineCount() override
virtual void SAL_CALL setMaxTextLen(sal_Int16 nLen) override
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
virtual void SAL_CALL setVisible(sal_Bool Visible) override
sal_Int32 addInterface(const css::uno::Reference< css::uno::XInterface > &rxIFace)
bool getBOOL(const Any &_rAny)
virtual bool commitControl() override
commits the content of the control (e.g.
bool IsTextLineColor() const
void ImplInitWindow(vcl::Window const &rParent, const InitWindowFacet _eInitWhat)
virtual sal_Bool SAL_CALL isEditable() override
virtual void SAL_CALL selectItemPos(sal_Int16 nPos, sal_Bool bSelect) override
#define FM_PROP_MULTILINE
exports com.sun.star. awt
void CreateControl(sal_Int32 _nFieldPos, const css::uno::Reference< css::beans::XPropertySet > &xField, sal_Int32 nTypeId)
virtual OUString SAL_CALL getSelectedItem() override
virtual void SetSizePixel(const Size &rNewSize)
virtual int find_text(const OUString &rStr) const =0
virtual bool commitControl() override
commits the content of the control (e.g.
virtual void SAL_CALL setEditable(sal_Bool bEditable) override
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
void disposeAndClear(const css::lang::EventObject &rEvt)
virtual css::uno::Sequence< OUString > SAL_CALL getItems() override
FmXListBoxCell(DbGridColumn *pColumn, std::unique_ptr< DbCellControl > pControl)
virtual void DeactivateCell(bool bUpdate=true)
weld::ComboBox & get_widget()
virtual OUString SAL_CALL getItem(::sal_Int16 Pos) override