stuff-from-scratch/apps/notes_tk/text_editor/TextEditorController.h

35 lines
633 B
C
Raw Normal View History

2020-06-27 09:47:30 +00:00
#pragma once
2023-12-21 09:18:44 +00:00
#include "Memory.h"
2020-06-27 09:47:30 +00:00
#include <filesystem>
#include "TextEditorModel.h"
class TextEditorController
{
public:
TextEditorController();
2023-12-21 09:18:44 +00:00
static Ptr<TextEditorController> Create();
2020-06-27 09:47:30 +00:00
void OnSave();
void OnClear();
void OnLoad();
2023-12-21 09:18:44 +00:00
String GetContent() const;
2020-06-27 09:47:30 +00:00
2023-12-21 09:18:44 +00:00
void SetContent(const String& content);
2020-06-27 09:47:30 +00:00
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
};
2023-12-21 09:18:44 +00:00
using TextEditorControllerUPtr = Ptr<TextEditorController>;