34 lines
656 B
C
34 lines
656 B
C
|
#pragma once
|
||
|
#include <memory>
|
||
|
#include <filesystem>
|
||
|
#include "TextEditorModel.h"
|
||
|
|
||
|
class TextEditorController
|
||
|
{
|
||
|
TextEditorModelUPtr mModel;
|
||
|
std::filesystem::path mSavePath;
|
||
|
std::filesystem::path mLoadPath;
|
||
|
|
||
|
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);
|
||
|
};
|
||
|
|
||
|
using TextEditorControllerUPtr = std::unique_ptr<TextEditorController>;
|