-- GENERATED by C->Haskell Compiler, version 0.13.13 (gtk2hs branch) "Bin IO", 27 May 2012 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "./Graphics/UI/Gtk/WebKit/DOM/NamedNodeMap.chs" #-}
module Graphics.UI.Gtk.WebKit.DOM.NamedNodeMap(
getNamedItem,
setNamedItem,
removeNamedItem,
item,
getNamedItemNS,
setNamedItemNS,
removeNamedItemNS,
getLength,
NamedNodeMap,
castToNamedNodeMap,
gTypeNamedNodeMap,
NamedNodeMapClass,
toNamedNodeMap,
) where
import Prelude hiding (drop, error, print)
import Data.Typeable (Typeable)
import Foreign.Marshal (maybePeek, maybeWith)
import System.Glib.FFI (maybeNull, withForeignPtr, nullForeignPtr, Ptr, nullPtr, castPtr, Word, Int64, Word64, CChar(..), CInt(..), CUInt(..), CLong(..), CULong(..), CLLong(..), CULLong(..), CShort(..), CUShort(..), CFloat(..), CDouble(..), toBool, fromBool)
import System.Glib.UTFString (GlibString(..), readUTFString)
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Monad.IO.Class (MonadIO(..))
import System.Glib.GError
import Graphics.UI.Gtk.WebKit.DOM.EventTargetClosures
import Graphics.UI.Gtk.WebKit.DOM.EventM
import Graphics.UI.Gtk.WebKit.Types
{-# LINE 27 "./Graphics/UI/Gtk/WebKit/DOM/NamedNodeMap.chs" #-}
import Graphics.UI.Gtk.WebKit.DOM.Enums

 
getNamedItem ::
             (MonadIO m, NamedNodeMapClass self, GlibString string) =>
               self -> string -> m (Maybe Node)
getNamedItem self name
  = liftIO
      (maybeNull (makeNewGObject mkNode)
         (withUTFString name $
            \ namePtr ->
              (\(NamedNodeMap arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_named_node_map_get_named_item argPtr1 arg2)
{-# LINE 39 "./Graphics/UI/Gtk/WebKit/DOM/NamedNodeMap.chs" #-}
                (toNamedNodeMap self)
                namePtr))
 
setNamedItem ::
             (MonadIO m, NamedNodeMapClass self, NodeClass node) =>
               self -> Maybe node -> m (Maybe Node)
setNamedItem self node
  = liftIO
      (maybeNull (makeNewGObject mkNode)
         (propagateGError $
            \ errorPtr_ ->
              (\(NamedNodeMap arg1) (Node arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_named_node_map_set_named_item argPtr1 argPtr2 arg3)
{-# LINE 51 "./Graphics/UI/Gtk/WebKit/DOM/NamedNodeMap.chs" #-}
                (toNamedNodeMap self)
                (maybe (Node nullForeignPtr) toNode node)
                errorPtr_))
 
removeNamedItem ::
                (MonadIO m, NamedNodeMapClass self, GlibString string) =>
                  self -> string -> m (Maybe Node)
removeNamedItem self name
  = liftIO
      (maybeNull (makeNewGObject mkNode)
         (propagateGError $
            \ errorPtr_ ->
              withUTFString name $
                \ namePtr ->
                  (\(NamedNodeMap arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_named_node_map_remove_named_item argPtr1 arg2 arg3)
{-# LINE 66 "./Graphics/UI/Gtk/WebKit/DOM/NamedNodeMap.chs" #-}
                    (toNamedNodeMap self)
                    namePtr
                errorPtr_))
 
item ::
     (MonadIO m, NamedNodeMapClass self) =>
       self -> Word -> m (Maybe Node)
item self index
  = liftIO
      (maybeNull (makeNewGObject mkNode)
         ((\(NamedNodeMap arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_named_node_map_item argPtr1 arg2) (toNamedNodeMap self)
            (fromIntegral index)))
 
getNamedItemNS ::
               (MonadIO m, NamedNodeMapClass self, GlibString string) =>
                 self -> (Maybe string) -> string -> m (Maybe Node)
getNamedItemNS self namespaceURI localName
  = liftIO
      (maybeNull (makeNewGObject mkNode)
         (withUTFString localName $
            \ localNamePtr ->
              maybeWith withUTFString namespaceURI $
                \ namespaceURIPtr ->
                  (\(NamedNodeMap arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_named_node_map_get_named_item_ns argPtr1 arg2 arg3)
{-# LINE 90 "./Graphics/UI/Gtk/WebKit/DOM/NamedNodeMap.chs" #-}
                    (toNamedNodeMap self)
                    namespaceURIPtr
                localNamePtr))
 
setNamedItemNS ::
               (MonadIO m, NamedNodeMapClass self, NodeClass node) =>
                 self -> Maybe node -> m (Maybe Node)
setNamedItemNS self node
  = liftIO
      (maybeNull (makeNewGObject mkNode)
         (propagateGError $
            \ errorPtr_ ->
              (\(NamedNodeMap arg1) (Node arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_named_node_map_set_named_item_ns argPtr1 argPtr2 arg3)
{-# LINE 103 "./Graphics/UI/Gtk/WebKit/DOM/NamedNodeMap.chs" #-}
                (toNamedNodeMap self)
                (maybe (Node nullForeignPtr) toNode node)
                errorPtr_))
 
removeNamedItemNS ::
                  (MonadIO m, NamedNodeMapClass self, GlibString string) =>
                    self -> (Maybe string) -> string -> m (Maybe Node)
removeNamedItemNS self namespaceURI localName
  = liftIO
      (maybeNull (makeNewGObject mkNode)
         (propagateGError $
            \ errorPtr_ ->
              withUTFString localName $
                \ localNamePtr ->
                  maybeWith withUTFString namespaceURI $
                    \ namespaceURIPtr ->
                      (\(NamedNodeMap arg1) arg2 arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_named_node_map_remove_named_item_ns argPtr1 arg2 arg3 arg4)
{-# LINE 120 "./Graphics/UI/Gtk/WebKit/DOM/NamedNodeMap.chs" #-}
                        (toNamedNodeMap self)
                        namespaceURIPtr
                    localNamePtr
                errorPtr_))
 
getLength :: (MonadIO m, NamedNodeMapClass self) => self -> m Word
getLength self
  = liftIO
      (fromIntegral <$>
         ((\(NamedNodeMap arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_named_node_map_get_length argPtr1)
{-# LINE 130 "./Graphics/UI/Gtk/WebKit/DOM/NamedNodeMap.chs" #-}
            (toNamedNodeMap self)))

foreign import ccall safe "webkit_dom_named_node_map_get_named_item"
  webkit_dom_named_node_map_get_named_item :: ((Ptr NamedNodeMap) -> ((Ptr CChar) -> (IO (Ptr Node))))

foreign import ccall safe "webkit_dom_named_node_map_set_named_item"
  webkit_dom_named_node_map_set_named_item :: ((Ptr NamedNodeMap) -> ((Ptr Node) -> ((Ptr (Ptr ())) -> (IO (Ptr Node)))))

foreign import ccall safe "webkit_dom_named_node_map_remove_named_item"
  webkit_dom_named_node_map_remove_named_item :: ((Ptr NamedNodeMap) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO (Ptr Node)))))

foreign import ccall safe "webkit_dom_named_node_map_item"
  webkit_dom_named_node_map_item :: ((Ptr NamedNodeMap) -> (CULong -> (IO (Ptr Node))))

foreign import ccall safe "webkit_dom_named_node_map_get_named_item_ns"
  webkit_dom_named_node_map_get_named_item_ns :: ((Ptr NamedNodeMap) -> ((Ptr CChar) -> ((Ptr CChar) -> (IO (Ptr Node)))))

foreign import ccall safe "webkit_dom_named_node_map_set_named_item_ns"
  webkit_dom_named_node_map_set_named_item_ns :: ((Ptr NamedNodeMap) -> ((Ptr Node) -> ((Ptr (Ptr ())) -> (IO (Ptr Node)))))

foreign import ccall safe "webkit_dom_named_node_map_remove_named_item_ns"
  webkit_dom_named_node_map_remove_named_item_ns :: ((Ptr NamedNodeMap) -> ((Ptr CChar) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO (Ptr Node))))))

foreign import ccall safe "webkit_dom_named_node_map_get_length"
  webkit_dom_named_node_map_get_length :: ((Ptr NamedNodeMap) -> (IO CULong))