stuff-from-scratch/apps/sample-gui/text_editor/TextEditorController.h
2022-11-11 11:48:42 +00:00

33 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>;