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 |
Result of a Hit Test.
A Hit Test is an operation to get context information about a given
point in a WebKitWebView
. HitTestResult
represents the
result of a Hit Test. It provides context information about what is
at the coordinates of the Hit Test, such as if there's a link,
an image or a media.
You can get the context of the HitTestResult with
hitTestResultGetContext
that returns a bitmask of
HitTestResultContext
flags. You can also use
hitTestResultContextIsLink
, hitTestResultContextIsImage
and
hitTestResultContextIsMedia
to determine whether there's
a link, image or a media element at the coordinates of the Hit Test.
Note that it's possible that several HitTestResultContext
flags
are active at the same time, for example if there's a link containing an image.
When the mouse is moved over a WebKitWebView
a Hit Test is performed
for the mouse coordinates and WebKitWebView::mouse-target-changed
signal is emitted with a HitTestResult
.
Synopsis
- newtype HitTestResult = HitTestResult (ManagedPtr HitTestResult)
- class (GObject o, IsDescendantOf HitTestResult o) => IsHitTestResult o
- toHitTestResult :: (MonadIO m, IsHitTestResult o) => o -> m HitTestResult
- hitTestResultContextIsEditable :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Bool
- hitTestResultContextIsImage :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Bool
- hitTestResultContextIsLink :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Bool
- hitTestResultContextIsMedia :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Bool
- hitTestResultContextIsScrollbar :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Bool
- hitTestResultContextIsSelection :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Bool
- hitTestResultGetContext :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Word32
- hitTestResultGetImageUri :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Text
- hitTestResultGetLinkLabel :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Text
- hitTestResultGetLinkTitle :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Text
- hitTestResultGetLinkUri :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Text
- hitTestResultGetMediaUri :: (HasCallStack, MonadIO m, IsHitTestResult a) => a -> m Text
- constructHitTestResultContext :: (IsHitTestResult o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getHitTestResultContext :: (MonadIO m, IsHitTestResult o) => o -> m Word32
- constructHitTestResultImageUri :: (IsHitTestResult o, MonadIO m) => Text -> m (GValueConstruct o)
- getHitTestResultImageUri :: (MonadIO m, IsHitTestResult o) => o -> m Text
- constructHitTestResultLinkLabel :: (IsHitTestResult o, MonadIO m) => Text -> m (GValueConstruct o)
- getHitTestResultLinkLabel :: (MonadIO m, IsHitTestResult o) => o -> m Text
- constructHitTestResultLinkTitle :: (IsHitTestResult o, MonadIO m) => Text -> m (GValueConstruct o)
- getHitTestResultLinkTitle :: (MonadIO m, IsHitTestResult o) => o -> m Text
- constructHitTestResultLinkUri :: (IsHitTestResult o, MonadIO m) => Text -> m (GValueConstruct o)
- getHitTestResultLinkUri :: (MonadIO m, IsHitTestResult o) => o -> m Text
- constructHitTestResultMediaUri :: (IsHitTestResult o, MonadIO m) => Text -> m (GValueConstruct o)
- getHitTestResultMediaUri :: (MonadIO m, IsHitTestResult o) => o -> m Text
Exported types
newtype HitTestResult Source #
Memory-managed wrapper type.
HitTestResult (ManagedPtr HitTestResult) |
Instances
class (GObject o, IsDescendantOf HitTestResult o) => IsHitTestResult o Source #
Type class for types which can be safely cast to HitTestResult
, for instance with toHitTestResult
.
Instances
(GObject o, IsDescendantOf HitTestResult o) => IsHitTestResult o Source # | |
Defined in GI.WebKit2WebExtension.Objects.HitTestResult |
toHitTestResult :: (MonadIO m, IsHitTestResult o) => o -> m HitTestResult Source #
Cast to HitTestResult
, 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, contextIsEditable, contextIsImage, contextIsLink, contextIsMedia, contextIsScrollbar, contextIsSelection, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getContext, getData, getImageUri, getLinkLabel, getLinkTitle, getLinkUri, getMediaUri, getProperty, getQdata.
Setters
contextIsEditable
hitTestResultContextIsEditable Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether HitTestResultContextEditable
flag is present in
HitTestResult:context.
contextIsImage
hitTestResultContextIsImage Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether HitTestResultContextImage
flag is present in
HitTestResult:context.
contextIsLink
hitTestResultContextIsLink Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether HitTestResultContextLink
flag is present in
HitTestResult:context.
contextIsMedia
hitTestResultContextIsMedia Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether HitTestResultContextMedia
flag is present in
HitTestResult:context.
contextIsScrollbar
hitTestResultContextIsScrollbar Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether HitTestResultContextScrollbar
flag is present in
HitTestResult:context.
contextIsSelection
hitTestResultContextIsSelection Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether HitTestResultContextSelection
flag is present in
HitTestResult:context.
Since: 2.8
getContext
hitTestResultGetContext Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Word32 | Returns: a bitmask of |
Gets the value of the HitTestResult:context property.
getImageUri
hitTestResultGetImageUri Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Text | Returns: the URI of the image element in the coordinates of the Hit Test,
or |
Gets the value of the HitTestResult:imageUri property.
getLinkLabel
hitTestResultGetLinkLabel Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Text | Returns: the label of the link element in the coordinates of the Hit Test,
or |
Gets the value of the HitTestResult:linkLabel property.
getLinkTitle
hitTestResultGetLinkTitle Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Text | Returns: the title of the link element in the coordinates of the Hit Test,
or |
Gets the value of the HitTestResult:linkTitle property.
getLinkUri
hitTestResultGetLinkUri Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Text | Returns: the URI of the link element in the coordinates of the Hit Test,
or |
Gets the value of the HitTestResult:linkUri property.
getMediaUri
hitTestResultGetMediaUri Source #
:: (HasCallStack, MonadIO m, IsHitTestResult a) | |
=> a |
|
-> m Text | Returns: the URI of the media element in the coordinates of the Hit Test,
or |
Gets the value of the HitTestResult:mediaUri property.
Properties
context
Bitmask of HitTestResultContext
flags representing
the context of the HitTestResult
.
constructHitTestResultContext :: (IsHitTestResult o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “context
” property. This is rarely needed directly, but it is used by new
.
getHitTestResultContext :: (MonadIO m, IsHitTestResult o) => o -> m Word32 Source #
Get the value of the “context
” property.
When overloading is enabled, this is equivalent to
get
hitTestResult #context
imageUri
The URI of the image if flag HitTestResultContextImage
is present in HitTestResult:context
constructHitTestResultImageUri :: (IsHitTestResult o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “image-uri
” property. This is rarely needed directly, but it is used by new
.
getHitTestResultImageUri :: (MonadIO m, IsHitTestResult o) => o -> m Text Source #
Get the value of the “image-uri
” property.
When overloading is enabled, this is equivalent to
get
hitTestResult #imageUri
linkLabel
The label of the link if flag HitTestResultContextLink
is present in HitTestResult:context
constructHitTestResultLinkLabel :: (IsHitTestResult o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “link-label
” property. This is rarely needed directly, but it is used by new
.
getHitTestResultLinkLabel :: (MonadIO m, IsHitTestResult o) => o -> m Text Source #
Get the value of the “link-label
” property.
When overloading is enabled, this is equivalent to
get
hitTestResult #linkLabel
linkTitle
The title of the link if flag HitTestResultContextLink
is present in HitTestResult:context
constructHitTestResultLinkTitle :: (IsHitTestResult o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “link-title
” property. This is rarely needed directly, but it is used by new
.
getHitTestResultLinkTitle :: (MonadIO m, IsHitTestResult o) => o -> m Text Source #
Get the value of the “link-title
” property.
When overloading is enabled, this is equivalent to
get
hitTestResult #linkTitle
linkUri
The URI of the link if flag HitTestResultContextLink
is present in HitTestResult:context
constructHitTestResultLinkUri :: (IsHitTestResult o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “link-uri
” property. This is rarely needed directly, but it is used by new
.
getHitTestResultLinkUri :: (MonadIO m, IsHitTestResult o) => o -> m Text Source #
Get the value of the “link-uri
” property.
When overloading is enabled, this is equivalent to
get
hitTestResult #linkUri
mediaUri
The URI of the media if flag HitTestResultContextMedia
is present in HitTestResult:context
constructHitTestResultMediaUri :: (IsHitTestResult o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “media-uri
” property. This is rarely needed directly, but it is used by new
.
getHitTestResultMediaUri :: (MonadIO m, IsHitTestResult o) => o -> m Text Source #
Get the value of the “media-uri
” property.
When overloading is enabled, this is equivalent to
get
hitTestResult #mediaUri