/**
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 * In particular this file is part of the Framework Griffin
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 * 
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __DISPLAYHANDLERWIDGETDATA_H
#define __DISPLAYHANDLERWIDGETDATA_H

// Standard includes
#include <stdlib.h>

// iWear includes
#include <iwear_output_griffin/displayhandler.h>
#include <iwear_output_griffin/displayeventwidgetdata.h>


namespace iwear{
namespace output{

/**
 * @author Carsten Rachuy
 */
class DisplayHandlerWidgetData : public DisplayHandler {

 public:

    /**
     * Constructor
     */
    DisplayHandlerWidgetData(Configuration& configuration, LayoutManager& layout_manager);
    
    /**
     * Destructor
     */
    virtual ~DisplayHandlerWidgetData(void);

    /**
     * Command for the handler to store the output data
     * supported internally and, if the application 
     * is the currently active one, display it
     */
    virtual void handle(OutputData* output_data);

    /**
     * Command for the handler to discard the
     * appropriate output data, throw it away and
     * stop updating the screen with it's content
     */
    virtual void discard(OutputData* output_data);

    /**
     * This method is called when a application switch
     * occured and has to be processed by the handler.
     */
    virtual void switch_focus_to(const uid& application_id);

    /**
     * The main 'display' method which blits the appropriate
     * data which should be displayed into the SDL_Surface provided
     */
    virtual void render(SDL_Surface* sdl_surface);

    /**
     * Return the number of output data objects this very module can
     * handle.
     */
    inline const uint32_t get_number_of_displayable_output_data(void){
	return 1;
    }

 private:

    /**
     * A map from uid to WidgetData
     */
    map<uid, WidgetData*> managed_applications;

    /**
     * The TTF_Font
     */
    TTF_Font* font;

    /**
     * The fontsize
     */
    uint32_t fontsize;

    /**
     * Profile
     */
    string color_profile;

};


} // namespace output
} // namespace iwear

#endif // __DISPLAYHANDLERWIDGETDATA_H

