#ifndef SRCEDIT_STORYCHAIN_H
#define SRCEDIT_STORYCHAIN_H

#include "ContentPresent.h"
#include "DocsManager.h"
#include "srcedit_defaulttext.h"
#include "keywordshighlighter.h"

#include <QObject>
#include <QSyntaxHighlighter>

namespace Components {

    /**
     * @brief Storychain详情属性展示
     */
    class StorychainSourceEdit : public Presents::ModeView, public MakeTools::CompileFeature,
            public MakeTools::FilePresent, public Enhancement::HighlightFeature
    {
    public:
        StorychainSourceEdit();
        virtual ~StorychainSourceEdit() = default;

      private:
        QSyntaxHighlighter *const highter_ins;
        Core::AppCore *app_core;
        QTextEdit *edit_square;
        QString name_store;
        QString filepath_store;

        // HighlightDemand interface
      public:
        virtual void contexBinding(Core::AppCore *app) override;
        virtual void renderRepeat() const override;

        // ModeView interface
      public:
        virtual void modeReset(const QString &) const override;
        virtual QList<QString> modes() const override;
        virtual QString currentMode() const override;

        // ContentPresent interface
    public:
        virtual QList<QString> suffixes() const override;
        virtual std::tuple<bool, QString> create(const QDir &target, const QString &name, const QString &suffix) override;
        virtual MakeTools::FilePresent *newInst() const override;
        virtual QWidget *widget() const override;
        virtual void applySetting(const QString &name, Core::AppCore *core) override;
        virtual QString name() const override;
        virtual void load(const QFileInfo &target_file) override;
        virtual void saveAs(const QString &path) override;
        virtual QString relativeTargetPath(const QDir &base) const override;
        virtual QString absoluteTargetPath() const override;
        virtual QString getText() const override;
        virtual bool isModified() const override;
        virtual void jumpTo(const QList<QString> &path) override;
        virtual Features features() override;
    };

}

#endif // SRCEDIT_STORYCHAIN_H
