#ifndef DRONE_WEAPON_ITEM_WIDGET_H
#define DRONE_WEAPON_ITEM_WIDGET_H

#include "ui_droneWeaponWidget.h"
#include <QtGui>
#include "weaponItem.h"
#include "protocol.h"
#include <cassert>

void setButtonIcon(QPushButton * button, const std::string & filePath, unsigned int iconSize);

class CombinedSlider;
class AllDevicesWidget;

///Manages and displays Drone weapon issues.
class DroneWeaponWidget : public BasicWeaponWidget {
	Q_OBJECT
private:
	Ui::DroneWeaponWidget ui_;
	drone_missile_launcher_status state_;
	bool isSmall_;
	unsigned long long actualLaunch_;

	QIcon okIcon;
	QIcon notokIcon;

	QString availableButtonStyle_;
	QString unavailableButtonStyle_;

	QString availableSmallButtonStyle_;
	QString unavailableSmallButtonStyle_;
public slots:
	void switchOnButtonClickedSlot(bool);
	void unmountButtonClickedSlot();
public:
	virtual void setDeviceName(const std::wstring & deviceName);

	DroneWeaponWidget(QWidget * parent);

	virtual void setChargeToFire(unsigned long long value); /**< Returns weapon charge value. */
	virtual void setCurrentCharge(unsigned long long value);  /**< Sets current weapon charge value. */ 
	virtual void setMaximumCharge(unsigned long long value); /**< Sets weapon maximum charge limit. */ 

	virtual unsigned long long getChargeToFire();	/**< Returns weapon charge value. */

	virtual void activateDevice(); /**< Makes the weapon active. */
	virtual void deactivateDevice(); /**< Makes the weapon unactive. */

	//TODO, FIXME, COMMENTME
	virtual void refreshDesignByActivity();

	void setState(const drone_missile_launcher_status & state, unsigned long long actualLaunch);
	virtual std::pair<id_t, unsigned long long> getState();

	virtual void setEnergyUnit(const std::wstring & unit) {
		ui_.fireSlider->setEnergyUnit(unit);
	}

	void setAsBig();
	void setAsSmall();

	void setAsMounted(bool mounted);
	virtual void notifyUpdate(double difference);
signals:
	void settingsChangedSignal(const std::pair<id_t, unsigned long long> & state);
	void unmountSignal(id_t itemId);
};

#endif