stuff-from-scratch/apps/notes_tk/text_editor/TextEditorController.h
2023-12-21 09:18:44 +00:00

34 lines
633 B
C++

#pragma once
#include "Memory.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>;