#ifndef CREW_WIDGET_H
#define CREW_WIDGET_H

#include <QtGui>
#include "ui_crewWidget.h"
#include "protocol.h"
#include "..\helpers.h"
#include "softProj\Main\INotifyUpdate.h"
#include "addCrewDialog.h"

///Widget, where the ship crew is displayed.
class CrewWidget : public NotifyWidget {
	Q_OBJECT

private:
	Ui::CrewWidget ui_;

	QString memberWeightUnit_;

	AddCrewDialog * addCrewDialog_;
	crew_status state_;

	void createAddCrewDialog();
	void showAddCrewDialog(crew_type crewType, bool isAdding);
public:
	CrewWidget(QWidget * parent);

	void setState(crew_status & state);
	void notifyUpdate();
private slots:
	void addCaptainSlot();
	void addOfficersSlot();
	void addPilotsSlot();
	void addEngineersSlot();
	void addScientistsSlot();
	void addDoctorsSlot();
	void addPassengersSlot();

	void removeCaptainSlot();
	void removeOfficersSlot();
	void removePilotsSlot();
	void removeEngineersSlot();
	void removeScientistsSlot();
	void removeDoctorsSlot();
	void removePassengersSlot();
	
	void submitAddCrewDialogSlot();
	void cancelAddCrewDialogSlot();
signals:
	void addCrewSignal(unsigned long able, unsigned long wounded, crew_type crewType);
	void removeCrewSignal(unsigned long able, unsigned long wounded, crew_type crewType);

	/** Signals that widget wants to show dialog */
	void showDialogSignal();

	/** Signals that widget wants to hide dialog */
	void hideDialogSignal();
};

#endif