// src/schedulable_statistics_widget.hh - Copyright 2005, 2006, University
//               of Padova, dept. of Pure and Applied
//               Mathematics
//
// This file is part of SGPEMv2.
//
// This 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; either version 2 of the License, or
// (at your option) any later version.
//
// SGPEMv2 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 SGPEMv2; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#ifndef SCHEDULABLE_STATISTICS_WIDGET_HH
#define SCHEDULABLE_STATISTICS_WIDGET_HH 1

#include "config.h"

#include "cairo_widget.hh"
#include <sgpemv2/history_observer.hh>

#include <gtkmm/treeview.h>
#include <gtkmm/treestore.h>

namespace sgpem
{

	
	class TabularSchedulableStatisticsWidget : public HistoryObserver, public Gtk::TreeView
	{	
	public:	
		TabularSchedulableStatisticsWidget();
		virtual ~TabularSchedulableStatisticsWidget();
		
		void 		update(const History& changed_history);
		
		void		set_show_runs(bool);
		bool		get_show_runs() const;
		
		void		set_show_perc(bool);
		bool		get_show_perc() const;
		
		void		set_show_inactive(bool);
		bool		get_show_inactive() const;

		void		set_show_turn_around(bool);
		bool		get_show_turn_around() const;
		
		void		set_show_response(bool);
		bool		get_show_response() const;

		void		set_show_efficiency(bool);
		bool		get_show_efficiency() const;

		void		set_show_resource_usage(bool);
		bool		get_show_resource_usage() const;

		void		set_show_resource_block(bool);
		bool		get_show_resource_block() const;

	protected:
		void 								update_columns();
		
		bool 								_show_runs,			//which info to show
											_show_perc,
											_show_inactive,
											_show_turn,
											_show_resp,
											_show_effic,
											_show_ris_usage,
											_show_ris_block;
											
		Glib::RefPtr<Gtk::TreeStore> 		_model;				//treeview stuffs
		Gtk::TreeModelColumnRecord 			_columns;
		
		Gtk::TreeModelColumn<Glib::ustring> _col_name;			//all columns
		Gtk::TreeModelColumn<int>			_col_runs;
		Gtk::TreeModelColumn<Glib::ustring>	_col_perc;
		Gtk::TreeModelColumn<int>			_col_inactive;
		Gtk::TreeModelColumn<int>			_col_turn;
		Gtk::TreeModelColumn<Glib::ustring>	_col_resp;
		Gtk::TreeModelColumn<Glib::ustring>	_col_effic;
		Gtk::TreeModelColumn<int>			_col_ris_usage;
		Gtk::TreeModelColumn<int>			_col_ris_block;
	
	};

} //~ namespace sgpem


#endif
