-- 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/CSSRule.chs" #-}
module Graphics.UI.Gtk.WebKit.DOM.CSSRule(
pattern UNKNOWN_RULE,
pattern STYLE_RULE,
pattern CHARSET_RULE,
pattern IMPORT_RULE,
pattern MEDIA_RULE,
pattern FONT_FACE_RULE,
pattern PAGE_RULE,
pattern KEYFRAMES_RULE,
pattern KEYFRAME_RULE,
pattern SUPPORTS_RULE,
pattern WEBKIT_VIEWPORT_RULE,
pattern WEBKIT_REGION_RULE,
pattern WEBKIT_KEYFRAMES_RULE,
pattern WEBKIT_KEYFRAME_RULE,
setCssText,
getCssText,
getParentStyleSheet,
getParentRule,
CSSRule,
castToCSSRule,
gTypeCSSRule,
CSSRuleClass,
toCSSRule,
) 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 37 "./Graphics/UI/Gtk/WebKit/DOM/CSSRule.chs" #-}
import Graphics.UI.Gtk.WebKit.DOM.Enums

pattern UNKNOWN_RULE = 0
pattern STYLE_RULE = 1
pattern CHARSET_RULE = 2
pattern IMPORT_RULE = 3
pattern MEDIA_RULE = 4
pattern FONT_FACE_RULE = 5
pattern PAGE_RULE = 6
pattern KEYFRAMES_RULE = 7
pattern KEYFRAME_RULE = 8
pattern SUPPORTS_RULE = 12
pattern WEBKIT_VIEWPORT_RULE = 15
pattern WEBKIT_REGION_RULE = 16
pattern WEBKIT_KEYFRAMES_RULE = 7
pattern WEBKIT_KEYFRAME_RULE = 8
 
setCssText ::
           (MonadIO m, CSSRuleClass self, GlibString string) =>
             self -> (Maybe string) -> m ()
setCssText self val
  = liftIO
      (propagateGError $
         \ errorPtr_ ->
           maybeWith withUTFString val $
             \ valPtr ->
               (\(CSSRule arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_css_rule_set_css_text argPtr1 arg2 arg3) (toCSSRule self) valPtr
             errorPtr_)
 
getCssText ::
           (MonadIO m, CSSRuleClass self, GlibString string) =>
             self -> m (Maybe string)
getCssText self
  = liftIO
      (((\(CSSRule arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_css_rule_get_css_text argPtr1) (toCSSRule self)) >>=
         maybePeek readUTFString)
 
getParentStyleSheet ::
                    (MonadIO m, CSSRuleClass self) => self -> m (Maybe CSSStyleSheet)
getParentStyleSheet self
  = liftIO
      (maybeNull (makeNewGObject mkCSSStyleSheet)
         ((\(CSSRule arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_css_rule_get_parent_style_sheet argPtr1)
{-# LINE 80 "./Graphics/UI/Gtk/WebKit/DOM/CSSRule.chs" #-}
            (toCSSRule self)))
 
getParentRule ::
              (MonadIO m, CSSRuleClass self) => self -> m (Maybe CSSRule)
getParentRule self
  = liftIO
      (maybeNull (makeNewGObject mkCSSRule)
         ((\(CSSRule arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_css_rule_get_parent_rule argPtr1) (toCSSRule self)))

foreign import ccall safe "webkit_dom_css_rule_set_css_text"
  webkit_dom_css_rule_set_css_text :: ((Ptr CSSRule) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO ()))))

foreign import ccall safe "webkit_dom_css_rule_get_css_text"
  webkit_dom_css_rule_get_css_text :: ((Ptr CSSRule) -> (IO (Ptr CChar)))

foreign import ccall safe "webkit_dom_css_rule_get_parent_style_sheet"
  webkit_dom_css_rule_get_parent_style_sheet :: ((Ptr CSSRule) -> (IO (Ptr CSSStyleSheet)))

foreign import ccall safe "webkit_dom_css_rule_get_parent_rule"
  webkit_dom_css_rule_get_parent_rule :: ((Ptr CSSRule) -> (IO (Ptr CSSRule)))