LibreOffice Module svx (master)  1
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
svxform::ControlBorderManager Class Reference

manages the dynamic border color for form controls More...

#include <fmcontrolbordermanager.hxx>

Collaboration diagram for svxform::ControlBorderManager:
[legend]

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, ControlDataCompareControlBag
 
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)
 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...
 

Private Attributes

PeerBag m_aColorableControls
 
PeerBag m_aNonColorableControls
 
ControlData m_aFocusControl
 
ControlData m_aMouseHoverControl
 
ControlBag m_aInvalidControls
 
Color m_nFocusColor
 
Color m_nMouseHoveColor
 
Color m_nInvalidColor
 
bool m_bDynamicBorderColors
 

Detailed Description

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 101 of file fmcontrolbordermanager.hxx.

Member Typedef Documentation

Definition at line 112 of file fmcontrolbordermanager.hxx.

typedef ::std::set< css::uno::Reference< css::awt::XVclWindowPeer > > svxform::ControlBorderManager::PeerBag
private

Definition at line 113 of file fmcontrolbordermanager.hxx.

Constructor & Destructor Documentation

svxform::ControlBorderManager::ControlBorderManager ( )

Definition at line 87 of file fmcontrolbordermanager.cxx.

svxform::ControlBorderManager::~ControlBorderManager ( )

Definition at line 96 of file fmcontrolbordermanager.cxx.

Member Function Documentation

bool svxform::ControlBorderManager::canColorBorder ( const css::uno::Reference< css::awt::XVclWindowPeer > &  _rxPeer)
private

determines whether the border of a given peer can be colored

Parameters
_rxPeerthe peer to examine. Must not be <NULL>

Definition at line 101 of file fmcontrolbordermanager.cxx.

References FM_PROP_BORDER, m_aColorableControls, m_aNonColorableControls, and svx::sidebar::NONE.

Referenced by controlStatusGained(), controlStatusLost(), and validityChanged().

void svxform::ControlBorderManager::controlStatusGained ( const css::uno::Reference< css::uno::XInterface > &  _rxControl,
ControlData _rControlData 
)
private

called when a control got one of the two possible statuses (focused, and hovered with the mouse)

Parameters
_rxControlthe control which gained the status
_rControlDatathe control's status data, as a reference to our respective member

Definition at line 215 of file fmcontrolbordermanager.cxx.

References canColorBorder(), DBG_ASSERT, determineOriginalBorderStyle(), Exception, updateBorderStyle(), and svxform::ControlData::xControl.

Referenced by focusGained(), and mouseEntered().

void svxform::ControlBorderManager::controlStatusLost ( const css::uno::Reference< css::uno::XInterface > &  _rxControl,
ControlData _rControlData 
)
private

called when a control lost one of the two possible statuses (focused, and hovered with the mouse)

Parameters
_rxControlthe control which lost the status
_rControlDatathe control's status data, as a reference to our respective member

Definition at line 248 of file fmcontrolbordermanager.cxx.

References canColorBorder(), Exception, updateBorderStyle(), and svxform::ControlData::xControl.

Referenced by focusLost(), mouseExited(), and restoreAll().

void svxform::ControlBorderManager::determineOriginalBorderStyle ( const css::uno::Reference< css::awt::XControl > &  _rxControl,
BorderDescriptor _rData 
) const
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

Parameters
_rxControlthe control to examine. Must not be <NULL>, and have a non-<NULL> peer

Definition at line 188 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 278 of file fmcontrolbordermanager.cxx.

References m_bDynamicBorderColors, and restoreAll().

void svxform::ControlBorderManager::enableDynamicBorderColor ( )

enables dynamic border color for the controls

Definition at line 272 of file fmcontrolbordermanager.cxx.

References m_bDynamicBorderColors.

void svxform::ControlBorderManager::focusGained ( const css::uno::Reference< css::uno::XInterface > &  _rxControl)
void svxform::ControlBorderManager::focusLost ( const css::uno::Reference< css::uno::XInterface > &  _rxControl)
Color svxform::ControlBorderManager::getControlColorByStatus ( ControlStatus  _eStatus)
private

retrieves the color associated with a given ControlStatus

Parameters
_eStatusthe status of the control. Must not be <member>ControlStatus::none</member>

Definition at line 153 of file fmcontrolbordermanager.cxx.

References Focused, Invalid, m_nFocusColor, m_nInvalidColor, m_nMouseHoveColor, and MouseHover.

Referenced by updateBorderStyle().

ControlStatus svxform::ControlBorderManager::getControlStatus ( const css::uno::Reference< css::awt::XControl > &  _rxControl)
private

determines the status of the given control

Definition at line 136 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)
void svxform::ControlBorderManager::mouseExited ( const css::uno::Reference< css::uno::XInterface > &  _rxControl)
void svxform::ControlBorderManager::restoreAll ( )
void svxform::ControlBorderManager::setStatusColor ( ControlStatus  _nStatus,
Color  _nColor 
)

sets a color to be used for a given status

Parameters
_nStatusthe status which the color should be applied for. Must not be ControlStatus::NONE
_nColorthe color to apply for the given status

Definition at line 285 of file fmcontrolbordermanager.cxx.

References Focused, Invalid, m_nFocusColor, m_nInvalidColor, m_nMouseHoveColor, and MouseHover.

void svxform::ControlBorderManager::updateBorderStyle ( const css::uno::Reference< css::awt::XControl > &  _rxControl,
const css::uno::Reference< css::awt::XVclWindowPeer > &  _rxPeer,
const BorderDescriptor _rFallback 
)
private

sets the border color for a given control, depending on its status

Parameters
_rxControlthe control to set the border color for. Must not be <NULL>
_rxPeerthe peer of the control, to be passed herein for optimization the caller usually needs it, anyway). Must not be <NULL>
_rFallbackthe color/type to use when the control has the status ControlStatus::NONE

Definition at line 172 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 
)

Member Data Documentation

PeerBag svxform::ControlBorderManager::m_aColorableControls
private

Definition at line 115 of file fmcontrolbordermanager.hxx.

Referenced by canColorBorder().

ControlData svxform::ControlBorderManager::m_aFocusControl
private
ControlBag svxform::ControlBorderManager::m_aInvalidControls
private
ControlData svxform::ControlBorderManager::m_aMouseHoverControl
private
PeerBag svxform::ControlBorderManager::m_aNonColorableControls
private

Definition at line 116 of file fmcontrolbordermanager.hxx.

Referenced by canColorBorder().

bool svxform::ControlBorderManager::m_bDynamicBorderColors
private
Color svxform::ControlBorderManager::m_nFocusColor
private

Definition at line 124 of file fmcontrolbordermanager.hxx.

Referenced by getControlColorByStatus(), and setStatusColor().

Color svxform::ControlBorderManager::m_nInvalidColor
private
Color svxform::ControlBorderManager::m_nMouseHoveColor
private

Definition at line 125 of file fmcontrolbordermanager.hxx.

Referenced by getControlColorByStatus(), and setStatusColor().


The documentation for this class was generated from the following files: