aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graph/text_layout.hpp
blob: 20009c0dc4e1ea83e0b620ef43cf7626c82fc071 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once
#include "resource.hpp"

#include <string>
#include <vector>

namespace cru::platform::graph {
struct ITextLayout : virtual IGraphResource {
  virtual std::string GetText() = 0;
  virtual void SetText(std::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 Rect GetTextBounds() = 0;
  virtual std::vector<Rect> TextRangeRect(const TextRange& text_range) = 0;
  virtual Point TextSingleRect(int position, bool trailing) = 0;
  virtual TextHitTestResult HitTest(const Point& point) = 0;
};
}  // namespace cru::platform::graph