{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.HTMLOptionsCollection (js_namedItem, namedItem, js_addBefore, addBefore, js_add, add, js_remove, remove, js_setSelectedIndex, setSelectedIndex, js_getSelectedIndex, getSelectedIndex, js_setLength, setLength, js_getLength, getLength, HTMLOptionsCollection, castToHTMLOptionsCollection, gTypeHTMLOptionsCollection) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, fmap, Show, Read, Eq, Ord) import Data.Typeable (Typeable) import GHCJS.Types (JSRef(..), JSString, castRef) import GHCJS.Foreign (jsNull) import GHCJS.Foreign.Callback (syncCallback, asyncCallback, syncCallback1, asyncCallback1, syncCallback2, asyncCallback2, OnBlocked(..)) import GHCJS.Marshal (ToJSRef(..), FromJSRef(..)) import GHCJS.Marshal.Pure (PToJSRef(..), PFromJSRef(..)) import Control.Monad.IO.Class (MonadIO(..)) import Data.Int (Int64) import Data.Word (Word, Word64) import GHCJS.DOM.Types import Control.Applicative ((<$>)) import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName) import GHCJS.DOM.Enums foreign import javascript unsafe "$1[\"namedItem\"]($2)" js_namedItem :: JSRef HTMLOptionsCollection -> JSString -> IO (JSRef Node) -- | namedItem :: (MonadIO m, ToJSString name) => HTMLOptionsCollection -> name -> m (Maybe Node) namedItem self name = liftIO ((js_namedItem (unHTMLOptionsCollection self) (toJSString name)) >>= fromJSRef) foreign import javascript unsafe "$1[\"add\"]($2, $3)" js_addBefore :: JSRef HTMLOptionsCollection -> JSRef HTMLElement -> JSRef HTMLElement -> IO () -- | addBefore :: (MonadIO m, IsHTMLElement element, IsHTMLElement before) => HTMLOptionsCollection -> Maybe element -> Maybe before -> m () addBefore self element before = liftIO (js_addBefore (unHTMLOptionsCollection self) (maybe jsNull (unHTMLElement . toHTMLElement) element) (maybe jsNull (unHTMLElement . toHTMLElement) before)) foreign import javascript unsafe "$1[\"add\"]($2, $3)" js_add :: JSRef HTMLOptionsCollection -> JSRef HTMLElement -> Int -> IO () -- | add :: (MonadIO m, IsHTMLElement element) => HTMLOptionsCollection -> Maybe element -> Int -> m () add self element index = liftIO (js_add (unHTMLOptionsCollection self) (maybe jsNull (unHTMLElement . toHTMLElement) element) index) foreign import javascript unsafe "$1[\"remove\"]($2)" js_remove :: JSRef HTMLOptionsCollection -> Word -> IO () -- | remove :: (MonadIO m) => HTMLOptionsCollection -> Word -> m () remove self index = liftIO (js_remove (unHTMLOptionsCollection self) index) foreign import javascript unsafe "$1[\"selectedIndex\"] = $2;" js_setSelectedIndex :: JSRef HTMLOptionsCollection -> Int -> IO () -- | setSelectedIndex :: (MonadIO m) => HTMLOptionsCollection -> Int -> m () setSelectedIndex self val = liftIO (js_setSelectedIndex (unHTMLOptionsCollection self) val) foreign import javascript unsafe "$1[\"selectedIndex\"]" js_getSelectedIndex :: JSRef HTMLOptionsCollection -> IO Int -- | getSelectedIndex :: (MonadIO m) => HTMLOptionsCollection -> m Int getSelectedIndex self = liftIO (js_getSelectedIndex (unHTMLOptionsCollection self)) foreign import javascript unsafe "$1[\"length\"] = $2;" js_setLength :: JSRef HTMLOptionsCollection -> Word -> IO () -- | setLength :: (MonadIO m) => HTMLOptionsCollection -> Word -> m () setLength self val = liftIO (js_setLength (unHTMLOptionsCollection self) val) foreign import javascript unsafe "$1[\"length\"]" js_getLength :: JSRef HTMLOptionsCollection -> IO Word -- | getLength :: (MonadIO m) => HTMLOptionsCollection -> m Word getLength self = liftIO (js_getLength (unHTMLOptionsCollection self))