schema_editor/mainwindow.h

62 lines
1.2 KiB
C
Raw Normal View History

2022-04-08 18:17:58 +00:00
#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
2022-03-29 19:31:45 +00:00
2022-04-07 22:21:23 +00:00
#include <QListWidget>
2022-03-29 19:31:45 +00:00
#include <QMainWindow>
2022-04-07 22:21:23 +00:00
#include <comdel/display/library_display.h>
#include <comdel/display/schema_display.h>
#include <comdel/domain/library.h>
#include <comdel/domain/schema.h>
2022-04-09 19:11:17 +00:00
#include <QPlainTextEdit>
2022-05-27 06:18:17 +00:00
#include <comdel/domain/comdel_validator.h>
2022-04-07 22:21:23 +00:00
2022-03-29 19:31:45 +00:00
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
2022-04-07 22:21:23 +00:00
display::Library *libraryDisplay;
display::Schema *schemaDisplay;
static std::optional<domain::Library> library;
static domain::Schema* schema;
2022-04-07 22:21:23 +00:00
2022-05-15 09:17:05 +00:00
std::vector<domain::FunctionValidator*> validators;
2022-04-07 22:21:23 +00:00
void setupUi();
void clear();
static domain::Schema* getSchema() {
return schema;
}
static std::optional<domain::Library> getLibrary() {
return library;
}
2022-04-07 22:21:23 +00:00
private slots:
void onLoadLibrary();
void onLoadSchema();
2022-04-10 12:23:18 +00:00
void onValidateSchema(bool toggled);
2022-04-24 20:21:45 +00:00
void onStoreScheme();
void onGenerateComdel();
2022-04-07 22:21:23 +00:00
2022-03-29 19:31:45 +00:00
private:
2022-04-24 20:21:45 +00:00
std::string librarySource;
2022-03-29 19:31:45 +00:00
Ui::MainWindow *ui;
2022-04-09 19:11:17 +00:00
QPlainTextEdit *log;
2022-04-10 12:23:18 +00:00
std::vector<domain::ValidationError> validationErrors;
2022-03-29 19:31:45 +00:00
};
2022-04-08 18:17:58 +00:00
#endif // MAIN_WINDOW_H