2020-06-27 09:47:30 +00:00
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include <filesystem>
|
|
|
|
#include "TextEditorModel.h"
|
|
|
|
|
|
|
|
class TextEditorController
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
TextEditorController();
|
|
|
|
|
|
|
|
static std::unique_ptr<TextEditorController> Create();
|
|
|
|
|
|
|
|
void OnSave();
|
|
|
|
|
|
|
|
void OnClear();
|
|
|
|
|
|
|
|
void OnLoad();
|
|
|
|
|
|
|
|
std::string GetContent() const;
|
|
|
|
|
|
|
|
void SetContent(const std::string& content);
|
|
|
|
|
|
|
|
void SetSavePath(const std::filesystem::path& path);
|
|
|
|
|
|
|
|
void SetLoadPath(const std::filesystem::path& path);
|
2022-11-18 15:11:54 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
TextEditorModelUPtr mModel;
|
|
|
|
std::filesystem::path mSavePath;
|
|
|
|
std::filesystem::path mLoadPath;
|
2020-06-27 09:47:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
using TextEditorControllerUPtr = std::unique_ptr<TextEditorController>;
|