1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-23 11:53:53 +00:00
openmw/apps/opencs/view/world/scripterrortable.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.5 KiB
C++
Raw Normal View History

#ifndef CSV_WORLD_SCRIPTERRORTABLE_H
#define CSV_WORLD_SCRIPTERRORTABLE_H
#include <QTableWidget>
#include <components/compiler/errorhandler.hpp>
#include <components/compiler/extensions.hpp>
#include "../../model/doc/messages.hpp"
2022-09-22 18:26:05 +00:00
#include "../../model/world/scriptcontext.hpp"
namespace CSMDoc
{
class Document;
}
namespace CSMPrefs
{
class Setting;
}
namespace CSVWorld
{
class ScriptErrorTable : public QTableWidget, private Compiler::ErrorHandler
{
2022-09-22 18:26:05 +00:00
Q_OBJECT
2022-09-22 18:26:05 +00:00
Compiler::Extensions mExtensions;
CSMWorld::ScriptContext mContext;
2022-09-22 18:26:05 +00:00
void report(const std::string& message, const Compiler::TokenLoc& loc, Type type) override;
///< Report error to the user.
2022-09-22 18:26:05 +00:00
void report(const std::string& message, Type type) override;
///< Report a file related error
2022-09-22 18:26:05 +00:00
void addMessage(const std::string& message, CSMDoc::Message::Severity severity, int line = -1, int column = -1);
2022-09-22 18:26:05 +00:00
void setWarningsMode(const std::string& value);
2022-09-22 18:26:05 +00:00
public:
ScriptErrorTable(const CSMDoc::Document& document, QWidget* parent = nullptr);
2022-09-22 18:26:05 +00:00
void update(const std::string& source);
2022-09-22 18:26:05 +00:00
void clear();
2022-09-22 18:26:05 +00:00
/// Clear local variable cache for \a script.
///
/// \return Were there any locals that needed clearing?
bool clearLocals(const std::string& script);
2022-09-22 18:26:05 +00:00
private slots:
2022-09-22 18:26:05 +00:00
void settingChanged(const CSMPrefs::Setting* setting);
2022-09-22 18:26:05 +00:00
void cellClicked(int row, int column);
2022-09-22 18:26:05 +00:00
signals:
2022-09-22 18:26:05 +00:00
void highlightError(int line, int column);
};
}
#endif