{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)

/No description available in the introspection data./
-}

#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
       && !defined(__HADDOCK_VERSION__))

module GI.WebKit2WebExtension.Objects.DOMDOMTokenList
    (

-- * Exported types
    DOMDOMTokenList(..)                     ,
    IsDOMDOMTokenList                       ,
    toDOMDOMTokenList                       ,
    noDOMDOMTokenList                       ,


 -- * Methods
-- ** contains #method:contains#

#if ENABLE_OVERLOADING
    DOMDOMTokenListContainsMethodInfo       ,
#endif
    dOMDOMTokenListContains                 ,


-- ** getLength #method:getLength#

#if ENABLE_OVERLOADING
    DOMDOMTokenListGetLengthMethodInfo      ,
#endif
    dOMDOMTokenListGetLength                ,


-- ** getValue #method:getValue#

#if ENABLE_OVERLOADING
    DOMDOMTokenListGetValueMethodInfo       ,
#endif
    dOMDOMTokenListGetValue                 ,


-- ** item #method:item#

#if ENABLE_OVERLOADING
    DOMDOMTokenListItemMethodInfo           ,
#endif
    dOMDOMTokenListItem                     ,


-- ** replace #method:replace#

#if ENABLE_OVERLOADING
    DOMDOMTokenListReplaceMethodInfo        ,
#endif
    dOMDOMTokenListReplace                  ,


-- ** setValue #method:setValue#

#if ENABLE_OVERLOADING
    DOMDOMTokenListSetValueMethodInfo       ,
#endif
    dOMDOMTokenListSetValue                 ,


-- ** toggle #method:toggle#

#if ENABLE_OVERLOADING
    DOMDOMTokenListToggleMethodInfo         ,
#endif
    dOMDOMTokenListToggle                   ,




 -- * Properties
-- ** length #attr:length#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMDOMTokenListLengthPropertyInfo       ,
#endif
#if ENABLE_OVERLOADING
    dOMDOMTokenListLength                   ,
#endif
    getDOMDOMTokenListLength                ,


-- ** value #attr:value#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMDOMTokenListValuePropertyInfo        ,
#endif
    constructDOMDOMTokenListValue           ,
#if ENABLE_OVERLOADING
    dOMDOMTokenListValue                    ,
#endif
    getDOMDOMTokenListValue                 ,
    setDOMDOMTokenListValue                 ,




    ) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
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 GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMObject as WebKit2WebExtension.DOMObject

-- | Memory-managed wrapper type.
newtype DOMDOMTokenList = DOMDOMTokenList (ManagedPtr DOMDOMTokenList)
foreign import ccall "webkit_dom_dom_token_list_get_type"
    c_webkit_dom_dom_token_list_get_type :: IO GType

instance GObject DOMDOMTokenList where
    gobjectType = c_webkit_dom_dom_token_list_get_type


-- | Type class for types which can be safely cast to `DOMDOMTokenList`, for instance with `toDOMDOMTokenList`.
class (GObject o, O.IsDescendantOf DOMDOMTokenList o) => IsDOMDOMTokenList o
instance (GObject o, O.IsDescendantOf DOMDOMTokenList o) => IsDOMDOMTokenList o

instance O.HasParentTypes DOMDOMTokenList
type instance O.ParentTypes DOMDOMTokenList = '[WebKit2WebExtension.DOMObject.DOMObject, GObject.Object.Object]

-- | Cast to `DOMDOMTokenList`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toDOMDOMTokenList :: (MonadIO m, IsDOMDOMTokenList o) => o -> m DOMDOMTokenList
toDOMDOMTokenList = liftIO . unsafeCastTo DOMDOMTokenList

-- | A convenience alias for `Nothing` :: `Maybe` `DOMDOMTokenList`.
noDOMDOMTokenList :: Maybe DOMDOMTokenList
noDOMDOMTokenList = Nothing

#if ENABLE_OVERLOADING
type family ResolveDOMDOMTokenListMethod (t :: Symbol) (o :: *) :: * where
    ResolveDOMDOMTokenListMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDOMDOMTokenListMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDOMDOMTokenListMethod "contains" o = DOMDOMTokenListContainsMethodInfo
    ResolveDOMDOMTokenListMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDOMDOMTokenListMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDOMDOMTokenListMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDOMDOMTokenListMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDOMDOMTokenListMethod "item" o = DOMDOMTokenListItemMethodInfo
    ResolveDOMDOMTokenListMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDOMDOMTokenListMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDOMDOMTokenListMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDOMDOMTokenListMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDOMDOMTokenListMethod "replace" o = DOMDOMTokenListReplaceMethodInfo
    ResolveDOMDOMTokenListMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDOMDOMTokenListMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDOMDOMTokenListMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDOMDOMTokenListMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDOMDOMTokenListMethod "toggle" o = DOMDOMTokenListToggleMethodInfo
    ResolveDOMDOMTokenListMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDOMDOMTokenListMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDOMDOMTokenListMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDOMDOMTokenListMethod "getLength" o = DOMDOMTokenListGetLengthMethodInfo
    ResolveDOMDOMTokenListMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDOMDOMTokenListMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDOMDOMTokenListMethod "getValue" o = DOMDOMTokenListGetValueMethodInfo
    ResolveDOMDOMTokenListMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDOMDOMTokenListMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveDOMDOMTokenListMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDOMDOMTokenListMethod "setValue" o = DOMDOMTokenListSetValueMethodInfo
    ResolveDOMDOMTokenListMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDOMDOMTokenListMethod t DOMDOMTokenList, O.MethodInfo info DOMDOMTokenList p) => OL.IsLabel t (DOMDOMTokenList -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

#endif

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

{- |
Get the value of the “@length@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dOMDOMTokenList #length
@
-}
getDOMDOMTokenListLength :: (MonadIO m, IsDOMDOMTokenList o) => o -> m CULong
getDOMDOMTokenListLength obj = liftIO $ B.Properties.getObjectPropertyULong obj "length"

#if ENABLE_OVERLOADING
data DOMDOMTokenListLengthPropertyInfo
instance AttrInfo DOMDOMTokenListLengthPropertyInfo where
    type AttrAllowedOps DOMDOMTokenListLengthPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMDOMTokenListLengthPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMDOMTokenListLengthPropertyInfo = IsDOMDOMTokenList
    type AttrGetType DOMDOMTokenListLengthPropertyInfo = CULong
    type AttrLabel DOMDOMTokenListLengthPropertyInfo = "length"
    type AttrOrigin DOMDOMTokenListLengthPropertyInfo = DOMDOMTokenList
    attrGet _ = getDOMDOMTokenListLength
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "value"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

{- |
Get the value of the “@value@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dOMDOMTokenList #value
@
-}
getDOMDOMTokenListValue :: (MonadIO m, IsDOMDOMTokenList o) => o -> m (Maybe T.Text)
getDOMDOMTokenListValue obj = liftIO $ B.Properties.getObjectPropertyString obj "value"

{- |
Set the value of the “@value@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' dOMDOMTokenList [ #value 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDOMDOMTokenListValue :: (MonadIO m, IsDOMDOMTokenList o) => o -> T.Text -> m ()
setDOMDOMTokenListValue obj val = liftIO $ B.Properties.setObjectPropertyString obj "value" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@value@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDOMDOMTokenListValue :: (IsDOMDOMTokenList o) => T.Text -> IO (GValueConstruct o)
constructDOMDOMTokenListValue val = B.Properties.constructObjectPropertyString "value" (Just val)

#if ENABLE_OVERLOADING
data DOMDOMTokenListValuePropertyInfo
instance AttrInfo DOMDOMTokenListValuePropertyInfo where
    type AttrAllowedOps DOMDOMTokenListValuePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DOMDOMTokenListValuePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DOMDOMTokenListValuePropertyInfo = IsDOMDOMTokenList
    type AttrGetType DOMDOMTokenListValuePropertyInfo = (Maybe T.Text)
    type AttrLabel DOMDOMTokenListValuePropertyInfo = "value"
    type AttrOrigin DOMDOMTokenListValuePropertyInfo = DOMDOMTokenList
    attrGet _ = getDOMDOMTokenListValue
    attrSet _ = setDOMDOMTokenListValue
    attrConstruct _ = constructDOMDOMTokenListValue
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList DOMDOMTokenList
type instance O.AttributeList DOMDOMTokenList = DOMDOMTokenListAttributeList
type DOMDOMTokenListAttributeList = ('[ '("coreObject", WebKit2WebExtension.DOMObject.DOMObjectCoreObjectPropertyInfo), '("length", DOMDOMTokenListLengthPropertyInfo), '("value", DOMDOMTokenListValuePropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
dOMDOMTokenListLength :: AttrLabelProxy "length"
dOMDOMTokenListLength = AttrLabelProxy

dOMDOMTokenListValue :: AttrLabelProxy "value"
dOMDOMTokenListValue = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
type instance O.SignalList DOMDOMTokenList = DOMDOMTokenListSignalList
type DOMDOMTokenListSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method DOMDOMTokenList::contains
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMDOMTokenList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "token", 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 (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_dom_token_list_contains" webkit_dom_dom_token_list_contains ::
    Ptr DOMDOMTokenList ->                  -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"})
    CString ->                              -- token : TBasicType TUTF8
    IO CInt

{-# DEPRECATED dOMDOMTokenListContains ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./

/Since: 2.16/
-}
dOMDOMTokenListContains ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMTokenList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMDOMTokenList.DOMDOMTokenList' -}
    -> T.Text
    {- ^ /@token@/: A @/gchar/@ -}
    -> m Bool
    {- ^ __Returns:__ A 'Bool' -}
dOMDOMTokenListContains self token = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    token' <- textToCString token
    result <- webkit_dom_dom_token_list_contains self' token'
    let result' = (/= 0) result
    touchManagedPtr self
    freeMem token'
    return result'

#if ENABLE_OVERLOADING
data DOMDOMTokenListContainsMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDOMDOMTokenList a) => O.MethodInfo DOMDOMTokenListContainsMethodInfo a signature where
    overloadedMethod _ = dOMDOMTokenListContains

#endif

-- method DOMDOMTokenList::get_length
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMDOMTokenList", 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_token_list_get_length" webkit_dom_dom_token_list_get_length ::
    Ptr DOMDOMTokenList ->                  -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"})
    IO CULong

{-# DEPRECATED dOMDOMTokenListGetLength ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./

/Since: 2.16/
-}
dOMDOMTokenListGetLength ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMTokenList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMDOMTokenList.DOMDOMTokenList' -}
    -> m CULong
    {- ^ __Returns:__ A @/gulong/@ -}
dOMDOMTokenListGetLength self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_dom_token_list_get_length self'
    touchManagedPtr self
    return result

#if ENABLE_OVERLOADING
data DOMDOMTokenListGetLengthMethodInfo
instance (signature ~ (m CULong), MonadIO m, IsDOMDOMTokenList a) => O.MethodInfo DOMDOMTokenListGetLengthMethodInfo a signature where
    overloadedMethod _ = dOMDOMTokenListGetLength

#endif

-- method DOMDOMTokenList::get_value
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMDOMTokenList", 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_dom_token_list_get_value" webkit_dom_dom_token_list_get_value ::
    Ptr DOMDOMTokenList ->                  -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"})
    IO CString

{-# DEPRECATED dOMDOMTokenListGetValue ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./

/Since: 2.16/
-}
dOMDOMTokenListGetValue ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMTokenList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMDOMTokenList.DOMDOMTokenList' -}
    -> m T.Text
    {- ^ __Returns:__ A @/gchar/@ -}
dOMDOMTokenListGetValue self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_dom_token_list_get_value self'
    checkUnexpectedReturnNULL "dOMDOMTokenListGetValue" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr self
    return result'

#if ENABLE_OVERLOADING
data DOMDOMTokenListGetValueMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDOMDOMTokenList a) => O.MethodInfo DOMDOMTokenListGetValueMethodInfo a signature where
    overloadedMethod _ = dOMDOMTokenListGetValue

#endif

-- method DOMDOMTokenList::item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMDOMTokenList", 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 (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_dom_token_list_item" webkit_dom_dom_token_list_item ::
    Ptr DOMDOMTokenList ->                  -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"})
    CULong ->                               -- index : TBasicType TULong
    IO CString

{-# DEPRECATED dOMDOMTokenListItem ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./

/Since: 2.16/
-}
dOMDOMTokenListItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMTokenList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMDOMTokenList.DOMDOMTokenList' -}
    -> CULong
    {- ^ /@index@/: A @/gulong/@ -}
    -> m T.Text
    {- ^ __Returns:__ A @/gchar/@ -}
dOMDOMTokenListItem self index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_dom_token_list_item self' index
    checkUnexpectedReturnNULL "dOMDOMTokenListItem" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr self
    return result'

#if ENABLE_OVERLOADING
data DOMDOMTokenListItemMethodInfo
instance (signature ~ (CULong -> m T.Text), MonadIO m, IsDOMDOMTokenList a) => O.MethodInfo DOMDOMTokenListItemMethodInfo a signature where
    overloadedMethod _ = dOMDOMTokenListItem

#endif

-- method DOMDOMTokenList::replace
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMDOMTokenList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "token", 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},Arg {argCName = "newToken", 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 : Nothing
-- throws : True
-- Skip return : False

foreign import ccall "webkit_dom_dom_token_list_replace" webkit_dom_dom_token_list_replace ::
    Ptr DOMDOMTokenList ->                  -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"})
    CString ->                              -- token : TBasicType TUTF8
    CString ->                              -- newToken : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO ()

{-# DEPRECATED dOMDOMTokenListReplace ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./

/Since: 2.16/
-}
dOMDOMTokenListReplace ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMTokenList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMDOMTokenList.DOMDOMTokenList' -}
    -> T.Text
    {- ^ /@token@/: A @/gchar/@ -}
    -> T.Text
    {- ^ /@newToken@/: A @/gchar/@ -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dOMDOMTokenListReplace self token newToken = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    token' <- textToCString token
    newToken' <- textToCString newToken
    onException (do
        propagateGError $ webkit_dom_dom_token_list_replace self' token' newToken'
        touchManagedPtr self
        freeMem token'
        freeMem newToken'
        return ()
     ) (do
        freeMem token'
        freeMem newToken'
     )

#if ENABLE_OVERLOADING
data DOMDOMTokenListReplaceMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsDOMDOMTokenList a) => O.MethodInfo DOMDOMTokenListReplaceMethodInfo a signature where
    overloadedMethod _ = dOMDOMTokenListReplace

#endif

-- method DOMDOMTokenList::set_value
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMDOMTokenList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", 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 : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_dom_token_list_set_value" webkit_dom_dom_token_list_set_value ::
    Ptr DOMDOMTokenList ->                  -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"})
    CString ->                              -- value : TBasicType TUTF8
    IO ()

{-# DEPRECATED dOMDOMTokenListSetValue ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./

/Since: 2.16/
-}
dOMDOMTokenListSetValue ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMTokenList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMDOMTokenList.DOMDOMTokenList' -}
    -> T.Text
    {- ^ /@value@/: A @/gchar/@ -}
    -> m ()
dOMDOMTokenListSetValue self value = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    value' <- textToCString value
    webkit_dom_dom_token_list_set_value self' value'
    touchManagedPtr self
    freeMem value'
    return ()

#if ENABLE_OVERLOADING
data DOMDOMTokenListSetValueMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDOMDOMTokenList a) => O.MethodInfo DOMDOMTokenListSetValueMethodInfo a signature where
    overloadedMethod _ = dOMDOMTokenListSetValue

#endif

-- method DOMDOMTokenList::toggle
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMDOMTokenList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "token", 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},Arg {argCName = "force", 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 : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "webkit_dom_dom_token_list_toggle" webkit_dom_dom_token_list_toggle ::
    Ptr DOMDOMTokenList ->                  -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMDOMTokenList"})
    CString ->                              -- token : TBasicType TUTF8
    CInt ->                                 -- force : TBasicType TBoolean
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{-# DEPRECATED dOMDOMTokenListToggle ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./

/Since: 2.16/
-}
dOMDOMTokenListToggle ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMDOMTokenList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMDOMTokenList.DOMDOMTokenList' -}
    -> T.Text
    {- ^ /@token@/: A @/gchar/@ -}
    -> Bool
    {- ^ /@force@/: A 'Bool' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dOMDOMTokenListToggle self token force = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    token' <- textToCString token
    let force' = (fromIntegral . fromEnum) force
    onException (do
        _ <- propagateGError $ webkit_dom_dom_token_list_toggle self' token' force'
        touchManagedPtr self
        freeMem token'
        return ()
     ) (do
        freeMem token'
     )

#if ENABLE_OVERLOADING
data DOMDOMTokenListToggleMethodInfo
instance (signature ~ (T.Text -> Bool -> m ()), MonadIO m, IsDOMDOMTokenList a) => O.MethodInfo DOMDOMTokenListToggleMethodInfo a signature where
    overloadedMethod _ = dOMDOMTokenListToggle

#endif