/**
 * $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 __DISPLAYHANDLERMENUDATA_H
#define __DISPLAYHANDLERMENUDATA_H

// Standard includes
#include <stdlib.h>

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


namespace iwear{
namespace output{

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

 public:

    /**
     * Constructor
     */
    DisplayHandlerMenuData(Configuration& configuration, LayoutManager& layout_manager);
    
    /**
     * Destructor
     */
    virtual ~DisplayHandlerMenuData(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;
    }

 protected:

    void load_icons( void );

 private:

    /**
     * The currently to-be-displayed menu (exportable one)
     */
    ExportableMenu* exportable_menu;

    /*

    // Some surfaces for displaying standard buttons
    SDL_Surface* application_running;
    SDL_Surface* application_starter;
    SDL_Surface* application_audioplayer;

    SDL_Surface* menu_button;
    SDL_Surface* menu_nuke;
    SDL_Surface* menu_quit;
    SDL_Surface* menu_submenu;
    SDL_Surface* menu_switch;
    SDL_Surface* menu_top;
    SDL_Surface* menu_up;
    SDL_Surface* menu_next;
    SDL_Surface* menu_back;
    SDL_Surface* menu_play;
    SDL_Surface* menu_stop;


    // Application Icons
    SDL_Surface* audioplayer; 
    SDL_Surface* routetracker; 
    SDL_Surface* markassistant; 
    SDL_Surface* testapplication; 
    SDL_Surface* applicationlauncher;
    SDL_Surface* daemonlauncher;
    SDL_Surface* viewer;

    SDL_Surface* help;
    SDL_Surface* switch_icon;
    SDL_Surface* map_icon;
    SDL_Surface* phone;
    SDL_Surface* status;
    SDL_Surface* network;
    
    // Deamons
    SDL_Surface* clock; 
    SDL_Surface* battery; 
    SDL_Surface* mouseinput; 

    // General movement and arrows
    SDL_Surface* top; 
    SDL_Surface* up; 

    SDL_Surface* first; 
    SDL_Surface* previous; 
    SDL_Surface* back; 

    SDL_Surface* last; 
    SDL_Surface* next; 
    SDL_Surface* play; 
    SDL_Surface* down; 
    SDL_Surface* bottom; 
    SDL_Surface* stop; 
    SDL_Surface* pause; 

    // volume
    SDL_Surface* volume_max; 
    SDL_Surface* volume_medium; 
    SDL_Surface* volume_min; 
    SDL_Surface* volume_zero; 
    SDL_Surface* volume_mute; 

    SDL_Surface* home; 
    SDL_Surface* save; 
    SDL_Surface* open; 
    SDL_Surface* quit; 
    SDL_Surface* error; 
    SDL_Surface* info; 
    SDL_Surface* trash; 
    SDL_Surface* zoom_icon; 
    SDL_Surface* list_icon; 
    SDL_Surface* list_open; 
    SDL_Surface* list_delete; 
    SDL_Surface* camera; 
    SDL_Surface* keyboard; 
    SDL_Surface* mouse; 
    SDL_Surface* battery_full; 
    SDL_Surface* battery_empty; 
    SDL_Surface* weather; 
    SDL_Surface* car; 

    // markassisstant
    SDL_Surface* mark; 
    SDL_Surface* markmenu; 
    SDL_Surface* selectpoint; 
    SDL_Surface* changeview; 
    SDL_Surface* check; 
    SDL_Surface* new_check; 

    // audioplayer    
    SDL_Surface* append_on; 
    SDL_Surface* append_off; 
    SDL_Surface* playlist; 
    SDL_Surface* playlists; 
    SDL_Surface* default_playlist; 

    */

    map<string, SDL_Surface*> available_icons;

    /**
     * A map from application_uid to pairs from SDL surfaces and data with the menus
     */
    map<uid, MenuData*> managed_applications;

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

    /**
     * The fontsize
     */
    uint32_t fontsize;

    /**
     * Profile
     */
    string color_profile;

};


} // namespace output
} // namespace iwear

#endif // __DISPLAYHANDLERMENUDATA_H

