{- |
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.DOMPerformanceEntry
    ( 

-- * Exported types
    DOMPerformanceEntry(..)                 ,
    IsDOMPerformanceEntry                   ,
    toDOMPerformanceEntry                   ,
    noDOMPerformanceEntry                   ,


 -- * Methods
-- ** getDuration #method:getDuration#
    DOMPerformanceEntryGetDurationMethodInfo,
    dOMPerformanceEntryGetDuration          ,


-- ** getEntryType #method:getEntryType#
    DOMPerformanceEntryGetEntryTypeMethodInfo,
    dOMPerformanceEntryGetEntryType         ,


-- ** getName #method:getName#
    DOMPerformanceEntryGetNameMethodInfo    ,
    dOMPerformanceEntryGetName              ,


-- ** getStartTime #method:getStartTime#
    DOMPerformanceEntryGetStartTimeMethodInfo,
    dOMPerformanceEntryGetStartTime         ,




 -- * Properties
-- ** duration #attr:duration#
    DOMPerformanceEntryDurationPropertyInfo ,
    dOMPerformanceEntryDuration             ,
    getDOMPerformanceEntryDuration          ,


-- ** entryType #attr:entryType#
    DOMPerformanceEntryEntryTypePropertyInfo,
    dOMPerformanceEntryEntryType            ,
    getDOMPerformanceEntryEntryType         ,


-- ** name #attr:name#
    DOMPerformanceEntryNamePropertyInfo     ,
    dOMPerformanceEntryName                 ,
    getDOMPerformanceEntryName              ,


-- ** startTime #attr:startTime#
    DOMPerformanceEntryStartTimePropertyInfo,
    dOMPerformanceEntryStartTime            ,
    getDOMPerformanceEntryStartTime         ,




    ) 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 DOMPerformanceEntry = DOMPerformanceEntry (ManagedPtr DOMPerformanceEntry)
foreign import ccall "webkit_dom_performance_entry_get_type"
    c_webkit_dom_performance_entry_get_type :: IO GType

instance GObject DOMPerformanceEntry where
    gobjectType _ = c_webkit_dom_performance_entry_get_type
    

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

toDOMPerformanceEntry :: IsDOMPerformanceEntry o => o -> IO DOMPerformanceEntry
toDOMPerformanceEntry = unsafeCastTo DOMPerformanceEntry

noDOMPerformanceEntry :: Maybe DOMPerformanceEntry
noDOMPerformanceEntry = Nothing

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

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

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

-- VVV Prop "duration"
   -- Type: TBasicType TDouble
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getDOMPerformanceEntryDuration :: (MonadIO m, IsDOMPerformanceEntry o) => o -> m Double
getDOMPerformanceEntryDuration obj = liftIO $ getObjectPropertyDouble obj "duration"

data DOMPerformanceEntryDurationPropertyInfo
instance AttrInfo DOMPerformanceEntryDurationPropertyInfo where
    type AttrAllowedOps DOMPerformanceEntryDurationPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMPerformanceEntryDurationPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMPerformanceEntryDurationPropertyInfo = IsDOMPerformanceEntry
    type AttrGetType DOMPerformanceEntryDurationPropertyInfo = Double
    type AttrLabel DOMPerformanceEntryDurationPropertyInfo = "duration"
    type AttrOrigin DOMPerformanceEntryDurationPropertyInfo = DOMPerformanceEntry
    attrGet _ = getDOMPerformanceEntryDuration
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

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

getDOMPerformanceEntryEntryType :: (MonadIO m, IsDOMPerformanceEntry o) => o -> m (Maybe T.Text)
getDOMPerformanceEntryEntryType obj = liftIO $ getObjectPropertyString obj "entry-type"

data DOMPerformanceEntryEntryTypePropertyInfo
instance AttrInfo DOMPerformanceEntryEntryTypePropertyInfo where
    type AttrAllowedOps DOMPerformanceEntryEntryTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DOMPerformanceEntryEntryTypePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMPerformanceEntryEntryTypePropertyInfo = IsDOMPerformanceEntry
    type AttrGetType DOMPerformanceEntryEntryTypePropertyInfo = (Maybe T.Text)
    type AttrLabel DOMPerformanceEntryEntryTypePropertyInfo = "entry-type"
    type AttrOrigin DOMPerformanceEntryEntryTypePropertyInfo = DOMPerformanceEntry
    attrGet _ = getDOMPerformanceEntryEntryType
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

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

getDOMPerformanceEntryName :: (MonadIO m, IsDOMPerformanceEntry o) => o -> m (Maybe T.Text)
getDOMPerformanceEntryName obj = liftIO $ getObjectPropertyString obj "name"

data DOMPerformanceEntryNamePropertyInfo
instance AttrInfo DOMPerformanceEntryNamePropertyInfo where
    type AttrAllowedOps DOMPerformanceEntryNamePropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DOMPerformanceEntryNamePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMPerformanceEntryNamePropertyInfo = IsDOMPerformanceEntry
    type AttrGetType DOMPerformanceEntryNamePropertyInfo = (Maybe T.Text)
    type AttrLabel DOMPerformanceEntryNamePropertyInfo = "name"
    type AttrOrigin DOMPerformanceEntryNamePropertyInfo = DOMPerformanceEntry
    attrGet _ = getDOMPerformanceEntryName
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

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

getDOMPerformanceEntryStartTime :: (MonadIO m, IsDOMPerformanceEntry o) => o -> m Double
getDOMPerformanceEntryStartTime obj = liftIO $ getObjectPropertyDouble obj "start-time"

data DOMPerformanceEntryStartTimePropertyInfo
instance AttrInfo DOMPerformanceEntryStartTimePropertyInfo where
    type AttrAllowedOps DOMPerformanceEntryStartTimePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMPerformanceEntryStartTimePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMPerformanceEntryStartTimePropertyInfo = IsDOMPerformanceEntry
    type AttrGetType DOMPerformanceEntryStartTimePropertyInfo = Double
    type AttrLabel DOMPerformanceEntryStartTimePropertyInfo = "start-time"
    type AttrOrigin DOMPerformanceEntryStartTimePropertyInfo = DOMPerformanceEntry
    attrGet _ = getDOMPerformanceEntryStartTime
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList DOMPerformanceEntry
type instance O.AttributeList DOMPerformanceEntry = DOMPerformanceEntryAttributeList
type DOMPerformanceEntryAttributeList = ('[ '("coreObject", WebKit.DOMObject.DOMObjectCoreObjectPropertyInfo), '("duration", DOMPerformanceEntryDurationPropertyInfo), '("entryType", DOMPerformanceEntryEntryTypePropertyInfo), '("name", DOMPerformanceEntryNamePropertyInfo), '("startTime", DOMPerformanceEntryStartTimePropertyInfo)] :: [(Symbol, *)])

dOMPerformanceEntryDuration :: AttrLabelProxy "duration"
dOMPerformanceEntryDuration = AttrLabelProxy

dOMPerformanceEntryEntryType :: AttrLabelProxy "entryType"
dOMPerformanceEntryEntryType = AttrLabelProxy

dOMPerformanceEntryName :: AttrLabelProxy "name"
dOMPerformanceEntryName = AttrLabelProxy

dOMPerformanceEntryStartTime :: AttrLabelProxy "startTime"
dOMPerformanceEntryStartTime = AttrLabelProxy

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

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

foreign import ccall "webkit_dom_performance_entry_get_duration" webkit_dom_performance_entry_get_duration :: 
    Ptr DOMPerformanceEntry ->              -- self : TInterface (Name {namespace = "WebKit", name = "DOMPerformanceEntry"})
    IO CDouble

{- |
/No description available in the introspection data./
-}
dOMPerformanceEntryGetDuration ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMPerformanceEntry a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMPerformanceEntry.DOMPerformanceEntry' -}
    -> m Double
    {- ^ __Returns:__ A @/gdouble/@ -}
dOMPerformanceEntryGetDuration self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_performance_entry_get_duration self'
    let result' = realToFrac result
    touchManagedPtr self
    return result'

data DOMPerformanceEntryGetDurationMethodInfo
instance (signature ~ (m Double), MonadIO m, IsDOMPerformanceEntry a) => O.MethodInfo DOMPerformanceEntryGetDurationMethodInfo a signature where
    overloadedMethod _ = dOMPerformanceEntryGetDuration

-- method DOMPerformanceEntry::get_entry_type
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit", name = "DOMPerformanceEntry"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMPerformanceEntry", 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 "webkit_dom_performance_entry_get_entry_type" webkit_dom_performance_entry_get_entry_type :: 
    Ptr DOMPerformanceEntry ->              -- self : TInterface (Name {namespace = "WebKit", name = "DOMPerformanceEntry"})
    IO CString

{- |
/No description available in the introspection data./
-}
dOMPerformanceEntryGetEntryType ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMPerformanceEntry a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMPerformanceEntry.DOMPerformanceEntry' -}
    -> m T.Text
    {- ^ __Returns:__ A @/gchar/@ -}
dOMPerformanceEntryGetEntryType self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_performance_entry_get_entry_type self'
    checkUnexpectedReturnNULL "dOMPerformanceEntryGetEntryType" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr self
    return result'

data DOMPerformanceEntryGetEntryTypeMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDOMPerformanceEntry a) => O.MethodInfo DOMPerformanceEntryGetEntryTypeMethodInfo a signature where
    overloadedMethod _ = dOMPerformanceEntryGetEntryType

-- method DOMPerformanceEntry::get_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit", name = "DOMPerformanceEntry"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMPerformanceEntry", 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 "webkit_dom_performance_entry_get_name" webkit_dom_performance_entry_get_name :: 
    Ptr DOMPerformanceEntry ->              -- self : TInterface (Name {namespace = "WebKit", name = "DOMPerformanceEntry"})
    IO CString

{- |
/No description available in the introspection data./
-}
dOMPerformanceEntryGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMPerformanceEntry a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMPerformanceEntry.DOMPerformanceEntry' -}
    -> m T.Text
    {- ^ __Returns:__ A @/gchar/@ -}
dOMPerformanceEntryGetName self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_performance_entry_get_name self'
    checkUnexpectedReturnNULL "dOMPerformanceEntryGetName" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr self
    return result'

data DOMPerformanceEntryGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDOMPerformanceEntry a) => O.MethodInfo DOMPerformanceEntryGetNameMethodInfo a signature where
    overloadedMethod _ = dOMPerformanceEntryGetName

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

foreign import ccall "webkit_dom_performance_entry_get_start_time" webkit_dom_performance_entry_get_start_time :: 
    Ptr DOMPerformanceEntry ->              -- self : TInterface (Name {namespace = "WebKit", name = "DOMPerformanceEntry"})
    IO CDouble

{- |
/No description available in the introspection data./
-}
dOMPerformanceEntryGetStartTime ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMPerformanceEntry a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMPerformanceEntry.DOMPerformanceEntry' -}
    -> m Double
    {- ^ __Returns:__ A @/gdouble/@ -}
dOMPerformanceEntryGetStartTime self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_performance_entry_get_start_time self'
    let result' = realToFrac result
    touchManagedPtr self
    return result'

data DOMPerformanceEntryGetStartTimeMethodInfo
instance (signature ~ (m Double), MonadIO m, IsDOMPerformanceEntry a) => O.MethodInfo DOMPerformanceEntryGetStartTimeMethodInfo a signature where
    overloadedMethod _ = dOMPerformanceEntryGetStartTime