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


{-# LINE 1 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
module Graphics.UI.Gtk.WebKit.DOM.XPathResult
       (xPathResultIterateNext, xPathResultSnapshotItem, cANY_TYPE,
        cNUMBER_TYPE, cSTRING_TYPE, cBOOLEAN_TYPE,
        cUNORDERED_NODE_ITERATOR_TYPE, cORDERED_NODE_ITERATOR_TYPE,
        cUNORDERED_NODE_SNAPSHOT_TYPE, cORDERED_NODE_SNAPSHOT_TYPE,
        cANY_UNORDERED_NODE_TYPE, cFIRST_ORDERED_NODE_TYPE,
        xPathResultGetResultType, xPathResultGetNumberValue,
        xPathResultGetStringValue, xPathResultGetBooleanValue,
        xPathResultGetSingleNodeValue, xPathResultGetInvalidIteratorState,
        xPathResultGetSnapshotLength, XPathResult, XPathResultClass,
        castToXPathResult, gTypeXPathResult, toXPathResult)
       where
import System.Glib.FFI
import System.Glib.UTFString
import Control.Applicative
import Graphics.UI.Gtk.WebKit.Types
{-# LINE 16 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
import System.Glib.GError
import Graphics.UI.Gtk.WebKit.DOM.EventM
 
xPathResultIterateNext ::
                       (XPathResultClass self) => self -> IO (Maybe Node)
xPathResultIterateNext self
  = maybeNull (makeNewGObject mkNode)
      (propagateGError $
         \ errorPtr_ ->
           (\(XPathResult arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_xpath_result_iterate_next argPtr1 arg2)
{-# LINE 26 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
             (toXPathResult self)
             errorPtr_)
 
xPathResultSnapshotItem ::
                        (XPathResultClass self) => self -> Word -> IO (Maybe Node)
xPathResultSnapshotItem self index
  = maybeNull (makeNewGObject mkNode)
      (propagateGError $
         \ errorPtr_ ->
           (\(XPathResult arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_xpath_result_snapshot_item argPtr1 arg2 arg3)
{-# LINE 36 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
             (toXPathResult self)
             (fromIntegral index)
             errorPtr_)
cANY_TYPE = 0
cNUMBER_TYPE = 1
cSTRING_TYPE = 2
cBOOLEAN_TYPE = 3
cUNORDERED_NODE_ITERATOR_TYPE = 4
cORDERED_NODE_ITERATOR_TYPE = 5
cUNORDERED_NODE_SNAPSHOT_TYPE = 6
cORDERED_NODE_SNAPSHOT_TYPE = 7
cANY_UNORDERED_NODE_TYPE = 8
cFIRST_ORDERED_NODE_TYPE = 9
 
xPathResultGetResultType ::
                         (XPathResultClass self) => self -> IO Word
xPathResultGetResultType self
  = fromIntegral <$>
      ((\(XPathResult arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_xpath_result_get_result_type argPtr1)
{-# LINE 55 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
         (toXPathResult self))
 
xPathResultGetNumberValue ::
                          (XPathResultClass self) => self -> IO Double
xPathResultGetNumberValue self
  = realToFrac <$>
      (propagateGError $
         \ errorPtr_ ->
           (\(XPathResult arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_xpath_result_get_number_value argPtr1 arg2)
{-# LINE 64 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
             (toXPathResult self)
             errorPtr_)
 
xPathResultGetStringValue ::
                          (XPathResultClass self, GlibString string) => self -> IO string
xPathResultGetStringValue self
  = (propagateGError $
       \ errorPtr_ ->
         (\(XPathResult arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_xpath_result_get_string_value argPtr1 arg2)
{-# LINE 73 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
           (toXPathResult self)
           errorPtr_)
      >>=
      readUTFString
 
xPathResultGetBooleanValue ::
                           (XPathResultClass self) => self -> IO Bool
xPathResultGetBooleanValue self
  = toBool <$>
      (propagateGError $
         \ errorPtr_ ->
           (\(XPathResult arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_xpath_result_get_boolean_value argPtr1 arg2)
{-# LINE 85 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
             (toXPathResult self)
             errorPtr_)
 
xPathResultGetSingleNodeValue ::
                              (XPathResultClass self) => self -> IO (Maybe Node)
xPathResultGetSingleNodeValue self
  = maybeNull (makeNewGObject mkNode)
      (propagateGError $
         \ errorPtr_ ->
           (\(XPathResult arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_xpath_result_get_single_node_value argPtr1 arg2)
{-# LINE 95 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
             (toXPathResult self)
             errorPtr_)
 
xPathResultGetInvalidIteratorState ::
                                   (XPathResultClass self) => self -> IO Bool
xPathResultGetInvalidIteratorState self
  = toBool <$>
      ((\(XPathResult arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_xpath_result_get_invalid_iterator_state argPtr1)
{-# LINE 103 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
         (toXPathResult self))
 
xPathResultGetSnapshotLength ::
                             (XPathResultClass self) => self -> IO Word
xPathResultGetSnapshotLength self
  = fromIntegral <$>
      (propagateGError $
         \ errorPtr_ ->
           (\(XPathResult arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_xpath_result_get_snapshot_length argPtr1 arg2)
{-# LINE 112 "./Graphics/UI/Gtk/WebKit/DOM/XPathResult.chs" #-}
             (toXPathResult self)
             errorPtr_)

foreign import ccall safe "webkit_dom_xpath_result_iterate_next"
  webkit_dom_xpath_result_iterate_next :: ((Ptr XPathResult) -> ((Ptr (Ptr ())) -> (IO (Ptr Node))))

foreign import ccall safe "webkit_dom_xpath_result_snapshot_item"
  webkit_dom_xpath_result_snapshot_item :: ((Ptr XPathResult) -> (CULong -> ((Ptr (Ptr ())) -> (IO (Ptr Node)))))

foreign import ccall safe "webkit_dom_xpath_result_get_result_type"
  webkit_dom_xpath_result_get_result_type :: ((Ptr XPathResult) -> (IO CUShort))

foreign import ccall safe "webkit_dom_xpath_result_get_number_value"
  webkit_dom_xpath_result_get_number_value :: ((Ptr XPathResult) -> ((Ptr (Ptr ())) -> (IO CDouble)))

foreign import ccall safe "webkit_dom_xpath_result_get_string_value"
  webkit_dom_xpath_result_get_string_value :: ((Ptr XPathResult) -> ((Ptr (Ptr ())) -> (IO (Ptr CChar))))

foreign import ccall safe "webkit_dom_xpath_result_get_boolean_value"
  webkit_dom_xpath_result_get_boolean_value :: ((Ptr XPathResult) -> ((Ptr (Ptr ())) -> (IO CInt)))

foreign import ccall safe "webkit_dom_xpath_result_get_single_node_value"
  webkit_dom_xpath_result_get_single_node_value :: ((Ptr XPathResult) -> ((Ptr (Ptr ())) -> (IO (Ptr Node))))

foreign import ccall safe "webkit_dom_xpath_result_get_invalid_iterator_state"
  webkit_dom_xpath_result_get_invalid_iterator_state :: ((Ptr XPathResult) -> (IO CInt))

foreign import ccall safe "webkit_dom_xpath_result_get_snapshot_length"
  webkit_dom_xpath_result_get_snapshot_length :: ((Ptr XPathResult) -> ((Ptr (Ptr ())) -> (IO CULong)))