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

module GI.WebKit.Objects.DOMPerformanceNavigation
    ( 

-- * Exported types
    DOMPerformanceNavigation(..)            ,
    IsDOMPerformanceNavigation              ,
    toDOMPerformanceNavigation              ,
    noDOMPerformanceNavigation              ,


 -- * Methods
-- ** getRedirectCount #method:getRedirectCount#
    DOMPerformanceNavigationGetRedirectCountMethodInfo,
    dOMPerformanceNavigationGetRedirectCount,




 -- * Properties
-- ** redirectCount #attr:redirectCount#
    DOMPerformanceNavigationRedirectCountPropertyInfo,
    dOMPerformanceNavigationRedirectCount   ,
    getDOMPerformanceNavigationRedirectCount,


-- ** type #attr:type#
    DOMPerformanceNavigationTypePropertyInfo,
    dOMPerformanceNavigationType            ,
    getDOMPerformanceNavigationType         ,




    ) 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.Objects.DOMObject as WebKit.DOMObject

newtype DOMPerformanceNavigation = DOMPerformanceNavigation (ManagedPtr DOMPerformanceNavigation)
foreign import ccall "webkit_dom_performance_navigation_get_type"
    c_webkit_dom_performance_navigation_get_type :: IO GType

instance GObject DOMPerformanceNavigation where
    gobjectType _ = c_webkit_dom_performance_navigation_get_type
    

class GObject o => IsDOMPerformanceNavigation o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DOMPerformanceNavigation a) =>
    IsDOMPerformanceNavigation a
#endif
instance IsDOMPerformanceNavigation DOMPerformanceNavigation
instance WebKit.DOMObject.IsDOMObject DOMPerformanceNavigation
instance GObject.Object.IsObject DOMPerformanceNavigation

toDOMPerformanceNavigation :: IsDOMPerformanceNavigation o => o -> IO DOMPerformanceNavigation
toDOMPerformanceNavigation = unsafeCastTo DOMPerformanceNavigation

noDOMPerformanceNavigation :: Maybe DOMPerformanceNavigation
noDOMPerformanceNavigation = Nothing

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

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

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

-- VVV Prop "redirect-count"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDOMPerformanceNavigationRedirectCount :: (MonadIO m, IsDOMPerformanceNavigation o) => o -> m Word32
getDOMPerformanceNavigationRedirectCount obj = liftIO $ getObjectPropertyUInt32 obj "redirect-count"

data DOMPerformanceNavigationRedirectCountPropertyInfo
instance AttrInfo DOMPerformanceNavigationRedirectCountPropertyInfo where
    type AttrAllowedOps DOMPerformanceNavigationRedirectCountPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMPerformanceNavigationRedirectCountPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMPerformanceNavigationRedirectCountPropertyInfo = IsDOMPerformanceNavigation
    type AttrGetType DOMPerformanceNavigationRedirectCountPropertyInfo = Word32
    type AttrLabel DOMPerformanceNavigationRedirectCountPropertyInfo = "redirect-count"
    type AttrOrigin DOMPerformanceNavigationRedirectCountPropertyInfo = DOMPerformanceNavigation
    attrGet _ = getDOMPerformanceNavigationRedirectCount
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "type"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDOMPerformanceNavigationType :: (MonadIO m, IsDOMPerformanceNavigation o) => o -> m Word32
getDOMPerformanceNavigationType obj = liftIO $ getObjectPropertyUInt32 obj "type"

data DOMPerformanceNavigationTypePropertyInfo
instance AttrInfo DOMPerformanceNavigationTypePropertyInfo where
    type AttrAllowedOps DOMPerformanceNavigationTypePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMPerformanceNavigationTypePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMPerformanceNavigationTypePropertyInfo = IsDOMPerformanceNavigation
    type AttrGetType DOMPerformanceNavigationTypePropertyInfo = Word32
    type AttrLabel DOMPerformanceNavigationTypePropertyInfo = "type"
    type AttrOrigin DOMPerformanceNavigationTypePropertyInfo = DOMPerformanceNavigation
    attrGet _ = getDOMPerformanceNavigationType
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList DOMPerformanceNavigation
type instance O.AttributeList DOMPerformanceNavigation = DOMPerformanceNavigationAttributeList
type DOMPerformanceNavigationAttributeList = ('[ '("coreObject", WebKit.DOMObject.DOMObjectCoreObjectPropertyInfo), '("redirectCount", DOMPerformanceNavigationRedirectCountPropertyInfo), '("type", DOMPerformanceNavigationTypePropertyInfo)] :: [(Symbol, *)])

dOMPerformanceNavigationRedirectCount :: AttrLabelProxy "redirectCount"
dOMPerformanceNavigationRedirectCount = AttrLabelProxy

dOMPerformanceNavigationType :: AttrLabelProxy "type"
dOMPerformanceNavigationType = AttrLabelProxy

type instance O.SignalList DOMPerformanceNavigation = DOMPerformanceNavigationSignalList
type DOMPerformanceNavigationSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method DOMPerformanceNavigation::get_redirect_count
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit", name = "DOMPerformanceNavigation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMPerformanceNavigation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt16)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_performance_navigation_get_redirect_count" webkit_dom_performance_navigation_get_redirect_count :: 
    Ptr DOMPerformanceNavigation ->         -- self : TInterface (Name {namespace = "WebKit", name = "DOMPerformanceNavigation"})
    IO Word16

{- |
/No description available in the introspection data./
-}
dOMPerformanceNavigationGetRedirectCount ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMPerformanceNavigation a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMPerformanceNavigation.DOMPerformanceNavigation' -}
    -> m Word16
    {- ^ __Returns:__ A @/gushort/@ -}
dOMPerformanceNavigationGetRedirectCount self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_performance_navigation_get_redirect_count self'
    touchManagedPtr self
    return result

data DOMPerformanceNavigationGetRedirectCountMethodInfo
instance (signature ~ (m Word16), MonadIO m, IsDOMPerformanceNavigation a) => O.MethodInfo DOMPerformanceNavigationGetRedirectCountMethodInfo a signature where
    overloadedMethod _ = dOMPerformanceNavigationGetRedirectCount