Struct sourceview5::SnippetChunk[][src]

pub struct SnippetChunk(_);

Implementations

impl SnippetChunk[src]

pub fn new() -> SnippetChunk[src]

Create a new SnippetChunk that can be added to a Snippet.

Feature: v5_0

pub fn copy(&self) -> Option<SnippetChunk>[src]

Copies the source snippet.

Feature: v5_0

Returns

A SnippetChunk

pub fn get_context(&self) -> Option<SnippetContext>[src]

Gets the context for the snippet insertion.

Feature: v5_0

Returns

A SnippetContext

pub fn get_focus_position(&self) -> i32[src]

Gets the SnippetChunk:focus-position.

The focus-position is used to determine how many tabs it takes for the snippet to advanced to this chunk.

A focus-position of zero will be the last focus position of the snippet and snippet editing ends when it has been reached.

A focus-position of -1 means the chunk cannot be focused by the user.

Feature: v5_0

Returns

the focus-position

pub fn get_spec(&self) -> Option<GString>[src]

Gets the specification for the chunk.

The specification is evaluated for variables when other chunks are edited within the snippet context. If the user has changed the text, the SnippetChunk:text and SnippetChunk:text-set properties are updated.

Feature: v5_0

Returns

the specification, if any

pub fn get_text(&self) -> Option<GString>[src]

Gets the SnippetChunk:text property.

The text property is updated when the user edits the text of the chunk. If it has not been edited, the SnippetChunk:spec property is returned.

Feature: v5_0

Returns

the text of the chunk

pub fn get_text_set(&self) -> bool[src]

Gets the SnippetChunk:text-set property.

This is typically set when the user has edited a snippet chunk.

Feature: v5_0

pub fn get_tooltip_text(&self) -> Option<GString>[src]

pub fn set_context(&self, context: &SnippetContext)[src]

pub fn set_focus_position(&self, focus_position: i32)[src]

Sets the SnippetChunk:focus-position property.

The focus-position is used to determine how many tabs it takes for the snippet to advanced to this chunk.

A focus-position of zero will be the last focus position of the snippet and snippet editing ends when it has been reached.

A focus-position of -1 means the chunk cannot be focused by the user.

Feature: v5_0

focus_position

the focus-position

pub fn set_spec(&self, spec: &str)[src]

Sets the specification for the chunk.

The specification is evaluated for variables when other chunks are edited within the snippet context. If the user has changed the text, the SnippetChunk:text and SnippetChunk:text-set properties are updated.

Feature: v5_0

spec

the new specification for the chunk

pub fn set_text(&self, text: &str)[src]

Sets the text for the snippet chunk.

This is usually used by the snippet engine to update the text, but may be useful when creating custom snippets to avoid expansion of any specification.

Feature: v5_0

text

the text of the property

pub fn set_text_set(&self, text_set: bool)[src]

Sets the SnippetChunk:text-set property.

This is typically set when the user has edited a snippet chunk by the snippet engine.

Feature: v5_0

text_set

the property value

pub fn set_tooltip_text(&self, tooltip_text: &str)[src]

pub fn get_property_context(&self) -> Option<SnippetContext>[src]

pub fn get_property_focus_position(&self) -> i32[src]

pub fn set_property_focus_position(&self, focus_position: i32)[src]

pub fn get_property_spec(&self) -> Option<GString>[src]

pub fn set_property_spec(&self, spec: Option<&str>)[src]

pub fn get_property_text(&self) -> Option<GString>[src]

pub fn set_property_text(&self, text: Option<&str>)[src]

pub fn get_property_text_set(&self) -> bool[src]

pub fn set_property_text_set(&self, text_set: bool)[src]

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

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

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

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

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

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

Trait Implementations

impl Clone for SnippetChunk[src]

impl Debug for SnippetChunk[src]

impl Default for SnippetChunk[src]

impl Display for SnippetChunk[src]

impl Eq for SnippetChunk[src]

impl Hash for SnippetChunk[src]

impl Ord for SnippetChunk[src]

impl ParentClassIs for SnippetChunk[src]

type Parent = Object

impl<T: ObjectType> PartialEq<T> for SnippetChunk[src]

impl<T: ObjectType> PartialOrd<T> for SnippetChunk[src]

impl StaticType for SnippetChunk[src]

impl StructuralEq for SnippetChunk[src]

Auto Trait Implementations

impl RefUnwindSafe for SnippetChunk

impl !Send for SnippetChunk

impl !Sync for SnippetChunk

impl Unpin for SnippetChunk

impl UnwindSafe for SnippetChunk

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: SetValue + Send + ToValue + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.