32 #include "../../Core/Math/rect.h"
33 #include "../../Core/Math/size.h"
45 class SpanLayout_Impl;
115 void add_component(T *component,
int baseline_offset = 0,
int id = -1);
234 void add_component_helper(SpanComponent *component,
int baseline_offset,
int id);
236 std::shared_ptr<SpanLayout_Impl> impl;
std::string get_combined_text() const
Get Combined text.
Floating point color description class (for float).
Definition: color.h:660
static Colorf white
Definition: color.h:1251
void layout(Canvas &canvas, int max_width)
Layout.
2D Graphics Canvas
Definition: canvas.h:72
Definition: span_layout.h:76
enum clan::SpanLayout::HitTestResult::Type type
void set_selection_colors(const Colorf &foreground, const Colorf &background)
Set selection colors.
Definition: span_layout.h:77
Definition: span_layout.h:55
void add_text(const std::string &text, const Font &font, const Colorf &color=Colorf::white, int id=-1)
Add text.
Definition: span_layout.h:69
void set_align(SpanAlign align)
Sets the text alignment.
void add_component(T *component, int baseline_offset=0, int id=-1)
Add component.
SpanAlign
Span Align.
Definition: span_layout.h:51
Definition: span_layout.h:54
void set_selection_range(std::string::size_type start, std::string::size_type end)
Set selection range.
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:470
int offset
Definition: span_layout.h:84
Definition: span_layout.h:53
Definition: span_layout.h:75
Definition: span_layout.h:78
void set_cursor_color(const Colorf &color)
Sets the cursor color.
Type
Definition: span_layout.h:73
void set_cursor_overwrite_mode(bool enable)
Toggles whether the cursor caret is shown as a solid box or a line.
void set_component_geometry()
Set component geometry.
Definition: span_layout.h:80
void add_image(const Image &image, int baseline_offset=0, int id=-1)
Add image.
HitTestResult()
Definition: span_layout.h:71
Image class.
Definition: image.h:59
void show_cursor()
Shows the cursor caret.
int get_last_baseline_offset()
Returns the baseline offset for the last baseline.
2D (x,y) point structure - Integer
Definition: point.h:62
std::vector< Rect > get_rect_by_id(int id) const
Get Rect By Id.
Size get_size() const
Get Size.
void draw_layout_ellipsis(Canvas &canvas, const Rect &content_rect)
Draw layout generating ellipsis for clipped text.
Font class.
Definition: font.h:53
Span layout class.
Definition: span_layout.h:60
2D (width,height) size structure - Integer
Definition: size.h:156
void set_position(const Point &pos)
Set position.
void hide_cursor()
Hides the cursor caret.
int get_first_baseline_offset()
Returns the baseline offset for the first baseline.
void set_cursor_pos(std::string::size_type pos)
Sets the cursor position.
Size find_preferred_size(Canvas &canvas)
Find preferred size.
void draw_layout(Canvas &canvas)
Draw layout.
Rect get_rect() const
Get Rect.
Definition: span_layout.h:79
HitTestResult hit_test(Canvas &canvas, const Point &pos)
Hit test.
Definition: span_layout.h:56
int object_id
Definition: span_layout.h:83