stuff-from-scratch/apps/notes_tk/text_editor/TextEditorController.h
2023-12-27 12:20:02 +00:00

34 lines
634 B
C++

#pragma once
#include "Pointer.h"
#include <filesystem>
#include "TextEditorModel.h"
class TextEditorController
{
public:
TextEditorController();
static Ptr<TextEditorController> Create();
void OnSave();
void OnClear();
void OnLoad();
String GetContent() const;
void SetContent(const String& content);
void SetSavePath(const std::filesystem::path& path);
void SetLoadPath(const std::filesystem::path& path);
private:
TextEditorModelUPtr mModel;
std::filesystem::path mSavePath;
std::filesystem::path mLoadPath;
};
using TextEditorControllerUPtr = Ptr<TextEditorController>;