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

An ATK object which encapsulates a link or set of links (for
instance in the case of client-side image maps) in a hypertext
document.  It may implement the AtkAction interface.  AtkHyperlink
may also be used to refer to inline embedded content, since it
allows specification of a start and end offset within the host
AtkHypertext object.
-}

module GI.Atk.Objects.Hyperlink
    ( 

-- * Exported types
    Hyperlink(..)                           ,
    IsHyperlink                             ,
    toHyperlink                             ,
    noHyperlink                             ,


 -- * Methods
-- ** getEndIndex #method:getEndIndex#
    HyperlinkGetEndIndexMethodInfo          ,
    hyperlinkGetEndIndex                    ,


-- ** getNAnchors #method:getNAnchors#
    HyperlinkGetNAnchorsMethodInfo          ,
    hyperlinkGetNAnchors                    ,


-- ** getObject #method:getObject#
    HyperlinkGetObjectMethodInfo            ,
    hyperlinkGetObject                      ,


-- ** getStartIndex #method:getStartIndex#
    HyperlinkGetStartIndexMethodInfo        ,
    hyperlinkGetStartIndex                  ,


-- ** getUri #method:getUri#
    HyperlinkGetUriMethodInfo               ,
    hyperlinkGetUri                         ,


-- ** isInline #method:isInline#
    HyperlinkIsInlineMethodInfo             ,
    hyperlinkIsInline                       ,


-- ** isSelectedLink #method:isSelectedLink#
    HyperlinkIsSelectedLinkMethodInfo       ,
    hyperlinkIsSelectedLink                 ,


-- ** isValid #method:isValid#
    HyperlinkIsValidMethodInfo              ,
    hyperlinkIsValid                        ,




 -- * Properties
-- ** endIndex #attr:endIndex#
    HyperlinkEndIndexPropertyInfo           ,
    getHyperlinkEndIndex                    ,
    hyperlinkEndIndex                       ,


-- ** numberOfAnchors #attr:numberOfAnchors#
    HyperlinkNumberOfAnchorsPropertyInfo    ,
    getHyperlinkNumberOfAnchors             ,
    hyperlinkNumberOfAnchors                ,


-- ** selectedLink #attr:selectedLink#
    HyperlinkSelectedLinkPropertyInfo       ,
    getHyperlinkSelectedLink                ,
    hyperlinkSelectedLink                   ,


-- ** startIndex #attr:startIndex#
    HyperlinkStartIndexPropertyInfo         ,
    getHyperlinkStartIndex                  ,
    hyperlinkStartIndex                     ,




 -- * Signals
-- ** linkActivated #signal:linkActivated#
    C_HyperlinkLinkActivatedCallback        ,
    HyperlinkLinkActivatedCallback          ,
    HyperlinkLinkActivatedSignalInfo        ,
    afterHyperlinkLinkActivated             ,
    genClosure_HyperlinkLinkActivated       ,
    mk_HyperlinkLinkActivatedCallback       ,
    noHyperlinkLinkActivatedCallback        ,
    onHyperlinkLinkActivated                ,
    wrap_HyperlinkLinkActivatedCallback     ,




    ) 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 {-# SOURCE #-} qualified GI.Atk.Interfaces.Action as Atk.Action
import {-# SOURCE #-} qualified GI.Atk.Objects.Object as Atk.Object
import qualified GI.GObject.Objects.Object as GObject.Object

newtype Hyperlink = Hyperlink (ManagedPtr Hyperlink)
foreign import ccall "atk_hyperlink_get_type"
    c_atk_hyperlink_get_type :: IO GType

instance GObject Hyperlink where
    gobjectType _ = c_atk_hyperlink_get_type
    

class GObject o => IsHyperlink o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError Hyperlink a) =>
    IsHyperlink a
#endif
instance IsHyperlink Hyperlink
instance GObject.Object.IsObject Hyperlink
instance Atk.Action.IsAction Hyperlink

toHyperlink :: IsHyperlink o => o -> IO Hyperlink
toHyperlink = unsafeCastTo Hyperlink

noHyperlink :: Maybe Hyperlink
noHyperlink = Nothing

type family ResolveHyperlinkMethod (t :: Symbol) (o :: *) :: * where
    ResolveHyperlinkMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveHyperlinkMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveHyperlinkMethod "doAction" o = Atk.Action.ActionDoActionMethodInfo
    ResolveHyperlinkMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveHyperlinkMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveHyperlinkMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveHyperlinkMethod "isInline" o = HyperlinkIsInlineMethodInfo
    ResolveHyperlinkMethod "isSelectedLink" o = HyperlinkIsSelectedLinkMethodInfo
    ResolveHyperlinkMethod "isValid" o = HyperlinkIsValidMethodInfo
    ResolveHyperlinkMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveHyperlinkMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveHyperlinkMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveHyperlinkMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveHyperlinkMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveHyperlinkMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveHyperlinkMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveHyperlinkMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveHyperlinkMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveHyperlinkMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveHyperlinkMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveHyperlinkMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveHyperlinkMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveHyperlinkMethod "getDescription" o = Atk.Action.ActionGetDescriptionMethodInfo
    ResolveHyperlinkMethod "getEndIndex" o = HyperlinkGetEndIndexMethodInfo
    ResolveHyperlinkMethod "getKeybinding" o = Atk.Action.ActionGetKeybindingMethodInfo
    ResolveHyperlinkMethod "getLocalizedName" o = Atk.Action.ActionGetLocalizedNameMethodInfo
    ResolveHyperlinkMethod "getNActions" o = Atk.Action.ActionGetNActionsMethodInfo
    ResolveHyperlinkMethod "getNAnchors" o = HyperlinkGetNAnchorsMethodInfo
    ResolveHyperlinkMethod "getName" o = Atk.Action.ActionGetNameMethodInfo
    ResolveHyperlinkMethod "getObject" o = HyperlinkGetObjectMethodInfo
    ResolveHyperlinkMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveHyperlinkMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveHyperlinkMethod "getStartIndex" o = HyperlinkGetStartIndexMethodInfo
    ResolveHyperlinkMethod "getUri" o = HyperlinkGetUriMethodInfo
    ResolveHyperlinkMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveHyperlinkMethod "setDescription" o = Atk.Action.ActionSetDescriptionMethodInfo
    ResolveHyperlinkMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveHyperlinkMethod l o = O.MethodResolutionFailed l o

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

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

-- signal Hyperlink::link-activated
type HyperlinkLinkActivatedCallback =
    IO ()

noHyperlinkLinkActivatedCallback :: Maybe HyperlinkLinkActivatedCallback
noHyperlinkLinkActivatedCallback = Nothing

type C_HyperlinkLinkActivatedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_HyperlinkLinkActivatedCallback :: C_HyperlinkLinkActivatedCallback -> IO (FunPtr C_HyperlinkLinkActivatedCallback)

genClosure_HyperlinkLinkActivated :: HyperlinkLinkActivatedCallback -> IO Closure
genClosure_HyperlinkLinkActivated cb = do
    let cb' = wrap_HyperlinkLinkActivatedCallback cb
    mk_HyperlinkLinkActivatedCallback cb' >>= newCClosure


wrap_HyperlinkLinkActivatedCallback ::
    HyperlinkLinkActivatedCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_HyperlinkLinkActivatedCallback _cb _ _ = do
    _cb 


onHyperlinkLinkActivated :: (GObject a, MonadIO m) => a -> HyperlinkLinkActivatedCallback -> m SignalHandlerId
onHyperlinkLinkActivated obj cb = liftIO $ connectHyperlinkLinkActivated obj cb SignalConnectBefore
afterHyperlinkLinkActivated :: (GObject a, MonadIO m) => a -> HyperlinkLinkActivatedCallback -> m SignalHandlerId
afterHyperlinkLinkActivated obj cb = connectHyperlinkLinkActivated obj cb SignalConnectAfter

connectHyperlinkLinkActivated :: (GObject a, MonadIO m) =>
                                 a -> HyperlinkLinkActivatedCallback -> SignalConnectMode -> m SignalHandlerId
connectHyperlinkLinkActivated obj cb after = liftIO $ do
    let cb' = wrap_HyperlinkLinkActivatedCallback cb
    cb'' <- mk_HyperlinkLinkActivatedCallback cb'
    connectSignalFunPtr obj "link-activated" cb'' after

-- VVV Prop "end-index"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getHyperlinkEndIndex :: (MonadIO m, IsHyperlink o) => o -> m Int32
getHyperlinkEndIndex obj = liftIO $ getObjectPropertyInt32 obj "end-index"

data HyperlinkEndIndexPropertyInfo
instance AttrInfo HyperlinkEndIndexPropertyInfo where
    type AttrAllowedOps HyperlinkEndIndexPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint HyperlinkEndIndexPropertyInfo = (~) ()
    type AttrBaseTypeConstraint HyperlinkEndIndexPropertyInfo = IsHyperlink
    type AttrGetType HyperlinkEndIndexPropertyInfo = Int32
    type AttrLabel HyperlinkEndIndexPropertyInfo = "end-index"
    type AttrOrigin HyperlinkEndIndexPropertyInfo = Hyperlink
    attrGet _ = getHyperlinkEndIndex
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "number-of-anchors"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getHyperlinkNumberOfAnchors :: (MonadIO m, IsHyperlink o) => o -> m Int32
getHyperlinkNumberOfAnchors obj = liftIO $ getObjectPropertyInt32 obj "number-of-anchors"

data HyperlinkNumberOfAnchorsPropertyInfo
instance AttrInfo HyperlinkNumberOfAnchorsPropertyInfo where
    type AttrAllowedOps HyperlinkNumberOfAnchorsPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint HyperlinkNumberOfAnchorsPropertyInfo = (~) ()
    type AttrBaseTypeConstraint HyperlinkNumberOfAnchorsPropertyInfo = IsHyperlink
    type AttrGetType HyperlinkNumberOfAnchorsPropertyInfo = Int32
    type AttrLabel HyperlinkNumberOfAnchorsPropertyInfo = "number-of-anchors"
    type AttrOrigin HyperlinkNumberOfAnchorsPropertyInfo = Hyperlink
    attrGet _ = getHyperlinkNumberOfAnchors
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "selected-link"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getHyperlinkSelectedLink :: (MonadIO m, IsHyperlink o) => o -> m Bool
getHyperlinkSelectedLink obj = liftIO $ getObjectPropertyBool obj "selected-link"

data HyperlinkSelectedLinkPropertyInfo
instance AttrInfo HyperlinkSelectedLinkPropertyInfo where
    type AttrAllowedOps HyperlinkSelectedLinkPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint HyperlinkSelectedLinkPropertyInfo = (~) ()
    type AttrBaseTypeConstraint HyperlinkSelectedLinkPropertyInfo = IsHyperlink
    type AttrGetType HyperlinkSelectedLinkPropertyInfo = Bool
    type AttrLabel HyperlinkSelectedLinkPropertyInfo = "selected-link"
    type AttrOrigin HyperlinkSelectedLinkPropertyInfo = Hyperlink
    attrGet _ = getHyperlinkSelectedLink
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "start-index"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getHyperlinkStartIndex :: (MonadIO m, IsHyperlink o) => o -> m Int32
getHyperlinkStartIndex obj = liftIO $ getObjectPropertyInt32 obj "start-index"

data HyperlinkStartIndexPropertyInfo
instance AttrInfo HyperlinkStartIndexPropertyInfo where
    type AttrAllowedOps HyperlinkStartIndexPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint HyperlinkStartIndexPropertyInfo = (~) ()
    type AttrBaseTypeConstraint HyperlinkStartIndexPropertyInfo = IsHyperlink
    type AttrGetType HyperlinkStartIndexPropertyInfo = Int32
    type AttrLabel HyperlinkStartIndexPropertyInfo = "start-index"
    type AttrOrigin HyperlinkStartIndexPropertyInfo = Hyperlink
    attrGet _ = getHyperlinkStartIndex
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList Hyperlink
type instance O.AttributeList Hyperlink = HyperlinkAttributeList
type HyperlinkAttributeList = ('[ '("endIndex", HyperlinkEndIndexPropertyInfo), '("numberOfAnchors", HyperlinkNumberOfAnchorsPropertyInfo), '("selectedLink", HyperlinkSelectedLinkPropertyInfo), '("startIndex", HyperlinkStartIndexPropertyInfo)] :: [(Symbol, *)])

hyperlinkEndIndex :: AttrLabelProxy "endIndex"
hyperlinkEndIndex = AttrLabelProxy

hyperlinkNumberOfAnchors :: AttrLabelProxy "numberOfAnchors"
hyperlinkNumberOfAnchors = AttrLabelProxy

hyperlinkSelectedLink :: AttrLabelProxy "selectedLink"
hyperlinkSelectedLink = AttrLabelProxy

hyperlinkStartIndex :: AttrLabelProxy "startIndex"
hyperlinkStartIndex = AttrLabelProxy

data HyperlinkLinkActivatedSignalInfo
instance SignalInfo HyperlinkLinkActivatedSignalInfo where
    type HaskellCallbackType HyperlinkLinkActivatedSignalInfo = HyperlinkLinkActivatedCallback
    connectSignal _ = connectHyperlinkLinkActivated

type instance O.SignalList Hyperlink = HyperlinkSignalList
type HyperlinkSignalList = ('[ '("linkActivated", HyperlinkLinkActivatedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method Hyperlink::get_end_index
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "link_", argType = TInterface (Name {namespace = "Atk", name = "Hyperlink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #AtkHyperlink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "atk_hyperlink_get_end_index" atk_hyperlink_get_end_index :: 
    Ptr Hyperlink ->                        -- link_ : TInterface (Name {namespace = "Atk", name = "Hyperlink"})
    IO Int32

{- |
Gets the index with the hypertext document at which this link ends.
-}
hyperlinkGetEndIndex ::
    (B.CallStack.HasCallStack, MonadIO m, IsHyperlink a) =>
    a
    {- ^ /@link_@/: an 'GI.Atk.Objects.Hyperlink.Hyperlink' -}
    -> m Int32
    {- ^ __Returns:__ the index with the hypertext document at which this link ends -}
hyperlinkGetEndIndex link_ = liftIO $ do
    link_' <- unsafeManagedPtrCastPtr link_
    result <- atk_hyperlink_get_end_index link_'
    touchManagedPtr link_
    return result

data HyperlinkGetEndIndexMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsHyperlink a) => O.MethodInfo HyperlinkGetEndIndexMethodInfo a signature where
    overloadedMethod _ = hyperlinkGetEndIndex

-- method Hyperlink::get_n_anchors
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "link_", argType = TInterface (Name {namespace = "Atk", name = "Hyperlink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #AtkHyperlink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "atk_hyperlink_get_n_anchors" atk_hyperlink_get_n_anchors :: 
    Ptr Hyperlink ->                        -- link_ : TInterface (Name {namespace = "Atk", name = "Hyperlink"})
    IO Int32

{- |
Gets the number of anchors associated with this hyperlink.
-}
hyperlinkGetNAnchors ::
    (B.CallStack.HasCallStack, MonadIO m, IsHyperlink a) =>
    a
    {- ^ /@link_@/: an 'GI.Atk.Objects.Hyperlink.Hyperlink' -}
    -> m Int32
    {- ^ __Returns:__ the number of anchors associated with this hyperlink -}
hyperlinkGetNAnchors link_ = liftIO $ do
    link_' <- unsafeManagedPtrCastPtr link_
    result <- atk_hyperlink_get_n_anchors link_'
    touchManagedPtr link_
    return result

data HyperlinkGetNAnchorsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsHyperlink a) => O.MethodInfo HyperlinkGetNAnchorsMethodInfo a signature where
    overloadedMethod _ = hyperlinkGetNAnchors

-- method Hyperlink::get_object
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "link_", argType = TInterface (Name {namespace = "Atk", name = "Hyperlink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #AtkHyperlink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "i", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a (zero-index) integer specifying the desired anchor", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Atk", name = "Object"}))
-- throws : False
-- Skip return : False

foreign import ccall "atk_hyperlink_get_object" atk_hyperlink_get_object :: 
    Ptr Hyperlink ->                        -- link_ : TInterface (Name {namespace = "Atk", name = "Hyperlink"})
    Int32 ->                                -- i : TBasicType TInt
    IO (Ptr Atk.Object.Object)

{- |
Returns the item associated with this hyperlinks nth anchor.
For instance, the returned 'GI.Atk.Objects.Object.Object' will implement 'GI.Atk.Interfaces.Text.Text'
if /@link_@/ is a text hyperlink, 'GI.Atk.Interfaces.Image.Image' if /@link_@/ is an image
hyperlink etc.

Multiple anchors are primarily used by client-side image maps.
-}
hyperlinkGetObject ::
    (B.CallStack.HasCallStack, MonadIO m, IsHyperlink a) =>
    a
    {- ^ /@link_@/: an 'GI.Atk.Objects.Hyperlink.Hyperlink' -}
    -> Int32
    {- ^ /@i@/: a (zero-index) integer specifying the desired anchor -}
    -> m Atk.Object.Object
    {- ^ __Returns:__ an 'GI.Atk.Objects.Object.Object' associated with this hyperlinks
i-th anchor -}
hyperlinkGetObject link_ i = liftIO $ do
    link_' <- unsafeManagedPtrCastPtr link_
    result <- atk_hyperlink_get_object link_' i
    checkUnexpectedReturnNULL "hyperlinkGetObject" result
    result' <- (newObject Atk.Object.Object) result
    touchManagedPtr link_
    return result'

data HyperlinkGetObjectMethodInfo
instance (signature ~ (Int32 -> m Atk.Object.Object), MonadIO m, IsHyperlink a) => O.MethodInfo HyperlinkGetObjectMethodInfo a signature where
    overloadedMethod _ = hyperlinkGetObject

-- method Hyperlink::get_start_index
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "link_", argType = TInterface (Name {namespace = "Atk", name = "Hyperlink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #AtkHyperlink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "atk_hyperlink_get_start_index" atk_hyperlink_get_start_index :: 
    Ptr Hyperlink ->                        -- link_ : TInterface (Name {namespace = "Atk", name = "Hyperlink"})
    IO Int32

{- |
Gets the index with the hypertext document at which this link begins.
-}
hyperlinkGetStartIndex ::
    (B.CallStack.HasCallStack, MonadIO m, IsHyperlink a) =>
    a
    {- ^ /@link_@/: an 'GI.Atk.Objects.Hyperlink.Hyperlink' -}
    -> m Int32
    {- ^ __Returns:__ the index with the hypertext document at which this link begins -}
hyperlinkGetStartIndex link_ = liftIO $ do
    link_' <- unsafeManagedPtrCastPtr link_
    result <- atk_hyperlink_get_start_index link_'
    touchManagedPtr link_
    return result

data HyperlinkGetStartIndexMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsHyperlink a) => O.MethodInfo HyperlinkGetStartIndexMethodInfo a signature where
    overloadedMethod _ = hyperlinkGetStartIndex

-- method Hyperlink::get_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "link_", argType = TInterface (Name {namespace = "Atk", name = "Hyperlink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #AtkHyperlink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "i", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a (zero-index) integer specifying the desired anchor", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "atk_hyperlink_get_uri" atk_hyperlink_get_uri :: 
    Ptr Hyperlink ->                        -- link_ : TInterface (Name {namespace = "Atk", name = "Hyperlink"})
    Int32 ->                                -- i : TBasicType TInt
    IO CString

{- |
Get a the URI associated with the anchor specified
by /@i@/ of /@link_@/.

Multiple anchors are primarily used by client-side image maps.
-}
hyperlinkGetUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsHyperlink a) =>
    a
    {- ^ /@link_@/: an 'GI.Atk.Objects.Hyperlink.Hyperlink' -}
    -> Int32
    {- ^ /@i@/: a (zero-index) integer specifying the desired anchor -}
    -> m T.Text
    {- ^ __Returns:__ a string specifying the URI -}
hyperlinkGetUri link_ i = liftIO $ do
    link_' <- unsafeManagedPtrCastPtr link_
    result <- atk_hyperlink_get_uri link_' i
    checkUnexpectedReturnNULL "hyperlinkGetUri" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr link_
    return result'

data HyperlinkGetUriMethodInfo
instance (signature ~ (Int32 -> m T.Text), MonadIO m, IsHyperlink a) => O.MethodInfo HyperlinkGetUriMethodInfo a signature where
    overloadedMethod _ = hyperlinkGetUri

-- method Hyperlink::is_inline
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "link_", argType = TInterface (Name {namespace = "Atk", name = "Hyperlink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #AtkHyperlink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "atk_hyperlink_is_inline" atk_hyperlink_is_inline :: 
    Ptr Hyperlink ->                        -- link_ : TInterface (Name {namespace = "Atk", name = "Hyperlink"})
    IO CInt

{- |
Indicates whether the link currently displays some or all of its
          content inline.  Ordinary HTML links will usually return
          'False', but an inline &lt;src&gt; HTML element will return
          'True'.
-}
hyperlinkIsInline ::
    (B.CallStack.HasCallStack, MonadIO m, IsHyperlink a) =>
    a
    {- ^ /@link_@/: an 'GI.Atk.Objects.Hyperlink.Hyperlink' -}
    -> m Bool
    {- ^ __Returns:__ whether or not this link displays its content inline. -}
hyperlinkIsInline link_ = liftIO $ do
    link_' <- unsafeManagedPtrCastPtr link_
    result <- atk_hyperlink_is_inline link_'
    let result' = (/= 0) result
    touchManagedPtr link_
    return result'

data HyperlinkIsInlineMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsHyperlink a) => O.MethodInfo HyperlinkIsInlineMethodInfo a signature where
    overloadedMethod _ = hyperlinkIsInline

-- method Hyperlink::is_selected_link
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "link_", argType = TInterface (Name {namespace = "Atk", name = "Hyperlink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #AtkHyperlink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "atk_hyperlink_is_selected_link" atk_hyperlink_is_selected_link :: 
    Ptr Hyperlink ->                        -- link_ : TInterface (Name {namespace = "Atk", name = "Hyperlink"})
    IO CInt

{-# DEPRECATED hyperlinkIsSelectedLink ["(Since version 1.8)","Please use ATK_STATE_FOCUSABLE for all links,","and ATK_STATE_FOCUSED for focused links."] #-}
{- |
Determines whether this AtkHyperlink is selected

@since 1.4
-}
hyperlinkIsSelectedLink ::
    (B.CallStack.HasCallStack, MonadIO m, IsHyperlink a) =>
    a
    {- ^ /@link_@/: an 'GI.Atk.Objects.Hyperlink.Hyperlink' -}
    -> m Bool
    {- ^ __Returns:__ True if the AtkHyperlink is selected, False otherwise -}
hyperlinkIsSelectedLink link_ = liftIO $ do
    link_' <- unsafeManagedPtrCastPtr link_
    result <- atk_hyperlink_is_selected_link link_'
    let result' = (/= 0) result
    touchManagedPtr link_
    return result'

data HyperlinkIsSelectedLinkMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsHyperlink a) => O.MethodInfo HyperlinkIsSelectedLinkMethodInfo a signature where
    overloadedMethod _ = hyperlinkIsSelectedLink

-- method Hyperlink::is_valid
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "link_", argType = TInterface (Name {namespace = "Atk", name = "Hyperlink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #AtkHyperlink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "atk_hyperlink_is_valid" atk_hyperlink_is_valid :: 
    Ptr Hyperlink ->                        -- link_ : TInterface (Name {namespace = "Atk", name = "Hyperlink"})
    IO CInt

{- |
Since the document that a link is associated with may have changed
this method returns 'True' if the link is still valid (with
respect to the document it references) and 'False' otherwise.
-}
hyperlinkIsValid ::
    (B.CallStack.HasCallStack, MonadIO m, IsHyperlink a) =>
    a
    {- ^ /@link_@/: an 'GI.Atk.Objects.Hyperlink.Hyperlink' -}
    -> m Bool
    {- ^ __Returns:__ whether or not this link is still valid -}
hyperlinkIsValid link_ = liftIO $ do
    link_' <- unsafeManagedPtrCastPtr link_
    result <- atk_hyperlink_is_valid link_'
    let result' = (/= 0) result
    touchManagedPtr link_
    return result'

data HyperlinkIsValidMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsHyperlink a) => O.MethodInfo HyperlinkIsValidMethodInfo a signature where
    overloadedMethod _ = hyperlinkIsValid