CtrlGeneric Class Reference

Base class for controls. More...

Inheritance diagram for CtrlGeneric:

Inheritance graph
[legend]
Collaboration diagram for CtrlGeneric:

Collaboration graph
[legend]

Public Member Functions

virtual ~CtrlGeneric ()
virtual void handleEvent (EvtGeneric &rEvent)
 Handle an event on the control.
virtual bool mouseOver (int x, int y) const
 Check whether coordinates are inside the control.
virtual void draw (OSGraphics &rImage, int xDest, int yDest)
 Draw the control on the given graphics.
virtual void setLayout (GenericLayout *pLayout, const Position &rPosition)
 Set the position and the associated layout of the control.
virtual void unsetLayout ()
virtual const PositiongetPosition () const
 Get the position of the control in the layout, if any.
virtual UString getTooltipText () const
 Get the text of the tooltip.
virtual void onResize ()
 Overload this method if you want to do something special when the layout is resized.
virtual const UStringgetHelpText () const
 Get the help text.
virtual bool isFocusable () const
 Return true if the control can gain the focus.
virtual bool isVisible () const
 Return true if the control is visible.
virtual string getType () const
 Get the type of control (custom RTTI).

Protected Member Functions

 CtrlGeneric (intf_thread_t *pIntf, const UString &rHelp, VarBool *pVisible=NULL)
virtual void notifyLayout (int witdh=-1, int height=-1, int xOffSet=0, int yOffSet=0) const
 Tell the layout when the image has changed, with the size of the rectangle to repaint and its offset.
void notifyLayoutMaxSize (const Box *pImg1=NULL, const Box *pImg2=NULL)
 Same as notifyLayout(), but takes optional images as parameters.
virtual void captureMouse () const
 Ask the layout to capture the mouse.
virtual void releaseMouse () const
 Ask the layout to release the mouse.
virtual void notifyTooltipChange () const
 Notify the window the tooltip has changed.
virtual TopWindowgetWindow () const
 Get the associated window, if any.
virtual void onPositionChange ()
 Overload this method if you want to do something special when the Position object is set.
virtual void onVarBoolUpdate (VarBool &rVar)
 Overload this method to get notified of bool variable changes.
virtual void onUpdate (Subject< VarBool > &rVariable, void *)
 Method called when an observed bool variable is changed.

Protected Attributes

GenericLayoutm_pLayout
 Associated layout.
VarBoolm_pVisible
 Visibility variable.

Detailed Description

Base class for controls.

Constructor & Destructor Documentation

CtrlGeneric::~CtrlGeneric (  )  [virtual]

CtrlGeneric::CtrlGeneric ( intf_thread_t pIntf,
const UString rHelp,
VarBool pVisible = NULL 
) [protected]


Member Function Documentation

virtual void CtrlGeneric::handleEvent ( EvtGeneric rEvent  )  [inline, virtual]

virtual bool CtrlGeneric::mouseOver ( int  x,
int  y 
) const [inline, virtual]

Check whether coordinates are inside the control.

Reimplemented in CtrlButton, CtrlCheckbox, CtrlImage, CtrlList, CtrlMove, CtrlRadialSlider, CtrlResize, CtrlSliderCursor, CtrlSliderBg, CtrlText, CtrlTree, and CtrlVideo.

Referenced by CtrlResize::mouseOver(), and CtrlMove::mouseOver().

virtual void CtrlGeneric::draw ( OSGraphics rImage,
int  xDest,
int  yDest 
) [inline, virtual]

void CtrlGeneric::setLayout ( GenericLayout pLayout,
const Position rPosition 
) [virtual]

Set the position and the associated layout of the control.

Reimplemented in CtrlButton, CtrlMove, CtrlResize, and CtrlVideo.

References m_pLayout, onPositionChange(), and Position().

Referenced by GenericLayout::addControl(), CtrlVideo::setLayout(), CtrlResize::setLayout(), CtrlMove::setLayout(), and CtrlButton::setLayout().

void CtrlGeneric::unsetLayout (  )  [virtual]

virtual const Position* CtrlGeneric::getPosition (  )  const [inline, virtual]

virtual UString CtrlGeneric::getTooltipText (  )  const [inline, virtual]

Get the text of the tooltip.

Reimplemented in CtrlButton, CtrlCheckbox, and CtrlSliderCursor.

References SkinObject::getIntf().

Referenced by TopWindow::onControlRelease(), and TopWindow::onTooltipChange().

virtual void CtrlGeneric::onResize (  )  [inline, virtual]

Overload this method if you want to do something special when the layout is resized.

Reimplemented in CtrlList, CtrlMove, CtrlResize, CtrlSliderBg, CtrlTree, and CtrlVideo.

Referenced by CtrlResize::onResize(), and CtrlMove::onResize().

virtual const UString& CtrlGeneric::getHelpText (  )  const [inline, virtual]

Get the help text.

Referenced by TopWindow::processEvent().

virtual bool CtrlGeneric::isFocusable (  )  const [inline, virtual]

Return true if the control can gain the focus.

Reimplemented in CtrlList, and CtrlTree.

Referenced by TopWindow::processEvent().

bool CtrlGeneric::isVisible (  )  const [virtual]

Return true if the control is visible.

References VarBool::get(), and m_pVisible.

Referenced by GenericLayout::addControl(), CtrlVideo::onUpdate(), GenericLayout::refreshRect(), and CtrlVideo::setLayout().

virtual string CtrlGeneric::getType (  )  const [inline, virtual]

void CtrlGeneric::notifyLayout ( int  witdh = -1,
int  height = -1,
int  xOffSet = 0,
int  yOffSet = 0 
) const [protected, virtual]

Tell the layout when the image has changed, with the size of the rectangle to repaint and its offset.

Use the default values to repaint the whole window

References m_pLayout, and GenericLayout::onControlUpdate().

Referenced by CtrlTree::handleEvent(), CtrlList::handleEvent(), notifyLayoutMaxSize(), CtrlVideo::onUpdate(), and onUpdate().

void CtrlGeneric::notifyLayoutMaxSize ( const Box pImg1 = NULL,
const Box pImg2 = NULL 
) [protected]

Same as notifyLayout(), but takes optional images as parameters.

The maximum size(s) of the images will be used for repainting.

References Box::getHeight(), Box::getWidth(), and notifyLayout().

void CtrlGeneric::captureMouse (  )  const [protected, virtual]

Ask the layout to capture the mouse.

References m_pLayout, and GenericLayout::onControlCapture().

void CtrlGeneric::releaseMouse (  )  const [protected, virtual]

Ask the layout to release the mouse.

References m_pLayout, and GenericLayout::onControlRelease().

void CtrlGeneric::notifyTooltipChange (  )  const [protected, virtual]

Notify the window the tooltip has changed.

References getWindow(), and TopWindow::onTooltipChange().

TopWindow * CtrlGeneric::getWindow (  )  const [protected, virtual]

Get the associated window, if any.

References GenericLayout::getWindow(), and m_pLayout.

Referenced by CtrlVideo::getWindow(), CtrlSliderBg::handleEvent(), and notifyTooltipChange().

virtual void CtrlGeneric::onPositionChange (  )  [inline, protected, virtual]

Overload this method if you want to do something special when the Position object is set.

Reimplemented in CtrlVideo.

Referenced by setLayout().

virtual void CtrlGeneric::onVarBoolUpdate ( VarBool rVar  )  [inline, protected, virtual]

Overload this method to get notified of bool variable changes.

Referenced by onUpdate().

void CtrlGeneric::onUpdate ( Subject< VarBool > &  rVariable,
void *  arg 
) [protected, virtual]

Method called when an observed bool variable is changed.

Reimplemented in CtrlVideo.

References m_pVisible, notifyLayout(), and onVarBoolUpdate().


Field Documentation

Visibility variable.

Referenced by CtrlGeneric(), isVisible(), CtrlVideo::onUpdate(), onUpdate(), and ~CtrlGeneric().


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

Generated on Tue May 25 08:05:54 2010 for VLC by  doxygen 1.5.6