efl/src/lib/evas/canvas/efl_text_formatter.eo

40 lines
1.6 KiB
Plaintext

import efl_text_types;
abstract Efl.Text.Formatter extends Efl.Object {
[[Text Formatter API to manage text formatting(attributes).
Use it to insert and remove style attributes (font, size, color, ...) using @Efl.Text.Cursor on EFL Widgets.
Attributes can be assigned to character ranges, selected using two @Efl.Text.Cursor instances.
Cursor instances are already bound to a text object so there's no need to provide it to this class.
Style is specified using format strings as described in @Efl.Canvas.Textblock.style_apply.
There is no need to instantiate this class. Use directly the @.attribute_insert and @.attribute_clear static methods.
@since 1.24
]]
methods {
attribute_insert @static {
[[Inserts an attribute format in a specified range [$start, $end - 1].
The $format will be applied to the given range.
The passed cursors must belong to same text object, otherwise insertion will be ignored.
]]
params {
start: const(Efl.Text.Cursor); [[Start of range.]]
end: const(Efl.Text.Cursor); [[End of range.]]
format: string; [[Format string. Uses same format as $style in @Efl.Canvas.Textblock.style_apply.]]
}
}
attribute_clear @static {
[[Clear (remove) attributes in the specified range [$start, $end - 1].
]]
params {
start: const(Efl.Text.Cursor); [[Start of range.]]
end: const(Efl.Text.Cursor); [[End of range.]]
}
return: uint; [[Number of removed attributes.]]
}
}
}