62 lines
1.2 KiB
C++
62 lines
1.2 KiB
C++
#ifndef MAIN_WINDOW_H
|
|
#define MAIN_WINDOW_H
|
|
|
|
#include <QListWidget>
|
|
#include <QMainWindow>
|
|
|
|
#include <comdel/display/library_display.h>
|
|
#include <comdel/display/schema_display.h>
|
|
|
|
#include <comdel/domain/library.h>
|
|
#include <comdel/domain/schema.h>
|
|
#include <QPlainTextEdit>
|
|
#include <comdel/domain/comdelvalidator.h>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui { class MainWindow; }
|
|
QT_END_NAMESPACE
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
display::Library *libraryDisplay;
|
|
display::Schema *schemaDisplay;
|
|
|
|
static std::optional<domain::Library> library;
|
|
static domain::Schema* schema;
|
|
|
|
std::vector<domain::FunctionValidator*> validators;
|
|
|
|
void setupUi();
|
|
void clear();
|
|
|
|
static domain::Schema* getSchema() {
|
|
return schema;
|
|
}
|
|
|
|
static std::optional<domain::Library> getLibrary() {
|
|
return library;
|
|
}
|
|
|
|
|
|
private slots:
|
|
void onLoadLibrary();
|
|
void onLoadSchema();
|
|
void onValidateSchema(bool toggled);
|
|
void onStoreScheme();
|
|
void onGenerateComdel();
|
|
|
|
private:
|
|
std::string librarySource;
|
|
Ui::MainWindow *ui;
|
|
QPlainTextEdit *log;
|
|
std::vector<domain::ValidationError> validationErrors;
|
|
|
|
};
|
|
#endif // MAIN_WINDOW_H
|