gi-gio-2.0.38: Gio bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gio.Objects.FilenameCompleter

Contents

- Exported types
- Methods
  - getCompletionSuffix
  - getCompletions
  - new
  - setDirsOnly
- Signals
  - gotCompletionData

Description

Completes partial file and directory names given a partial string by looking in the file system for clues. Can return a list of possible completion strings for widget implementations.

Synopsis

- newtype FilenameCompleter = FilenameCompleter (ManagedPtr FilenameCompleter)
- class (GObject o, IsDescendantOf FilenameCompleter o) => IsFilenameCompleter o
- toFilenameCompleter :: (MonadIO m, IsFilenameCompleter o) => o -> m FilenameCompleter
- filenameCompleterGetCompletionSuffix :: (HasCallStack, MonadIO m, IsFilenameCompleter a) => a -> Text -> m (Maybe Text)
- filenameCompleterGetCompletions :: (HasCallStack, MonadIO m, IsFilenameCompleter a) => a -> Text -> m [Text]
- filenameCompleterNew :: (HasCallStack, MonadIO m) => m FilenameCompleter
- filenameCompleterSetDirsOnly :: (HasCallStack, MonadIO m, IsFilenameCompleter a) => a -> Bool -> m ()
- type FilenameCompleterGotCompletionDataCallback = IO ()
- afterFilenameCompleterGotCompletionData :: (IsFilenameCompleter a, MonadIO m) => a -> ((?self :: a) => FilenameCompleterGotCompletionDataCallback) -> m SignalHandlerId
- onFilenameCompleterGotCompletionData :: (IsFilenameCompleter a, MonadIO m) => a -> ((?self :: a) => FilenameCompleterGotCompletionDataCallback) -> m SignalHandlerId

# Exported types

newtype FilenameCompleter Source #

Memory-managed wrapper type.

Constructors

FilenameCompleter (ManagedPtr FilenameCompleter) |

#### Instances

Instances details

Eq FilenameCompleter Source # |
Instance details Defined in GI.Gio.Objects.FilenameCompleter Methods (==) :: FilenameCompleter -> FilenameCompleter -> Bool Source # (/=) :: FilenameCompleter -> FilenameCompleter -> Bool Source #
GObject FilenameCompleter Source # |
Instance details Defined in GI.Gio.Objects.FilenameCompleter
ManagedPtrNewtype FilenameCompleter Source # |
Instance details Defined in GI.Gio.Objects.FilenameCompleter Methods toManagedPtr :: FilenameCompleter -> ManagedPtr FilenameCompleter Source #
TypedObject FilenameCompleter Source # |
Instance details Defined in GI.Gio.Objects.FilenameCompleter Methods glibType :: IO GType Source #
HasParentTypes FilenameCompleter Source # |
Instance details Defined in GI.Gio.Objects.FilenameCompleter
IsGValue (Maybe FilenameCompleter) Source # | Convert `FilenameCompleter` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.FilenameCompleter Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe FilenameCompleter -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe FilenameCompleter) Source #
type ParentTypes FilenameCompleter Source # |
Instance details Defined in GI.Gio.Objects.FilenameCompleter type ParentTypes FilenameCompleter = '[Object]

class (GObject o, IsDescendantOf FilenameCompleter o) => IsFilenameCompleter o Source #

Type class for types which can be safely cast to `FilenameCompleter`, for instance with `toFilenameCompleter`.

#### Instances

Instances details

(GObject o, IsDescendantOf FilenameCompleter o) => IsFilenameCompleter o Source # |
Instance details Defined in GI.Gio.Objects.FilenameCompleter

toFilenameCompleter :: (MonadIO m, IsFilenameCompleter o) => o -> m FilenameCompleter Source #

Cast to `FilenameCompleter`, 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

Expand

#### Methods

bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getCompletionSuffix, getCompletions, getData, getProperty, getQdata.

#### Setters

setData, setDataFull, setDirsOnly, setProperty.

## getCompletionSuffix

filenameCompleterGetCompletionSuffix Source #

Arguments

:: (HasCallStack, MonadIO m, IsFilenameCompleter a) |
=> a | `completer`: the filename completer.
-> Text | `initialText`: text to be completed.
-> m (Maybe Text) | Returns: a suffix completion string, or `NULL` if no completion exists.

Obtains a suffix completion for `initialText` from `completer`.

Suffix will be an empty string if there's no shared suffix among matching completions. If there's no matching completions anyway, `NULL` is returned.

## getCompletions

filenameCompleterGetCompletions Source #

Arguments

:: (HasCallStack, MonadIO m, IsFilenameCompleter a) |
=> a | `completer`: the filename completer.
-> Text | `initialText`: text to be completed.
-> m [Text] | Returns: array of strings with possible completions for `initialText`. This array must be freed by `strfreev` when finished.

Gets an array of completion strings for a given initial text.

## new

filenameCompleterNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m FilenameCompleter | Returns: a `FilenameCompleter`.

Creates a new filename completer.

## setDirsOnly

filenameCompleterSetDirsOnly Source #

Arguments

:: (HasCallStack, MonadIO m, IsFilenameCompleter a) |
=> a | `completer`: the filename completer.
-> Bool | `dirsOnly`: a `Bool`.
-> m () |

If `dirsOnly` is `True`, `completer` will only complete directory names, and not file names.

This function needs to be called before waiting for results from the completer to be populated.

# Signals

## gotCompletionData

type FilenameCompleterGotCompletionDataCallback = IO () Source #

Emitted when the file name completion information comes available.

afterFilenameCompleterGotCompletionData :: (IsFilenameCompleter a, MonadIO m) => a -> ((?self :: a) => FilenameCompleterGotCompletionDataCallback) -> m SignalHandlerId Source #

Connect a signal handler for the gotCompletionData signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after filenameCompleter #gotCompletionData callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onFilenameCompleterGotCompletionData :: (IsFilenameCompleter a, MonadIO m) => a -> ((?self :: a) => FilenameCompleterGotCompletionDataCallback) -> m SignalHandlerId Source #

Connect a signal handler for the gotCompletionData signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on filenameCompleter #gotCompletionData callback