2019-06-13 06:22:20 +00:00
|
|
|
#ifndef TYPESINTERACTIONDIALOG_H
|
|
|
|
#define TYPESINTERACTIONDIALOG_H
|
2019-02-11 09:34:15 +00:00
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace Ui {
|
2019-06-13 06:22:20 +00:00
|
|
|
class TypesInteractionDialog;
|
2019-02-11 09:34:15 +00:00
|
|
|
}
|
2019-07-11 13:21:54 +00:00
|
|
|
|
|
|
|
class QSyntaxHighlighter;
|
2019-02-11 09:34:15 +00:00
|
|
|
|
2019-06-13 06:22:20 +00:00
|
|
|
class TypesInteractionDialog : public QDialog
|
2019-02-11 09:34:15 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2019-06-13 06:22:20 +00:00
|
|
|
explicit TypesInteractionDialog(QWidget *parent = nullptr, bool readOnly = false);
|
|
|
|
~TypesInteractionDialog();
|
|
|
|
/**
|
|
|
|
* @brief Fill the Dialog's TextEdit object with the content
|
|
|
|
* passed to the function. The content will most likely be a C
|
|
|
|
* representation of a Type.
|
|
|
|
* @param content - The content which should be in the TextEdit object.
|
|
|
|
* most likely will be a C representation of a Type.
|
|
|
|
* @param readonly - Will be set as "true" for viewing mode
|
|
|
|
*/
|
|
|
|
void fillTextArea(QString content);
|
2019-02-11 09:34:15 +00:00
|
|
|
|
|
|
|
private slots:
|
2019-03-06 20:30:39 +00:00
|
|
|
/**
|
|
|
|
* @brief Executed when the user clicks the selectFileButton
|
2019-02-11 09:34:15 +00:00
|
|
|
* Opens a File Dialog from where the user can select a file from where
|
|
|
|
* the types will be loaded.
|
|
|
|
*/
|
|
|
|
void on_selectFileButton_clicked();
|
|
|
|
|
2019-03-06 20:30:39 +00:00
|
|
|
/**
|
|
|
|
* @brief Executed whenever the text inside the textbox changes
|
2019-02-11 09:34:15 +00:00
|
|
|
* When the text box is empty, the OK button is disabled.
|
|
|
|
*/
|
|
|
|
void on_plainTextEdit_textChanged();
|
|
|
|
|
2019-03-06 20:30:39 +00:00
|
|
|
/**
|
|
|
|
* @brief done Closes the dialog and sets its result code to r
|
|
|
|
* @param r The value which will be returned by exec()
|
2019-02-11 09:34:15 +00:00
|
|
|
*/
|
|
|
|
void done(int r) override;
|
|
|
|
|
|
|
|
private:
|
2019-06-13 06:22:20 +00:00
|
|
|
std::unique_ptr<Ui::TypesInteractionDialog> ui;
|
2019-07-11 13:21:54 +00:00
|
|
|
QSyntaxHighlighter *syntaxHighLighter;
|
2019-02-11 09:34:15 +00:00
|
|
|
|
|
|
|
signals:
|
2019-03-06 20:30:39 +00:00
|
|
|
/**
|
|
|
|
* @brief Emitted when new types are loaded
|
2019-02-11 09:34:15 +00:00
|
|
|
*/
|
|
|
|
void newTypesLoaded();
|
|
|
|
};
|
|
|
|
|
2019-06-13 06:22:20 +00:00
|
|
|
#endif // TYPESINTERACTIONDIALOG_H
|