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

-- * Exported types
    DOMDOMPluginArray(..)                   ,
    IsDOMDOMPluginArray                     ,
    toDOMDOMPluginArray                     ,
    noDOMDOMPluginArray                     ,


 -- * Methods
-- ** getLength #method:getLength#
    DOMDOMPluginArrayGetLengthMethodInfo    ,
    dOMDOMPluginArrayGetLength              ,


-- ** item #method:item#
    DOMDOMPluginArrayItemMethodInfo         ,
    dOMDOMPluginArrayItem                   ,


-- ** namedItem #method:namedItem#
    DOMDOMPluginArrayNamedItemMethodInfo    ,
    dOMDOMPluginArrayNamedItem              ,


-- ** refresh #method:refresh#
    DOMDOMPluginArrayRefreshMethodInfo      ,
    dOMDOMPluginArrayRefresh                ,




 -- * Properties
-- ** length #attr:length#
    DOMDOMPluginArrayLengthPropertyInfo     ,
    dOMDOMPluginArrayLength                 ,
    getDOMDOMPluginArrayLength              ,




    ) 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.DOMDOMPlugin as WebKit.DOMDOMPlugin
import {-# SOURCE #-} qualified GI.WebKit.Objects.DOMObject as WebKit.DOMObject

newtype DOMDOMPluginArray = DOMDOMPluginArray (ManagedPtr DOMDOMPluginArray)
foreign import ccall "webkit_dom_dom_plugin_array_get_type"
    c_webkit_dom_dom_plugin_array_get_type :: IO GType

instance GObject DOMDOMPluginArray where
    gobjectType _ = c_webkit_dom_dom_plugin_array_get_type
    

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

toDOMDOMPluginArray :: IsDOMDOMPluginArray o => o -> IO DOMDOMPluginArray
toDOMDOMPluginArray = unsafeCastTo DOMDOMPluginArray

noDOMDOMPluginArray :: Maybe DOMDOMPluginArray
noDOMDOMPluginArray = Nothing

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

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

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

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

getDOMDOMPluginArrayLength :: (MonadIO m, IsDOMDOMPluginArray o) => o -> m CULong
getDOMDOMPluginArrayLength obj = liftIO $ getObjectPropertyULong obj "length"

data DOMDOMPluginArrayLengthPropertyInfo
instance AttrInfo DOMDOMPluginArrayLengthPropertyInfo where
    type AttrAllowedOps DOMDOMPluginArrayLengthPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMDOMPluginArrayLengthPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMDOMPluginArrayLengthPropertyInfo = IsDOMDOMPluginArray
    type AttrGetType DOMDOMPluginArrayLengthPropertyInfo = CULong
    type AttrLabel DOMDOMPluginArrayLengthPropertyInfo = "length"
    type AttrOrigin DOMDOMPluginArrayLengthPropertyInfo = DOMDOMPluginArray
    attrGet _ = getDOMDOMPluginArrayLength
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList DOMDOMPluginArray
type instance O.AttributeList DOMDOMPluginArray = DOMDOMPluginArrayAttributeList
type DOMDOMPluginArrayAttributeList = ('[ '("coreObject", WebKit.DOMObject.DOMObjectCoreObjectPropertyInfo), '("length", DOMDOMPluginArrayLengthPropertyInfo)] :: [(Symbol, *)])

dOMDOMPluginArrayLength :: AttrLabelProxy "length"
dOMDOMPluginArrayLength = AttrLabelProxy

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

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

foreign import ccall "webkit_dom_dom_plugin_array_get_length" webkit_dom_dom_plugin_array_get_length :: 
    Ptr DOMDOMPluginArray ->                -- self : TInterface (Name {namespace = "WebKit", name = "DOMDOMPluginArray"})
    IO CULong

{- |
/No description available in the introspection data./
-}
dOMDOMPluginArrayGetLength ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMPluginArray a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMDOMPluginArray.DOMDOMPluginArray' -}
    -> m CULong
    {- ^ __Returns:__ A @/gulong/@ -}
dOMDOMPluginArrayGetLength self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_dom_plugin_array_get_length self'
    touchManagedPtr self
    return result

data DOMDOMPluginArrayGetLengthMethodInfo
instance (signature ~ (m CULong), MonadIO m, IsDOMDOMPluginArray a) => O.MethodInfo DOMDOMPluginArrayGetLengthMethodInfo a signature where
    overloadedMethod _ = dOMDOMPluginArrayGetLength

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

foreign import ccall "webkit_dom_dom_plugin_array_item" webkit_dom_dom_plugin_array_item :: 
    Ptr DOMDOMPluginArray ->                -- self : TInterface (Name {namespace = "WebKit", name = "DOMDOMPluginArray"})
    CULong ->                               -- index : TBasicType TULong
    IO (Ptr WebKit.DOMDOMPlugin.DOMDOMPlugin)

{- |
/No description available in the introspection data./
-}
dOMDOMPluginArrayItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMPluginArray a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMDOMPluginArray.DOMDOMPluginArray' -}
    -> CULong
    {- ^ /@index@/: A @/gulong/@ -}
    -> m WebKit.DOMDOMPlugin.DOMDOMPlugin
    {- ^ __Returns:__ A 'GI.WebKit.Objects.DOMDOMPlugin.DOMDOMPlugin' -}
dOMDOMPluginArrayItem self index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_dom_plugin_array_item self' index
    checkUnexpectedReturnNULL "dOMDOMPluginArrayItem" result
    result' <- (wrapObject WebKit.DOMDOMPlugin.DOMDOMPlugin) result
    touchManagedPtr self
    return result'

data DOMDOMPluginArrayItemMethodInfo
instance (signature ~ (CULong -> m WebKit.DOMDOMPlugin.DOMDOMPlugin), MonadIO m, IsDOMDOMPluginArray a) => O.MethodInfo DOMDOMPluginArrayItemMethodInfo a signature where
    overloadedMethod _ = dOMDOMPluginArrayItem

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

foreign import ccall "webkit_dom_dom_plugin_array_named_item" webkit_dom_dom_plugin_array_named_item :: 
    Ptr DOMDOMPluginArray ->                -- self : TInterface (Name {namespace = "WebKit", name = "DOMDOMPluginArray"})
    CString ->                              -- name : TBasicType TUTF8
    IO (Ptr WebKit.DOMDOMPlugin.DOMDOMPlugin)

{- |
/No description available in the introspection data./
-}
dOMDOMPluginArrayNamedItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMPluginArray a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMDOMPluginArray.DOMDOMPluginArray' -}
    -> T.Text
    {- ^ /@name@/: A @/gchar/@ -}
    -> m WebKit.DOMDOMPlugin.DOMDOMPlugin
    {- ^ __Returns:__ A 'GI.WebKit.Objects.DOMDOMPlugin.DOMDOMPlugin' -}
dOMDOMPluginArrayNamedItem self name = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    name' <- textToCString name
    result <- webkit_dom_dom_plugin_array_named_item self' name'
    checkUnexpectedReturnNULL "dOMDOMPluginArrayNamedItem" result
    result' <- (wrapObject WebKit.DOMDOMPlugin.DOMDOMPlugin) result
    touchManagedPtr self
    freeMem name'
    return result'

data DOMDOMPluginArrayNamedItemMethodInfo
instance (signature ~ (T.Text -> m WebKit.DOMDOMPlugin.DOMDOMPlugin), MonadIO m, IsDOMDOMPluginArray a) => O.MethodInfo DOMDOMPluginArrayNamedItemMethodInfo a signature where
    overloadedMethod _ = dOMDOMPluginArrayNamedItem

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

foreign import ccall "webkit_dom_dom_plugin_array_refresh" webkit_dom_dom_plugin_array_refresh :: 
    Ptr DOMDOMPluginArray ->                -- self : TInterface (Name {namespace = "WebKit", name = "DOMDOMPluginArray"})
    CInt ->                                 -- reload : TBasicType TBoolean
    IO ()

{- |
/No description available in the introspection data./
-}
dOMDOMPluginArrayRefresh ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMPluginArray a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMDOMPluginArray.DOMDOMPluginArray' -}
    -> Bool
    {- ^ /@reload@/: A 'Bool' -}
    -> m ()
dOMDOMPluginArrayRefresh self reload = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let reload' = (fromIntegral . fromEnum) reload
    webkit_dom_dom_plugin_array_refresh self' reload'
    touchManagedPtr self
    return ()

data DOMDOMPluginArrayRefreshMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsDOMDOMPluginArray a) => O.MethodInfo DOMDOMPluginArrayRefreshMethodInfo a signature where
    overloadedMethod _ = dOMDOMPluginArrayRefresh