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

-- * Exported types
    DOMDOMPlugin(..)                        ,
    DOMDOMPluginK                           ,
    toDOMDOMPlugin                          ,
    noDOMDOMPlugin                          ,


 -- * Methods
-- ** dOMDOMPluginGetDescription
    dOMDOMPluginGetDescription              ,


-- ** dOMDOMPluginGetFilename
    dOMDOMPluginGetFilename                 ,


-- ** dOMDOMPluginGetLength
    dOMDOMPluginGetLength                   ,


-- ** dOMDOMPluginGetName
    dOMDOMPluginGetName                     ,


-- ** dOMDOMPluginItem
    dOMDOMPluginItem                        ,


-- ** dOMDOMPluginNamedItem
    dOMDOMPluginNamedItem                   ,




 -- * Properties
-- ** Description
    DOMDOMPluginDescriptionPropertyInfo     ,
    getDOMDOMPluginDescription              ,


-- ** Filename
    DOMDOMPluginFilenamePropertyInfo        ,
    getDOMDOMPluginFilename                 ,


-- ** Length
    DOMDOMPluginLengthPropertyInfo          ,
    getDOMDOMPluginLength                   ,


-- ** Name
    DOMDOMPluginNamePropertyInfo            ,
    getDOMDOMPluginName                     ,




    ) 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 DOMDOMPlugin = DOMDOMPlugin (ForeignPtr DOMDOMPlugin)
foreign import ccall "webkit_dom_dom_plugin_get_type"
    c_webkit_dom_dom_plugin_get_type :: IO GType

type instance ParentTypes DOMDOMPlugin = DOMDOMPluginParentTypes
type DOMDOMPluginParentTypes = '[DOMObject, GObject.Object]

instance GObject DOMDOMPlugin where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_webkit_dom_dom_plugin_get_type
    

class GObject o => DOMDOMPluginK o
instance (GObject o, IsDescendantOf DOMDOMPlugin o) => DOMDOMPluginK o

toDOMDOMPlugin :: DOMDOMPluginK o => o -> IO DOMDOMPlugin
toDOMDOMPlugin = unsafeCastTo DOMDOMPlugin

noDOMDOMPlugin :: Maybe DOMDOMPlugin
noDOMDOMPlugin = Nothing

-- VVV Prop "description"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]

getDOMDOMPluginDescription :: (MonadIO m, DOMDOMPluginK o) => o -> m T.Text
getDOMDOMPluginDescription obj = liftIO $ getObjectPropertyString obj "description"

data DOMDOMPluginDescriptionPropertyInfo
instance AttrInfo DOMDOMPluginDescriptionPropertyInfo where
    type AttrAllowedOps DOMDOMPluginDescriptionPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMDOMPluginDescriptionPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMDOMPluginDescriptionPropertyInfo = DOMDOMPluginK
    type AttrGetType DOMDOMPluginDescriptionPropertyInfo = T.Text
    type AttrLabel DOMDOMPluginDescriptionPropertyInfo = "DOMDOMPlugin::description"
    attrGet _ = getDOMDOMPluginDescription
    attrSet _ = undefined
    attrConstruct _ = undefined

-- VVV Prop "filename"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]

getDOMDOMPluginFilename :: (MonadIO m, DOMDOMPluginK o) => o -> m T.Text
getDOMDOMPluginFilename obj = liftIO $ getObjectPropertyString obj "filename"

data DOMDOMPluginFilenamePropertyInfo
instance AttrInfo DOMDOMPluginFilenamePropertyInfo where
    type AttrAllowedOps DOMDOMPluginFilenamePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMDOMPluginFilenamePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMDOMPluginFilenamePropertyInfo = DOMDOMPluginK
    type AttrGetType DOMDOMPluginFilenamePropertyInfo = T.Text
    type AttrLabel DOMDOMPluginFilenamePropertyInfo = "DOMDOMPlugin::filename"
    attrGet _ = getDOMDOMPluginFilename
    attrSet _ = undefined
    attrConstruct _ = undefined

-- VVV Prop "length"
   -- Type: TBasicType TUInt64
   -- Flags: [PropertyReadable]

getDOMDOMPluginLength :: (MonadIO m, DOMDOMPluginK o) => o -> m Word64
getDOMDOMPluginLength obj = liftIO $ getObjectPropertyUInt64 obj "length"

data DOMDOMPluginLengthPropertyInfo
instance AttrInfo DOMDOMPluginLengthPropertyInfo where
    type AttrAllowedOps DOMDOMPluginLengthPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMDOMPluginLengthPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMDOMPluginLengthPropertyInfo = DOMDOMPluginK
    type AttrGetType DOMDOMPluginLengthPropertyInfo = Word64
    type AttrLabel DOMDOMPluginLengthPropertyInfo = "DOMDOMPlugin::length"
    attrGet _ = getDOMDOMPluginLength
    attrSet _ = undefined
    attrConstruct _ = undefined

-- VVV Prop "name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]

getDOMDOMPluginName :: (MonadIO m, DOMDOMPluginK o) => o -> m T.Text
getDOMDOMPluginName obj = liftIO $ getObjectPropertyString obj "name"

data DOMDOMPluginNamePropertyInfo
instance AttrInfo DOMDOMPluginNamePropertyInfo where
    type AttrAllowedOps DOMDOMPluginNamePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMDOMPluginNamePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMDOMPluginNamePropertyInfo = DOMDOMPluginK
    type AttrGetType DOMDOMPluginNamePropertyInfo = T.Text
    type AttrLabel DOMDOMPluginNamePropertyInfo = "DOMDOMPlugin::name"
    attrGet _ = getDOMDOMPluginName
    attrSet _ = undefined
    attrConstruct _ = undefined

type instance AttributeList DOMDOMPlugin = DOMDOMPluginAttributeList
type DOMDOMPluginAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo), '("description", DOMDOMPluginDescriptionPropertyInfo), '("filename", DOMDOMPluginFilenamePropertyInfo), '("length", DOMDOMPluginLengthPropertyInfo), '("name", DOMDOMPluginNamePropertyInfo)] :: [(Symbol, *)])

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

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

foreign import ccall "webkit_dom_dom_plugin_get_description" webkit_dom_dom_plugin_get_description :: 
    Ptr DOMDOMPlugin ->                     -- _obj : TInterface "WebKit" "DOMDOMPlugin"
    IO CString


dOMDOMPluginGetDescription ::
    (MonadIO m, DOMDOMPluginK a) =>
    a ->                                    -- _obj
    m T.Text
dOMDOMPluginGetDescription _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_dom_plugin_get_description _obj'
    checkUnexpectedReturnNULL "webkit_dom_dom_plugin_get_description" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr _obj
    return result'

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

foreign import ccall "webkit_dom_dom_plugin_get_filename" webkit_dom_dom_plugin_get_filename :: 
    Ptr DOMDOMPlugin ->                     -- _obj : TInterface "WebKit" "DOMDOMPlugin"
    IO CString


dOMDOMPluginGetFilename ::
    (MonadIO m, DOMDOMPluginK a) =>
    a ->                                    -- _obj
    m T.Text
dOMDOMPluginGetFilename _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_dom_plugin_get_filename _obj'
    checkUnexpectedReturnNULL "webkit_dom_dom_plugin_get_filename" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr _obj
    return result'

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

foreign import ccall "webkit_dom_dom_plugin_get_length" webkit_dom_dom_plugin_get_length :: 
    Ptr DOMDOMPlugin ->                     -- _obj : TInterface "WebKit" "DOMDOMPlugin"
    IO Word64


dOMDOMPluginGetLength ::
    (MonadIO m, DOMDOMPluginK a) =>
    a ->                                    -- _obj
    m Word64
dOMDOMPluginGetLength _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_dom_plugin_get_length _obj'
    touchManagedPtr _obj
    return result

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

foreign import ccall "webkit_dom_dom_plugin_get_name" webkit_dom_dom_plugin_get_name :: 
    Ptr DOMDOMPlugin ->                     -- _obj : TInterface "WebKit" "DOMDOMPlugin"
    IO CString


dOMDOMPluginGetName ::
    (MonadIO m, DOMDOMPluginK a) =>
    a ->                                    -- _obj
    m T.Text
dOMDOMPluginGetName _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_dom_plugin_get_name _obj'
    checkUnexpectedReturnNULL "webkit_dom_dom_plugin_get_name" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr _obj
    return result'

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

foreign import ccall "webkit_dom_dom_plugin_item" webkit_dom_dom_plugin_item :: 
    Ptr DOMDOMPlugin ->                     -- _obj : TInterface "WebKit" "DOMDOMPlugin"
    Word64 ->                               -- index : TBasicType TUInt64
    IO (Ptr DOMDOMMimeType)


dOMDOMPluginItem ::
    (MonadIO m, DOMDOMPluginK a) =>
    a ->                                    -- _obj
    Word64 ->                               -- index
    m DOMDOMMimeType
dOMDOMPluginItem _obj index = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_dom_plugin_item _obj' index
    checkUnexpectedReturnNULL "webkit_dom_dom_plugin_item" result
    result' <- (wrapObject DOMDOMMimeType) result
    touchManagedPtr _obj
    return result'

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

foreign import ccall "webkit_dom_dom_plugin_named_item" webkit_dom_dom_plugin_named_item :: 
    Ptr DOMDOMPlugin ->                     -- _obj : TInterface "WebKit" "DOMDOMPlugin"
    CString ->                              -- name : TBasicType TUTF8
    IO (Ptr DOMDOMMimeType)


dOMDOMPluginNamedItem ::
    (MonadIO m, DOMDOMPluginK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- name
    m DOMDOMMimeType
dOMDOMPluginNamedItem _obj name = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    name' <- textToCString name
    result <- webkit_dom_dom_plugin_named_item _obj' name'
    checkUnexpectedReturnNULL "webkit_dom_dom_plugin_named_item" result
    result' <- (wrapObject DOMDOMMimeType) result
    touchManagedPtr _obj
    freeMem name'
    return result'