-- 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/CSSValue.chs" #-}
module Graphics.UI.Gtk.WebKit.DOM.CSSValue(
pattern CSS_INHERIT,
pattern CSS_PRIMITIVE_VALUE,
pattern CSS_VALUE_LIST,
pattern CSS_CUSTOM,
setCssText,
getCssText,
getCssValueType,
CSSValue,
castToCSSValue,
gTypeCSSValue,
CSSValueClass,
toCSSValue,
) 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 26 "./Graphics/UI/Gtk/WebKit/DOM/CSSValue.chs" #-}
import Graphics.UI.Gtk.WebKit.DOM.Enums

pattern CSS_INHERIT = 0
pattern CSS_PRIMITIVE_VALUE = 1
pattern CSS_VALUE_LIST = 2
pattern CSS_CUSTOM = 3
 
setCssText ::
           (MonadIO m, CSSValueClass self, GlibString string) =>
             self -> (Maybe string) -> m ()
setCssText self val
  = liftIO
      (propagateGError $
         \ errorPtr_ ->
           maybeWith withUTFString val $
             \ valPtr ->
               (\(CSSValue arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_css_value_set_css_text argPtr1 arg2 arg3) (toCSSValue self)
                 valPtr
             errorPtr_)
 
getCssText ::
           (MonadIO m, CSSValueClass self, GlibString string) =>
             self -> m (Maybe string)
getCssText self
  = liftIO
      (((\(CSSValue arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_css_value_get_css_text argPtr1) (toCSSValue self))
         >>=
         maybePeek readUTFString)
 
getCssValueType ::
                (MonadIO m, CSSValueClass self) => self -> m Word
getCssValueType self
  = liftIO
      (fromIntegral <$>
         ((\(CSSValue arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_css_value_get_css_value_type argPtr1)
{-# LINE 61 "./Graphics/UI/Gtk/WebKit/DOM/CSSValue.chs" #-}
            (toCSSValue self)))

foreign import ccall safe "webkit_dom_css_value_set_css_text"
  webkit_dom_css_value_set_css_text :: ((Ptr CSSValue) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO ()))))

foreign import ccall safe "webkit_dom_css_value_get_css_text"
  webkit_dom_css_value_get_css_text :: ((Ptr CSSValue) -> (IO (Ptr CChar)))

foreign import ccall safe "webkit_dom_css_value_get_css_value_type"
  webkit_dom_css_value_get_css_value_type :: ((Ptr CSSValue) -> (IO CUShort))