![]() |
![]() |
![]() |
Evolution Utilities Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
gboolean e_html_editor_selection_has_text (EHTMLEditorSelection *selection
); gchar * e_html_editor_selection_get_caret_word (EHTMLEditorSelection *selection
); void e_html_editor_selection_replace_caret_word (EHTMLEditorSelection *selection
,const gchar *replacement
); enum EHTMLEditorSelectionAlignment; EHTMLEditorSelectionAlignment e_html_editor_selection_get_alignment (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_alignment (EHTMLEditorSelection *selection
,EHTMLEditorSelectionAlignment alignment
); const gchar * e_html_editor_selection_get_background_color (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_background_color (EHTMLEditorSelection *selection
,const gchar *color
); void e_html_editor_selection_get_font_color (EHTMLEditorSelection *selection
,GdkRGBA *rgba
); void e_html_editor_selection_set_font_color (EHTMLEditorSelection *selection
,const GdkRGBA *rgba
); const gchar * e_html_editor_selection_get_font_name (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_font_name (EHTMLEditorSelection *selection
,const gchar *font_name
); enum EHTMLEditorSelectionFontSize; guint e_html_editor_selection_get_font_size (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_font_size (EHTMLEditorSelection *selection
,guint font_size
); enum EHTMLEditorSelectionBlockFormat; EHTMLEditorSelectionBlockFormat e_html_editor_selection_get_block_format (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_block_format (EHTMLEditorSelection *selection
,EHTMLEditorSelectionBlockFormat format
); gboolean e_html_editor_selection_is_citation (EHTMLEditorSelection *selection
); gboolean e_html_editor_selection_is_indented (EHTMLEditorSelection *selection
); void e_html_editor_selection_indent (EHTMLEditorSelection *selection
); void e_html_editor_selection_unindent (EHTMLEditorSelection *selection
); gboolean e_html_editor_selection_is_bold (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_bold (EHTMLEditorSelection *selection
,gboolean bold
); gboolean e_html_editor_selection_is_italic (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_italic (EHTMLEditorSelection *selection
,gboolean italic
); gboolean e_html_editor_selection_is_monospaced (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_monospaced (EHTMLEditorSelection *selection
,gboolean monospaced
); gboolean e_html_editor_selection_is_superscript (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_superscript (EHTMLEditorSelection *selection
,gboolean superscript
); gboolean e_html_editor_selection_is_subscript (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_subscript (EHTMLEditorSelection *selection
,gboolean subscript
); gboolean e_html_editor_selection_is_underline (EHTMLEditorSelection *selection
); void e_html_editor_selection_set_underline (EHTMLEditorSelection *selection
,gboolean underline
); void e_html_editor_selection_unlink (EHTMLEditorSelection *selection
); void e_html_editor_selection_create_link (EHTMLEditorSelection *selection
,const gchar *uri
); const gchar * e_html_editor_selection_get_string (EHTMLEditorSelection *selection
); void e_html_editor_selection_replace (EHTMLEditorSelection *selection
,const gchar *new_string
); void e_html_editor_selection_insert_html (EHTMLEditorSelection *selection
,const gchar *html_text
); void e_html_editor_selection_insert_image (EHTMLEditorSelection *selection
,const gchar *image_uri
); void e_html_editor_selection_insert_text (EHTMLEditorSelection *selection
,const gchar *plain_text
); void e_html_editor_selection_wrap_lines (EHTMLEditorSelection *selection
); void e_html_editor_selection_save (EHTMLEditorSelection *selection
); void e_html_editor_selection_restore (EHTMLEditorSelection *selection
); enum EHTMLEditorSelectionGranularity; void e_html_editor_selection_move (EHTMLEditorSelection *selection
,gboolean forward
,EHTMLEditorSelectionGranularity granularity
); void e_html_editor_selection_extend (EHTMLEditorSelection *selection
,gboolean forward
,EHTMLEditorSelectionGranularity granularity
);
gboolean e_html_editor_selection_has_text (EHTMLEditorSelection *selection
);
Returns whether current selection contains any text.
|
an EHTMLEditorSelection |
Returns : |
TRUE when current selection contains text, FALSE otherwise. |
gchar * e_html_editor_selection_get_caret_word
(EHTMLEditorSelection *selection
);
Returns word under cursor.
|
an EHTMLEditorSelection |
Returns : |
A newly allocated string with current caret word or NULL when there
is no text under cursor or when selection is active. [transfer-full]. |
void e_html_editor_selection_replace_caret_word (EHTMLEditorSelection *selection
,const gchar *replacement
);
Replaces current word under cursor with replacement
.
|
an EHTMLEditorSelection |
|
a string to replace current caret word with |
typedef enum { E_HTML_EDITOR_SELECTION_ALIGNMENT_LEFT, E_HTML_EDITOR_SELECTION_ALIGNMENT_CENTER, E_HTML_EDITOR_SELECTION_ALIGNMENT_RIGHT } EHTMLEditorSelectionAlignment;
EHTMLEditorSelectionAlignment e_html_editor_selection_get_alignment
(EHTMLEditorSelection *selection
);
Returns alignment of current paragraph
|
an EHTMLEditorSelection |
Returns : |
EHTMLEditorSelectionAlignment |
void e_html_editor_selection_set_alignment (EHTMLEditorSelection *selection
,EHTMLEditorSelectionAlignment alignment
);
Sets alignment of current paragraph to give alignment
.
|
an EHTMLEditorSelection |
|
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.
|
an EHTMLEditorSelection |
Returns : |
A string with code of current background color. |
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
.
|
an EHTMLEditorSelection |
|
code of new background color to set |
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.
|
an EHTMLEditorSelection |
|
a GdkRGBA object to be set to current font color |
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
.
|
an EHTMLEditorSelection |
|
a GdkRGBA |
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.
|
an EHTMLEditorSelection |
Returns : |
A string with font name. [transfer-none] |
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
.
|
an EHTMLEditorSelection |
|
a font name to apply |
typedef enum { E_HTML_EDITOR_SELECTION_FONT_SIZE_TINY = 1, E_HTML_EDITOR_SELECTION_FONT_SIZE_SMALL = 2, E_HTML_EDITOR_SELECTION_FONT_SIZE_NORMAL = 3, E_HTML_EDITOR_SELECTION_FONT_SIZE_BIG = 4, E_HTML_EDITOR_SELECTION_FONT_SIZE_BIGGER = 5, E_HTML_EDITOR_SELECTION_FONT_SIZE_LARGE = 6, E_HTML_EDITOR_SELECTION_FONT_SIZE_VERY_LARGE = 7 } EHTMLEditorSelectionFontSize;
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
.
|
an EHTMLEditorSelection |
|
point size to apply |
typedef enum { E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_NONE = 0, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_PARAGRAPH, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_PRE, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_ADDRESS, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_BLOCKQUOTE, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_H1, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_H2, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_H3, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_H4, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_H5, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_H6, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_UNORDERED_LIST, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_ORDERED_LIST, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_ORDERED_LIST_ROMAN, E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_ORDERED_LIST_ALPHA } EHTMLEditorSelectionBlockFormat;
EHTMLEditorSelectionBlockFormat e_html_editor_selection_get_block_format
(EHTMLEditorSelection *selection
);
Returns block format of current paragraph.
|
an EHTMLEditorSelection |
Returns : |
EHTMLEditorSelectionBlockFormat |
void e_html_editor_selection_set_block_format (EHTMLEditorSelection *selection
,EHTMLEditorSelectionBlockFormat format
);
Changes block format of current paragraph to format
.
|
an EHTMLEditorSelection |
|
an EHTMLEditorSelectionBlockFormat value |
gboolean e_html_editor_selection_is_citation (EHTMLEditorSelection *selection
);
Returns whether current paragraph is a citation.
|
an EHTMLEditorSelection |
Returns : |
TRUE when current paragraph is a citation, FALSE otherwise. |
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()
.
|
an EHTMLEditorSelection |
Returns : |
TRUE when current paragraph is indented, FALSE otherwise. |
void e_html_editor_selection_indent (EHTMLEditorSelection *selection
);
Indents current paragraph by one level.
|
an EHTMLEditorSelection |
void e_html_editor_selection_unindent (EHTMLEditorSelection *selection
);
Unindents current paragraph by one level.
|
an EHTMLEditorSelection |
gboolean e_html_editor_selection_is_bold (EHTMLEditorSelection *selection
);
|
an EHTMLEditorSelection |
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
.
|
an EHTMLEditorSelection |
|
TRUE to enable bold, FALSE to disable |
gboolean e_html_editor_selection_is_italic (EHTMLEditorSelection *selection
);
|
an EHTMLEditorSelection |
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
.
|
an EHTMLEditorSelection |
|
TRUE to enable italic, FALSE to disable |
gboolean e_html_editor_selection_is_monospaced
(EHTMLEditorSelection *selection
);
|
an EHTMLEditorSelection |
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
.
|
an EHTMLEditorSelection |
|
TRUE to enable monospaced, FALSE to disable |
gboolean e_html_editor_selection_is_superscript
(EHTMLEditorSelection *selection
);
|
an EHTMLEditorSelection |
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
.
|
an EHTMLEditorSelection |
|
TRUE to enable superscript, FALSE to disable |
gboolean e_html_editor_selection_is_subscript
(EHTMLEditorSelection *selection
);
|
an EHTMLEditorSelection |
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
.
|
an EHTMLEditorSelection |
|
TRUE to enable subscript, FALSE to disable |
gboolean e_html_editor_selection_is_underline
(EHTMLEditorSelection *selection
);
|
an EHTMLEditorSelection |
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
.
|
an EHTMLEditorSelection |
|
TRUE to enable underline, FALSE to disable |
void e_html_editor_selection_unlink (EHTMLEditorSelection *selection
);
Removes any links (<A> elements) from current selection or at current cursor position.
|
an EHTMLEditorSelection |
void e_html_editor_selection_create_link (EHTMLEditorSelection *selection
,const gchar *uri
);
Converts current selection into a link pointing to url
.
|
an EHTMLEditorSelection |
|
destination of the new link |
const gchar * e_html_editor_selection_get_string (EHTMLEditorSelection *selection
);
Returns currently selected string.
|
an EHTMLEditorSelection |
Returns : |
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
.
|
an EHTMLEditorSelection |
|
a string to replace current selection with |
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
.
|
an EHTMLEditorSelection |
|
an HTML code to insert |
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.
|
an EHTMLEditorSelection |
|
an URI of the source 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
.
|
an EHTMLEditorSelection |
|
text to insert |
void e_html_editor_selection_wrap_lines (EHTMLEditorSelection *selection
);
Wraps all lines in current selection to be 71 characters long.
|
an EHTMLEditorSelection |
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).
|
an EHTMLEditorSelection |
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.
|
an EHTMLEditorSelection |
typedef enum { E_HTML_EDITOR_SELECTION_GRANULARITY_CHARACTER, E_HTML_EDITOR_SELECTION_GRANULARITY_WORD } EHTMLEditorSelectionGranularity;
void e_html_editor_selection_move (EHTMLEditorSelection *selection
,gboolean forward
,EHTMLEditorSelectionGranularity granularity
);
Moves current selection in given direction by given granularity
|
an EHTMLEditorSelection |
|
whether to move the selection forward or backward |
|
granularity of the movement |
void e_html_editor_selection_extend (EHTMLEditorSelection *selection
,gboolean forward
,EHTMLEditorSelectionGranularity granularity
);
Extends current selection in given direction by given granularity.
|
an EHTMLEditorSelection |
|
whether to extend selection forward or backward |
|
granularity of the extension |