Trait sourceview5::prelude::ViewExt[][src]

pub trait ViewExt: 'static {
    fn get_auto_indent(&self) -> bool;
fn get_background_pattern(&self) -> BackgroundPatternType;
fn get_completion(&self) -> Option<Completion>;
fn get_enable_snippets(&self) -> bool;
fn get_gutter(&self, window_type: TextWindowType) -> Option<Gutter>;
fn get_highlight_current_line(&self) -> bool;
fn get_hover(&self) -> Option<Hover>;
fn get_indent_on_tab(&self) -> bool;
fn get_indent_width(&self) -> i32;
fn get_indenter(&self) -> Option<Indenter>;
fn get_insert_spaces_instead_of_tabs(&self) -> bool;
fn get_right_margin_position(&self) -> u32;
fn get_show_line_marks(&self) -> bool;
fn get_show_line_numbers(&self) -> bool;
fn get_show_right_margin(&self) -> bool;
fn get_smart_backspace(&self) -> bool;
fn get_smart_home_end(&self) -> SmartHomeEndType;
fn get_space_drawer(&self) -> Option<SpaceDrawer>;
fn get_tab_width(&self) -> u32;
fn get_visual_column(&self, iter: &TextIter) -> u32;
fn indent_lines(&self, start: &mut TextIter, end: &mut TextIter);
fn set_auto_indent(&self, enable: bool);
fn set_background_pattern(&self, background_pattern: BackgroundPatternType);
fn set_enable_snippets(&self, enable_snippets: bool);
fn set_highlight_current_line(&self, highlight: bool);
fn set_indent_on_tab(&self, enable: bool);
fn set_indent_width(&self, width: i32);
fn set_indenter<P: IsA<Indenter>>(&self, indenter: Option<&P>);
fn set_insert_spaces_instead_of_tabs(&self, enable: bool);
fn set_mark_attributes(
        &self,
        category: &str,
        attributes: &MarkAttributes,
        priority: i32
    );
fn set_right_margin_position(&self, pos: u32);
fn set_show_line_marks(&self, show: bool);
fn set_show_line_numbers(&self, show: bool);
fn set_show_right_margin(&self, show: bool);
fn set_smart_backspace(&self, smart_backspace: bool);
fn set_smart_home_end(&self, smart_home_end: SmartHomeEndType);
fn set_tab_width(&self, width: u32);
fn unindent_lines(&self, start: &mut TextIter, end: &mut TextIter);
fn connect_change_case<F: Fn(&Self, ChangeCaseType) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_change_case(&self, case_type: ChangeCaseType);
fn connect_change_number<F: Fn(&Self, i32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_change_number(&self, count: i32);
fn connect_join_lines<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_join_lines(&self);
fn connect_line_mark_activated<F: Fn(&Self, &TextIter, u32, ModifierType, i32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_move_lines<F: Fn(&Self, bool) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_move_lines(&self, down: bool);
fn connect_move_to_matching_bracket<F: Fn(&Self, bool) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_move_to_matching_bracket(&self, extend_selection: bool);
fn connect_move_words<F: Fn(&Self, i32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_move_words(&self, count: i32);
fn connect_show_completion<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_show_completion(&self);
fn connect_smart_home_end<F: Fn(&Self, &TextIter, i32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_auto_indent_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_background_pattern_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_completion_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_enable_snippets_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_highlight_current_line_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_indent_on_tab_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_indent_width_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_indenter_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_insert_spaces_instead_of_tabs_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_right_margin_position_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_show_line_marks_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_show_line_numbers_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_show_right_margin_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_smart_backspace_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_smart_home_end_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_space_drawer_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_tab_width_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all View methods.

Implementors

Map, View

Required methods

fn get_auto_indent(&self) -> bool[src]

Returns whether auto-indentation of text is enabled.

Returns

true if auto indentation is enabled.

fn get_background_pattern(&self) -> BackgroundPatternType[src]

Returns the BackgroundPatternType specifying if and how the background pattern should be displayed for this self.

Returns

the BackgroundPatternType.

fn get_completion(&self) -> Option<Completion>[src]

Gets the Completion associated with self. The returned object is guaranteed to be the same for the lifetime of self. Each View object has a different Completion.

Returns

the Completion associated with self.

fn get_enable_snippets(&self) -> bool[src]

Gets the View:enable-snippets property.

If true, matching snippets found in the SnippetManager may be expanded when the user presses Tab after a word in the View.

Feature: v5_0

Returns

true if enabled

fn get_gutter(&self, window_type: TextWindowType) -> Option<Gutter>[src]

Returns the Gutter object associated with window_type for self. Only GTK_TEXT_WINDOW_LEFT and GTK_TEXT_WINDOW_RIGHT are supported, respectively corresponding to the left and right gutter. The line numbers and mark category icons are rendered in the left gutter.

window_type

the gutter window type.

Returns

the Gutter.

fn get_highlight_current_line(&self) -> bool[src]

Returns whether the current line is highlighted.

Returns

true if the current line is highlighted.

fn get_hover(&self) -> Option<Hover>[src]

Gets the Hover associated with self. The returned object is guaranteed to be the same for the lifetime of self. Each View object has a different Hover.

Returns

a Hover associated with self.

fn get_indent_on_tab(&self) -> bool[src]

Returns whether when the tab key is pressed the current selection should get indented instead of replaced with the \t character.

Returns

true if the selection is indented when tab is pressed.

fn get_indent_width(&self) -> i32[src]

Returns the number of spaces to use for each step of indent. See ViewExt::set_indent_width for details.

Returns

indent width.

fn get_indenter(&self) -> Option<Indenter>[src]

Gets the View:indenter property.

Feature: v5_0

Returns

a Indenter or None

fn get_insert_spaces_instead_of_tabs(&self) -> bool[src]

Returns whether when inserting a tabulator character it should be replaced by a group of space characters.

Returns

true if spaces are inserted instead of tabs.

fn get_right_margin_position(&self) -> u32[src]

Gets the position of the right margin in the given self.

Returns

the position of the right margin.

fn get_show_line_marks(&self) -> bool[src]

Returns whether line marks are displayed beside the text.

Returns

true if the line marks are displayed.

fn get_show_line_numbers(&self) -> bool[src]

Returns whether line numbers are displayed beside the text.

Returns

true if the line numbers are displayed.

fn get_show_right_margin(&self) -> bool[src]

Returns whether a right margin is displayed.

Returns

true if the right margin is shown.

fn get_smart_backspace(&self) -> bool[src]

Returns true if pressing the Backspace key will try to delete spaces up to the previous tab stop.

Returns

true if smart Backspace handling is enabled.

fn get_smart_home_end(&self) -> SmartHomeEndType[src]

Returns a SmartHomeEndType end value specifying how the cursor will move when HOME and END keys are pressed.

Returns

a SmartHomeEndType value.

fn get_space_drawer(&self) -> Option<SpaceDrawer>[src]

Gets the SpaceDrawer associated with self. The returned object is guaranteed to be the same for the lifetime of self. Each View object has a different SpaceDrawer.

Returns

the SpaceDrawer associated with self.

fn get_tab_width(&self) -> u32[src]

Returns the width of tabulation in characters.

Returns

width of tab.

fn get_visual_column(&self, iter: &TextIter) -> u32[src]

Determines the visual column at iter taking into consideration the View:tab-width of self.

iter

a position in self.

Returns

the visual column at iter.

fn indent_lines(&self, start: &mut TextIter, end: &mut TextIter)[src]

Inserts one indentation level at the beginning of the specified lines. The empty lines are not indented.

start

gtk::TextIter of the first line to indent

end

gtk::TextIter of the last line to indent

fn set_auto_indent(&self, enable: bool)[src]

If true auto-indentation of text is enabled.

When Enter is pressed to create a new line, the auto-indentation inserts the same indentation as the previous line. This is <emphasis>not</emphasis> a “smart indentation” where an indentation level is added or removed depending on the context.

enable

whether to enable auto indentation.

fn set_background_pattern(&self, background_pattern: BackgroundPatternType)[src]

Set if and how the background pattern should be displayed.

background_pattern

the BackgroundPatternType.

fn set_enable_snippets(&self, enable_snippets: bool)[src]

Sets the View:enable-snippets property.

If enable_snippets is true, matching snippets found in the SnippetManager may be expanded when the user presses Tab after a word in the View.

Feature: v5_0

enable_snippets

if snippets should be enabled

fn set_highlight_current_line(&self, highlight: bool)[src]

If highlight is true the current line will be highlighted.

highlight

whether to highlight the current line.

fn set_indent_on_tab(&self, enable: bool)[src]

If true, when the tab key is pressed when several lines are selected, the selected lines are indented of one level instead of being replaced with a \t character. Shift+Tab unindents the selection.

If the first or last line is not selected completely, it is also indented or unindented.

When the selection doesn’t span several lines, the tab key always replaces the selection with a normal \t character.

enable

whether to indent a block when tab is pressed.

fn set_indent_width(&self, width: i32)[src]

Sets the number of spaces to use for each step of indent when the tab key is pressed. If width is -1, the value of the View:tab-width property will be used.

The View:indent-width interacts with the View:insert-spaces-instead-of-tabs property and View:tab-width. An example will be clearer: if the View:indent-width is 4 and View:tab-width is 8 and View:insert-spaces-instead-of-tabs is false, then pressing the tab key at the beginning of a line will insert 4 spaces. So far so good. Pressing the tab key a second time will remove the 4 spaces and insert a \t character instead (since View:tab-width is 8). On the other hand, if View:insert-spaces-instead-of-tabs is true, the second tab key pressed will insert 4 more spaces for a total of 8 spaces in the gtk::TextBuffer.

The test-widget program (available in the View repository) may be useful to better understand the indentation settings (enable the space drawing!).

width

indent width in characters.

fn set_indenter<P: IsA<Indenter>>(&self, indenter: Option<&P>)[src]

Sets the indenter for self to indenter.

Note that the indenter will not be used unless View:auto-indent has been set to true.

Feature: v5_0

indenter

a Indenter or None

fn set_insert_spaces_instead_of_tabs(&self, enable: bool)[src]

If true a tab key pressed is replaced by a group of space characters. Of course it is still possible to insert a real \t programmatically with the gtk::TextBuffer API.

enable

whether to insert spaces instead of tabs.

fn set_mark_attributes(
    &self,
    category: &str,
    attributes: &MarkAttributes,
    priority: i32
)
[src]

Sets attributes and priority for the category.

category

the category.

attributes

mark attributes.

priority

priority of the category.

fn set_right_margin_position(&self, pos: u32)[src]

Sets the position of the right margin in the given self.

pos

the width in characters where to position the right margin.

fn set_show_line_marks(&self, show: bool)[src]

If true line marks will be displayed beside the text.

show

whether line marks should be displayed.

fn set_show_line_numbers(&self, show: bool)[src]

If true line numbers will be displayed beside the text.

show

whether line numbers should be displayed.

fn set_show_right_margin(&self, show: bool)[src]

If true a right margin is displayed.

show

whether to show a right margin.

fn set_smart_backspace(&self, smart_backspace: bool)[src]

When set to true, pressing the Backspace key will try to delete spaces up to the previous tab stop.

smart_backspace

whether to enable smart Backspace handling.

fn set_smart_home_end(&self, smart_home_end: SmartHomeEndType)[src]

Set the desired movement of the cursor when HOME and END keys are pressed.

smart_home_end

the desired behavior among SmartHomeEndType.

fn set_tab_width(&self, width: u32)[src]

Sets the width of tabulation in characters. The gtk::TextBuffer still contains \t characters, but they can take a different visual width in a View widget.

width

width of tab in characters.

fn unindent_lines(&self, start: &mut TextIter, end: &mut TextIter)[src]

Removes one indentation level at the beginning of the specified lines.

start

gtk::TextIter of the first line to indent

end

gtk::TextIter of the last line to indent

fn connect_change_case<F: Fn(&Self, ChangeCaseType) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Keybinding signal to change case of the text at the current cursor position.

case_type

the case to use

fn emit_change_case(&self, case_type: ChangeCaseType)[src]

fn connect_change_number<F: Fn(&Self, i32) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Keybinding signal to edit a number at the current cursor position.

count

the number to add to the number at the current position

fn emit_change_number(&self, count: i32)[src]

fn connect_join_lines<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]

Keybinding signal to join the lines currently selected.

fn emit_join_lines(&self)[src]

fn connect_line_mark_activated<F: Fn(&Self, &TextIter, u32, ModifierType, i32) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Emitted when a line mark has been activated (for instance when there was a button press in the line marks gutter). You can use iter to determine on which line the activation took place.

iter

a gtk::TextIter

button

the button that was pressed

state

the modifier state, if any

n_presses

the number of presses

fn connect_move_lines<F: Fn(&Self, bool) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::move-lines signal is a keybinding which gets emitted when the user initiates moving a line. The default binding key is Alt+Up/Down arrow. And moves the currently selected lines, or the current line up or down by one line.

down

true to move down, false to move up.

fn emit_move_lines(&self, down: bool)[src]

fn connect_move_to_matching_bracket<F: Fn(&Self, bool) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Keybinding signal to move the cursor to the matching bracket.

extend_selection

true if the move should extend the selection

fn emit_move_to_matching_bracket(&self, extend_selection: bool)[src]

fn connect_move_words<F: Fn(&Self, i32) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::move-words signal is a keybinding which gets emitted when the user initiates moving a word. The default binding key is Alt+Left/Right Arrow and moves the current selection, or the current word by one word.

count

the number of words to move over

fn emit_move_words(&self, count: i32)[src]

fn connect_show_completion<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::show-completion signal is a key binding signal which gets emitted when the user requests a completion, by pressing <keycombo>``<keycap>Control</keycap>``<keycap>space</keycap>``</keycombo>.

This will create a CompletionContext with the activation type as CompletionActivation::UserRequested.

Applications should not connect to it, but may emit it with g_signal_emit_by_name if they need to activate the completion by another means, for example with another key binding or a menu entry.

fn emit_show_completion(&self)[src]

fn connect_smart_home_end<F: Fn(&Self, &TextIter, i32) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Emitted when a the cursor was moved according to the smart home end setting. The signal is emitted after the cursor is moved, but during the gtk::TextView::move-cursor action. This can be used to find out whether the cursor was moved by a normal home/end or by a smart home/end.

iter

a gtk::TextIter

count

the count

fn connect_property_auto_indent_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_background_pattern_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_completion_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_enable_snippets_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_highlight_current_line_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_indent_on_tab_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_indent_width_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_indenter_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_insert_spaces_instead_of_tabs_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_right_margin_position_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_show_line_marks_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_show_line_numbers_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_show_right_margin_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_smart_backspace_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_smart_home_end_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_space_drawer_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_tab_width_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Loading content...

Implementors

impl<O: IsA<View>> ViewExt for O[src]

Loading content...