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
42 #define OP_ADD (quint8)0
43 #define OP_REM (quint8)1
44 #define OP_RAZ (quint8)2
50 class MainWindow : public QMainWindow {
55 explicit MainWindow(QWidget *parent = 0);
59 void addTopGroup(GroupWidget* _topGroup);
60 void removeTopGroup(); // called when closing project
63 inline BlockLibraryWidget *getLibrary(){return library;}
67 void closeEvent(QCloseEvent *);
68 void mousePressEvent(QMouseEvent *e);
69 void focusInEvent(QFocusEvent *e);
73 GroupWidget* topGroup;
74 QStackedWidget *stackedWidget;
75 Dispatcher *dispatcher;
77 BlockLibraryWidget *library;
79 QString absoluteFilename;
81 QString checkNewVersion;
83 void save(QString absoluteFilename);
95 quint16 projectMenuEnb;
97 quint16 analysisMenuEnb;
100 // actions for project
102 QAction* openProject;
103 QAction* saveProject;
104 QAction* saveAsProject;
105 QAction* closeProject;
106 QAction* openLibrary;
108 // actions for graph analysis
109 QAction *graphAnalysis;
112 QAction *vhdlToXmlAct;
114 // versioning related
120 void enableProjectActions(bool enbMenu, quint16 mask = 0, quint8 op = 0); // default : add nothing
121 void enableAnalysisActions(bool enbMenu, quint16 mask = 0, quint8 op = 0); // default : add nothing
124 void slotNewProject();
125 void slotLoadProject();
126 void slotSaveProject();
127 void slotSaveAsProject();
128 bool slotCloseProject();
129 void slotOpenBlockLibrary();
131 void slotGraphAnalysis();
133 void slotVHDLToXml();
135 void slotCheckNewVersion(QNetworkReply *reply);
138 #endif // MAINWINDOW_H