243 lines
5.2 KiB
C++
243 lines
5.2 KiB
C++
#include "SourceEditView.h"
|
|
#include "chainhightlighter.h"
|
|
|
|
using namespace Components;
|
|
using namespace Parse::Result;
|
|
|
|
StoryChainSourceEdit::StoryChainSourceEdit(const QFileInfo &file, QWidget *parent)
|
|
: MakeTools::VariedTextView(file,parent), edit_square(new QTextEdit(parent)),
|
|
highter_ins(new Enhancement::ChainHightlighter(this)),
|
|
core_ins(nullptr)
|
|
{
|
|
connect(edit_square, &QTextEdit::textChanged, [this](){
|
|
emit this->dataChanged(this->core_ins->filePath());
|
|
});
|
|
|
|
highter_ins->setDocument(this->edit_square->document());
|
|
}
|
|
|
|
void StoryChainSourceEdit::modeReset(const QString &) const{}
|
|
|
|
QList<QString> StoryChainSourceEdit::modes() const
|
|
{
|
|
return QList<QString>() << "源码";
|
|
}
|
|
|
|
QString StoryChainSourceEdit::currentMode() const
|
|
{
|
|
return modes()[0];
|
|
}
|
|
|
|
QString StoryChainSourceEdit::title() const
|
|
{
|
|
return core_ins->filePath();
|
|
}
|
|
|
|
void StoryChainSourceEdit::reset(Parse::Result::DocCore *syntax_base)
|
|
{
|
|
this->core_ins = syntax_base;
|
|
static_cast<Enhancement::ChainHightlighter*>(this->highter_ins)->reset(core_ins);
|
|
}
|
|
|
|
QWidget *StoryChainSourceEdit::textView() const
|
|
{
|
|
return edit_square;
|
|
}
|
|
|
|
QString StoryChainSourceEdit::textContent() const
|
|
{
|
|
return edit_square->toPlainText();
|
|
}
|
|
|
|
void StoryChainSourceEdit::textContentReset(const QString &value)
|
|
{
|
|
this->edit_square->setText(value);
|
|
}
|
|
|
|
TextContentEdit::TextContentEdit(const QFileInfo &refer, QWidget *parent)
|
|
: MakeTools::VariedTextView(refer, parent), edit_square(new QTextEdit(parent)), source_target(refer)
|
|
{
|
|
connect(edit_square, &QTextEdit::textChanged, [this](){
|
|
emit this->dataChanged(this->source_target.absoluteFilePath());
|
|
});
|
|
}
|
|
|
|
void TextContentEdit::modeReset(const QString &) const
|
|
{
|
|
|
|
}
|
|
|
|
QList<QString> TextContentEdit::modes() const
|
|
{
|
|
return QList<QString>() << "文本";
|
|
}
|
|
|
|
QString TextContentEdit::currentMode() const
|
|
{
|
|
return modes()[0];
|
|
}
|
|
|
|
QString TextContentEdit::title() const
|
|
{
|
|
return source_target.fileName();
|
|
}
|
|
|
|
void TextContentEdit::reset(Parse::Result::DocCore *syntax_base)
|
|
{
|
|
|
|
}
|
|
|
|
QWidget *TextContentEdit::textView() const
|
|
{
|
|
return edit_square;
|
|
}
|
|
|
|
|
|
QString TextContentEdit::textContent() const
|
|
{
|
|
return edit_square->toPlainText();
|
|
}
|
|
|
|
void TextContentEdit::textContentReset(const QString &value)
|
|
{
|
|
edit_square->setText(value);
|
|
}
|
|
|
|
StoryUnitSourceEdit::StoryUnitSourceEdit(const QFileInfo &refer, QWidget *parent)
|
|
: MakeTools::VariedTextView(refer,parent), edit_square(new QTextEdit(parent)), source_target(refer)
|
|
{
|
|
connect(edit_square, &QTextEdit::textChanged, [this](){
|
|
emit this->dataChanged(this->source_target.absoluteFilePath());
|
|
});
|
|
}
|
|
|
|
void StoryUnitSourceEdit::modeReset(const QString &) const
|
|
{
|
|
|
|
}
|
|
|
|
QList<QString> StoryUnitSourceEdit::modes() const
|
|
{
|
|
return QList<QString>() << "源码";
|
|
}
|
|
|
|
QString StoryUnitSourceEdit::currentMode() const
|
|
{
|
|
return modes()[0];
|
|
}
|
|
|
|
QString StoryUnitSourceEdit::title() const
|
|
{
|
|
return source_target.fileName();
|
|
}
|
|
|
|
void StoryUnitSourceEdit::reset(Parse::Result::DocCore *syntax_base)
|
|
{
|
|
|
|
}
|
|
|
|
QWidget *StoryUnitSourceEdit::textView() const
|
|
{
|
|
return edit_square;
|
|
}
|
|
|
|
QString StoryUnitSourceEdit::textContent() const
|
|
{
|
|
return edit_square->toPlainText();
|
|
}
|
|
|
|
void StoryUnitSourceEdit::textContentReset(const QString &value)
|
|
{
|
|
edit_square->setText(value);
|
|
}
|
|
|
|
StoryBoardSourceEdit::StoryBoardSourceEdit(const QFileInfo &refer, QWidget *parent)
|
|
: MakeTools::VariedTextView(refer,parent), edit_square(new QTextEdit(parent)), source_target(refer)
|
|
{
|
|
connect(edit_square, &QTextEdit::textChanged, [this](){
|
|
emit this->dataChanged(this->source_target.absoluteFilePath());
|
|
});
|
|
}
|
|
|
|
void StoryBoardSourceEdit::modeReset(const QString &) const{}
|
|
|
|
QList<QString> StoryBoardSourceEdit::modes() const
|
|
{
|
|
return QList<QString>() << "源码";
|
|
}
|
|
|
|
QString StoryBoardSourceEdit::currentMode() const
|
|
{
|
|
return modes()[0];
|
|
}
|
|
|
|
QString StoryBoardSourceEdit::title() const
|
|
{
|
|
return source_target.fileName();
|
|
}
|
|
|
|
void StoryBoardSourceEdit::reset(Parse::Result::DocCore *syntax_base)
|
|
{
|
|
|
|
}
|
|
|
|
QWidget *StoryBoardSourceEdit::textView() const
|
|
{
|
|
return edit_square;
|
|
}
|
|
|
|
QString StoryBoardSourceEdit::textContent() const
|
|
{
|
|
return edit_square->toPlainText();
|
|
}
|
|
|
|
void StoryBoardSourceEdit::textContentReset(const QString &value)
|
|
{
|
|
this->edit_square->setText(value);
|
|
}
|
|
|
|
StoryVolumeSourceEdit::StoryVolumeSourceEdit(const QFileInfo &refer, QWidget *parent)
|
|
: MakeTools::VariedTextView(refer,parent), edit_square(new QTextEdit(parent)), source_target(refer)
|
|
{
|
|
connect(edit_square, &QTextEdit::textChanged, [this](){
|
|
emit this->dataChanged(this->source_target.absoluteFilePath());
|
|
});
|
|
}
|
|
|
|
void StoryVolumeSourceEdit::modeReset(const QString &) const{}
|
|
|
|
QList<QString> StoryVolumeSourceEdit::modes() const
|
|
{
|
|
return QList<QString>() << "源码";
|
|
}
|
|
|
|
QString StoryVolumeSourceEdit::currentMode() const
|
|
{
|
|
return modes()[0];
|
|
}
|
|
|
|
QString StoryVolumeSourceEdit::title() const
|
|
{
|
|
return source_target.fileName();
|
|
}
|
|
|
|
void StoryVolumeSourceEdit::reset(Parse::Result::DocCore *syntax_base)
|
|
{
|
|
|
|
}
|
|
|
|
QWidget *StoryVolumeSourceEdit::textView() const
|
|
{
|
|
return edit_square;
|
|
}
|
|
|
|
QString StoryVolumeSourceEdit::textContent() const
|
|
{
|
|
return edit_square->toPlainText();
|
|
}
|
|
|
|
void StoryVolumeSourceEdit::textContentReset(const QString &value)
|
|
{
|
|
this->edit_square->setText(value);
|
|
}
|