Top | ![]() |
![]() |
![]() |
![]() |
gint | alignment | Read / Write |
gchar * | background-color | Read / Write |
gint | block-format | Read / Write |
gboolean | bold | Read / Write |
GdkRGBA * | font-color | Read / Write |
gchar * | font-name | Read / Write |
gint | font-size | Read / Write |
EHTMLEditorView * | html-editor-view | Read / Write / Construct Only |
gboolean | indented | Read |
gboolean | italic | Read / Write |
gboolean | monospaced | Read / Write |
gboolean | strikethrough | Read / Write |
gboolean | subscript | Read / Write |
gboolean | superscript | Read / Write |
gchar * | text | Read |
gboolean | underline | Read / Write |
struct _EHTMLEditorView *
e_html_editor_selection_ref_html_editor_view
(EHTMLEditorSelection *selection
);
Returns a new reference to selection
's EHTMLEditorView. Unreference
the EHTMLEditorView with g_object_unref()
when finished with it.
void
e_html_editor_selection_block_selection_changed
(EHTMLEditorSelection *selection
);
void
e_html_editor_selection_unblock_selection_changed
(EHTMLEditorSelection *selection
);
gint
e_html_editor_selection_get_word_wrap_length
(EHTMLEditorSelection *selection
);
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
.
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_strikethrough
(EHTMLEditorSelection *selection
);
Returns whether current selection or letter at current cursor position is striked through.
Returns TRUE
when selection is striked through, FALSE
otherwise.
void e_html_editor_selection_set_strikethrough (EHTMLEditorSelection *selection
,gboolean strikethrough
);
Toggles strike through formatting of current selection or letter at current
cursor position, depending on whether strikethrough
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
.
gboolean
e_html_editor_selection_is_collapsed (EHTMLEditorSelection *selection
);
Returns if selection is collapsed.
const gchar *
e_html_editor_selection_get_string (EHTMLEditorSelection *selection
);
Returns currently selected string.
A pointer to content of current selection. The string is owned by EHTMLEditorSelection and should not be free'd.
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_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_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_as_text (EHTMLEditorSelection *selection
,const gchar *html_text
);
void e_html_editor_selection_replace_image_src (EHTMLEditorSelection *selection
,WebKitDOMElement *element
,const gchar *image_uri
);
If given element
is image we will replace the src attribute of it with base64
data from given image_uri
. Otherwise we will set the base64 data to
the background attribute of given element
.
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_move_caret_into_element (WebKitDOMDocument *document
,WebKitDOMElement *element
,gboolean to_start
);
void e_html_editor_selection_set_indented_style (EHTMLEditorSelection *selection
,WebKitDOMElement *element
,gint width
);
WebKitDOMElement * e_html_editor_selection_get_indented_element (EHTMLEditorSelection *selection
,WebKitDOMDocument *document
,gint width
);
void e_html_editor_selection_set_paragraph_style (EHTMLEditorSelection *selection
,WebKitDOMElement *element
,gint width
,gint offset
,const gchar *style_to_add
);
WebKitDOMElement * e_html_editor_selection_get_paragraph_element (EHTMLEditorSelection *selection
,WebKitDOMDocument *document
,gint width
,gint offset
);
WebKitDOMElement * e_html_editor_selection_put_node_into_paragraph (EHTMLEditorSelection *selection
,WebKitDOMDocument *document
,WebKitDOMNode *node
,gboolean with_input
);
void
e_html_editor_selection_wrap_lines (EHTMLEditorSelection *selection
);
Wraps all lines in current selection to be 71 characters long.
WebKitDOMElement * e_html_editor_selection_wrap_paragraph_length (EHTMLEditorSelection *selection
,WebKitDOMElement *paragraph
,gint length
);
void e_html_editor_selection_wrap_paragraphs_in_document (EHTMLEditorSelection *selection
,WebKitDOMDocument *document
);
WebKitDOMElement * e_html_editor_selection_wrap_paragraph (EHTMLEditorSelection *selection
,WebKitDOMElement *paragraph
);
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_set_on_point (EHTMLEditorSelection *selection
,guint x
,guint y
);
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.
void
e_html_editor_selection_scroll_to_caret
(EHTMLEditorSelection *selection
);
EHTMLEditorSelectionAlignment
e_html_editor_selection_get_list_alignment_from_node
(WebKitDOMNode *node
);
Returns alignment of given list.
void e_html_editor_selection_get_selection_coordinates (EHTMLEditorSelection *selection
,guint *start_x
,guint *start_y
,guint *end_x
,guint *end_y
);
“alignment”
property“alignment” gint
Holds alignment of current paragraph.
Flags: Read / Write
Allowed values: [0,2]
Default value: 0
“background-color”
property“background-color” gchar *
Holds background color of current selection or at current cursor position.
Flags: Read / Write
Default value: NULL
“block-format”
property“block-format” gint
Holds block format of current paragraph. See EHTMLEditorSelectionBlockFormat for valid values.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“bold”
property“bold” gboolean
Holds whether current selection or text at current cursor position is bold.
Flags: Read / Write
Default value: FALSE
“font-color”
property“font-color” GdkRGBA *
Holds font color of current selection or at current cursor position.
Flags: Read / Write
“font-name”
property“font-name” gchar *
Holds name of font in current selection or at current cursor position.
Flags: Read / Write
Default value: NULL
“font-size”
property“font-size” gint
Holds point size of current selection or at current cursor position.
Flags: Read / Write
Allowed values: [1,7]
Default value: 3
“html-editor-view”
property“html-editor-view” EHTMLEditorView *
Flags: Read / Write / Construct Only
“indented”
property“indented” gboolean
Holds whether current paragraph is indented. This does not include citations.
Flags: Read
Default value: FALSE
“italic”
property“italic” gboolean
Holds whether current selection or letter at current cursor position is italic.
Flags: Read / Write
Default value: FALSE
“monospaced”
property“monospaced” gboolean
Holds whether current selection or letter at current cursor position is monospaced.
Flags: Read / Write
Default value: FALSE
“strikethrough”
property“strikethrough” gboolean
Holds whether current selection or letter at current cursor position is strikethrough.
Flags: Read / Write
Default value: FALSE
“subscript”
property“subscript” gboolean
Holds whether current selection or letter at current cursor position is in subscript.
Flags: Read / Write
Default value: FALSE
“superscript”
property“superscript” gboolean
Holds whether current selection or letter at current cursor position is in superscript.
Flags: Read / Write
Default value: FALSE
“text”
property“text” gchar *
Holds always up-to-date text of current selection.
Flags: Read
Default value: NULL
“underline”
property“underline” gboolean
Holds whether current selection or letter at current cursor position is underlined.
Flags: Read / Write
Default value: FALSE