packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from image-capture (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.PhotoSettings
       (js_newPhotoSettings, js_setFillLightMode, js_getFillLightMode, js_setImageHeight, js_getImageHeight, js_setImageWidth, js_getImageWidth, js_setRedEyeReduction, js_getRedEyeReduction, newPhotoSettings, setFillLightMode, getFillLightMode, getFillLightModeUnsafe, getFillLightModeUnchecked, setImageHeight, getImageHeight, getImageHeightUnsafe, getImageHeightUnchecked, setImageWidth, getImageWidth, getImageWidthUnsafe, getImageWidthUnchecked, setRedEyeReduction, getRedEyeReduction, getRedEyeReductionUnsafe, getRedEyeReductionUnchecked, PhotoSettings(..), gTypePhotoSettings)
       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 "(() => { return ({}); })"
        js_newPhotoSettings :: IO PhotoSettings
-- | <https://w3c.github.io/mediacapture-image/#dictdef-photosettings PhotoSettings specification>
newPhotoSettings :: (MonadDOM m) => m PhotoSettings
newPhotoSettings = liftDOM ((js_newPhotoSettings))

foreign import javascript safe "(($1, $2) => { $1[\"fillLightMode\"] = $2; })"
        js_setFillLightMode :: PhotoSettings -> JSVal -> IO ()
-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-filllightmode PhotoSettings.fillLightMode specification>
setFillLightMode :: (MonadDOM m) => PhotoSettings -> FillLightMode -> m ()
setFillLightMode self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setFillLightMode (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"fillLightMode\"]; })"
        js_getFillLightMode :: PhotoSettings -> IO JSVal
-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-filllightmode PhotoSettings.fillLightMode specification>
getFillLightMode :: (MonadDOM m) => PhotoSettings -> m (Maybe FillLightMode)
getFillLightMode self = liftDOM (((js_getFillLightMode (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-filllightmode PhotoSettings.fillLightMode specification>
getFillLightModeUnsafe :: (MonadDOM m, HasCallStack) => PhotoSettings -> m FillLightMode
getFillLightModeUnsafe self = liftDOM ((((js_getFillLightMode (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-filllightmode PhotoSettings.fillLightMode specification>
getFillLightModeUnchecked :: (MonadDOM m) => PhotoSettings -> m FillLightMode
getFillLightModeUnchecked self = liftDOM ((pFromJSVal <$> (js_getFillLightMode (self))))

foreign import javascript safe "(($1, $2) => { $1[\"imageHeight\"] = $2; })"
        js_setImageHeight :: PhotoSettings -> Double -> IO ()
-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-imageheight PhotoSettings.imageHeight specification>
setImageHeight :: (MonadDOM m) => PhotoSettings -> Double -> m ()
setImageHeight self val = liftDOM (void ((js_setImageHeight (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"imageHeight\"]; })"
        js_getImageHeight :: PhotoSettings -> IO JSVal
-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-imageheight PhotoSettings.imageHeight specification>
getImageHeight :: (MonadDOM m) => PhotoSettings -> m (Maybe Double)
getImageHeight self = liftDOM (((js_getImageHeight (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-imageheight PhotoSettings.imageHeight specification>
getImageHeightUnsafe :: (MonadDOM m, HasCallStack) => PhotoSettings -> m Double
getImageHeightUnsafe self = liftDOM ((((js_getImageHeight (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-imageheight PhotoSettings.imageHeight specification>
getImageHeightUnchecked :: (MonadDOM m) => PhotoSettings -> m Double
getImageHeightUnchecked self = liftDOM ((pFromJSVal <$> (js_getImageHeight (self))))

foreign import javascript safe "(($1, $2) => { $1[\"imageWidth\"] = $2; })"
        js_setImageWidth :: PhotoSettings -> Double -> IO ()
-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-imagewidth PhotoSettings.imageWidth specification>
setImageWidth :: (MonadDOM m) => PhotoSettings -> Double -> m ()
setImageWidth self val = liftDOM (void ((js_setImageWidth (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"imageWidth\"]; })"
        js_getImageWidth :: PhotoSettings -> IO JSVal
-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-imagewidth PhotoSettings.imageWidth specification>
getImageWidth :: (MonadDOM m) => PhotoSettings -> m (Maybe Double)
getImageWidth self = liftDOM (((js_getImageWidth (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-imagewidth PhotoSettings.imageWidth specification>
getImageWidthUnsafe :: (MonadDOM m, HasCallStack) => PhotoSettings -> m Double
getImageWidthUnsafe self = liftDOM ((((js_getImageWidth (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-imagewidth PhotoSettings.imageWidth specification>
getImageWidthUnchecked :: (MonadDOM m) => PhotoSettings -> m Double
getImageWidthUnchecked self = liftDOM ((pFromJSVal <$> (js_getImageWidth (self))))

foreign import javascript safe "(($1, $2) => { $1[\"redEyeReduction\"] = $2; })"
        js_setRedEyeReduction :: PhotoSettings -> Bool -> IO ()
-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-redeyereduction PhotoSettings.redEyeReduction specification>
setRedEyeReduction :: (MonadDOM m) => PhotoSettings -> Bool -> m ()
setRedEyeReduction self val = liftDOM (void ((js_setRedEyeReduction (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"redEyeReduction\"]; })"
        js_getRedEyeReduction :: PhotoSettings -> IO JSVal
-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-redeyereduction PhotoSettings.redEyeReduction specification>
getRedEyeReduction :: (MonadDOM m) => PhotoSettings -> m (Maybe Bool)
getRedEyeReduction self = liftDOM (((js_getRedEyeReduction (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-redeyereduction PhotoSettings.redEyeReduction specification>
getRedEyeReductionUnsafe :: (MonadDOM m, HasCallStack) => PhotoSettings -> m Bool
getRedEyeReductionUnsafe self = liftDOM ((((js_getRedEyeReduction (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/mediacapture-image/#dom-photosettings-redeyereduction PhotoSettings.redEyeReduction specification>
getRedEyeReductionUnchecked :: (MonadDOM m) => PhotoSettings -> m Bool
getRedEyeReductionUnchecked self = liftDOM ((pFromJSVal <$> (js_getRedEyeReduction (self))))