{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SpeechSynthesisUtterance (js_newSpeechSynthesisUtterance, newSpeechSynthesisUtterance, js_setText, setText, js_getText, getText, js_setLang, setLang, js_getLang, getLang, js_setVoice, setVoice, js_getVoice, getVoice, js_setVolume, setVolume, js_getVolume, getVolume, js_setRate, setRate, js_getRate, getRate, js_setPitch, setPitch, js_getPitch, getPitch, start, end, error, pause, resume, mark, boundary, SpeechSynthesisUtterance, castToSpeechSynthesisUtterance, gTypeSpeechSynthesisUtterance) 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 "new window[\"SpeechSynthesisUtterance\"]($1)" js_newSpeechSynthesisUtterance :: JSString -> IO (JSRef SpeechSynthesisUtterance) -- | newSpeechSynthesisUtterance :: (MonadIO m, ToJSString text) => text -> m SpeechSynthesisUtterance newSpeechSynthesisUtterance text = liftIO (js_newSpeechSynthesisUtterance (toJSString text) >>= fromJSRefUnchecked) foreign import javascript unsafe "$1[\"text\"] = $2;" js_setText :: JSRef SpeechSynthesisUtterance -> JSString -> IO () -- | setText :: (MonadIO m, ToJSString val) => SpeechSynthesisUtterance -> val -> m () setText self val = liftIO (js_setText (unSpeechSynthesisUtterance self) (toJSString val)) foreign import javascript unsafe "$1[\"text\"]" js_getText :: JSRef SpeechSynthesisUtterance -> IO JSString -- | getText :: (MonadIO m, FromJSString result) => SpeechSynthesisUtterance -> m result getText self = liftIO (fromJSString <$> (js_getText (unSpeechSynthesisUtterance self))) foreign import javascript unsafe "$1[\"lang\"] = $2;" js_setLang :: JSRef SpeechSynthesisUtterance -> JSString -> IO () -- | setLang :: (MonadIO m, ToJSString val) => SpeechSynthesisUtterance -> val -> m () setLang self val = liftIO (js_setLang (unSpeechSynthesisUtterance self) (toJSString val)) foreign import javascript unsafe "$1[\"lang\"]" js_getLang :: JSRef SpeechSynthesisUtterance -> IO JSString -- | getLang :: (MonadIO m, FromJSString result) => SpeechSynthesisUtterance -> m result getLang self = liftIO (fromJSString <$> (js_getLang (unSpeechSynthesisUtterance self))) foreign import javascript unsafe "$1[\"voice\"] = $2;" js_setVoice :: JSRef SpeechSynthesisUtterance -> JSRef SpeechSynthesisVoice -> IO () -- | setVoice :: (MonadIO m) => SpeechSynthesisUtterance -> Maybe SpeechSynthesisVoice -> m () setVoice self val = liftIO (js_setVoice (unSpeechSynthesisUtterance self) (maybe jsNull pToJSRef val)) foreign import javascript unsafe "$1[\"voice\"]" js_getVoice :: JSRef SpeechSynthesisUtterance -> IO (JSRef SpeechSynthesisVoice) -- | getVoice :: (MonadIO m) => SpeechSynthesisUtterance -> m (Maybe SpeechSynthesisVoice) getVoice self = liftIO ((js_getVoice (unSpeechSynthesisUtterance self)) >>= fromJSRef) foreign import javascript unsafe "$1[\"volume\"] = $2;" js_setVolume :: JSRef SpeechSynthesisUtterance -> Float -> IO () -- | setVolume :: (MonadIO m) => SpeechSynthesisUtterance -> Float -> m () setVolume self val = liftIO (js_setVolume (unSpeechSynthesisUtterance self) val) foreign import javascript unsafe "$1[\"volume\"]" js_getVolume :: JSRef SpeechSynthesisUtterance -> IO Float -- | getVolume :: (MonadIO m) => SpeechSynthesisUtterance -> m Float getVolume self = liftIO (js_getVolume (unSpeechSynthesisUtterance self)) foreign import javascript unsafe "$1[\"rate\"] = $2;" js_setRate :: JSRef SpeechSynthesisUtterance -> Float -> IO () -- | setRate :: (MonadIO m) => SpeechSynthesisUtterance -> Float -> m () setRate self val = liftIO (js_setRate (unSpeechSynthesisUtterance self) val) foreign import javascript unsafe "$1[\"rate\"]" js_getRate :: JSRef SpeechSynthesisUtterance -> IO Float -- | getRate :: (MonadIO m) => SpeechSynthesisUtterance -> m Float getRate self = liftIO (js_getRate (unSpeechSynthesisUtterance self)) foreign import javascript unsafe "$1[\"pitch\"] = $2;" js_setPitch :: JSRef SpeechSynthesisUtterance -> Float -> IO () -- | setPitch :: (MonadIO m) => SpeechSynthesisUtterance -> Float -> m () setPitch self val = liftIO (js_setPitch (unSpeechSynthesisUtterance self) val) foreign import javascript unsafe "$1[\"pitch\"]" js_getPitch :: JSRef SpeechSynthesisUtterance -> IO Float -- | getPitch :: (MonadIO m) => SpeechSynthesisUtterance -> m Float getPitch self = liftIO (js_getPitch (unSpeechSynthesisUtterance self)) -- | start :: EventName SpeechSynthesisUtterance Event start = unsafeEventName (toJSString "start") -- | end :: EventName SpeechSynthesisUtterance Event end = unsafeEventName (toJSString "end") -- | error :: EventName SpeechSynthesisUtterance UIEvent error = unsafeEventName (toJSString "error") -- | pause :: EventName SpeechSynthesisUtterance Event pause = unsafeEventName (toJSString "pause") -- | resume :: EventName SpeechSynthesisUtterance Event resume = unsafeEventName (toJSString "resume") -- | mark :: EventName SpeechSynthesisUtterance Event mark = unsafeEventName (toJSString "mark") -- | boundary :: EventName SpeechSynthesisUtterance Event boundary = unsafeEventName (toJSString "boundary")