aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graphics/TextLayout.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-08 16:53:51 +0800
committercrupest <crupest@outlook.com>2022-02-08 16:53:51 +0800
commit74bb9cd27242b9320f99ff4d2b50c3051576cc14 (patch)
tree744bac5799c593d1d6f81e7b09581bea626f2cde /include/cru/platform/graphics/TextLayout.hpp
parentb90c398de829d1ba5329651d75bae82f5e4085fe (diff)
downloadcru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.gz
cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.bz2
cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.zip
...
Diffstat (limited to 'include/cru/platform/graphics/TextLayout.hpp')
-rw-r--r--include/cru/platform/graphics/TextLayout.hpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/include/cru/platform/graphics/TextLayout.hpp b/include/cru/platform/graphics/TextLayout.hpp
deleted file mode 100644
index f9ccc824..00000000
--- a/include/cru/platform/graphics/TextLayout.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#pragma once
-#include "Resource.hpp"
-
-#include <string>
-#include <vector>
-
-namespace cru::platform::graphics {
-// Requirement:
-// All text must be left-top aligned.
-struct CRU_PLATFORM_GRAPHICS_API ITextLayout : virtual IGraphicsResource {
- virtual String GetText() = 0;
- virtual void SetText(String new_text) = 0;
-
- virtual std::shared_ptr<IFont> GetFont() = 0;
- virtual void SetFont(std::shared_ptr<IFont> font) = 0;
-
- virtual void SetMaxWidth(float max_width) = 0;
- virtual void SetMaxHeight(float max_height) = 0;
-
- virtual bool IsEditMode() = 0;
- virtual void SetEditMode(bool enable) = 0;
-
- virtual Index GetLineIndexFromCharIndex(Index char_index) = 0;
- virtual Index GetLineCount() = 0;
- virtual float GetLineHeight(Index line_index) = 0;
-
- virtual Rect GetTextBounds(bool includingTrailingSpace = false) = 0;
- virtual std::vector<Rect> TextRangeRect(const TextRange& text_range) = 0;
- // Width is always 0, height is line height.
- virtual Rect TextSinglePoint(Index position, bool trailing) = 0;
- virtual TextHitTestResult HitTest(const Point& point) = 0;
-};
-} // namespace cru::platform::graphics