#ifndef RESOURCE_WIDGET_H
#define RESOURCE_WIDGET_H

#include <QtGui>
#include "ui_resourceWidget.h"

/// Widget for displaying resource in a game 
/** Widget for displaying resource in a game. It displays resource name, current
and maximum values and gradient. It can also set units that are used and displayed
for given values */
class ResourceWidget : public QWidget {
	Q_OBJECT
public:
	/** Creates new instance of ResourceWidget
	@param parent Parent widget
	*/
	ResourceWidget(QWidget * parent);

	/** Sets name of resource that widget represents 
	@param name Name of resource that widget represents
	*/
	void setName(const std::wstring & name);

	/** Sets capacity of the resource as not used, because some resources does not have some parameters */
	void setCapacityAsNo();

	/** Sets image of resource that widget represents 
	@param path Path to icon image of resource that widget represents
	*/
	void setIcon(const std::string & path);

	/** Sets value of resource that widget represents 
	@param value Value of resource that widget represents 
	*/
	void setValue(unsigned long long value);

	/** Sets unit of count values of resource that widget represents 
	@param countUnit Unit of count values of resource that widget represents 
	*/
	void setValueUnit(const std::wstring & countUnit);

	/** Sets unit of capacity values of resource that widget represents 
	@param countUnit Unit of capacity values of resource that widget represents 
	*/
	void setCapacityUnit(const std::wstring & countUnit);

	/** Sets size value of resource that widget represents 
	@param Maximum value Size of resource that widget represents 
	*/
	void setSize(unsigned long long value);

	/** Sets size value of resource that widget represents 
	@param value Size of resource that widget represents 
	*/
	void setSize(const std::wstring & value);

	/** Sets free capacity value of resource that widget represents 
	@param Maximum value Capacity of resource that widget represents 
	*/
	void setFreeCapacity(unsigned long long value);

	/** Sets free capacity value of resource that widget represents 
	@param value Capacity of resource that widget represents 
	*/
	void setFreeCapacity(const std::wstring & value);

	/** Sets gradient of resource that widget represents 
	@param value Gradient of resource that widget represents 
	*/
	void setGradient(signed long long value);

	/** Sets title of label with value 
	@param value Text to display in value label 
	*/
	void setValueLabel(const std::wstring & value);
private:
	Ui::ResourceWidget ui_;
	QString countUnit_;
	QString capacityUnit_;
};

#endif