{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.HTMLTrackElement
(pattern NONE, pattern LOADING, pattern LOADED, pattern ERROR,
setKind, getKind, setSrc, getSrc, setSrclang, getSrclang, setLabel,
getLabel, setDefault, getDefault, getReadyState, getTrack,
HTMLTrackElement(..), gTypeHTMLTrackElement)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Enums
pattern $mNONE :: forall {r} {a}.
(Eq a, Num a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNONE :: forall {a}. (Eq a, Num a) => a
NONE = 0
pattern $mLOADING :: forall {r} {a}.
(Eq a, Num a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bLOADING :: forall {a}. (Eq a, Num a) => a
LOADING = 1
pattern $mLOADED :: forall {r} {a}.
(Eq a, Num a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bLOADED :: forall {a}. (Eq a, Num a) => a
LOADED = 2
pattern $mERROR :: forall {r} {a}.
(Eq a, Num a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bERROR :: forall {a}. (Eq a, Num a) => a
ERROR = 3
setKind ::
(MonadDOM m, ToJSString val) => HTMLTrackElement -> val -> m ()
setKind :: forall (m :: * -> *) val.
(MonadDOM m, ToJSString val) =>
HTMLTrackElement -> val -> m ()
setKind HTMLTrackElement
self val
val = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (HTMLTrackElement
self HTMLTrackElement
-> Getting (DOM ()) HTMLTrackElement (DOM ()) -> DOM ()
forall s a. s -> Getting a s a -> a
^. String
-> JSM JSVal
-> forall o. MakeObject o => IndexPreservingGetter o (DOM ())
forall name val.
(ToJSString name, ToJSVal val) =>
name
-> val
-> forall o. MakeObject o => IndexPreservingGetter o (DOM ())
jss String
"kind" (val -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal val
val))
getKind ::
(MonadDOM m, FromJSString result) => HTMLTrackElement -> m result
getKind :: forall (m :: * -> *) result.
(MonadDOM m, FromJSString result) =>
HTMLTrackElement -> m result
getKind HTMLTrackElement
self = DOM result -> m result
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((HTMLTrackElement
self HTMLTrackElement
-> Getting (JSM JSVal) HTMLTrackElement (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter HTMLTrackElement (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"kind") JSM JSVal -> (JSVal -> DOM result) -> DOM result
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM result
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)
setSrc ::
(MonadDOM m, ToJSString val) => HTMLTrackElement -> val -> m ()
setSrc :: forall (m :: * -> *) val.
(MonadDOM m, ToJSString val) =>
HTMLTrackElement -> val -> m ()
setSrc HTMLTrackElement
self val
val = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (HTMLTrackElement
self HTMLTrackElement
-> Getting (DOM ()) HTMLTrackElement (DOM ()) -> DOM ()
forall s a. s -> Getting a s a -> a
^. String
-> JSM JSVal
-> forall o. MakeObject o => IndexPreservingGetter o (DOM ())
forall name val.
(ToJSString name, ToJSVal val) =>
name
-> val
-> forall o. MakeObject o => IndexPreservingGetter o (DOM ())
jss String
"src" (val -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal val
val))
getSrc ::
(MonadDOM m, FromJSString result) => HTMLTrackElement -> m result
getSrc :: forall (m :: * -> *) result.
(MonadDOM m, FromJSString result) =>
HTMLTrackElement -> m result
getSrc HTMLTrackElement
self = DOM result -> m result
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((HTMLTrackElement
self HTMLTrackElement
-> Getting (JSM JSVal) HTMLTrackElement (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter HTMLTrackElement (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"src") JSM JSVal -> (JSVal -> DOM result) -> DOM result
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM result
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)
setSrclang ::
(MonadDOM m, ToJSString val) => HTMLTrackElement -> val -> m ()
setSrclang :: forall (m :: * -> *) val.
(MonadDOM m, ToJSString val) =>
HTMLTrackElement -> val -> m ()
setSrclang HTMLTrackElement
self val
val = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (HTMLTrackElement
self HTMLTrackElement
-> Getting (DOM ()) HTMLTrackElement (DOM ()) -> DOM ()
forall s a. s -> Getting a s a -> a
^. String
-> JSM JSVal
-> forall o. MakeObject o => IndexPreservingGetter o (DOM ())
forall name val.
(ToJSString name, ToJSVal val) =>
name
-> val
-> forall o. MakeObject o => IndexPreservingGetter o (DOM ())
jss String
"srclang" (val -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal val
val))
getSrclang ::
(MonadDOM m, FromJSString result) => HTMLTrackElement -> m result
getSrclang :: forall (m :: * -> *) result.
(MonadDOM m, FromJSString result) =>
HTMLTrackElement -> m result
getSrclang HTMLTrackElement
self
= DOM result -> m result
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((HTMLTrackElement
self HTMLTrackElement
-> Getting (JSM JSVal) HTMLTrackElement (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter HTMLTrackElement (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"srclang") JSM JSVal -> (JSVal -> DOM result) -> DOM result
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM result
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)
setLabel ::
(MonadDOM m, ToJSString val) => HTMLTrackElement -> val -> m ()
setLabel :: forall (m :: * -> *) val.
(MonadDOM m, ToJSString val) =>
HTMLTrackElement -> val -> m ()
setLabel HTMLTrackElement
self val
val = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (HTMLTrackElement
self HTMLTrackElement
-> Getting (DOM ()) HTMLTrackElement (DOM ()) -> DOM ()
forall s a. s -> Getting a s a -> a
^. String
-> JSM JSVal
-> forall o. MakeObject o => IndexPreservingGetter o (DOM ())
forall name val.
(ToJSString name, ToJSVal val) =>
name
-> val
-> forall o. MakeObject o => IndexPreservingGetter o (DOM ())
jss String
"label" (val -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal val
val))
getLabel ::
(MonadDOM m, FromJSString result) => HTMLTrackElement -> m result
getLabel :: forall (m :: * -> *) result.
(MonadDOM m, FromJSString result) =>
HTMLTrackElement -> m result
getLabel HTMLTrackElement
self
= DOM result -> m result
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((HTMLTrackElement
self HTMLTrackElement
-> Getting (JSM JSVal) HTMLTrackElement (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter HTMLTrackElement (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"label") JSM JSVal -> (JSVal -> DOM result) -> DOM result
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM result
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)
setDefault :: (MonadDOM m) => HTMLTrackElement -> Bool -> m ()
setDefault :: forall (m :: * -> *).
MonadDOM m =>
HTMLTrackElement -> Bool -> m ()
setDefault HTMLTrackElement
self Bool
val = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (HTMLTrackElement
self HTMLTrackElement
-> Getting (DOM ()) HTMLTrackElement (DOM ()) -> DOM ()
forall s a. s -> Getting a s a -> a
^. String
-> JSM JSVal
-> forall o. MakeObject o => IndexPreservingGetter o (DOM ())
forall name val.
(ToJSString name, ToJSVal val) =>
name
-> val
-> forall o. MakeObject o => IndexPreservingGetter o (DOM ())
jss String
"default" (Bool -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Bool
val))
getDefault :: (MonadDOM m) => HTMLTrackElement -> m Bool
getDefault :: forall (m :: * -> *). MonadDOM m => HTMLTrackElement -> m Bool
getDefault HTMLTrackElement
self = DOM Bool -> m Bool
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((HTMLTrackElement
self HTMLTrackElement
-> Getting (JSM JSVal) HTMLTrackElement (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter HTMLTrackElement (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"default") JSM JSVal -> (JSVal -> DOM Bool) -> DOM Bool
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM Bool
forall value. ToJSVal value => value -> DOM Bool
valToBool)
getReadyState :: (MonadDOM m) => HTMLTrackElement -> m Word
getReadyState :: forall (m :: * -> *). MonadDOM m => HTMLTrackElement -> m Word
getReadyState HTMLTrackElement
self
= DOM Word -> m Word
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (Double -> Word
forall b. Integral b => Double -> b
forall a b. (RealFrac a, Integral b) => a -> b
round (Double -> Word) -> JSM Double -> DOM Word
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ((HTMLTrackElement
self HTMLTrackElement
-> Getting (JSM JSVal) HTMLTrackElement (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter HTMLTrackElement (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"readyState") JSM JSVal -> (JSVal -> JSM Double) -> JSM Double
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Double
forall value. ToJSVal value => value -> JSM Double
valToNumber))
getTrack :: (MonadDOM m) => HTMLTrackElement -> m TextTrack
getTrack :: forall (m :: * -> *). MonadDOM m => HTMLTrackElement -> m TextTrack
getTrack HTMLTrackElement
self
= DOM TextTrack -> m TextTrack
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((HTMLTrackElement
self HTMLTrackElement
-> Getting (JSM JSVal) HTMLTrackElement (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter HTMLTrackElement (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"track") JSM JSVal -> (JSVal -> DOM TextTrack) -> DOM TextTrack
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM TextTrack
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)