#ifndef SRCEDIT_DEFAULTTEXT_H
#define SRCEDIT_DEFAULTTEXT_H

#include "DocsManager.h"
#include "ContentPresent.h"
#include <QSyntaxHighlighter>


#include <QTextEdit>

namespace Components {

    /**
     * @brief Text默认文本编辑视图
    */
    class DefaultTextEdit : public MakeTools::FilePresent, public Presents::ModeView {
      public:
        DefaultTextEdit();
        virtual ~DefaultTextEdit() = default;

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

    private:
        QTextEdit * edit_square;
        QFileInfo source_target;
        QString name_store;
        QString target_file_path;

        // ContentPresent interface
    public:
        virtual std::tuple<bool, QString> create(const QDir &target, const QString &name, const QString &suffix) override;
        virtual QWidget *widget() const override;
        virtual MakeTools::FilePresent *newInst() 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 bool isModified() const override;
        virtual QList<QString> suffixes() const override;
        virtual QString absoluteTargetPath() const override;
        virtual void jumpTo(const QList<QString> &path) override;
        virtual Features features() override;
    };
}


#endif // SRCEDIT_DEFAULTTEXT_H
