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

-- * Exported types
    DOMMediaError(..)                       ,
    IsDOMMediaError                         ,
    toDOMMediaError                         ,
    noDOMMediaError                         ,


 -- * Methods
-- ** getCode #method:getCode#
    DOMMediaErrorGetCodeMethodInfo          ,
    dOMMediaErrorGetCode                    ,




 -- * Properties
-- ** code #attr:code#
    DOMMediaErrorCodePropertyInfo           ,
    dOMMediaErrorCode                       ,
    getDOMMediaErrorCode                    ,




    ) 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 DOMMediaError = DOMMediaError (ManagedPtr DOMMediaError)
foreign import ccall "webkit_dom_media_error_get_type"
    c_webkit_dom_media_error_get_type :: IO GType

instance GObject DOMMediaError where
    gobjectType _ = c_webkit_dom_media_error_get_type
    

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

toDOMMediaError :: IsDOMMediaError o => o -> IO DOMMediaError
toDOMMediaError = unsafeCastTo DOMMediaError

noDOMMediaError :: Maybe DOMMediaError
noDOMMediaError = Nothing

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

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

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

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

getDOMMediaErrorCode :: (MonadIO m, IsDOMMediaError o) => o -> m Word32
getDOMMediaErrorCode obj = liftIO $ getObjectPropertyUInt32 obj "code"

data DOMMediaErrorCodePropertyInfo
instance AttrInfo DOMMediaErrorCodePropertyInfo where
    type AttrAllowedOps DOMMediaErrorCodePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMMediaErrorCodePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMMediaErrorCodePropertyInfo = IsDOMMediaError
    type AttrGetType DOMMediaErrorCodePropertyInfo = Word32
    type AttrLabel DOMMediaErrorCodePropertyInfo = "code"
    type AttrOrigin DOMMediaErrorCodePropertyInfo = DOMMediaError
    attrGet _ = getDOMMediaErrorCode
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList DOMMediaError
type instance O.AttributeList DOMMediaError = DOMMediaErrorAttributeList
type DOMMediaErrorAttributeList = ('[ '("code", DOMMediaErrorCodePropertyInfo), '("coreObject", WebKit.DOMObject.DOMObjectCoreObjectPropertyInfo)] :: [(Symbol, *)])

dOMMediaErrorCode :: AttrLabelProxy "code"
dOMMediaErrorCode = AttrLabelProxy

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

-- method DOMMediaError::get_code
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit", name = "DOMMediaError"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMMediaError", 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_media_error_get_code" webkit_dom_media_error_get_code :: 
    Ptr DOMMediaError ->                    -- self : TInterface (Name {namespace = "WebKit", name = "DOMMediaError"})
    IO Word16

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

data DOMMediaErrorGetCodeMethodInfo
instance (signature ~ (m Word16), MonadIO m, IsDOMMediaError a) => O.MethodInfo DOMMediaErrorGetCodeMethodInfo a signature where
    overloadedMethod _ = dOMMediaErrorGetCode