/*	Author:		Magdin Stoica
	Supervisor: Dr. Ryan Leduc

	Project created in conformity with the requirements for the Degree of Master of Engineering in Software Engineering,
	Computing and Software Department,
	McMaster University
	2003 - 2007
*/

#pragma once

#include <QTabWidget>

#include "Workspace.h"
#include "OutputWidget.h"

class QAction;
class QMenu;
class QToolBar;
class QResizeEvent;
class QButtonGroup;


namespace DESpot
{
	class Des;
	class ProjectEditor;
	class DesProject;
	class EventPoolForm;

	class ProjStructureUiPart;
	class ProjSummaryUiPart;
	class DesViewUiPart;
	class OutputUiPart;
	class ProgressWidget;

	class ProjectWorkspace: public Workspace
	{
		Q_OBJECT

		public:
			virtual ~ProjectWorkspace(void);

		//Protect constructor to deny creation. This is intended to be only a base class for concrete project workspace classes
		protected:
			ProjectWorkspace(ProjectEditor* pProjectEditor, DesProject* pProject);

		//Access to UI parts
		public:
			ProjStructureUiPart& projStructureUiPart();
			ProjSummaryUiPart&   projSummaryUiPart();
			DesViewUiPart& desViewUiPart();
			OutputUiPart& outputUiPart();

			bool useGraphEditor();

			virtual ProgressWidget* progressWidget() = 0;


		protected slots:
			virtual void onChangedCurrentDes(Des* pNewCrtDes, Des* pOldCrtDes);

		//Implementations Methods ____________________________
		protected:
			ProjectEditor* projectEditor();

			void setupConnections();
			void createActions();
			void setupMenu();
			void setupToolBar();
			void setupStatusBar();

			void setProjectEditorTitle(const QString& editorTypeDesc, const std::wstring& projName);

		//Actions_____________________________________________
		protected:
			// Project actions
			QAction* m_newFlatProjectAct;
			QAction* m_newHierProjectAct;
			QAction* m_openProjectAct;
			QAction* m_saveProjectAct;
			QAction* m_saveProjectAsAct;
			QAction* m_viewEventPoolAct;

			QAction* m_projectSetNameAct;
			QAction* m_printProjectAct;
			QAction* m_closeProjectAct;

			//DES actions
			QAction* m_addDesAct;
			QAction* m_removeDesAct;
			QAction* m_editDesAct;

			//add by XMA to choose editor
			QAction *m_tabularEditorAct;
			QAction *m_graphEditorAct;

			//Native Tools actions
			QAction* m_checkProjectIntegAct;
			QAction* m_checkProjectAct;
			QAction* m_cleanProjectAct;
			QAction* m_runMeetToolAct;
			QAction* m_runSyncToolAct;
			QAction* m_runNonblockToolAct;
			QAction* m_runCtrlToolAct;
			QAction* m_runMultiCtrlToolAct;
			QAction* m_runSynthesisToolAct;
            //Simulation
			QAction* m_runSimAct;

			#ifdef __ENABLE_BDD__
				QAction* m_runBddMeetToolAct;
				QAction* m_runBddSyncToolAct;
				//removed by Adam. No longer in flat only hisc (moved to HierProjectWorkspace.h)
				//QAction* m_runBddNonblockToolAct;
				//QAction* m_runBddCtrlToolAct;
				QAction* m_runBddSynthesisToolAct;
			#endif

			#ifdef __ENABLE_NEXT_VERSION__
				QAction* m_runSupconToolAct;
			#endif
			//Help actions
			QAction* m_openHelpFileAct;
			QAction* m_aboutDespotAct;

		//Menus_______________________________________________
		protected:
			QMenu* m_projectMenu;
			QMenu* m_newProjectMenu;
			QMenu* m_desMenu;
			QMenu* m_toolsMenu;
			#ifdef __ENABLE_BDD__
				QMenu* m_bddToolsMenu;
			#endif

			QMenu* m_helpMenu;

		//Toolbars____________________________________________
		protected:
			QToolBar* m_projectToolBar;
			QToolBar* m_toolsToolBar;

		//UI Parts______________________________
		protected:
			ProjStructureUiPart* m_pProjStructUiPart;
			ProjSummaryUiPart* m_pSummaryUiPart;
			DesViewUiPart* m_pDesViewUiPart;
			OutputUiPart* m_pOutputUiPart;
	};

} //end of namespace DESpot
