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 |
GI.WebKit.Objects.InputMethodContext
Description
Base class for input method contexts.
WebKitInputMethodContext defines the interface to implement WebKit input methods. The input methods are used by WebKit, when editable content is focused, to map from key events to Unicode character strings.
An input method may consume multiple key events in sequence and finally output the composed result. This is called preediting, and an input method may provide feedback about this process by displaying the intermediate composition states as preedit text.
Since: 2.28
Synopsis
- newtype InputMethodContext = InputMethodContext (ManagedPtr InputMethodContext)
- class (GObject o, IsDescendantOf InputMethodContext o) => IsInputMethodContext o
- toInputMethodContext :: (MonadIO m, IsInputMethodContext o) => o -> m InputMethodContext
- inputMethodContextFilterKeyEvent :: (HasCallStack, MonadIO m, IsInputMethodContext a, IsEvent b) => a -> b -> m Bool
- inputMethodContextGetInputHints :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> m [InputHints]
- inputMethodContextGetInputPurpose :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> m InputPurpose
- inputMethodContextGetPreedit :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> m (Maybe Text, [InputMethodUnderline], Word32)
- inputMethodContextNotifyCursorArea :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- inputMethodContextNotifyFocusIn :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> m ()
- inputMethodContextNotifyFocusOut :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> m ()
- inputMethodContextNotifySurrounding :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> Text -> Int32 -> Word32 -> Word32 -> m ()
- inputMethodContextReset :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> m ()
- inputMethodContextSetEnablePreedit :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> Bool -> m ()
- inputMethodContextSetInputHints :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> [InputHints] -> m ()
- inputMethodContextSetInputPurpose :: (HasCallStack, MonadIO m, IsInputMethodContext a) => a -> InputPurpose -> m ()
- constructInputMethodContextInputHints :: (IsInputMethodContext o, MonadIO m) => [InputHints] -> m (GValueConstruct o)
- getInputMethodContextInputHints :: (MonadIO m, IsInputMethodContext o) => o -> m [InputHints]
- setInputMethodContextInputHints :: (MonadIO m, IsInputMethodContext o) => o -> [InputHints] -> m ()
- constructInputMethodContextInputPurpose :: (IsInputMethodContext o, MonadIO m) => InputPurpose -> m (GValueConstruct o)
- getInputMethodContextInputPurpose :: (MonadIO m, IsInputMethodContext o) => o -> m InputPurpose
- setInputMethodContextInputPurpose :: (MonadIO m, IsInputMethodContext o) => o -> InputPurpose -> m ()
- type InputMethodContextCommittedCallback = Text -> IO ()
- afterInputMethodContextCommitted :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextCommittedCallback) -> m SignalHandlerId
- onInputMethodContextCommitted :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextCommittedCallback) -> m SignalHandlerId
- type InputMethodContextDeleteSurroundingCallback = Int32 -> Word32 -> IO ()
- afterInputMethodContextDeleteSurrounding :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextDeleteSurroundingCallback) -> m SignalHandlerId
- onInputMethodContextDeleteSurrounding :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextDeleteSurroundingCallback) -> m SignalHandlerId
- type InputMethodContextPreeditChangedCallback = IO ()
- afterInputMethodContextPreeditChanged :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditChangedCallback) -> m SignalHandlerId
- onInputMethodContextPreeditChanged :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditChangedCallback) -> m SignalHandlerId
- type InputMethodContextPreeditFinishedCallback = IO ()
- afterInputMethodContextPreeditFinished :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditFinishedCallback) -> m SignalHandlerId
- onInputMethodContextPreeditFinished :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditFinishedCallback) -> m SignalHandlerId
- type InputMethodContextPreeditStartedCallback = IO ()
- afterInputMethodContextPreeditStarted :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditStartedCallback) -> m SignalHandlerId
- onInputMethodContextPreeditStarted :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditStartedCallback) -> m SignalHandlerId
Exported types
newtype InputMethodContext Source #
Memory-managed wrapper type.
Constructors
InputMethodContext (ManagedPtr InputMethodContext) |
Instances
class (GObject o, IsDescendantOf InputMethodContext o) => IsInputMethodContext o Source #
Type class for types which can be safely cast to InputMethodContext
, for instance with toInputMethodContext
.
Instances
(GObject o, IsDescendantOf InputMethodContext o) => IsInputMethodContext o Source # | |
Defined in GI.WebKit.Objects.InputMethodContext |
toInputMethodContext :: (MonadIO m, IsInputMethodContext o) => o -> m InputMethodContext Source #
Cast to InputMethodContext
, 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, filterKeyEvent, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, notifyCursorArea, notifyFocusIn, notifyFocusOut, notifySurrounding, ref, refSink, reset, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getInputHints, getInputPurpose, getPreedit, getProperty, getQdata.
Setters
setData, setDataFull, setEnablePreedit, setInputHints, setInputPurpose, setProperty.
filterKeyEvent
inputMethodContextFilterKeyEvent Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a, IsEvent b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Allow keyEvent
to be handled by the input method.
If True
is returned, then no further processing should be
done for the key event.
Since: 2.28
getInputHints
inputMethodContextGetInputHints Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> m [InputHints] | Returns: the |
Get the value of the InputMethodContext:inputHints property.
Since: 2.28
getInputPurpose
inputMethodContextGetInputPurpose Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> m InputPurpose | Returns: the |
Get the value of the InputMethodContext:inputPurpose property.
Since: 2.28
getPreedit
inputMethodContextGetPreedit Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> m (Maybe Text, [InputMethodUnderline], Word32) |
Get the pre-edit string and a list of WebKitInputMethodUnderline.
Get the current pre-edit string for the context
, and a list of WebKitInputMethodUnderline to apply to the string.
The string will be displayed inserted at cursorOffset
.
Since: 2.28
notifyCursorArea
inputMethodContextNotifyCursorArea Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Notify context
that cursor area changed in input associated.
Since: 2.28
notifyFocusIn
inputMethodContextNotifyFocusIn Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> m () |
Notify context
that input associated has gained focus.
Since: 2.28
notifyFocusOut
inputMethodContextNotifyFocusOut Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> m () |
Notify context
that input associated has lost focus.
Since: 2.28
notifySurrounding
inputMethodContextNotifySurrounding Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Notify context
that the context surrounding the cursor has changed.
If there's no selection selectionIndex
is the same as cursorIndex
.
Since: 2.28
reset
inputMethodContextReset Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> m () |
Reset the context
.
This will typically cause the input to clear the preedit state.
Since: 2.28
setEnablePreedit
inputMethodContextSetEnablePreedit Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> Bool |
|
-> m () |
Set whether context
should enable preedit to display feedback.
Since: 2.28
setInputHints
inputMethodContextSetInputHints Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> [InputHints] |
|
-> m () |
Set the value of the InputMethodContext:inputHints property.
Since: 2.28
setInputPurpose
inputMethodContextSetInputPurpose Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputMethodContext a) | |
=> a |
|
-> InputPurpose |
|
-> m () |
Set the value of the InputMethodContext:inputPurpose property.
Since: 2.28
Properties
inputHints
The InputHints
of the input associated with this context.
Since: 2.28
constructInputMethodContextInputHints :: (IsInputMethodContext o, MonadIO m) => [InputHints] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “input-hints
” property. This is rarely needed directly, but it is used by new
.
getInputMethodContextInputHints :: (MonadIO m, IsInputMethodContext o) => o -> m [InputHints] Source #
Get the value of the “input-hints
” property.
When overloading is enabled, this is equivalent to
get
inputMethodContext #inputHints
setInputMethodContextInputHints :: (MonadIO m, IsInputMethodContext o) => o -> [InputHints] -> m () Source #
Set the value of the “input-hints
” property.
When overloading is enabled, this is equivalent to
set
inputMethodContext [ #inputHints:=
value ]
inputPurpose
The InputPurpose
of the input associated with this context.
Since: 2.28
constructInputMethodContextInputPurpose :: (IsInputMethodContext o, MonadIO m) => InputPurpose -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “input-purpose
” property. This is rarely needed directly, but it is used by new
.
getInputMethodContextInputPurpose :: (MonadIO m, IsInputMethodContext o) => o -> m InputPurpose Source #
Get the value of the “input-purpose
” property.
When overloading is enabled, this is equivalent to
get
inputMethodContext #inputPurpose
setInputMethodContextInputPurpose :: (MonadIO m, IsInputMethodContext o) => o -> InputPurpose -> m () Source #
Set the value of the “input-purpose
” property.
When overloading is enabled, this is equivalent to
set
inputMethodContext [ #inputPurpose:=
value ]
Signals
committed
type InputMethodContextCommittedCallback Source #
Emitted when a complete input sequence has been entered by the user. This can be a single character immediately after a key press or the final result of preediting.
Since: 2.28
afterInputMethodContextCommitted :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextCommittedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the committed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
inputMethodContext #committed 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.
onInputMethodContextCommitted :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextCommittedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the committed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
inputMethodContext #committed callback
deleteSurrounding
type InputMethodContextDeleteSurroundingCallback Source #
Arguments
= Int32 |
|
-> Word32 |
|
-> IO () |
Emitted when the input method wants to delete the context surrounding the cursor.
If offset
is a negative value, it means a position before the cursor.
Since: 2.28
afterInputMethodContextDeleteSurrounding :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextDeleteSurroundingCallback) -> m SignalHandlerId Source #
Connect a signal handler for the deleteSurrounding signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
inputMethodContext #deleteSurrounding 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.
onInputMethodContextDeleteSurrounding :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextDeleteSurroundingCallback) -> m SignalHandlerId Source #
Connect a signal handler for the deleteSurrounding signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
inputMethodContext #deleteSurrounding callback
preeditChanged
type InputMethodContextPreeditChangedCallback = IO () Source #
Emitted whenever the preedit sequence currently being entered has changed.
It is also emitted at the end of a preedit sequence, in which case
inputMethodContextGetPreedit
returns the empty string.
Since: 2.28
afterInputMethodContextPreeditChanged :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the preeditChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
inputMethodContext #preeditChanged 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.
onInputMethodContextPreeditChanged :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the preeditChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
inputMethodContext #preeditChanged callback
preeditFinished
type InputMethodContextPreeditFinishedCallback = IO () Source #
Emitted when a preediting sequence has been completed or canceled.
Since: 2.28
afterInputMethodContextPreeditFinished :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditFinishedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the preeditFinished signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
inputMethodContext #preeditFinished 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.
onInputMethodContextPreeditFinished :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditFinishedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the preeditFinished signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
inputMethodContext #preeditFinished callback
preeditStarted
type InputMethodContextPreeditStartedCallback = IO () Source #
Emitted when a new preediting sequence starts.
Since: 2.28
afterInputMethodContextPreeditStarted :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditStartedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the preeditStarted signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
inputMethodContext #preeditStarted 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.
onInputMethodContextPreeditStarted :: (IsInputMethodContext a, MonadIO m) => a -> ((?self :: a) => InputMethodContextPreeditStartedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the preeditStarted signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
inputMethodContext #preeditStarted callback