-- 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/DOMSelection.chs" #-}
module Graphics.UI.Gtk.WebKit.DOM.DOMSelection
       (domSelectionCollapse, domSelectionCollapseToEnd,
        domSelectionCollapseToStart, domSelectionDeleteFromDocument,
        domSelectionContainsNode, domSelectionSelectAllChildren,
        domSelectionExtend, domSelectionGetRangeAt,
        domSelectionRemoveAllRanges, domSelectionAddRange,
        domSelectionModify, domSelectionSetBaseAndExtent,
        domSelectionSetPosition, domSelectionEmpty,
        domSelectionGetAnchorNode, domSelectionGetAnchorOffset,
        domSelectionGetFocusNode, domSelectionGetFocusOffset,
        domSelectionGetIsCollapsed, domSelectionGetRangeCount,
        domSelectionGetBaseNode, domSelectionGetBaseOffset,
        domSelectionGetExtentNode, domSelectionGetExtentOffset,
        DOMSelection, DOMSelectionClass, castToDOMSelection,
        gTypeDOMSelection, toDOMSelection)
       where
import System.Glib.FFI
import System.Glib.UTFString
import Control.Applicative
import Graphics.UI.Gtk.WebKit.Types
{-# LINE 20 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
import System.Glib.GError
import Graphics.UI.Gtk.WebKit.DOM.EventM
 
domSelectionCollapse ::
                     (DOMSelectionClass self, NodeClass node) =>
                       self -> Maybe node -> Int -> IO ()
domSelectionCollapse self node index
  = propagateGError $
      \ errorPtr_ ->
        (\(DOMSelection arg1) (Node arg2) arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_dom_selection_collapse argPtr1 argPtr2 arg3 arg4) (toDOMSelection self)
          (maybe (Node nullForeignPtr) toNode node)
          (fromIntegral index)
          errorPtr_
 
domSelectionCollapseToEnd ::
                          (DOMSelectionClass self) => self -> IO ()
domSelectionCollapseToEnd self
  = propagateGError $
      \ errorPtr_ ->
        (\(DOMSelection arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_collapse_to_end argPtr1 arg2)
{-# LINE 40 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
          (toDOMSelection self)
          errorPtr_
 
domSelectionCollapseToStart ::
                            (DOMSelectionClass self) => self -> IO ()
domSelectionCollapseToStart self
  = propagateGError $
      \ errorPtr_ ->
        (\(DOMSelection arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_collapse_to_start argPtr1 arg2)
{-# LINE 49 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
          (toDOMSelection self)
          errorPtr_
 
domSelectionDeleteFromDocument ::
                               (DOMSelectionClass self) => self -> IO ()
domSelectionDeleteFromDocument self
  = (\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_delete_from_document argPtr1)
{-# LINE 56 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
      (toDOMSelection self)
 
domSelectionContainsNode ::
                         (DOMSelectionClass self, NodeClass node) =>
                           self -> Maybe node -> Bool -> IO Bool
domSelectionContainsNode self node allowPartial
  = toBool <$>
      ((\(DOMSelection arg1) (Node arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_dom_selection_contains_node argPtr1 argPtr2 arg3)
{-# LINE 64 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self)
         (maybe (Node nullForeignPtr) toNode node)
         (fromBool allowPartial))
 
domSelectionSelectAllChildren ::
                              (DOMSelectionClass self, NodeClass node) =>
                                self -> Maybe node -> IO ()
domSelectionSelectAllChildren self node
  = propagateGError $
      \ errorPtr_ ->
        (\(DOMSelection arg1) (Node arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_dom_selection_select_all_children argPtr1 argPtr2 arg3)
{-# LINE 75 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
          (toDOMSelection self)
          (maybe (Node nullForeignPtr) toNode node)
          errorPtr_
 
domSelectionExtend ::
                   (DOMSelectionClass self, NodeClass node) =>
                     self -> Maybe node -> Int -> IO ()
domSelectionExtend self node offset
  = propagateGError $
      \ errorPtr_ ->
        (\(DOMSelection arg1) (Node arg2) arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_dom_selection_extend argPtr1 argPtr2 arg3 arg4) (toDOMSelection self)
          (maybe (Node nullForeignPtr) toNode node)
          (fromIntegral offset)
          errorPtr_
 
domSelectionGetRangeAt ::
                       (DOMSelectionClass self) => self -> Int -> IO (Maybe DOMRange)
domSelectionGetRangeAt self index
  = maybeNull (makeNewGObject mkDOMRange)
      (propagateGError $
         \ errorPtr_ ->
           (\(DOMSelection arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_range_at argPtr1 arg2 arg3)
{-# LINE 97 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
             (toDOMSelection self)
             (fromIntegral index)
             errorPtr_)
 
domSelectionRemoveAllRanges ::
                            (DOMSelectionClass self) => self -> IO ()
domSelectionRemoveAllRanges self
  = (\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_remove_all_ranges argPtr1)
{-# LINE 105 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
      (toDOMSelection self)
 
domSelectionAddRange ::
                     (DOMSelectionClass self, DOMRangeClass range) =>
                       self -> Maybe range -> IO ()
domSelectionAddRange self range
  = (\(DOMSelection arg1) (DOMRange arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_dom_selection_add_range argPtr1 argPtr2)
{-# LINE 112 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
      (toDOMSelection self)
      (maybe (DOMRange nullForeignPtr) toDOMRange range)
 
domSelectionModify ::
                   (DOMSelectionClass self, GlibString string) =>
                     self -> string -> string -> string -> IO ()
domSelectionModify self alter direction granularity
  = withUTFString granularity $
      \ granularityPtr ->
        withUTFString direction $
          \ directionPtr ->
            withUTFString alter $
              \ alterPtr ->
                (\(DOMSelection arg1) arg2 arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_modify argPtr1 arg2 arg3 arg4) (toDOMSelection self)
                  alterPtr
              directionPtr
          granularityPtr
 
domSelectionSetBaseAndExtent ::
                             (DOMSelectionClass self, NodeClass baseNode,
                              NodeClass extentNode) =>
                               self -> Maybe baseNode -> Int -> Maybe extentNode -> Int -> IO ()
domSelectionSetBaseAndExtent self baseNode baseOffset extentNode
  extentOffset
  = propagateGError $
      \ errorPtr_ ->
        (\(DOMSelection arg1) (Node arg2) arg3 (Node arg4) arg5 arg6 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg4 $ \argPtr4 ->webkit_dom_dom_selection_set_base_and_extent argPtr1 argPtr2 arg3 argPtr4 arg5 arg6)
{-# LINE 139 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
          (toDOMSelection self)
          (maybe (Node nullForeignPtr) toNode baseNode)
          (fromIntegral baseOffset)
          (maybe (Node nullForeignPtr) toNode extentNode)
          (fromIntegral extentOffset)
          errorPtr_
 
domSelectionSetPosition ::
                        (DOMSelectionClass self, NodeClass node) =>
                          self -> Maybe node -> Int -> IO ()
domSelectionSetPosition self node offset
  = propagateGError $
      \ errorPtr_ ->
        (\(DOMSelection arg1) (Node arg2) arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_dom_selection_set_position argPtr1 argPtr2 arg3 arg4)
{-# LINE 153 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
          (toDOMSelection self)
          (maybe (Node nullForeignPtr) toNode node)
          (fromIntegral offset)
          errorPtr_
 
domSelectionEmpty :: (DOMSelectionClass self) => self -> IO ()
domSelectionEmpty self
  = (\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_empty argPtr1) (toDOMSelection self)
 
domSelectionGetAnchorNode ::
                          (DOMSelectionClass self) => self -> IO (Maybe Node)
domSelectionGetAnchorNode self
  = maybeNull (makeNewGObject mkNode)
      ((\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_anchor_node argPtr1)
{-# LINE 167 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self))
 
domSelectionGetAnchorOffset ::
                            (DOMSelectionClass self) => self -> IO Int
domSelectionGetAnchorOffset self
  = fromIntegral <$>
      ((\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_anchor_offset argPtr1)
{-# LINE 174 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self))
 
domSelectionGetFocusNode ::
                         (DOMSelectionClass self) => self -> IO (Maybe Node)
domSelectionGetFocusNode self
  = maybeNull (makeNewGObject mkNode)
      ((\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_focus_node argPtr1)
{-# LINE 181 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self))
 
domSelectionGetFocusOffset ::
                           (DOMSelectionClass self) => self -> IO Int
domSelectionGetFocusOffset self
  = fromIntegral <$>
      ((\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_focus_offset argPtr1)
{-# LINE 188 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self))
 
domSelectionGetIsCollapsed ::
                           (DOMSelectionClass self) => self -> IO Bool
domSelectionGetIsCollapsed self
  = toBool <$>
      ((\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_is_collapsed argPtr1)
{-# LINE 195 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self))
 
domSelectionGetRangeCount ::
                          (DOMSelectionClass self) => self -> IO Int
domSelectionGetRangeCount self
  = fromIntegral <$>
      ((\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_range_count argPtr1)
{-# LINE 202 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self))
 
domSelectionGetBaseNode ::
                        (DOMSelectionClass self) => self -> IO (Maybe Node)
domSelectionGetBaseNode self
  = maybeNull (makeNewGObject mkNode)
      ((\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_base_node argPtr1)
{-# LINE 209 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self))
 
domSelectionGetBaseOffset ::
                          (DOMSelectionClass self) => self -> IO Int
domSelectionGetBaseOffset self
  = fromIntegral <$>
      ((\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_base_offset argPtr1)
{-# LINE 216 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self))
 
domSelectionGetExtentNode ::
                          (DOMSelectionClass self) => self -> IO (Maybe Node)
domSelectionGetExtentNode self
  = maybeNull (makeNewGObject mkNode)
      ((\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_extent_node argPtr1)
{-# LINE 223 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self))
 
domSelectionGetExtentOffset ::
                            (DOMSelectionClass self) => self -> IO Int
domSelectionGetExtentOffset self
  = fromIntegral <$>
      ((\(DOMSelection arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_dom_selection_get_extent_offset argPtr1)
{-# LINE 230 "./Graphics/UI/Gtk/WebKit/DOM/DOMSelection.chs" #-}
         (toDOMSelection self))

foreign import ccall safe "webkit_dom_dom_selection_collapse"
  webkit_dom_dom_selection_collapse :: ((Ptr DOMSelection) -> ((Ptr Node) -> (CLong -> ((Ptr (Ptr ())) -> (IO ())))))

foreign import ccall safe "webkit_dom_dom_selection_collapse_to_end"
  webkit_dom_dom_selection_collapse_to_end :: ((Ptr DOMSelection) -> ((Ptr (Ptr ())) -> (IO ())))

foreign import ccall safe "webkit_dom_dom_selection_collapse_to_start"
  webkit_dom_dom_selection_collapse_to_start :: ((Ptr DOMSelection) -> ((Ptr (Ptr ())) -> (IO ())))

foreign import ccall safe "webkit_dom_dom_selection_delete_from_document"
  webkit_dom_dom_selection_delete_from_document :: ((Ptr DOMSelection) -> (IO ()))

foreign import ccall safe "webkit_dom_dom_selection_contains_node"
  webkit_dom_dom_selection_contains_node :: ((Ptr DOMSelection) -> ((Ptr Node) -> (CInt -> (IO CInt))))

foreign import ccall safe "webkit_dom_dom_selection_select_all_children"
  webkit_dom_dom_selection_select_all_children :: ((Ptr DOMSelection) -> ((Ptr Node) -> ((Ptr (Ptr ())) -> (IO ()))))

foreign import ccall safe "webkit_dom_dom_selection_extend"
  webkit_dom_dom_selection_extend :: ((Ptr DOMSelection) -> ((Ptr Node) -> (CLong -> ((Ptr (Ptr ())) -> (IO ())))))

foreign import ccall safe "webkit_dom_dom_selection_get_range_at"
  webkit_dom_dom_selection_get_range_at :: ((Ptr DOMSelection) -> (CLong -> ((Ptr (Ptr ())) -> (IO (Ptr DOMRange)))))

foreign import ccall safe "webkit_dom_dom_selection_remove_all_ranges"
  webkit_dom_dom_selection_remove_all_ranges :: ((Ptr DOMSelection) -> (IO ()))

foreign import ccall safe "webkit_dom_dom_selection_add_range"
  webkit_dom_dom_selection_add_range :: ((Ptr DOMSelection) -> ((Ptr DOMRange) -> (IO ())))

foreign import ccall safe "webkit_dom_dom_selection_modify"
  webkit_dom_dom_selection_modify :: ((Ptr DOMSelection) -> ((Ptr CChar) -> ((Ptr CChar) -> ((Ptr CChar) -> (IO ())))))

foreign import ccall safe "webkit_dom_dom_selection_set_base_and_extent"
  webkit_dom_dom_selection_set_base_and_extent :: ((Ptr DOMSelection) -> ((Ptr Node) -> (CLong -> ((Ptr Node) -> (CLong -> ((Ptr (Ptr ())) -> (IO ())))))))

foreign import ccall safe "webkit_dom_dom_selection_set_position"
  webkit_dom_dom_selection_set_position :: ((Ptr DOMSelection) -> ((Ptr Node) -> (CLong -> ((Ptr (Ptr ())) -> (IO ())))))

foreign import ccall safe "webkit_dom_dom_selection_empty"
  webkit_dom_dom_selection_empty :: ((Ptr DOMSelection) -> (IO ()))

foreign import ccall safe "webkit_dom_dom_selection_get_anchor_node"
  webkit_dom_dom_selection_get_anchor_node :: ((Ptr DOMSelection) -> (IO (Ptr Node)))

foreign import ccall safe "webkit_dom_dom_selection_get_anchor_offset"
  webkit_dom_dom_selection_get_anchor_offset :: ((Ptr DOMSelection) -> (IO CLong))

foreign import ccall safe "webkit_dom_dom_selection_get_focus_node"
  webkit_dom_dom_selection_get_focus_node :: ((Ptr DOMSelection) -> (IO (Ptr Node)))

foreign import ccall safe "webkit_dom_dom_selection_get_focus_offset"
  webkit_dom_dom_selection_get_focus_offset :: ((Ptr DOMSelection) -> (IO CLong))

foreign import ccall safe "webkit_dom_dom_selection_get_is_collapsed"
  webkit_dom_dom_selection_get_is_collapsed :: ((Ptr DOMSelection) -> (IO CInt))

foreign import ccall safe "webkit_dom_dom_selection_get_range_count"
  webkit_dom_dom_selection_get_range_count :: ((Ptr DOMSelection) -> (IO CLong))

foreign import ccall safe "webkit_dom_dom_selection_get_base_node"
  webkit_dom_dom_selection_get_base_node :: ((Ptr DOMSelection) -> (IO (Ptr Node)))

foreign import ccall safe "webkit_dom_dom_selection_get_base_offset"
  webkit_dom_dom_selection_get_base_offset :: ((Ptr DOMSelection) -> (IO CLong))

foreign import ccall safe "webkit_dom_dom_selection_get_extent_node"
  webkit_dom_dom_selection_get_extent_node :: ((Ptr DOMSelection) -> (IO (Ptr Node)))

foreign import ccall safe "webkit_dom_dom_selection_get_extent_offset"
  webkit_dom_dom_selection_get_extent_offset :: ((Ptr DOMSelection) -> (IO CLong))