Top | ![]() |
![]() |
![]() |
![]() |
gboolean
e_html_editor_selection_has_text (EHTMLEditorSelection *selection
);
Returns whether current selection contains any text.
gchar *
e_html_editor_selection_get_caret_word
(EHTMLEditorSelection *selection
);
Returns word under cursor.
void e_html_editor_selection_replace_caret_word (EHTMLEditorSelection *selection
,const gchar *replacement
);
Replaces current word under cursor with replacement
.
EHTMLEditorSelectionAlignment
e_html_editor_selection_get_alignment (EHTMLEditorSelection *selection
);
Returns alignment of current paragraph
void e_html_editor_selection_set_alignment (EHTMLEditorSelection *selection
,EHTMLEditorSelectionAlignment alignment
);
Sets alignment of current paragraph to give alignment
.
selection |
an EHTMLEditorSelection |
|
alignment |
an EHTMLEditorSelectionAlignment value to apply |
const gchar *
e_html_editor_selection_get_background_color
(EHTMLEditorSelection *selection
);
Returns background color of currently selected text or letter at current cursor position.
void e_html_editor_selection_set_background_color (EHTMLEditorSelection *selection
,const gchar *color
);
Changes background color of current selection or letter at current cursor
position to color
.
void e_html_editor_selection_get_font_color (EHTMLEditorSelection *selection
,GdkRGBA *rgba
);
Sets rgba
to contain color of current text selection or letter at current
cursor position.
void e_html_editor_selection_set_font_color (EHTMLEditorSelection *selection
,const GdkRGBA *rgba
);
Sets font color of current selection or letter at current cursor position to
color defined in rgba
.
const gchar *
e_html_editor_selection_get_font_name (EHTMLEditorSelection *selection
);
Returns name of font used in current selection or at letter at current cursor position.
void e_html_editor_selection_set_font_name (EHTMLEditorSelection *selection
,const gchar *font_name
);
Sets font name of current selection or of letter at current cursor position
to font_name
.
guint
e_html_editor_selection_get_font_size (EHTMLEditorSelection *selection
);
void e_html_editor_selection_set_font_size (EHTMLEditorSelection *selection
,guint font_size
);
Sets font size of current selection or of letter at current cursor position
to font_size
.
EHTMLEditorSelectionBlockFormat
e_html_editor_selection_get_block_format
(EHTMLEditorSelection *selection
);
Returns block format of current paragraph.
void e_html_editor_selection_set_block_format (EHTMLEditorSelection *selection
,EHTMLEditorSelectionBlockFormat format
);
Changes block format of current paragraph to format
.
gboolean
e_html_editor_selection_is_citation (EHTMLEditorSelection *selection
);
Returns whether current paragraph is a citation.
gboolean
e_html_editor_selection_is_indented (EHTMLEditorSelection *selection
);
Returns whether current paragraph is indented. This does not include
citations. To check, whether paragraph is a citation, use
e_html_editor_selection_is_citation()
.
void
e_html_editor_selection_indent (EHTMLEditorSelection *selection
);
Indents current paragraph by one level.
void
e_html_editor_selection_unindent (EHTMLEditorSelection *selection
);
Unindents current paragraph by one level.
gboolean
e_html_editor_selection_is_bold (EHTMLEditorSelection *selection
);
Returns whether current selection or letter at current cursor position is bold.
Returns TRUE
when selection is bold, FALSE
otherwise.
void e_html_editor_selection_set_bold (EHTMLEditorSelection *selection
,gboolean bold
);
Toggles bold formatting of current selection or letter at current cursor
position, depending on whether bold
is TRUE
or FALSE
.
gboolean
e_html_editor_selection_is_italic (EHTMLEditorSelection *selection
);
Returns whether current selection or letter at current cursor position is italic.
Returns TRUE
when selection is italic, FALSE
otherwise.
void e_html_editor_selection_set_italic (EHTMLEditorSelection *selection
,gboolean italic
);
Toggles italic formatting of current selection or letter at current cursor
position, depending on whether italic
is TRUE
or FALSE
.
gboolean
e_html_editor_selection_is_monospaced (EHTMLEditorSelection *selection
);
Returns whether current selection or letter at current cursor position is monospaced.
Returns TRUE
when selection is monospaced, FALSE
otherwise.
void e_html_editor_selection_set_monospaced (EHTMLEditorSelection *selection
,gboolean monospaced
);
Toggles monospaced formatting of current selection or letter at current cursor
position, depending on whether monospaced
is TRUE
or FALSE
.
gboolean
e_html_editor_selection_is_superscript
(EHTMLEditorSelection *selection
);
Returns whether current selection or letter at current cursor position is in superscript.
Returns TRUE
when selection is in superscript, FALSE
otherwise.
void e_html_editor_selection_set_superscript (EHTMLEditorSelection *selection
,gboolean superscript
);
Toggles superscript of current selection or letter at current cursor position,
depending on whether superscript
is TRUE
or FALSE
.
gboolean
e_html_editor_selection_is_subscript (EHTMLEditorSelection *selection
);
Returns whether current selection or letter at current cursor position is in subscript.
Returns TRUE
when selection is in subscript, FALSE
otherwise.
void e_html_editor_selection_set_subscript (EHTMLEditorSelection *selection
,gboolean subscript
);
Toggles subscript of current selection or letter at current cursor position,
depending on whether subscript
is TRUE
or FALSE
.
gboolean
e_html_editor_selection_is_underline (EHTMLEditorSelection *selection
);
Returns whether current selection or letter at current cursor position is underlined.
Returns TRUE
when selection is underlined, FALSE
otherwise.
void e_html_editor_selection_set_underline (EHTMLEditorSelection *selection
,gboolean underline
);
Toggles underline formatting of current selection or letter at current
cursor position, depending on whether underline
is TRUE
or FALSE
.
void
e_html_editor_selection_unlink (EHTMLEditorSelection *selection
);
Removes any links (<A> elements) from current selection or at current cursor position.
void e_html_editor_selection_create_link (EHTMLEditorSelection *selection
,const gchar *uri
);
Converts current selection into a link pointing to url
.
const gchar *
e_html_editor_selection_get_string (EHTMLEditorSelection *selection
);
Returns currently selected string.
void e_html_editor_selection_replace (EHTMLEditorSelection *selection
,const gchar *new_string
);
Replaces currently selected text with new_string
.
void e_html_editor_selection_insert_html (EHTMLEditorSelection *selection
,const gchar *html_text
);
Insert html_text
into document at current cursor position. When a text range
is selected, it will be replaced by html_text
.
void e_html_editor_selection_insert_image (EHTMLEditorSelection *selection
,const gchar *image_uri
);
Inserts image at current cursor position using image_uri
as source. When a
text range is selected, it will be replaced by the image.
void e_html_editor_selection_insert_text (EHTMLEditorSelection *selection
,const gchar *plain_text
);
Inserts plain_text
at current cursor position. When a text range is selected,
it will be replaced by plain_text
.
void
e_html_editor_selection_wrap_lines (EHTMLEditorSelection *selection
);
Wraps all lines in current selection to be 71 characters long.
void
e_html_editor_selection_save (EHTMLEditorSelection *selection
);
Saves current cursor position or current selection range. The selection can
be later restored by calling e_html_editor_selection_restore()
.
Note that calling e_html_editor_selection_save()
overwrites previously saved
position.
Note that this method inserts special markings into the HTML code that are
used to later restore the selection. It can happen that by deleting some
segments of the document some of the markings are deleted too. In that case
restoring the selection by e_html_editor_selection_restore()
can fail. Also by
moving text segments (Cut & Paste) can result in moving the markings
elsewhere, thus e_html_editor_selection_restore()
will restore the selection
incorrectly.
It is recommended to use this method only when you are not planning to make bigger changes to content or structure of the document (formatting changes are usually OK).
void
e_html_editor_selection_restore (EHTMLEditorSelection *selection
);
Restores cursor position or selection range that was saved by
e_html_editor_selection_save()
.
Note that calling this function without calling e_html_editor_selection_save()
before is a programming error and the behavior is undefined.
void e_html_editor_selection_move (EHTMLEditorSelection *selection
,gboolean forward
,EHTMLEditorSelectionGranularity granularity
);
Moves current selection in given direction by given granularity
void e_html_editor_selection_extend (EHTMLEditorSelection *selection
,gboolean forward
,EHTMLEditorSelectionGranularity granularity
);
Extends current selection in given direction by given granularity.