-- 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/Attr.chs" #-}
module Graphics.UI.Gtk.WebKit.DOM.Attr(
getName,
getSpecified,
setValue,
getValue,
getOwnerElement,
getIsId,
Attr,
castToAttr,
gTypeAttr,
AttrClass,
toAttr,
) 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 25 "./Graphics/UI/Gtk/WebKit/DOM/Attr.chs" #-}
import Graphics.UI.Gtk.WebKit.DOM.Enums

 
getName ::
        (MonadIO m, AttrClass self, GlibString string) =>
          self -> m (Maybe string)
getName self
  = liftIO
      (((\(Attr arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_attr_get_name argPtr1) (toAttr self)) >>=
         maybePeek readUTFString)
 
getSpecified :: (MonadIO m, AttrClass self) => self -> m Bool
getSpecified self
  = liftIO
      (toBool <$>
         ((\(Attr arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_attr_get_specified argPtr1) (toAttr self)))
 
setValue ::
         (MonadIO m, AttrClass self, GlibString string) =>
           self -> (Maybe string) -> m ()
setValue self val
  = liftIO
      (propagateGError $
         \ errorPtr_ ->
           maybeWith withUTFString val $
             \ valPtr ->
               (\(Attr arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_attr_set_value argPtr1 arg2 arg3) (toAttr self) valPtr
             errorPtr_)
 
getValue ::
         (MonadIO m, AttrClass self, GlibString string) =>
           self -> m (Maybe string)
getValue self
  = liftIO
      (((\(Attr arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_attr_get_value argPtr1) (toAttr self)) >>=
         maybePeek readUTFString)
 
getOwnerElement ::
                (MonadIO m, AttrClass self) => self -> m (Maybe Element)
getOwnerElement self
  = liftIO
      (maybeNull (makeNewGObject mkElement)
         ((\(Attr arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_attr_get_owner_element argPtr1) (toAttr self)))
 
getIsId :: (MonadIO m, AttrClass self) => self -> m Bool
getIsId self
  = liftIO
      (toBool <$> ((\(Attr arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_attr_get_is_id argPtr1) (toAttr self)))

foreign import ccall safe "webkit_dom_attr_get_name"
  webkit_dom_attr_get_name :: ((Ptr Attr) -> (IO (Ptr CChar)))

foreign import ccall safe "webkit_dom_attr_get_specified"
  webkit_dom_attr_get_specified :: ((Ptr Attr) -> (IO CInt))

foreign import ccall safe "webkit_dom_attr_set_value"
  webkit_dom_attr_set_value :: ((Ptr Attr) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO ()))))

foreign import ccall safe "webkit_dom_attr_get_value"
  webkit_dom_attr_get_value :: ((Ptr Attr) -> (IO (Ptr CChar)))

foreign import ccall safe "webkit_dom_attr_get_owner_element"
  webkit_dom_attr_get_owner_element :: ((Ptr Attr) -> (IO (Ptr Element)))

foreign import ccall safe "webkit_dom_attr_get_is_id"
  webkit_dom_attr_get_is_id :: ((Ptr Attr) -> (IO CInt))