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

243 lines
9.4 KiB
Plaintext

import efl_text_types;
class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text,
Efl.Canvas.Filter.Internal, Efl.Text_Font,
Efl.Text_Style, Efl.Text_Format,
Efl.Text_Markup, Efl.Ui.I18n
{
[[Efl canvas text class]]
methods {
@property is_empty {
[[Whether the object is empty (no text) or not
]]
get {
}
values {
is_empty: bool; [[$true if empty, $false otherwise]]
}
}
cursor_add {
[[Add cursor that will manipulate and iterate content of the text object
It is typically more convenient to obtain a cursor directly from the text object using @.cursor_create.]]
params {
cursor: Efl.Text.Cursor; [[Text cursor.]]
}
}
cursor_create {
[[ Create new cursor and add it to text object
]]
return: Efl.Text.Cursor @move; [[Text cursor.]]
}
visible_range_get {
[[Returns the currently visible range.
The given $start and $end cursor act like out-variables here,
as they are set to the positions of the start and the end of the
visible range in the text, respectively.
]]
return: bool; [[$true on success, $false otherwise]]
params {
@in start: Efl.Text.Cursor; [[Range start position]]
@in end: Efl.Text.Cursor; [[Range end position]]
}
}
@property style_insets {
[[Gets the left, right, top and bottom insets of the text.
The inset is any applied padding on the text.
]]
get {}
values {
l: int; [[Left padding]]
r: int; [[Right padding]]
t: int; [[Top padding]]
b: int; [[Bottom padding]]
}
}
@property bidi_delimiters {
[[BiDi delimiters are used for in-paragraph separation of bidi
segments. This is useful, for example, in the recipient fields of
e-mail clients where bidi oddities can occur when mixing RTL
and LTR.
]]
set {}
get {}
values {
delim: string; [[A null terminated string of delimiters, e.g ",|" or $null if empty]]
}
}
@property newline_as_paragraph_separator {
[[When $true, newline character will behave as a paragraph separator.
]]
set {}
get {}
values {
mode: bool; [[$true for legacy mode, $false otherwise]]
}
}
style_apply {
[[apply the style for this object, sent style member will override old ones, other styles will not be affected.
similar to setting style using functions (for example font_slant_set, wrap_set).]]
params {
@in style: string; [[A whitespace-separated list of $[property=value] pairs, for example, $[font=sans size=30].]]
}
}
@property all_styles {
[[Get all styles belong to this object as string (default styles plus styles
from style_apply or style functions (for example font_slant_set, wrap_set).]]
get {}
values {
style: string; [[All styles, should not be freed.]]
}
}
@property size_formatted {
[[The formatted width and height.
This calculates the actual size after restricting the
textblock to the current size of the object.
The main difference between this and @.size_native.get
is that the "native" function does not wrapping into account
it just calculates the real width of the object if it was
placed on an infinite canvas, while this function gives the
size after wrapping according to the size restrictions of the
object.
For example for a textblock containing the text:
"You shall not pass!" with no margins or padding and assuming
a monospace font and a size of 7x10 char widths (for simplicity)
has a native size of 19x1 and a formatted size of 5x4.
]]
get {}
values {
size: Eina.Size2D; [[The size of the object]]
}
}
@property size_native {
[[The native width and height.
This calculates the actual size without taking account the
current size of the object.
The main difference between this and @.size_formatted.get
is that the "native" function does not take wrapping into
account it just calculates the real width of the object if
it was placed on an infinite canvas, while the "formatted"
function gives the size after wrapping text according to
the size restrictions of the object.
For example for a textblock containing the text:
"You shall not pass!" with no margins or padding and assuming
a monospace font and a size of 7x10 char widths (for simplicity)
has a native size of 19x1 and a formatted size of 5x4.
]]
get {}
values {
size: Eina.Size2D; [[The size of the object]]
}
}
// Obstacles
obstacle_add {
[[Add obstacle evas object $eo_obs to be observed during layout
of text.
The textblock does the layout of the text according to the
position of the obstacle.
]]
params {
@in eo_obs: Efl.Canvas.Object; [[Obstacle object]]
}
return: bool; [[$true on success, $false otherwise.]]
}
obstacle_del {
[[Removes $eo_obs from observation during text layout.
]]
params {
@in eo_obs: Efl.Canvas.Object; [[Obstacle object]]
}
return: bool; [[$true on success, $false otherwise.]]
}
obstacles_update {
[[Triggers for relayout due to obstacles' state change.
The obstacles alone don't affect the layout, until this is
called. Use this after doing changes (moving, positioning etc.)
in the obstacles that you would like to be considered in the
layout.
For example: if you have just repositioned the obstacles to
differrent coordinates relative to the textblock, you need to
call this so it will consider this new state and will relayout
the text.
]]
}
async_layout {
[[Requests to layout the text off the mainloop.
Once layout is complete, the result is returned as @Eina.Rect,
with w, h fields set.
]]
return: future<Eina.Rect>; [[Future for layout result]]
}
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Canvas.Object.paragraph_direction { get; set; }
Efl.Text.text { get; set; }
Efl.Gfx.Filter.filter_program { get; set; }
Efl.Gfx.Filter.filter_data { get; set; }
Efl.Gfx.Filter.filter_source { get; set; }
Efl.Canvas.Filter.Internal.filter_dirty;
Efl.Canvas.Filter.Internal.filter_input_render;
Efl.Canvas.Filter.Internal.filter_state_prepare;
Efl.Text_Font.font_family { get; set; }
Efl.Text_Font.font_size { get; set; }
Efl.Text_Font.font_source { get; set; }
Efl.Text_Font.font_fallbacks { get; set; }
Efl.Text_Font.font_lang { get; set; }
Efl.Text_Font.font_weight { get; set; }
Efl.Text_Font.font_slant { get; set; }
Efl.Text_Font.font_width { get; set; }
Efl.Text_Font.font_bitmap_scalable { get; set; }
Efl.Text_Style.normal_color { get; set; }
Efl.Text_Style.backing_type { get; set; }
Efl.Text_Style.backing_color { get; set; }
Efl.Text_Style.underline_type { get; set; }
Efl.Text_Style.underline_color { get; set; }
Efl.Text_Style.underline_height { get; set; }
Efl.Text_Style.underline_dashed_color { get; set; }
Efl.Text_Style.underline_dashed_width { get; set; }
Efl.Text_Style.underline_dashed_gap { get; set; }
Efl.Text_Style.underline2_color { get; set; }
Efl.Text_Style.strikethrough_type { get; set; }
Efl.Text_Style.strikethrough_color { get; set; }
Efl.Text_Style.effect_type { get; set; }
Efl.Text_Style.outline_color { get; set; }
Efl.Text_Style.shadow_direction { get; set; }
Efl.Text_Style.shadow_color { get; set; }
Efl.Text_Style.glow_color { get; set; }
Efl.Text_Style.glow2_color { get; set; }
Efl.Text_Style.gfx_filter { get; set; }
Efl.Text_Format.ellipsis { get; set; }
Efl.Text_Format.wrap { get; set; }
Efl.Text_Format.multiline { get; set; }
Efl.Text_Format.horizontal_align { get; set; }
Efl.Text_Format.horizontal_align_auto_type { get; set; }
Efl.Text_Format.vertical_align { get; set; }
Efl.Text_Format.linegap { get; set; }
Efl.Text_Format.linerelgap { get; set; }
Efl.Text_Format.tabstops { get; set; }
Efl.Text_Format.password { get; set; }
Efl.Text_Format.replacement_char { get; set; }
Efl.Text_Markup.markup { set; get; }
Efl.Gfx.Entity.scale { set; }
}
events {
changed: void; [[Called when canvas text changed ]]
attributes,changed: void; [[Called when attributes change]]
layout,finished: void; [[Called when the object has been layed out]]
style_insets,changed: void; [[Called when the property @.style_insets changed.]]
}
}