25#include <com/sun/star/form/validation/XValidatableFormComponent.hpp>
26#include <com/sun/star/awt/XTextComponent.hpp>
27#include <com/sun/star/awt/XListBox.hpp>
30#include <osl/diagnose.h>
47 OSL_ENSURE( _rxPeer.is(),
"setUnderline: invalid peer!" );
51 OSL_VERIFY( _rxPeer->getProperty(
FM_PROP_FONT ) >>= aFont );
61 OSL_ENSURE( _rxPeer.is(),
"getUnderline: invalid peer!" );
64 OSL_VERIFY( _rxPeer->getProperty(
FM_PROP_FONT ) >>= aFont );
73 OSL_ENSURE( _rxPeer.is(),
"getBorder: invalid peer!" );
82 OSL_ENSURE( _rxPeer.is(),
"setBorder: invalid peer!" );
89 :m_nFocusColor ( 0x000000FF )
90 ,m_nMouseHoveColor( 0x007098BE )
91 ,m_nInvalidColor ( 0x00FF0000 )
92 ,m_bDynamicBorderColors( false )
104 OSL_PRECOND( _rxPeer.is(),
"ControlBorderManager::canColorBorder: invalid peer!" );
118 Reference< XTextComponent > xText( _rxPeer, UNO_QUERY );
119 Reference< XListBox > xListBox( _rxPeer, UNO_QUERY );
120 if ( xText.is() || xListBox.is() )
122 sal_Int16 nBorderStyle = VisualEffect::NONE;
123 OSL_VERIFY( _rxPeer->getProperty(
FM_PROP_BORDER ) >>= nBorderStyle );
124 if ( nBorderStyle == VisualEffect::FLAT )
168 OSL_FAIL(
"ControlBorderManager::getControlColorByStatus: invalid status!" );
175 OSL_PRECOND( _rxControl.is() && _rxPeer.is(),
"ControlBorderManager::updateBorderStyle: invalid parameters!" );
181 : VisualEffect::FLAT;
209 Reference< XVclWindowPeer > xPeer( _rxControl->getPeer(), UNO_QUERY );
218 if ( _rxControl == _rControlData.
xControl )
222 Reference< XControl > xAsControl( _rxControl, UNO_QUERY );
223 DBG_ASSERT( xAsControl.is(),
"ControlBorderManager::controlStatusGained: invalid control!" );
224 if ( !xAsControl.is() )
229 Reference< XVclWindowPeer > xPeer( xAsControl->getPeer(), UNO_QUERY );
237 _rControlData.
xControl = xAsControl;
251 if ( _rxControl != _rControlData.
xControl )
255 OSL_PRECOND( _rControlData.
xControl.is(),
"ControlBorderManager::controlStatusLost: invalid control data - this will crash!" );
258 Reference< XVclWindowPeer > xPeer( _rControlData.
xControl->getPeer(), UNO_QUERY );
300 OSL_FAIL(
"ControlBorderManager::setStatusColor: invalid status!" );
315 for (
const auto& rControl : aInvalidControls)
317 Reference< XVclWindowPeer > xPeer( rControl.xControl->getPeer(), UNO_QUERY );
360 OSL_ENSURE( _rxControl.is(),
"ControlBorderManager::validityChanged: invalid control!" );
361 OSL_ENSURE( _rxValidatable.is(),
"ControlBorderManager::validityChanged: invalid validatable!" );
363 Reference< XVclWindowPeer > xPeer( _rxControl.is() ? _rxControl->getPeer() : Reference< XWindowPeer >(), UNO_QUERY );
364 if ( !xPeer.is() || !_rxValidatable.is() )
369 if ( _rxValidatable->isValid() )
410 Reference< XValidator > xValidator = _rxValidatable->getValidator();
411 OSL_ENSURE( xValidator.is(),
"ControlBorderManager::validityChanged: invalid, but no validator?" );
412 OUString sExplainInvalidity = xValidator.is() ? xValidator->explainInvalid( _rxValidatable->getCurrentValue() ) : OUString();
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr OUStringLiteral FM_PROP_BORDERCOLOR
constexpr OUStringLiteral FM_PROP_HELPTEXT
constexpr OUStringLiteral FM_PROP_FONT
constexpr OUStringLiteral FM_PROP_BORDER
constexpr OUStringLiteral FM_PROP_TEXTLINECOLOR
constexpr OUStringLiteral aData