module JSDOM.Generated.DeviceOrientationEvent
(initDeviceOrientationEvent, getAlpha, getAlphaUnsafe,
getAlphaUnchecked, getBeta, getBetaUnsafe, getBetaUnchecked,
getGamma, getGammaUnsafe, getGammaUnchecked, getAbsolute,
getAbsoluteUnsafe, getAbsoluteUnchecked,
DeviceOrientationEvent(..), gTypeDeviceOrientationEvent)
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)
import JSDOM.Enums
initDeviceOrientationEvent ::
(MonadDOM m, ToJSString type') =>
DeviceOrientationEvent ->
Maybe type' ->
Bool ->
Bool ->
Maybe Double ->
Maybe Double -> Maybe Double -> Maybe Bool -> m ()
initDeviceOrientationEvent self type' bubbles cancelable alpha beta
gamma absolute
= liftDOM
(void
(self ^. jsf "initDeviceOrientationEvent"
[toJSVal type', toJSVal bubbles, toJSVal cancelable, toJSVal alpha,
toJSVal beta, toJSVal gamma, toJSVal absolute]))
getAlpha ::
(MonadDOM m) => DeviceOrientationEvent -> m (Maybe Double)
getAlpha self = liftDOM ((self ^. js "alpha") >>= fromJSVal)
getAlphaUnsafe ::
(MonadDOM m, HasCallStack) => DeviceOrientationEvent -> m Double
getAlphaUnsafe self
= liftDOM
(((self ^. js "alpha") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getAlphaUnchecked ::
(MonadDOM m) => DeviceOrientationEvent -> m Double
getAlphaUnchecked self
= liftDOM ((self ^. js "alpha") >>= fromJSValUnchecked)
getBeta ::
(MonadDOM m) => DeviceOrientationEvent -> m (Maybe Double)
getBeta self = liftDOM ((self ^. js "beta") >>= fromJSVal)
getBetaUnsafe ::
(MonadDOM m, HasCallStack) => DeviceOrientationEvent -> m Double
getBetaUnsafe self
= liftDOM
(((self ^. js "beta") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getBetaUnchecked ::
(MonadDOM m) => DeviceOrientationEvent -> m Double
getBetaUnchecked self
= liftDOM ((self ^. js "beta") >>= fromJSValUnchecked)
getGamma ::
(MonadDOM m) => DeviceOrientationEvent -> m (Maybe Double)
getGamma self = liftDOM ((self ^. js "gamma") >>= fromJSVal)
getGammaUnsafe ::
(MonadDOM m, HasCallStack) => DeviceOrientationEvent -> m Double
getGammaUnsafe self
= liftDOM
(((self ^. js "gamma") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getGammaUnchecked ::
(MonadDOM m) => DeviceOrientationEvent -> m Double
getGammaUnchecked self
= liftDOM ((self ^. js "gamma") >>= fromJSValUnchecked)
getAbsolute ::
(MonadDOM m) => DeviceOrientationEvent -> m (Maybe Bool)
getAbsolute self = liftDOM ((self ^. js "absolute") >>= fromJSVal)
getAbsoluteUnsafe ::
(MonadDOM m, HasCallStack) => DeviceOrientationEvent -> m Bool
getAbsoluteUnsafe self
= liftDOM
(((self ^. js "absolute") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getAbsoluteUnchecked ::
(MonadDOM m) => DeviceOrientationEvent -> m Bool
getAbsoluteUnchecked self
= liftDOM ((self ^. js "absolute") >>= fromJSValUnchecked)