packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/TouchInit.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from touch-events (webref). Do not edit.
module JSDOM.Generated.TouchInit
       (newTouchInit, setIdentifier, getIdentifier, setTarget, getTarget, setClientX, getClientX, getClientXUnsafe, getClientXUnchecked, setClientY, getClientY, getClientYUnsafe, getClientYUnchecked, setScreenX, getScreenX, getScreenXUnsafe, getScreenXUnchecked, setScreenY, getScreenY, getScreenYUnsafe, getScreenYUnchecked, setPageX, getPageX, getPageXUnsafe, getPageXUnchecked, setPageY, getPageY, getPageYUnsafe, getPageYUnchecked, setRadiusX, getRadiusX, getRadiusXUnsafe, getRadiusXUnchecked, setRadiusY, getRadiusY, getRadiusYUnsafe, getRadiusYUnchecked, setRotationAngle, getRotationAngle, getRotationAngleUnsafe, getRotationAngleUnchecked, setForce, getForce, getForceUnsafe, getForceUnchecked, setAltitudeAngle, getAltitudeAngle, getAltitudeAngleUnsafe, getAltitudeAngleUnchecked, setAzimuthAngle, getAzimuthAngle, getAzimuthAngleUnsafe, getAzimuthAngleUnchecked, setTouchType, getTouchType, getTouchTypeUnsafe, getTouchTypeUnchecked, TouchInit(..), gTypeTouchInit)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums

-- | <https://w3c.github.io/touch-events/#dom-touchinit TouchInit specification>
newTouchInit :: (MonadDOM m, IsEventTarget target) => Int -> target -> m TouchInit
newTouchInit identifier target = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "identifier" (toJSVal identifier)) P.>> (o ^. jss "target" (toJSVal target)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-identifier TouchInit.identifier specification>
setIdentifier :: (MonadDOM m) => TouchInit -> Int -> m ()
setIdentifier self val = liftDOM (void (self ^. jss "identifier" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-identifier TouchInit.identifier specification>
getIdentifier :: (MonadDOM m) => TouchInit -> m Int
getIdentifier self = liftDOM ((P.round <$> ((self ^. js "identifier") >>= valToNumber)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-target TouchInit.target specification>
setTarget :: (MonadDOM m, IsEventTarget val) => TouchInit -> val -> m ()
setTarget self val = liftDOM (void (self ^. jss "target" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-target TouchInit.target specification>
getTarget :: (MonadDOM m) => TouchInit -> m EventTarget
getTarget self = liftDOM (((self ^. js "target") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-clientx TouchInit.clientX specification>
setClientX :: (MonadDOM m) => TouchInit -> Double -> m ()
setClientX self val = liftDOM (void (self ^. jss "clientX" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-clientx TouchInit.clientX specification>
getClientX :: (MonadDOM m) => TouchInit -> m (Maybe Double)
getClientX self = liftDOM (((self ^. js "clientX") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-clientx TouchInit.clientX specification>
getClientXUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Double
getClientXUnsafe self = liftDOM ((((self ^. js "clientX") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-clientx TouchInit.clientX specification>
getClientXUnchecked :: (MonadDOM m) => TouchInit -> m Double
getClientXUnchecked self = liftDOM (((self ^. js "clientX") >>= valToNumber))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-clienty TouchInit.clientY specification>
setClientY :: (MonadDOM m) => TouchInit -> Double -> m ()
setClientY self val = liftDOM (void (self ^. jss "clientY" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-clienty TouchInit.clientY specification>
getClientY :: (MonadDOM m) => TouchInit -> m (Maybe Double)
getClientY self = liftDOM (((self ^. js "clientY") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-clienty TouchInit.clientY specification>
getClientYUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Double
getClientYUnsafe self = liftDOM ((((self ^. js "clientY") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-clienty TouchInit.clientY specification>
getClientYUnchecked :: (MonadDOM m) => TouchInit -> m Double
getClientYUnchecked self = liftDOM (((self ^. js "clientY") >>= valToNumber))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-screenx TouchInit.screenX specification>
setScreenX :: (MonadDOM m) => TouchInit -> Double -> m ()
setScreenX self val = liftDOM (void (self ^. jss "screenX" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-screenx TouchInit.screenX specification>
getScreenX :: (MonadDOM m) => TouchInit -> m (Maybe Double)
getScreenX self = liftDOM (((self ^. js "screenX") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-screenx TouchInit.screenX specification>
getScreenXUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Double
getScreenXUnsafe self = liftDOM ((((self ^. js "screenX") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-screenx TouchInit.screenX specification>
getScreenXUnchecked :: (MonadDOM m) => TouchInit -> m Double
getScreenXUnchecked self = liftDOM (((self ^. js "screenX") >>= valToNumber))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-screeny TouchInit.screenY specification>
setScreenY :: (MonadDOM m) => TouchInit -> Double -> m ()
setScreenY self val = liftDOM (void (self ^. jss "screenY" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-screeny TouchInit.screenY specification>
getScreenY :: (MonadDOM m) => TouchInit -> m (Maybe Double)
getScreenY self = liftDOM (((self ^. js "screenY") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-screeny TouchInit.screenY specification>
getScreenYUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Double
getScreenYUnsafe self = liftDOM ((((self ^. js "screenY") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-screeny TouchInit.screenY specification>
getScreenYUnchecked :: (MonadDOM m) => TouchInit -> m Double
getScreenYUnchecked self = liftDOM (((self ^. js "screenY") >>= valToNumber))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-pagex TouchInit.pageX specification>
setPageX :: (MonadDOM m) => TouchInit -> Double -> m ()
setPageX self val = liftDOM (void (self ^. jss "pageX" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-pagex TouchInit.pageX specification>
getPageX :: (MonadDOM m) => TouchInit -> m (Maybe Double)
getPageX self = liftDOM (((self ^. js "pageX") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-pagex TouchInit.pageX specification>
getPageXUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Double
getPageXUnsafe self = liftDOM ((((self ^. js "pageX") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-pagex TouchInit.pageX specification>
getPageXUnchecked :: (MonadDOM m) => TouchInit -> m Double
getPageXUnchecked self = liftDOM (((self ^. js "pageX") >>= valToNumber))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-pagey TouchInit.pageY specification>
setPageY :: (MonadDOM m) => TouchInit -> Double -> m ()
setPageY self val = liftDOM (void (self ^. jss "pageY" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-pagey TouchInit.pageY specification>
getPageY :: (MonadDOM m) => TouchInit -> m (Maybe Double)
getPageY self = liftDOM (((self ^. js "pageY") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-pagey TouchInit.pageY specification>
getPageYUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Double
getPageYUnsafe self = liftDOM ((((self ^. js "pageY") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-pagey TouchInit.pageY specification>
getPageYUnchecked :: (MonadDOM m) => TouchInit -> m Double
getPageYUnchecked self = liftDOM (((self ^. js "pageY") >>= valToNumber))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-radiusx TouchInit.radiusX specification>
setRadiusX :: (MonadDOM m) => TouchInit -> Float -> m ()
setRadiusX self val = liftDOM (void (self ^. jss "radiusX" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-radiusx TouchInit.radiusX specification>
getRadiusX :: (MonadDOM m) => TouchInit -> m (Maybe Float)
getRadiusX self = liftDOM (((self ^. js "radiusX") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-radiusx TouchInit.radiusX specification>
getRadiusXUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Float
getRadiusXUnsafe self = liftDOM ((((self ^. js "radiusX") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-radiusx TouchInit.radiusX specification>
getRadiusXUnchecked :: (MonadDOM m) => TouchInit -> m Float
getRadiusXUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "radiusX") >>= valToNumber)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-radiusy TouchInit.radiusY specification>
setRadiusY :: (MonadDOM m) => TouchInit -> Float -> m ()
setRadiusY self val = liftDOM (void (self ^. jss "radiusY" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-radiusy TouchInit.radiusY specification>
getRadiusY :: (MonadDOM m) => TouchInit -> m (Maybe Float)
getRadiusY self = liftDOM (((self ^. js "radiusY") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-radiusy TouchInit.radiusY specification>
getRadiusYUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Float
getRadiusYUnsafe self = liftDOM ((((self ^. js "radiusY") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-radiusy TouchInit.radiusY specification>
getRadiusYUnchecked :: (MonadDOM m) => TouchInit -> m Float
getRadiusYUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "radiusY") >>= valToNumber)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-rotationangle TouchInit.rotationAngle specification>
setRotationAngle :: (MonadDOM m) => TouchInit -> Float -> m ()
setRotationAngle self val = liftDOM (void (self ^. jss "rotationAngle" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-rotationangle TouchInit.rotationAngle specification>
getRotationAngle :: (MonadDOM m) => TouchInit -> m (Maybe Float)
getRotationAngle self = liftDOM (((self ^. js "rotationAngle") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-rotationangle TouchInit.rotationAngle specification>
getRotationAngleUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Float
getRotationAngleUnsafe self = liftDOM ((((self ^. js "rotationAngle") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-rotationangle TouchInit.rotationAngle specification>
getRotationAngleUnchecked :: (MonadDOM m) => TouchInit -> m Float
getRotationAngleUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "rotationAngle") >>= valToNumber)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-force TouchInit.force specification>
setForce :: (MonadDOM m) => TouchInit -> Float -> m ()
setForce self val = liftDOM (void (self ^. jss "force" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-force TouchInit.force specification>
getForce :: (MonadDOM m) => TouchInit -> m (Maybe Float)
getForce self = liftDOM (((self ^. js "force") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-force TouchInit.force specification>
getForceUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Float
getForceUnsafe self = liftDOM ((((self ^. js "force") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-force TouchInit.force specification>
getForceUnchecked :: (MonadDOM m) => TouchInit -> m Float
getForceUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "force") >>= valToNumber)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-altitudeangle TouchInit.altitudeAngle specification>
setAltitudeAngle :: (MonadDOM m) => TouchInit -> Double -> m ()
setAltitudeAngle self val = liftDOM (void (self ^. jss "altitudeAngle" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-altitudeangle TouchInit.altitudeAngle specification>
getAltitudeAngle :: (MonadDOM m) => TouchInit -> m (Maybe Double)
getAltitudeAngle self = liftDOM (((self ^. js "altitudeAngle") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-altitudeangle TouchInit.altitudeAngle specification>
getAltitudeAngleUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Double
getAltitudeAngleUnsafe self = liftDOM ((((self ^. js "altitudeAngle") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-altitudeangle TouchInit.altitudeAngle specification>
getAltitudeAngleUnchecked :: (MonadDOM m) => TouchInit -> m Double
getAltitudeAngleUnchecked self = liftDOM (((self ^. js "altitudeAngle") >>= valToNumber))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-azimuthangle TouchInit.azimuthAngle specification>
setAzimuthAngle :: (MonadDOM m) => TouchInit -> Double -> m ()
setAzimuthAngle self val = liftDOM (void (self ^. jss "azimuthAngle" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-azimuthangle TouchInit.azimuthAngle specification>
getAzimuthAngle :: (MonadDOM m) => TouchInit -> m (Maybe Double)
getAzimuthAngle self = liftDOM (((self ^. js "azimuthAngle") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-azimuthangle TouchInit.azimuthAngle specification>
getAzimuthAngleUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m Double
getAzimuthAngleUnsafe self = liftDOM ((((self ^. js "azimuthAngle") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-azimuthangle TouchInit.azimuthAngle specification>
getAzimuthAngleUnchecked :: (MonadDOM m) => TouchInit -> m Double
getAzimuthAngleUnchecked self = liftDOM (((self ^. js "azimuthAngle") >>= valToNumber))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-touchtype TouchInit.touchType specification>
setTouchType :: (MonadDOM m) => TouchInit -> TouchType -> m ()
setTouchType self val = liftDOM (void (self ^. jss "touchType" (toJSVal val)))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-touchtype TouchInit.touchType specification>
getTouchType :: (MonadDOM m) => TouchInit -> m (Maybe TouchType)
getTouchType self = liftDOM (((self ^. js "touchType") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-touchtype TouchInit.touchType specification>
getTouchTypeUnsafe :: (MonadDOM m, HasCallStack) => TouchInit -> m TouchType
getTouchTypeUnsafe self = liftDOM ((((self ^. js "touchType") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/touch-events/#dom-touchinit-touchtype TouchInit.touchType specification>
getTouchTypeUnchecked :: (MonadDOM m) => TouchInit -> m TouchType
getTouchTypeUnchecked self = liftDOM (((self ^. js "touchType") >>= fromJSValUnchecked))