#ifndef COMMAND_LIST_H
#define COMMAND_LIST_H

#include "route.h"

#include <commandsdispatcher.h>

namespace MakeTools {
    class PresentBase;
}
namespace Components {
    class PresentHost;
}

namespace CommandList {

    class NewProject : public Schedule::GeCommand {
      public:
        NewProject(const QDir &dir, const QString &name);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        QDir dir_symbo;
        QString name_val;
    };
    class OpenProject : public Schedule::GeCommand {
      public:
        OpenProject(const QString &path);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        QString project_path;
    };
    class CloseProject : public Schedule::GeCommand {
      public:
        CloseProject();

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;
    };

    class NewPackage : public Schedule::GeCommand {
      public:
        NewPackage(const QString &path_string);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        QList<QString> sequence;
    };
    class NewFile : public Schedule::GeCommand {
      public:
        NewFile(const Core::Route &group, const QString &name,
                const QString &suffix);

      private:
        QList<QString> group_val;
        QString name_val, suffix;

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;
    };
    class OpenFile : public Schedule::GeCommand {
      public:
        OpenFile(const Core::Route &path_node);
        OpenFile(const QFileInfo &f);

      private:
        QList<QString> path_store;
        QFileInfo final_file;

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;
    };
    class SaveAll : public Schedule::GeCommand {
      public:
        SaveAll();

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;
    };

    class Build : public Schedule::GeCommand {
      public:
        Build(bool fromdisk);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        bool all_from_disk;
    };

    // 故事脉络相关命令 ========================================================
    class StorychainDetailShow : public Schedule::GeCommand {
      public:
        StorychainDetailShow(const QList<QString> &chain_path);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        QList<QString> chain_path;
    };
    class StorychainJumpTo : public Schedule::GeCommand {
      public:
        StorychainJumpTo(const QList<QString> &node_path);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        QList<QString> jump_path;
    };

    // 故事单元相关命令 ======================================================
    class StoryunitDetailShow : public Schedule::GeCommand {
      public:
        StoryunitDetailShow(const QList<QString> &path);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        QList<QString> unit_nav;
    };

    class StoryunitJumpTo : public Schedule::GeCommand {
      public:
        StoryunitJumpTo(const QList<QString> &path);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        QList<QString> unit_nav;
    };

    // 故事概念相关命令===================================================
    class StoryconceptDetailShow : public Schedule::GeCommand {
      public:
        StoryconceptDetailShow(const QList<QString> &path);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        QList<QString> navi_path;
    };

    class StoryconceptJumpTo : public Schedule::GeCommand {
      public:
        StoryconceptJumpTo(const QList<QString> &path);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        QList<QString> navi_path;
    };

    class StoryboardDetailShow : public Schedule::GeCommand {
      public:
        StoryboardDetailShow(const QList<QString> &path);

      private:
        QList<QString> navi_path;

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;
    };

    class StoryboardJumpTo : public Schedule::GeCommand {
      public:
        StoryboardJumpTo(const QList<QString> &path);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        QList<QString> navi_path;
    };

    // 切换视图组件 ================================================================
    class CompVisible : public Schedule::GeCommand {
      public:
        CompVisible(Components::PresentHost *host, MakeTools::PresentBase *target, bool state);

        // GeCommand interface
      public:
        virtual QString name() const override;
        virtual void run(Schedule::CommandsDispatcher *core) const override;
        virtual QString toText() const override;
        virtual void fromText(const QString &line) override;

      private:
        Components::PresentHost *host_ins;
        MakeTools::PresentBase *target_ins;
        Core::Route path;
        bool state_val;
    };

} // namespace CommandList

#endif // COMMAND_LIST_H
