packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/FocusOptions.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from html (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.FocusOptions
       (js_newFocusOptions, js_setPreventScroll, js_getPreventScroll, js_setFocusVisible, js_getFocusVisible, newFocusOptions, setPreventScroll, getPreventScroll, getPreventScrollUnsafe, getPreventScrollUnchecked, setFocusVisible, getFocusVisible, getFocusVisibleUnsafe, getFocusVisibleUnchecked, FocusOptions(..), gTypeFocusOptions)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(() => { return ({}); })"
        js_newFocusOptions :: IO FocusOptions
-- | <https://html.spec.whatwg.org/multipage/interaction.html#focusoptions FocusOptions specification>
newFocusOptions :: (MonadDOM m) => m FocusOptions
newFocusOptions = liftDOM ((js_newFocusOptions))

foreign import javascript safe "(($1, $2) => { $1[\"preventScroll\"] = $2; })"
        js_setPreventScroll :: FocusOptions -> Bool -> IO ()
-- | <https://html.spec.whatwg.org/multipage/interaction.html#dom-focusoptions-preventscroll FocusOptions.preventScroll specification>
setPreventScroll :: (MonadDOM m) => FocusOptions -> Bool -> m ()
setPreventScroll self val = liftDOM (void ((js_setPreventScroll (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"preventScroll\"]; })"
        js_getPreventScroll :: FocusOptions -> IO JSVal
-- | <https://html.spec.whatwg.org/multipage/interaction.html#dom-focusoptions-preventscroll FocusOptions.preventScroll specification>
getPreventScroll :: (MonadDOM m) => FocusOptions -> m (Maybe Bool)
getPreventScroll self = liftDOM (((js_getPreventScroll (self)) >>= fromJSValUnchecked))

-- | <https://html.spec.whatwg.org/multipage/interaction.html#dom-focusoptions-preventscroll FocusOptions.preventScroll specification>
getPreventScrollUnsafe :: (MonadDOM m, HasCallStack) => FocusOptions -> m Bool
getPreventScrollUnsafe self = liftDOM ((((js_getPreventScroll (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://html.spec.whatwg.org/multipage/interaction.html#dom-focusoptions-preventscroll FocusOptions.preventScroll specification>
getPreventScrollUnchecked :: (MonadDOM m) => FocusOptions -> m Bool
getPreventScrollUnchecked self = liftDOM ((pFromJSVal <$> (js_getPreventScroll (self))))

foreign import javascript safe "(($1, $2) => { $1[\"focusVisible\"] = $2; })"
        js_setFocusVisible :: FocusOptions -> Bool -> IO ()
-- | <https://html.spec.whatwg.org/multipage/interaction.html#dom-focusoptions-focusvisible FocusOptions.focusVisible specification>
setFocusVisible :: (MonadDOM m) => FocusOptions -> Bool -> m ()
setFocusVisible self val = liftDOM (void ((js_setFocusVisible (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"focusVisible\"]; })"
        js_getFocusVisible :: FocusOptions -> IO JSVal
-- | <https://html.spec.whatwg.org/multipage/interaction.html#dom-focusoptions-focusvisible FocusOptions.focusVisible specification>
getFocusVisible :: (MonadDOM m) => FocusOptions -> m (Maybe Bool)
getFocusVisible self = liftDOM (((js_getFocusVisible (self)) >>= fromJSValUnchecked))

-- | <https://html.spec.whatwg.org/multipage/interaction.html#dom-focusoptions-focusvisible FocusOptions.focusVisible specification>
getFocusVisibleUnsafe :: (MonadDOM m, HasCallStack) => FocusOptions -> m Bool
getFocusVisibleUnsafe self = liftDOM ((((js_getFocusVisible (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://html.spec.whatwg.org/multipage/interaction.html#dom-focusoptions-focusvisible FocusOptions.focusVisible specification>
getFocusVisibleUnchecked :: (MonadDOM m) => FocusOptions -> m Bool
getFocusVisibleUnchecked self = liftDOM ((pFromJSVal <$> (js_getFocusVisible (self))))