33 #include "../../Core/Math/rect.h"
34 #include "../../Core/Math/size.h"
46 class SpanLayout_Impl;
107 void add_image(
const Image &image,
int baseline_offset = 0,
int id = -1);
116 void add_component(T *component,
int baseline_offset = 0,
int id = -1);
236 void add_component_helper(SpanComponent *component,
int baseline_offset,
int id);
238 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:661
static Colorf white
Definition: color.h:1245
void layout(Canvas &canvas, int max_width)
Layout.
2D Graphics Canvas
Definition: canvas.h:70
Definition: span_layout.h:77
enum clan::SpanLayout::HitTestResult::Type type
void set_selection_colors(const Colorf &foreground, const Colorf &background)
Set selection colors.
Definition: span_layout.h:78
Definition: span_layout.h:56
void add_text(const std::string &text, const Font &font, const Colorf &color=Colorf::white, int id=-1)
Add text.
Definition: span_layout.h:70
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:52
Definition: span_layout.h:55
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:453
int offset
Definition: span_layout.h:85
Definition: span_layout.h:54
Definition: span_layout.h:76
Definition: span_layout.h:79
void set_cursor_color(const Colorf &color)
Sets the cursor color.
Type
Definition: span_layout.h:74
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:81
void add_image(const Image &image, int baseline_offset=0, int id=-1)
Add image.
HitTestResult()
Definition: span_layout.h:72
Image class.
Definition: image.h:60
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:63
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:52
Span layout class.
Definition: span_layout.h:61
2D (width,height) size structure - Integer
Definition: size.h:157
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:80
HitTestResult hit_test(Canvas &canvas, const Point &pos)
Hit test.
Definition: span_layout.h:57
int object_id
Definition: span_layout.h:84