{- |
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(..)                       ,
    DOMMediaErrorK                          ,
    toDOMMediaError                         ,
    noDOMMediaError                         ,


 -- * Methods
-- ** dOMMediaErrorGetCode
    dOMMediaErrorGetCode                    ,




 -- * Properties
-- ** Code
    DOMMediaErrorCodePropertyInfo           ,
    getDOMMediaErrorCode                    ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.WebKit.Types
import GI.WebKit.Callbacks
import qualified GI.GObject as GObject

newtype DOMMediaError = DOMMediaError (ForeignPtr DOMMediaError)
foreign import ccall "webkit_dom_media_error_get_type"
    c_webkit_dom_media_error_get_type :: IO GType

type instance ParentTypes DOMMediaError = DOMMediaErrorParentTypes
type DOMMediaErrorParentTypes = '[DOMObject, GObject.Object]

instance GObject DOMMediaError where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_webkit_dom_media_error_get_type
    

class GObject o => DOMMediaErrorK o
instance (GObject o, IsDescendantOf DOMMediaError o) => DOMMediaErrorK o

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

noDOMMediaError :: Maybe DOMMediaError
noDOMMediaError = Nothing

-- VVV Prop "code"
   -- Type: TBasicType TUInt32
   -- Flags: [PropertyReadable]

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

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

type instance AttributeList DOMMediaError = DOMMediaErrorAttributeList
type DOMMediaErrorAttributeList = ('[ '("code", DOMMediaErrorCodePropertyInfo), '("core-object", DOMObjectCoreObjectPropertyInfo)] :: [(Symbol, *)])

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

-- method DOMMediaError::get_code
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMMediaError", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMMediaError", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUInt16
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_media_error_get_code" webkit_dom_media_error_get_code :: 
    Ptr DOMMediaError ->                    -- _obj : TInterface "WebKit" "DOMMediaError"
    IO Word16


dOMMediaErrorGetCode ::
    (MonadIO m, DOMMediaErrorK a) =>
    a ->                                    -- _obj
    m Word16
dOMMediaErrorGetCode _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_media_error_get_code _obj'
    touchManagedPtr _obj
    return result