/*
 SCROLLER.DOX

 License CC0 PUBLIC DOMAIN

 To the extent possible under law, Mark J. Olesen has waived all copyright
 and related or neighboring rights to FDOSTUI Library. This work is published
 from: United States.
*/

/*! \file scroller.hpp
\brief contains scroller class
*/

/*! \class scroller scroller.hpp
\brief  Allows the user to view a small portion of a large area via scrolling
*/

/*!
\fn scroller::scroller(
        int const                       i_pos_x,
        int const                       i_pos_y,
        unsigned int const              i_len_x,
        unsigned int const              i_len_y)
\brief constructor 
\param[in] i_pos_x x position to place widget
\param[in] i_pos_y y position to place widget
\param[in] i_len_x x length of widget
\param[in] i_len_y y length of widget
\returns none
*/
    
/*!
\fn virtual scroller::~scroller()
\brief destructor
\returns none
*/

/*!
\fn virtual int scroller::add(
        widget*const                    i_widget)
\brief add widget to the scroll bar group
\param[in] i_widget widget to add

\a i_widget must not belong to another group. Once added the
scrollbar takes ownership of the widget.
*/

/*!
\fn virtual void scroller::draw() const
\brief draws the widget

This method should not be called directly. 
\see widget::draw for details.
*/

/*!
\fn virtual enum event_response scroller::event_key(
        struct event_key const&         i_event)
\brief handle key event
\param[in] i_event key event to handle    
\returns response how event was handled
*/

/*!
\fn virtual enum event_response scroller::event_mouse(
        struct event_mouse const&       i_event)
\brief handle mouse event
\param[in] i_event mouse event to handle
\returns response how event was handled
*/

/*!
\fn int scroller::get_scroll_pos_x() const
\brief get scroll (horizontal) position in x direction
\returns scroll position
*/

/*!
\fn int scroller::get_scroll_pos_y() const
\brief get scroll (vertical) position in y direction
\returns scroll position
*/

/*!
\fn virtual void scroller::set_parent(
        group*const                    i_parent)
\brief set parent widget
\param[in] i_parent group to set widget

This is overwritten to set internal member parent group
*/

/*!
\var scroller::m_horizontal
	horizontal scrollbar
*/

/*!
\var scroller::m_vertical
	vertical scrollbar
*/

/*!
\var int scroller::m_scroll_pos_x
	horizontal x scroll position
*/

/*!
\var int scroller::m_scroll_pos_y
	vertical y scroll position
*/

/*!
\fn void scroller::set_scroll_bounds()
\brief configure scrollbar boundaries
*/	

/*!
\fn static void scroller::horizontal_cb(
        widget const*                   i_widget,
        void*                           io_user_data)
\brief horizontal scrollbar callback
\param[in] i_widget horizontal scrollbar
\param[in,out] io_user_data scroller widget
*/

/*!
\fn static void scroller::vertical_cb(
        widget const*                   i_widget,
        void*                           io_user_data)
\brief vertical scrollbar callback
\param[in] i_widget vertical scrollbar
\param[in,out] io_user_data scroller widget
*/

/*!
\fn scroller::scroll_internal()
\brief internal scroll handler, called when scrollbar changes.
*/
