#ifndef MAINWINDOW_HPP #define MAINWINDOW_HPP #include #include #include #include #include #include "../YAOObjects/Modul.hpp" #include #include #include //#include #include "ConstantWindow.hpp" #include "InsertFCTWindow.hpp" #include "InstructionWindow.hpp" #include "ModulWindow.hpp" #include "NetwardWindow.hpp" #include "SpaceController.hpp" #include "SpaceWindow.hpp" #include "TrajectoryWindow.hpp" #include "OperaWindow.hpp" #include "ContextWindow.hpp" #include "OrderWindow.hpp" #include "ConnectionWindow.hpp" #include "NewProjectWindow.hpp" #include "editor.h" class QDateEdit; class QTextCodec; class FilesViewer; class QTableView; class QTextCodec; class QWorkspace; class QStringList; class QStringListModel; class HatNameWindow; /*! * \class MainWindow * \brief MainWindow class for visual_YAO. */ class MainWindow : public QMainWindow { Q_OBJECT public : /*! * \brief Constructor * * Constructor of the class MainWindow * */ MainWindow(QWidget *parent = 0); MainWindow(yao::Table aConstantTable); void toolBarActions(QWorkspace &espace); void createActions(); void createToolBar(); void createMenus(); void setProjectName(std::string chaine); //!< Sets project's name. std::string getProjectName(); //!< Gets project's name. void setProjectPath(string aPath); std::string getProjectPath(); void directivesManager(); void setActiveProject(const bool aBool); bool isActiveProject(); bool contextTest; /*template void createDefvalWindow(R *directive, S *espace) { if (directive == NULL) { //to test if the object is already created. directive = new directive ; espace->addWindow(directive)->move(0, 0); //Put the object in the workspace directive->show();// shows the object. } connect(directive, SIGNAL(rowIsAdded()), this, SLOT(hatUpdate())); connect(directive, SIGNAL(rowIsDeleted(QString )), this, SLOT(hatUpdate(QString ))); connect(directive, SIGNAL(windowIsClosed(int )), this, SLOT(initializeWindow(int ))); }*/ //~MainWindow(); protected : //void closeEvent(QCloseEvent *event); //private slots: public slots: void clearAllStructures(); void activateToolBarButtons(); void cacherBarreOutils(); void desactivateToolBarButtons(); void generateDFile(std::string destination = "projects/"); void callGenerateDFile();// used only for the execution button void generateIFile(std::string destination = "projects/"); void instructionFileManager(); void montrerActionCompilation(); void montrerActionGenererD(); void createNewProjectWindow(); void openProject(); //void helpMessage(); void createDefvalWindow(); void createHatNameWindow(); void createContextWindow(); void createTrajectoryWindow(); void createSpaceWindow(); void createOperaWindow(); void createNetwardWindow(); void createModulWindow(); void createCtinWindow(); void createOrderWindow(); void createInsertFCTWindow(); void initializeWindow(int anInt); void changeButtonColor(QPushButton *aButton); void changeColorConstantButton(); void changeColorHatButton(); void changeColorContextButton(); void changeColorTrajButton(); void changeColorSpaceButton(); void changeColorOperaButton(); void changeColorModulButton(); void changeColorCtinButton(); void changeColorNetwardButton(); void changeColorInsertFCTButton(); void changeColorOrderButton(); //void createProjectDirectory(); //void openPathWindow(); void setTitle(); void hatUpdate(); void hatUpdate(QString choix ); void trajUpdate(); //void contextUpdate(); void mainWindowIsModified(); void saveAs(); void save(); void enableIAction(); signals : void modified(); void newProjectIsCreated(); void newProjectIsCreated(QString chaine); void WindowTitleChanged(); //void activeTheIAction(); private : MainWindowController the_mwc; InstructionWindow *iw; // Les attributs des menus QMenu *menuFichier; QMenu *menuEdition; QMenu *menuAffichage; QMenu *menuExecution; QMenu *menuConfig; QMenu *menuAide; // Les actions du menu Fichier QAction *actionFichierDescription; QAction *actionFichierHat; QAction *actionModule; QAction *actionFichierInstruction; QAction *actionGrapheModulaire; QAction *actionInfosProjet; QAction *actionNouveauProjet; QAction *actionOuvrirProjet; QAction *actionOuvrirProjetsRecents; QAction *actionImporterProjet; QAction *actionSaveProject; QAction *actionSaveAsProject; QAction *actionImprimerProjet; QAction *actionSortieProjet; // Les actions du menu edition //QAction *actionAnnuler; //QAction *actionRevenir; //QAction *actionCouper; //QAction *actionCopier; //QAction *actionColler; //QAction *actionSelectionnerTout; // Les actions du menu affichage QAction *actionCacherBarreOutils; QAction *actionCacherFenetreApercu; QAction *actionCacherFenetreProjet; QAction *actionCacherFenetreDialog; //QAction *actionPleinEcran; // Les actions du menu Execution QAction *actionGenerationD; QAction *actionGenerationI; QAction *actionCompilation; QAction *actionExecution; // Les actions du menu configuration QAction *actionEditeur; // Les actions du menu aide QAction *actionDocYao; QAction *actionRapport; // La barre d'outils QPushButton *m_constantButton; QPushButton *m_hatNameButton; QPushButton *m_contextButton; QPushButton *m_trajButton; QPushButton *m_spaceButton; QPushButton *m_operaButton; QPushButton *m_netwardButton; QPushButton *m_modulButton; QPushButton *m_ctinButton; QPushButton *m_orderButton; QPushButton *m_insertFCTButton; QToolBar *yaoToolBar; //Crée une barre d'outils QStatusBar *barreEtat; QWorkspace espace; QWorkspace *pt_espace; QTableWidget *tableWidget; QString curFile; QDockWidget *fenetreProjet; ConstantWindow *m_constantWindow; HatNameWindow *m_hatnameWindow; ContextWindow *m_contextWindow; TrajectoryWindow *m_trajectoryWindow; SpaceWindow *m_spaceWindow; OperaWindow *m_operaWindow; NetwardWindow *m_netwardWindow; ModulWindow *m_modulWindow; ConnectionWindow *m_ctinWindow; OrderWindow *m_orderWindow; InsertFCTWindow *m_insertFCTWindow; NewProjectWindow *m_newProjectWindow; NewProjectWindow *m_newProjectWindow2; FilesViewer *fv; std::string filename; std::string filepath; //!< les onglets QTabWidget *tabWidget; QWidget *page1; QWidget *page2; QLineEdit *m_lineDirName; QLineEdit *m_linePath; QTextEdit *ligneInfos; //QDialog *newProjectWindow; std::string m_newProjectName; std::string m_projectPath; // Yao structures are follow: yao::Constant m_theConstant; yao::Table theConstantTable; yao::Table &theConstantTablePt; std::vector theHeaderList; yao::Context theContext; //yao::Modul theModul; yao::Table theTrajectoryTable; yao::Table theSpaceTable; yao::Table theOperaTable; yao::Table theNeuronTable; yao::Table theModulTable; yao::Table theConnectionTable; yao::Table theOrderTable; yao::Table theFunctionTable; std::string theContextData; std::vector theInstructionData; bool m_activeProject; bool confirmationFlag; QDateEdit *date; }; #endif // FENETREPRINCIPALE_HPP