/*
 GROUP.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 group.hpp
\brief contains group class
*/

/*!
\class group group.hpp
\brief container to hold a collection of widgets
*/

/*!
\fn group::group(
        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 group::~group()
\brief destructor
\returns none
*/

/*!
\fn virtual void group::set_damage(
        unsigned int const              i_damage=DAMAGE_NONE)
\brief sets damage mask
\param[in] i_damage damage mask
\returns none

Propogates the damage flags to child widgets
*/
    
/*!
\fn virtual int group::add(
        widget*const                    i_widget)
\brief add child widget
\param[in] i_widget widget to add
\returns 0 success
\returns !0 failure 

A widget can only belong to one group at a time. It is assumed, the
widget has not been added to another group. The group takes ownership
of the widget. It must have been allocated on the heap.  Static widgets
will not work. When the group destructs it will delete all child widgets.
*/

/*!
\fn virtual void group::draw() const
\brief draws it's child widgets

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

/*!
\fn virtual enum event_response group::event_key_default(
        enum scancodes const            i_scan)
\brief default scan code event handler
\param[in] i_scan scan code to handle
\returns response how event was handled
*/

/*!
\fn virtual enum event_response group::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 group::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 virtual void group::focus_enter()
\brief handle entering focus
\returns none
*/

/*!
\fn virtual void group::focus_leave()
\brief handle leaving focus
\returns none
*/

/*!
\fn void group::set_focus(
        widget&                         i_widget)
\brief set widget focus
\param[in,out] widget to set focus
\returns none

\a i_widget should belong to group. Otherwise, nothing happens.
*/

/*!
\var group::m_focused
\brief widget that has focus
*/

/*!
\var group::m_slot
\brief focused widget slot (index into array)
*/

/*!
\var group::m_array
\brief widget container
*/

/*!
\fn void group::focus_next()
\brief focuses next widget
\returns none
*/

/*!
\fn void group::focus_previous()
\brief focuses previous widget
\returns none
*/
