Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype SnippetManager = SnippetManager (ManagedPtr SnippetManager)
- class (GObject o, IsDescendantOf SnippetManager o) => IsSnippetManager o
- toSnippetManager :: (MonadIO m, IsSnippetManager o) => o -> m SnippetManager
- snippetManagerGetDefault :: (HasCallStack, MonadIO m) => m SnippetManager
- snippetManagerGetSearchPath :: (HasCallStack, MonadIO m, IsSnippetManager a) => a -> m [Text]
- snippetManagerGetSnippet :: (HasCallStack, MonadIO m, IsSnippetManager a) => a -> Maybe Text -> Maybe Text -> Text -> m (Maybe Snippet)
- snippetManagerListAll :: (HasCallStack, MonadIO m, IsSnippetManager a) => a -> m ListModel
- snippetManagerListGroups :: (HasCallStack, MonadIO m, IsSnippetManager a) => a -> m [Text]
- snippetManagerListMatching :: (HasCallStack, MonadIO m, IsSnippetManager a) => a -> Maybe Text -> Maybe Text -> Maybe Text -> m ListModel
- snippetManagerSetSearchPath :: (HasCallStack, MonadIO m, IsSnippetManager a) => a -> Maybe [Text] -> m ()
- clearSnippetManagerSearchPath :: (MonadIO m, IsSnippetManager o) => o -> m ()
- constructSnippetManagerSearchPath :: (IsSnippetManager o, MonadIO m) => [Text] -> m (GValueConstruct o)
- getSnippetManagerSearchPath :: (MonadIO m, IsSnippetManager o) => o -> m [Text]
- setSnippetManagerSearchPath :: (MonadIO m, IsSnippetManager o) => o -> [Text] -> m ()
Exported types
newtype SnippetManager Source #
Memory-managed wrapper type.
SnippetManager (ManagedPtr SnippetManager) |
Instances
Eq SnippetManager Source # | |
Defined in GI.GtkSource.Objects.SnippetManager (==) :: SnippetManager -> SnippetManager -> Bool # (/=) :: SnippetManager -> SnippetManager -> Bool # | |
GObject SnippetManager Source # | |
Defined in GI.GtkSource.Objects.SnippetManager | |
ManagedPtrNewtype SnippetManager Source # | |
Defined in GI.GtkSource.Objects.SnippetManager toManagedPtr :: SnippetManager -> ManagedPtr SnippetManager | |
TypedObject SnippetManager Source # | |
Defined in GI.GtkSource.Objects.SnippetManager | |
HasParentTypes SnippetManager Source # | |
Defined in GI.GtkSource.Objects.SnippetManager | |
IsGValue (Maybe SnippetManager) Source # | Convert |
Defined in GI.GtkSource.Objects.SnippetManager gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe SnippetManager -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe SnippetManager) | |
type ParentTypes SnippetManager Source # | |
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
(GObject o, IsDescendantOf SnippetManager o) => IsSnippetManager o Source # | |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, listAll, listGroups, listMatching, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getProperty, getQdata, getSearchPath, getSnippet.
Setters
getDefault
snippetManagerGetDefault Source #
:: (HasCallStack, MonadIO m) | |
=> m SnippetManager | Returns: a |
Returns the default SnippetManager
instance.
getSearchPath
snippetManagerGetSearchPath Source #
:: (HasCallStack, MonadIO m, IsSnippetManager a) | |
=> a |
|
-> m [Text] | Returns: |
Gets the list directories where self
looks for snippet files.
getSnippet
snippetManagerGetSnippet Source #
:: (HasCallStack, MonadIO m, IsSnippetManager a) | |
=> a |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> Text |
|
-> m (Maybe Snippet) | Returns: a |
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 #
:: (HasCallStack, MonadIO m, IsSnippetManager a) | |
=> a |
|
-> m ListModel |
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 #
:: (HasCallStack, MonadIO m, IsSnippetManager a) | |
=> a |
|
-> m [Text] | Returns:
An array of strings which should be freed with |
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 #
:: (HasCallStack, MonadIO m, IsSnippetManager a) | |
=> a |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m ListModel |
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 #
:: (HasCallStack, MonadIO m, IsSnippetManager a) | |
=> a |
|
-> Maybe [Text] | |
-> 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 ]