packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webvtt1 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.VTTCue
       (js_newVTTCue, js_getCueAsHTML, js_setRegion, js_getRegion, js_setVertical, js_getVertical, js_setSnapToLines, js_getSnapToLines, js_setLine, js_getLine, js_setLineAlign, js_getLineAlign, js_setPosition, js_getPosition, js_setPositionAlign, js_getPositionAlign, js_setSize, js_getSize, js_setAlign, js_getAlign, js_setText, js_getText, newVTTCue, getCueAsHTML, getCueAsHTML_, setRegion, getRegion, getRegionUnsafe, getRegionUnchecked, setVertical, getVertical, setSnapToLines, getSnapToLines, setLine, getLine, setLineAlign, getLineAlign, setPosition, getPosition, setPositionAlign, getPositionAlign, setSize, getSize, setAlign, getAlign, setText, getText, VTTCue(..), gTypeVTTCue)
       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 "(($1, $2, $3) => { return new globalThis[\"VTTCue\"]($1, $2, $3); })"
        js_newVTTCue :: Double -> Double -> JSString -> IO VTTCue
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/VTTCue MDN VTTCue. documentation>
newVTTCue :: (MonadDOM m, ToJSString text) => Double -> Double -> text -> m VTTCue
newVTTCue startTime endTime text = liftDOM ((js_newVTTCue (startTime) (endTime) (toJSString text)))

foreign import javascript safe "(($1) => { return $1[\"getCueAsHTML\"](); })"
        js_getCueAsHTML :: VTTCue -> IO DocumentFragment
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/getCueAsHTML MDN VTTCue.getCueAsHTML documentation>
getCueAsHTML :: (MonadDOM m) => VTTCue -> m DocumentFragment
getCueAsHTML self = liftDOM ((js_getCueAsHTML (self)))

-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/getCueAsHTML MDN VTTCue.getCueAsHTML documentation>
getCueAsHTML_ :: (MonadDOM m) => VTTCue -> m ()
getCueAsHTML_ self = liftDOM (void ((js_getCueAsHTML (self))))

foreign import javascript safe "(($1, $2) => { $1[\"region\"] = $2; })"
        js_setRegion :: VTTCue -> JSVal -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/region MDN VTTCue.region documentation>
setRegion :: (MonadDOM m) => VTTCue -> Maybe VTTRegion -> m ()
setRegion self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setRegion (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"region\"]; })"
        js_getRegion :: VTTCue -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/region MDN VTTCue.region documentation>
getRegion :: (MonadDOM m) => VTTCue -> m (Maybe VTTRegion)
getRegion self = liftDOM (((js_getRegion (self)) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/region MDN VTTCue.region documentation>
getRegionUnsafe :: (MonadDOM m, HasCallStack) => VTTCue -> m VTTRegion
getRegionUnsafe self = liftDOM ((((js_getRegion (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/region MDN VTTCue.region documentation>
getRegionUnchecked :: (MonadDOM m) => VTTCue -> m VTTRegion
getRegionUnchecked self = liftDOM ((pFromJSVal <$> (js_getRegion (self))))

foreign import javascript safe "(($1, $2) => { $1[\"vertical\"] = $2; })"
        js_setVertical :: VTTCue -> JSVal -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/vertical MDN VTTCue.vertical documentation>
setVertical :: (MonadDOM m) => VTTCue -> DirectionSetting -> m ()
setVertical self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setVertical (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"vertical\"]; })"
        js_getVertical :: VTTCue -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/vertical MDN VTTCue.vertical documentation>
getVertical :: (MonadDOM m) => VTTCue -> m DirectionSetting
getVertical self = liftDOM (((js_getVertical (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"snapToLines\"] = $2; })"
        js_setSnapToLines :: VTTCue -> Bool -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/snapToLines MDN VTTCue.snapToLines documentation>
setSnapToLines :: (MonadDOM m) => VTTCue -> Bool -> m ()
setSnapToLines self val = liftDOM (void ((js_setSnapToLines (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"snapToLines\"]; })"
        js_getSnapToLines :: VTTCue -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/snapToLines MDN VTTCue.snapToLines documentation>
getSnapToLines :: (MonadDOM m) => VTTCue -> m Bool
getSnapToLines self = liftDOM ((js_getSnapToLines (self)))

foreign import javascript safe "(($1, $2) => { $1[\"line\"] = $2; })"
        js_setLine :: VTTCue -> LineAndPositionSetting -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/line MDN VTTCue.line documentation>
setLine :: (MonadDOM m, IsLineAndPositionSetting val) => VTTCue -> val -> m ()
setLine self val = liftDOM (void ((js_setLine (self) (Types.toLineAndPositionSetting val))))

foreign import javascript unsafe "(($1) => { return $1[\"line\"]; })"
        js_getLine :: VTTCue -> IO LineAndPositionSetting
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/line MDN VTTCue.line documentation>
getLine :: (MonadDOM m) => VTTCue -> m LineAndPositionSetting
getLine self = liftDOM ((js_getLine (self)))

foreign import javascript safe "(($1, $2) => { $1[\"lineAlign\"] = $2; })"
        js_setLineAlign :: VTTCue -> JSVal -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/lineAlign MDN VTTCue.lineAlign documentation>
setLineAlign :: (MonadDOM m) => VTTCue -> LineAlignSetting -> m ()
setLineAlign self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setLineAlign (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"lineAlign\"]; })"
        js_getLineAlign :: VTTCue -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/lineAlign MDN VTTCue.lineAlign documentation>
getLineAlign :: (MonadDOM m) => VTTCue -> m LineAlignSetting
getLineAlign self = liftDOM (((js_getLineAlign (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"position\"] = $2; })"
        js_setPosition :: VTTCue -> LineAndPositionSetting -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/position MDN VTTCue.position documentation>
setPosition :: (MonadDOM m, IsLineAndPositionSetting val) => VTTCue -> val -> m ()
setPosition self val = liftDOM (void ((js_setPosition (self) (Types.toLineAndPositionSetting val))))

foreign import javascript unsafe "(($1) => { return $1[\"position\"]; })"
        js_getPosition :: VTTCue -> IO LineAndPositionSetting
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/position MDN VTTCue.position documentation>
getPosition :: (MonadDOM m) => VTTCue -> m LineAndPositionSetting
getPosition self = liftDOM ((js_getPosition (self)))

foreign import javascript safe "(($1, $2) => { $1[\"positionAlign\"] = $2; })"
        js_setPositionAlign :: VTTCue -> JSVal -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/positionAlign MDN VTTCue.positionAlign documentation>
setPositionAlign :: (MonadDOM m) => VTTCue -> PositionAlignSetting -> m ()
setPositionAlign self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setPositionAlign (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"positionAlign\"]; })"
        js_getPositionAlign :: VTTCue -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/positionAlign MDN VTTCue.positionAlign documentation>
getPositionAlign :: (MonadDOM m) => VTTCue -> m PositionAlignSetting
getPositionAlign self = liftDOM (((js_getPositionAlign (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"size\"] = $2; })"
        js_setSize :: VTTCue -> Double -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/size MDN VTTCue.size documentation>
setSize :: (MonadDOM m) => VTTCue -> Double -> m ()
setSize self val = liftDOM (void ((js_setSize (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"size\"]; })"
        js_getSize :: VTTCue -> IO Double
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/size MDN VTTCue.size documentation>
getSize :: (MonadDOM m) => VTTCue -> m Double
getSize self = liftDOM ((js_getSize (self)))

foreign import javascript safe "(($1, $2) => { $1[\"align\"] = $2; })"
        js_setAlign :: VTTCue -> JSVal -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/align MDN VTTCue.align documentation>
setAlign :: (MonadDOM m) => VTTCue -> AlignSetting -> m ()
setAlign self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setAlign (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"align\"]; })"
        js_getAlign :: VTTCue -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/align MDN VTTCue.align documentation>
getAlign :: (MonadDOM m) => VTTCue -> m AlignSetting
getAlign self = liftDOM (((js_getAlign (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"text\"] = $2; })"
        js_setText :: VTTCue -> JSString -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/text MDN VTTCue.text documentation>
setText :: (MonadDOM m, ToJSString val) => VTTCue -> val -> m ()
setText self val = liftDOM (void ((js_setText (self) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"text\"]; })"
        js_getText :: VTTCue -> IO JSString
-- | <https://developer.mozilla.org/docs/Web/API/VTTCue/text MDN VTTCue.text documentation>
getText :: (MonadDOM m, FromJSString result) => VTTCue -> m result
getText self = liftDOM ((fromJSString <$> (js_getText (self))))