{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

This class holds context information about the coordinates
specified by a GDK event.
-}

module GI.WebKit.Objects.HitTestResult
    ( 

-- * Exported types
    HitTestResult(..)                       ,
    IsHitTestResult                         ,
    toHitTestResult                         ,
    noHitTestResult                         ,


 -- * Properties
-- ** context #attr:context#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    HitTestResultContextPropertyInfo        ,
#endif
    constructHitTestResultContext           ,
    getHitTestResultContext                 ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    hitTestResultContext                    ,
#endif


-- ** imageUri #attr:imageUri#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    HitTestResultImageUriPropertyInfo       ,
#endif
    constructHitTestResultImageUri          ,
    getHitTestResultImageUri                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    hitTestResultImageUri                   ,
#endif


-- ** innerNode #attr:innerNode#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    HitTestResultInnerNodePropertyInfo      ,
#endif
    constructHitTestResultInnerNode         ,
    getHitTestResultInnerNode               ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    hitTestResultInnerNode                  ,
#endif


-- ** linkUri #attr:linkUri#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    HitTestResultLinkUriPropertyInfo        ,
#endif
    constructHitTestResultLinkUri           ,
    getHitTestResultLinkUri                 ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    hitTestResultLinkUri                    ,
#endif


-- ** mediaUri #attr:mediaUri#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    HitTestResultMediaUriPropertyInfo       ,
#endif
    constructHitTestResultMediaUri          ,
    getHitTestResultMediaUri                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    hitTestResultMediaUri                   ,
#endif


-- ** x #attr:x#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    HitTestResultXPropertyInfo              ,
#endif
    constructHitTestResultX                 ,
    getHitTestResultX                       ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    hitTestResultX                          ,
#endif


-- ** y #attr:y#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    HitTestResultYPropertyInfo              ,
#endif
    constructHitTestResultY                 ,
    getHitTestResultY                       ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    hitTestResultY                          ,
#endif




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.WebKit.Flags as WebKit.Flags
import {-# SOURCE #-} qualified GI.WebKit.Objects.DOMNode as WebKit.DOMNode

newtype HitTestResult = HitTestResult (ManagedPtr HitTestResult)
foreign import ccall "webkit_hit_test_result_get_type"
    c_webkit_hit_test_result_get_type :: IO GType

instance GObject HitTestResult where
    gobjectType _ = c_webkit_hit_test_result_get_type
    

class GObject o => IsHitTestResult o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError HitTestResult a) =>
    IsHitTestResult a
#endif
instance IsHitTestResult HitTestResult
instance GObject.Object.IsObject HitTestResult

toHitTestResult :: (MonadIO m, IsHitTestResult o) => o -> m HitTestResult
toHitTestResult = liftIO . unsafeCastTo HitTestResult

noHitTestResult :: Maybe HitTestResult
noHitTestResult = Nothing

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveHitTestResultMethod (t :: Symbol) (o :: *) :: * where
    ResolveHitTestResultMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveHitTestResultMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveHitTestResultMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveHitTestResultMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveHitTestResultMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveHitTestResultMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveHitTestResultMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveHitTestResultMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveHitTestResultMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveHitTestResultMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveHitTestResultMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveHitTestResultMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveHitTestResultMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveHitTestResultMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveHitTestResultMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveHitTestResultMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveHitTestResultMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveHitTestResultMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveHitTestResultMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveHitTestResultMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveHitTestResultMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveHitTestResultMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveHitTestResultMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveHitTestResultMethod t HitTestResult, O.MethodInfo info HitTestResult p) => O.IsLabelProxy t (HitTestResult -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveHitTestResultMethod t HitTestResult, O.MethodInfo info HitTestResult p) => O.IsLabel t (HitTestResult -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif

#endif

-- VVV Prop "context"
   -- Type: TInterface (Name {namespace = "WebKit", name = "HitTestResultContext"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getHitTestResultContext :: (MonadIO m, IsHitTestResult o) => o -> m [WebKit.Flags.HitTestResultContext]
getHitTestResultContext obj = liftIO $ getObjectPropertyFlags obj "context"

constructHitTestResultContext :: (IsHitTestResult o) => [WebKit.Flags.HitTestResultContext] -> IO (GValueConstruct o)
constructHitTestResultContext val = constructObjectPropertyFlags "context" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data HitTestResultContextPropertyInfo
instance AttrInfo HitTestResultContextPropertyInfo where
    type AttrAllowedOps HitTestResultContextPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint HitTestResultContextPropertyInfo = (~) [WebKit.Flags.HitTestResultContext]
    type AttrBaseTypeConstraint HitTestResultContextPropertyInfo = IsHitTestResult
    type AttrGetType HitTestResultContextPropertyInfo = [WebKit.Flags.HitTestResultContext]
    type AttrLabel HitTestResultContextPropertyInfo = "context"
    type AttrOrigin HitTestResultContextPropertyInfo = HitTestResult
    attrGet _ = getHitTestResultContext
    attrSet _ = undefined
    attrConstruct _ = constructHitTestResultContext
    attrClear _ = undefined
#endif

-- VVV Prop "image-uri"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getHitTestResultImageUri :: (MonadIO m, IsHitTestResult o) => o -> m (Maybe T.Text)
getHitTestResultImageUri obj = liftIO $ getObjectPropertyString obj "image-uri"

constructHitTestResultImageUri :: (IsHitTestResult o) => T.Text -> IO (GValueConstruct o)
constructHitTestResultImageUri val = constructObjectPropertyString "image-uri" (Just val)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data HitTestResultImageUriPropertyInfo
instance AttrInfo HitTestResultImageUriPropertyInfo where
    type AttrAllowedOps HitTestResultImageUriPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint HitTestResultImageUriPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint HitTestResultImageUriPropertyInfo = IsHitTestResult
    type AttrGetType HitTestResultImageUriPropertyInfo = (Maybe T.Text)
    type AttrLabel HitTestResultImageUriPropertyInfo = "image-uri"
    type AttrOrigin HitTestResultImageUriPropertyInfo = HitTestResult
    attrGet _ = getHitTestResultImageUri
    attrSet _ = undefined
    attrConstruct _ = constructHitTestResultImageUri
    attrClear _ = undefined
#endif

-- VVV Prop "inner-node"
   -- Type: TInterface (Name {namespace = "WebKit", name = "DOMNode"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getHitTestResultInnerNode :: (MonadIO m, IsHitTestResult o) => o -> m (Maybe WebKit.DOMNode.DOMNode)
getHitTestResultInnerNode obj = liftIO $ getObjectPropertyObject obj "inner-node" WebKit.DOMNode.DOMNode

constructHitTestResultInnerNode :: (IsHitTestResult o, WebKit.DOMNode.IsDOMNode a) => a -> IO (GValueConstruct o)
constructHitTestResultInnerNode val = constructObjectPropertyObject "inner-node" (Just val)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data HitTestResultInnerNodePropertyInfo
instance AttrInfo HitTestResultInnerNodePropertyInfo where
    type AttrAllowedOps HitTestResultInnerNodePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint HitTestResultInnerNodePropertyInfo = WebKit.DOMNode.IsDOMNode
    type AttrBaseTypeConstraint HitTestResultInnerNodePropertyInfo = IsHitTestResult
    type AttrGetType HitTestResultInnerNodePropertyInfo = (Maybe WebKit.DOMNode.DOMNode)
    type AttrLabel HitTestResultInnerNodePropertyInfo = "inner-node"
    type AttrOrigin HitTestResultInnerNodePropertyInfo = HitTestResult
    attrGet _ = getHitTestResultInnerNode
    attrSet _ = undefined
    attrConstruct _ = constructHitTestResultInnerNode
    attrClear _ = undefined
#endif

-- VVV Prop "link-uri"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getHitTestResultLinkUri :: (MonadIO m, IsHitTestResult o) => o -> m (Maybe T.Text)
getHitTestResultLinkUri obj = liftIO $ getObjectPropertyString obj "link-uri"

constructHitTestResultLinkUri :: (IsHitTestResult o) => T.Text -> IO (GValueConstruct o)
constructHitTestResultLinkUri val = constructObjectPropertyString "link-uri" (Just val)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data HitTestResultLinkUriPropertyInfo
instance AttrInfo HitTestResultLinkUriPropertyInfo where
    type AttrAllowedOps HitTestResultLinkUriPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint HitTestResultLinkUriPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint HitTestResultLinkUriPropertyInfo = IsHitTestResult
    type AttrGetType HitTestResultLinkUriPropertyInfo = (Maybe T.Text)
    type AttrLabel HitTestResultLinkUriPropertyInfo = "link-uri"
    type AttrOrigin HitTestResultLinkUriPropertyInfo = HitTestResult
    attrGet _ = getHitTestResultLinkUri
    attrSet _ = undefined
    attrConstruct _ = constructHitTestResultLinkUri
    attrClear _ = undefined
#endif

-- VVV Prop "media-uri"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getHitTestResultMediaUri :: (MonadIO m, IsHitTestResult o) => o -> m (Maybe T.Text)
getHitTestResultMediaUri obj = liftIO $ getObjectPropertyString obj "media-uri"

constructHitTestResultMediaUri :: (IsHitTestResult o) => T.Text -> IO (GValueConstruct o)
constructHitTestResultMediaUri val = constructObjectPropertyString "media-uri" (Just val)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data HitTestResultMediaUriPropertyInfo
instance AttrInfo HitTestResultMediaUriPropertyInfo where
    type AttrAllowedOps HitTestResultMediaUriPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint HitTestResultMediaUriPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint HitTestResultMediaUriPropertyInfo = IsHitTestResult
    type AttrGetType HitTestResultMediaUriPropertyInfo = (Maybe T.Text)
    type AttrLabel HitTestResultMediaUriPropertyInfo = "media-uri"
    type AttrOrigin HitTestResultMediaUriPropertyInfo = HitTestResult
    attrGet _ = getHitTestResultMediaUri
    attrSet _ = undefined
    attrConstruct _ = constructHitTestResultMediaUri
    attrClear _ = undefined
#endif

-- VVV Prop "x"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getHitTestResultX :: (MonadIO m, IsHitTestResult o) => o -> m Int32
getHitTestResultX obj = liftIO $ getObjectPropertyInt32 obj "x"

constructHitTestResultX :: (IsHitTestResult o) => Int32 -> IO (GValueConstruct o)
constructHitTestResultX val = constructObjectPropertyInt32 "x" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data HitTestResultXPropertyInfo
instance AttrInfo HitTestResultXPropertyInfo where
    type AttrAllowedOps HitTestResultXPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint HitTestResultXPropertyInfo = (~) Int32
    type AttrBaseTypeConstraint HitTestResultXPropertyInfo = IsHitTestResult
    type AttrGetType HitTestResultXPropertyInfo = Int32
    type AttrLabel HitTestResultXPropertyInfo = "x"
    type AttrOrigin HitTestResultXPropertyInfo = HitTestResult
    attrGet _ = getHitTestResultX
    attrSet _ = undefined
    attrConstruct _ = constructHitTestResultX
    attrClear _ = undefined
#endif

-- VVV Prop "y"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getHitTestResultY :: (MonadIO m, IsHitTestResult o) => o -> m Int32
getHitTestResultY obj = liftIO $ getObjectPropertyInt32 obj "y"

constructHitTestResultY :: (IsHitTestResult o) => Int32 -> IO (GValueConstruct o)
constructHitTestResultY val = constructObjectPropertyInt32 "y" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data HitTestResultYPropertyInfo
instance AttrInfo HitTestResultYPropertyInfo where
    type AttrAllowedOps HitTestResultYPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint HitTestResultYPropertyInfo = (~) Int32
    type AttrBaseTypeConstraint HitTestResultYPropertyInfo = IsHitTestResult
    type AttrGetType HitTestResultYPropertyInfo = Int32
    type AttrLabel HitTestResultYPropertyInfo = "y"
    type AttrOrigin HitTestResultYPropertyInfo = HitTestResult
    attrGet _ = getHitTestResultY
    attrSet _ = undefined
    attrConstruct _ = constructHitTestResultY
    attrClear _ = undefined
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList HitTestResult
type instance O.AttributeList HitTestResult = HitTestResultAttributeList
type HitTestResultAttributeList = ('[ '("context", HitTestResultContextPropertyInfo), '("imageUri", HitTestResultImageUriPropertyInfo), '("innerNode", HitTestResultInnerNodePropertyInfo), '("linkUri", HitTestResultLinkUriPropertyInfo), '("mediaUri", HitTestResultMediaUriPropertyInfo), '("x", HitTestResultXPropertyInfo), '("y", HitTestResultYPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
hitTestResultContext :: AttrLabelProxy "context"
hitTestResultContext = AttrLabelProxy

hitTestResultImageUri :: AttrLabelProxy "imageUri"
hitTestResultImageUri = AttrLabelProxy

hitTestResultInnerNode :: AttrLabelProxy "innerNode"
hitTestResultInnerNode = AttrLabelProxy

hitTestResultLinkUri :: AttrLabelProxy "linkUri"
hitTestResultLinkUri = AttrLabelProxy

hitTestResultMediaUri :: AttrLabelProxy "mediaUri"
hitTestResultMediaUri = AttrLabelProxy

hitTestResultX :: AttrLabelProxy "x"
hitTestResultX = AttrLabelProxy

hitTestResultY :: AttrLabelProxy "y"
hitTestResultY = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList HitTestResult = HitTestResultSignalList
type HitTestResultSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif