LibreOffice Module svx (master) 1
|
manages the dynamic border color for form controls More...
#include <fmcontrolbordermanager.hxx>
Classes | |
struct | ControlDataCompare |
Public Member Functions | |
ControlBorderManager () | |
~ControlBorderManager () | |
void | focusGained (const css::uno::Reference< css::uno::XInterface > &_rxControl) |
void | focusLost (const css::uno::Reference< css::uno::XInterface > &_rxControl) |
void | mouseEntered (const css::uno::Reference< css::uno::XInterface > &_rxControl) |
void | mouseExited (const css::uno::Reference< css::uno::XInterface > &_rxControl) |
void | validityChanged (const css::uno::Reference< css::awt::XControl > &_rxControl, const css::uno::Reference< css::form::validation::XValidatableFormComponent > &_rxValidatable) |
void | enableDynamicBorderColor () |
enables dynamic border color for the controls More... | |
void | disableDynamicBorderColor () |
disables dynamic border color for the controls More... | |
void | setStatusColor (ControlStatus _nStatus, Color _nColor) |
sets a color to be used for a given status More... | |
void | restoreAll () |
restores all colors of all controls where we possibly changed them More... | |
Private Types | |
typedef ::std::set< ControlData, ControlDataCompare > | ControlBag |
typedef ::std::set< css::uno::Reference< css::awt::XVclWindowPeer > > | PeerBag |
Private Member Functions | |
void | controlStatusGained (const css::uno::Reference< css::uno::XInterface > &_rxControl, ControlData &_rControlData) |
called when a control got one of the two possible statuses (focused, and hovered with the mouse) More... | |
void | controlStatusLost (const css::uno::Reference< css::uno::XInterface > &_rxControl, ControlData &_rControlData) |
called when a control lost one of the two possible statuses (focused, and hovered with the mouse) More... | |
bool | canColorBorder (const css::uno::Reference< css::awt::XVclWindowPeer > &_rxPeer) |
determines whether the border of a given peer can be colored More... | |
ControlStatus | getControlStatus (const css::uno::Reference< css::awt::XControl > &_rxControl) |
determines the status of the given control More... | |
Color | getControlColorByStatus (ControlStatus _eStatus) const |
retrieves the color associated with a given ControlStatus More... | |
void | updateBorderStyle (const css::uno::Reference< css::awt::XControl > &_rxControl, const css::uno::Reference< css::awt::XVclWindowPeer > &_rxPeer, const BorderDescriptor &_rFallback) |
sets the border color for a given control, depending on its status More... | |
void | determineOriginalBorderStyle (const css::uno::Reference< css::awt::XControl > &_rxControl, BorderDescriptor &_rData) const |
determines the to-be-remembered original border color and type for a control More... | |
manages the dynamic border color for form controls
Used by the <type>FormController</type>, this class manages the dynamic changes in the border color of form controls. For this a set of events have to be forwarded to the manager instance, which then will switch the border color depending on the mouse and focus status of the controls.
Definition at line 100 of file fmcontrolbordermanager.hxx.
|
private |
Definition at line 111 of file fmcontrolbordermanager.hxx.
|
private |
Definition at line 112 of file fmcontrolbordermanager.hxx.
svxform::ControlBorderManager::ControlBorderManager | ( | ) |
Definition at line 88 of file fmcontrolbordermanager.cxx.
svxform::ControlBorderManager::~ControlBorderManager | ( | ) |
Definition at line 97 of file fmcontrolbordermanager.cxx.
|
private |
determines whether the border of a given peer can be colored
_rxPeer | the peer to examine. Must not be <NULL> |
Definition at line 102 of file fmcontrolbordermanager.cxx.
References FM_PROP_BORDER, m_aColorableControls, and m_aNonColorableControls.
Referenced by controlStatusGained(), controlStatusLost(), and validityChanged().
|
private |
called when a control got one of the two possible statuses (focused, and hovered with the mouse)
_rxControl | the control which gained the status |
_rControlData | the control's status data, as a reference to our respective member |
Definition at line 216 of file fmcontrolbordermanager.cxx.
References canColorBorder(), DBG_ASSERT, determineOriginalBorderStyle(), Exception, TOOLS_WARN_EXCEPTION, updateBorderStyle(), and svxform::ControlData::xControl.
Referenced by focusGained(), and mouseEntered().
|
private |
called when a control lost one of the two possible statuses (focused, and hovered with the mouse)
_rxControl | the control which lost the status |
_rControlData | the control's status data, as a reference to our respective member |
Definition at line 249 of file fmcontrolbordermanager.cxx.
References canColorBorder(), Exception, TOOLS_WARN_EXCEPTION, updateBorderStyle(), and svxform::ControlData::xControl.
Referenced by focusLost(), mouseExited(), and restoreAll().
|
private |
determines the to-be-remembered original border color and type for a control
The method also takes into account that the control may currently have an overwritten border style
_rxControl | the control to examine. Must not be <NULL>, and have a non-<NULL> peer |
Definition at line 189 of file fmcontrolbordermanager.cxx.
References svxform::getBorder(), m_aFocusControl, m_aInvalidControls, m_aMouseHoverControl, and svxform::ControlData::xControl.
Referenced by controlStatusGained(), and validityChanged().
void svxform::ControlBorderManager::disableDynamicBorderColor | ( | ) |
disables dynamic border color for the controls
Definition at line 279 of file fmcontrolbordermanager.cxx.
References m_bDynamicBorderColors, and restoreAll().
void svxform::ControlBorderManager::enableDynamicBorderColor | ( | ) |
enables dynamic border color for the controls
Definition at line 273 of file fmcontrolbordermanager.cxx.
References m_bDynamicBorderColors.
void svxform::ControlBorderManager::focusGained | ( | const css::uno::Reference< css::uno::XInterface > & | _rxControl | ) |
Definition at line 328 of file fmcontrolbordermanager.cxx.
References controlStatusGained(), m_aFocusControl, and m_bDynamicBorderColors.
void svxform::ControlBorderManager::focusLost | ( | const css::uno::Reference< css::uno::XInterface > & | _rxControl | ) |
Definition at line 335 of file fmcontrolbordermanager.cxx.
References controlStatusLost(), m_aFocusControl, and m_bDynamicBorderColors.
|
private |
retrieves the color associated with a given ControlStatus
_eStatus | the status of the control. Must not be <member>ControlStatus::none</member> |
Definition at line 154 of file fmcontrolbordermanager.cxx.
References Focused, Invalid, m_nFocusColor, m_nInvalidColor, m_nMouseHoveColor, and MouseHover.
Referenced by updateBorderStyle().
|
private |
determines the status of the given control
Definition at line 137 of file fmcontrolbordermanager.cxx.
References Focused, Invalid, m_aFocusControl, m_aInvalidControls, m_aMouseHoverControl, MouseHover, NONE, and svxform::ControlData::xControl.
Referenced by updateBorderStyle().
void svxform::ControlBorderManager::mouseEntered | ( | const css::uno::Reference< css::uno::XInterface > & | _rxControl | ) |
Definition at line 342 of file fmcontrolbordermanager.cxx.
References controlStatusGained(), m_aMouseHoverControl, and m_bDynamicBorderColors.
void svxform::ControlBorderManager::mouseExited | ( | const css::uno::Reference< css::uno::XInterface > & | _rxControl | ) |
Definition at line 349 of file fmcontrolbordermanager.cxx.
References controlStatusLost(), m_aMouseHoverControl, and m_bDynamicBorderColors.
void svxform::ControlBorderManager::restoreAll | ( | ) |
restores all colors of all controls where we possibly changed them
Definition at line 305 of file fmcontrolbordermanager.cxx.
References Any, controlStatusLost(), FM_PROP_HELPTEXT, m_aFocusControl, m_aInvalidControls, m_aMouseHoverControl, svxform::setUnderline(), updateBorderStyle(), and svxform::ControlData::xControl.
Referenced by disableDynamicBorderColor().
void svxform::ControlBorderManager::setStatusColor | ( | ControlStatus | _nStatus, |
Color | _nColor | ||
) |
sets a color to be used for a given status
_nStatus | the status which the color should be applied for. Must not be ControlStatus::NONE |
_nColor | the color to apply for the given status |
Definition at line 286 of file fmcontrolbordermanager.cxx.
References Focused, Invalid, m_nFocusColor, m_nInvalidColor, m_nMouseHoveColor, and MouseHover.
|
private |
sets the border color for a given control, depending on its status
_rxControl | the control to set the border color for. Must not be <NULL> |
_rxPeer | the peer of the control, to be passed herein for optimization the caller usually needs it, anyway). Must not be <NULL> |
_rFallback | the color/type to use when the control has the status ControlStatus::NONE |
Definition at line 173 of file fmcontrolbordermanager.cxx.
References getControlColorByStatus(), getControlStatus(), svxform::BorderDescriptor::nBorderColor, svxform::BorderDescriptor::nBorderType, NONE, and svxform::setBorder().
Referenced by controlStatusGained(), controlStatusLost(), restoreAll(), and validityChanged().
void svxform::ControlBorderManager::validityChanged | ( | const css::uno::Reference< css::awt::XControl > & | _rxControl, |
const css::uno::Reference< css::form::validation::XValidatableFormComponent > & | _rxValidatable | ||
) |
Definition at line 356 of file fmcontrolbordermanager.cxx.
References aData, Any, canColorBorder(), determineOriginalBorderStyle(), Exception, FM_PROP_HELPTEXT, svxform::getUnderline(), m_aInvalidControls, m_bDynamicBorderColors, m_nInvalidColor, svxform::setUnderline(), svxform::ControlData::sOriginalHelpText, TOOLS_WARN_EXCEPTION, and updateBorderStyle().
|
private |
Definition at line 114 of file fmcontrolbordermanager.hxx.
Referenced by canColorBorder().
|
private |
Definition at line 117 of file fmcontrolbordermanager.hxx.
Referenced by determineOriginalBorderStyle(), focusGained(), focusLost(), getControlStatus(), and restoreAll().
|
private |
Definition at line 119 of file fmcontrolbordermanager.hxx.
Referenced by determineOriginalBorderStyle(), getControlStatus(), restoreAll(), and validityChanged().
|
private |
Definition at line 118 of file fmcontrolbordermanager.hxx.
Referenced by determineOriginalBorderStyle(), getControlStatus(), mouseEntered(), mouseExited(), and restoreAll().
|
private |
Definition at line 115 of file fmcontrolbordermanager.hxx.
Referenced by canColorBorder().
|
private |
Definition at line 126 of file fmcontrolbordermanager.hxx.
Referenced by disableDynamicBorderColor(), enableDynamicBorderColor(), focusGained(), focusLost(), mouseEntered(), mouseExited(), and validityChanged().
|
private |
Definition at line 123 of file fmcontrolbordermanager.hxx.
Referenced by getControlColorByStatus(), and setStatusColor().
|
private |
Definition at line 125 of file fmcontrolbordermanager.hxx.
Referenced by getControlColorByStatus(), setStatusColor(), and validityChanged().
|
private |
Definition at line 124 of file fmcontrolbordermanager.hxx.
Referenced by getControlColorByStatus(), and setStatusColor().