1 #ifndef __MAINWINDOW_H__
2 #define __MAINWINDOW_H__
13 class BlockLibraryWidget;
19 #define MAGIC_STRING "opentrace"
20 #define VERSION_MAJ (quint8)0 // major version code
21 #define VERSION_MIN (quint8)2 // minor version number
22 #define REVISION (quint8)1 // revision number of current version
26 #define PROJECT_MENU (quint8)1
27 #define ANALYSIS_MENU (quint8)2
28 #define TOOLS_MENU (quint8)3
30 // defines for actions
31 #define NONE_ACT (quint16)0
33 #define PROJECT_NEW (quint16)1
34 #define PROJECT_OPEN (quint16)2
35 #define PROJECT_SAVE (quint16)4
36 #define PROJECT_SAVEAS (quint16)8
37 #define PROJECT_CLOSE (quint16)16
38 #define PROJECT_LIB (quint16)32
40 #define ANALYSIS_ANALYZE (quint16)1
41 #define ANALYSIS_GENERATE (quint16)2
43 #define OP_ADD (quint8)0
44 #define OP_REM (quint8)1
45 #define OP_RAZ (quint8)2
51 class MainWindow : public QMainWindow {
56 explicit MainWindow(QWidget *parent = 0);
60 void addTopGroup(GroupWidget* _topGroup);
61 void removeTopGroup(); // called when closing project
64 inline BlockLibraryWidget *getLibrary(){return library;}
68 void closeEvent(QCloseEvent *);
69 void mousePressEvent(QMouseEvent *e);
70 void focusInEvent(QFocusEvent *e);
74 GroupWidget* topGroup;
75 QStackedWidget *stackedWidget;
76 Dispatcher *dispatcher;
78 BlockLibraryWidget *library;
80 QString absoluteFilename;
82 QString checkNewVersion;
84 void save(QString absoluteFilename);
96 quint16 projectMenuEnb;
98 quint16 analysisMenuEnb;
101 // actions for project
103 QAction* openProject;
104 QAction* saveProject;
105 QAction* saveAsProject;
106 QAction* closeProject;
107 QAction* openLibrary;
109 // actions for graph analysis
110 QAction *graphAnalysis;
111 QAction *generateVHDL;
114 QAction *vhdlToXmlAct;
116 // versioning related
122 void enableProjectActions(bool enbMenu, quint16 mask = 0, quint8 op = 0); // default : add nothing
123 void enableAnalysisActions(bool enbMenu, quint16 mask = 0, quint8 op = 0); // default : add nothing
126 void slotNewProject();
127 void slotLoadProject();
128 void slotSaveProject();
129 void slotSaveAsProject();
130 bool slotCloseProject();
131 void slotOpenBlockLibrary();
133 void slotGraphAnalysis();
134 void slotGenerateVHDL();
136 void slotVHDLToXml();
138 void slotCheckNewVersion(QNetworkReply *reply);
141 #endif // MAINWINDOW_H