2014-02-15 16:55:18 +00:00
|
|
|
#ifndef SCRIPTEDIT_H
|
|
|
|
#define SCRIPTEDIT_H
|
|
|
|
|
2014-02-15 18:52:40 +00:00
|
|
|
#include <qtextedit.h>
|
2014-02-15 19:49:09 +00:00
|
|
|
#include <QVector>
|
|
|
|
|
|
|
|
#include "../../model/world/universalid.hpp"
|
2014-02-15 18:52:40 +00:00
|
|
|
|
|
|
|
class QWidget;
|
2014-02-17 07:58:55 +00:00
|
|
|
class QRegExp;
|
2014-02-15 16:55:18 +00:00
|
|
|
|
2014-02-16 08:51:33 +00:00
|
|
|
namespace CSMDoc
|
|
|
|
{
|
|
|
|
class Document;
|
|
|
|
}
|
|
|
|
|
2014-02-15 16:55:18 +00:00
|
|
|
namespace CSVWorld
|
|
|
|
{
|
|
|
|
class ScriptEdit : public QTextEdit
|
|
|
|
{
|
2014-02-15 18:52:40 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-02-16 08:51:33 +00:00
|
|
|
ScriptEdit (QWidget* parent, const CSMDoc::Document& document);
|
2014-02-15 18:52:40 +00:00
|
|
|
|
|
|
|
private:
|
2014-02-15 19:49:09 +00:00
|
|
|
QVector<CSMWorld::UniversalId::Type> mAllowedTypes;
|
2014-02-16 08:51:33 +00:00
|
|
|
const CSMDoc::Document& mDocument;
|
2014-02-17 07:58:55 +00:00
|
|
|
const QRegExp mWhiteListQoutes;
|
2014-02-15 19:49:09 +00:00
|
|
|
|
2014-02-15 16:55:18 +00:00
|
|
|
void dragEnterEvent (QDragEnterEvent* event);
|
|
|
|
|
|
|
|
void dropEvent (QDropEvent* event);
|
|
|
|
|
|
|
|
void dragMoveEvent (QDragMoveEvent* event);
|
2014-02-16 17:41:42 +00:00
|
|
|
|
2014-02-17 07:58:55 +00:00
|
|
|
bool stringNeedsQuote(const std::string& id) const;
|
2014-02-15 16:55:18 +00:00
|
|
|
};
|
|
|
|
}
|
2014-02-15 21:14:27 +00:00
|
|
|
#endif // SCRIPTEDIT_H
|