#ifndef ACCOMMODATIONS_WIDGET_H
#define ACCOMMODATIONS_WIDGET_H

#include <QtGui>
#include "ui_accommodationsWidget.h"
#include "softProj\clientServer\structs.h"
#include "softProj\Main\INotifyUpdate.h"
#include "addRoomDialog.h"

/// Widget for accommodations section in ship or base
/** 
Widget for accommodations section in ship or base. It is composed mostly from rommWidget instances 
that represents concrete room classes.
*/
class AccommodationsWidget : public NotifyWidget {
	Q_OBJECT
public:
	/** Creates new instance of AccommodationsWidget
	@param parent Parent widget
	*/
	AccommodationsWidget(QWidget * parent);

	/** Sets state of the widget from given state holder
	@param state State holder that holds information about section settings
	*/
	void setState(accommodation_status & state);

	void notifyUpdate() {}
private:
	Ui::AccommodationsWidget ui_;
	QString weightUnit_;
	QString sizeUnit_;

	AddRoomDialog * addRoomDialog_;
	accommodation_status state_;

	void createAddRoomDialog();
	void showAddRoomDialog(accommodation_type accommodationType);
private slots:
	void addLuxuryAccommodationsSlot();
	void addComfortableRoomsSlot();
	void addCommonCabinsSlot();
	void addWarehousesSlot();
	
	void submitAddRoomDialogSlot();
	void cancelAddRoomDialogSlot();
signals:
	void addAccommodationsSignal(unsigned long count, accommodation_type accommodationType);

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

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

#endif