gi-gtksource-5.0.0: GtkSource bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GtkSource.Objects.SnippetManager

Description

Provides access to [classsnippet].

GtkSourceSnippetManager is an object which processes snippet description files and creates [classsnippet] objects.

Use SnippetManager.get_default to retrieve the default instance of GtkSourceSnippetManager.

Use [methodsnippetManager.get_snippet] to retrieve snippets for a given snippets.

Synopsis

Exported types

newtype SnippetManager Source #

Memory-managed wrapper type.

Constructors

SnippetManager (ManagedPtr SnippetManager) 

Instances

Instances details
Eq SnippetManager Source # 
Instance details

Defined in GI.GtkSource.Objects.SnippetManager

GObject SnippetManager Source # 
Instance details

Defined in GI.GtkSource.Objects.SnippetManager

ManagedPtrNewtype SnippetManager Source # 
Instance details

Defined in GI.GtkSource.Objects.SnippetManager

TypedObject SnippetManager Source # 
Instance details

Defined in GI.GtkSource.Objects.SnippetManager

Methods

glibType :: IO GType

HasParentTypes SnippetManager Source # 
Instance details

Defined in GI.GtkSource.Objects.SnippetManager

IsGValue (Maybe SnippetManager) Source #

Convert SnippetManager to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.GtkSource.Objects.SnippetManager

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe SnippetManager -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe SnippetManager)

type ParentTypes SnippetManager Source # 
Instance details

Defined in GI.GtkSource.Objects.SnippetManager

type ParentTypes SnippetManager = '[Object]

class (GObject o, IsDescendantOf SnippetManager o) => IsSnippetManager o Source #

Type class for types which can be safely cast to SnippetManager, for instance with toSnippetManager.

Instances

Instances details
(GObject o, IsDescendantOf SnippetManager o) => IsSnippetManager o Source # 
Instance details

Defined in GI.GtkSource.Objects.SnippetManager

toSnippetManager :: (MonadIO m, IsSnippetManager o) => o -> m SnippetManager Source #

Cast to SnippetManager, for types for which this is known to be safe. For general casts, use castTo.

Methods

getDefault

snippetManagerGetDefault Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m SnippetManager

Returns: a SnippetManager which is owned by GtkSourceView library and must not be unref'd.

Returns the default SnippetManager instance.

getSearchPath

snippetManagerGetSearchPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsSnippetManager a) 
=> a

self: a SnippetManager.

-> m [Text]

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

Gets the list directories where self looks for snippet files.

getSnippet

snippetManagerGetSnippet Source #

Arguments

:: (HasCallStack, MonadIO m, IsSnippetManager a) 
=> a

self: a SnippetManager

-> Maybe Text

group: a group name or Nothing

-> Maybe Text

languageId: a Language:id or Nothing

-> Text

trigger: the trigger for the snippet

-> m (Maybe Snippet)

Returns: a Snippet or Nothing if no matching snippet was found.

Queries the known snippets for the first matching group, languageId, and/or trigger.

If group or languageId are Nothing, they will be ignored.

listAll

snippetManagerListAll Source #

Arguments

:: (HasCallStack, MonadIO m, IsSnippetManager a) 
=> a

self: a SnippetManager

-> m ListModel

Returns: a ListModel of Snippet

Gets a ListModel of all snippets.

This can be used to get an unfiltered list of all of the snippets known to the snippet manager.

Since: 5.6

listGroups

snippetManagerListGroups Source #

Arguments

:: (HasCallStack, MonadIO m, IsSnippetManager a) 
=> a

self: a SnippetManager

-> m [Text]

Returns: An array of strings which should be freed with free.

List all the known groups within the snippet manager.

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

listMatching

snippetManagerListMatching Source #

Arguments

:: (HasCallStack, MonadIO m, IsSnippetManager a) 
=> a

self: a SnippetManager

-> Maybe Text

group: a group name or Nothing

-> Maybe Text

languageId: a Language:id or Nothing

-> Maybe Text

triggerPrefix: a prefix for a trigger to activate

-> m ListModel

Returns: a ListModel of Snippet.

Queries the known snippets for those matching group, languageId, and/or triggerPrefix.

If any of these are Nothing, they will be ignored when filtering the available snippets.

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

setSearchPath

snippetManagerSetSearchPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsSnippetManager a) 
=> a

self: a SnippetManager

-> Maybe [Text]

dirs: a Nothing-terminated array of strings or Nothing.

-> m () 

Sets the list of directories in which the GtkSourceSnippetManager looks for snippet files.

If dirs is Nothing, the search path is reset to default.

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 GtkSourceSnippetManager, you have to call this function right after creating it.

Properties

searchPath

Contains a list of directories to search for files containing snippets (*.snippets).

clearSnippetManagerSearchPath :: (MonadIO m, IsSnippetManager o) => o -> m () Source #

Set the value of the “search-path” property to Nothing. When overloading is enabled, this is equivalent to

clear #searchPath

constructSnippetManagerSearchPath :: (IsSnippetManager o, MonadIO m) => [Text] -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “search-path” property. This is rarely needed directly, but it is used by new.

getSnippetManagerSearchPath :: (MonadIO m, IsSnippetManager o) => o -> m [Text] Source #

Get the value of the “search-path” property. When overloading is enabled, this is equivalent to

get snippetManager #searchPath

setSnippetManagerSearchPath :: (MonadIO m, IsSnippetManager o) => o -> [Text] -> m () Source #

Set the value of the “search-path” property. When overloading is enabled, this is equivalent to

set snippetManager [ #searchPath := value ]