Struct sourceview5::SnippetManager[][src]

pub struct SnippetManager(_);

Implementations

impl SnippetManager[src]

pub fn get_search_path(&self) -> Vec<GString>[src]

Gets the list directories where self looks for snippet files.

Feature: v5_0

Returns

None-terminated array containing a list of snippet files directories. The array is owned by lm and must not be modified.

pub fn get_snippet(
    &self,
    group: Option<&str>,
    language_id: Option<&str>,
    trigger: &str
) -> Option<Snippet>
[src]

Queries the known snippets for the first matching group, language_id, and/or trigger. If group or language_id are None, they will be ignored.

Feature: v5_0

group

a group name or None

language_id

a Language:id or None

trigger

the trigger for the snippet

Returns

a Snippet or None if no matching snippet was found.

pub fn list_groups(&self) -> Vec<GString>[src]

List all the known groups within the snippet manager.

The result should be freed with g_free, and the individual strings are owned by self and should never be freed by the caller.

Feature: v5_0

Returns

An array of strings which should be freed with g_free.

pub fn list_matching(
    &self,
    group: Option<&str>,
    language_id: Option<&str>,
    trigger_prefix: Option<&str>
) -> Option<ListModel>
[src]

Queries the known snippets for those matching group, language_id, and/or trigger_prefix. If any of these are None, they will be ignored when filtering the available snippets.

The gio::ListModel only contains information about the available snippets until gio::ListModel::get_item is called for a specific snippet. This helps reduce the number of glib::object::Object’s that are created at runtime to those needed by the calling application.

Feature: v5_0

group

a group name or None

language_id

a Language:id or None

trigger_prefix

a prefix for a trigger to activate

Returns

a gio::ListModel of Snippet.

pub fn set_search_path(&self, dirs: &[&str])[src]

Sets the list of directories in which the GtkSourceSnippetManagerlooks for snippet files. If dirs is None, the search path is reset to default.

<note> <para> At the moment this function can be called only before the snippet files are loaded for the first time. In practice to set a custom search path for a SnippetManager, you have to call this function right after creating it. </para> </note>

Feature: v5_0

dirs

a None-terminated array of strings or None.

pub fn get_default() -> Option<SnippetManager>[src]

Returns the default SnippetManager instance.

Feature: v5_0

Returns

a SnippetManager which is owned by View library and must not be unref’d.

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

Trait Implementations

impl Clone for SnippetManager[src]

impl Debug for SnippetManager[src]

impl Display for SnippetManager[src]

impl Eq for SnippetManager[src]

impl Hash for SnippetManager[src]

impl Ord for SnippetManager[src]

impl ParentClassIs for SnippetManager[src]

type Parent = Object

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

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

impl StaticType for SnippetManager[src]

impl StructuralEq for SnippetManager[src]

Auto Trait Implementations

impl RefUnwindSafe for SnippetManager

impl !Send for SnippetManager

impl !Sync for SnippetManager

impl Unpin for SnippetManager

impl UnwindSafe for SnippetManager

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.