module JSDOM.Generated.FontFace
(newFontFace, load, load_, setFamily, getFamily, setStyle,
getStyle, setWeight, getWeight, setStretch, getStretch,
setUnicodeRange, getUnicodeRange, setVariant, getVariant,
setFeatureSettings, getFeatureSettings, getStatus, getLoaded,
FontFace(..), gTypeFontFace)
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
newFontFace ::
(MonadDOM m, ToJSString family', IsStringOrBinaryData source) =>
family' -> source -> Maybe FontFaceDescriptors -> m FontFace
newFontFace family' source descriptors
= liftDOM
(FontFace <$>
new (jsg "FontFace")
[toJSVal family', toJSVal source, toJSVal descriptors])
load :: (MonadDOM m) => FontFace -> m FontFace
load self
= liftDOM
(((self ^. jsf "load" ()) >>= readPromise) >>= fromJSValUnchecked)
load_ :: (MonadDOM m) => FontFace -> m ()
load_ self = liftDOM (void (self ^. jsf "load" ()))
setFamily ::
(MonadDOM m, ToJSString val) => FontFace -> val -> m ()
setFamily self val = liftDOM (self ^. jss "family" (toJSVal val))
getFamily ::
(MonadDOM m, FromJSString result) => FontFace -> m result
getFamily self
= liftDOM ((self ^. js "family") >>= fromJSValUnchecked)
setStyle :: (MonadDOM m, ToJSString val) => FontFace -> val -> m ()
setStyle self val = liftDOM (self ^. jss "style" (toJSVal val))
getStyle ::
(MonadDOM m, FromJSString result) => FontFace -> m result
getStyle self
= liftDOM ((self ^. js "style") >>= fromJSValUnchecked)
setWeight ::
(MonadDOM m, ToJSString val) => FontFace -> val -> m ()
setWeight self val = liftDOM (self ^. jss "weight" (toJSVal val))
getWeight ::
(MonadDOM m, FromJSString result) => FontFace -> m result
getWeight self
= liftDOM ((self ^. js "weight") >>= fromJSValUnchecked)
setStretch ::
(MonadDOM m, ToJSString val) => FontFace -> val -> m ()
setStretch self val = liftDOM (self ^. jss "stretch" (toJSVal val))
getStretch ::
(MonadDOM m, FromJSString result) => FontFace -> m result
getStretch self
= liftDOM ((self ^. js "stretch") >>= fromJSValUnchecked)
setUnicodeRange ::
(MonadDOM m, ToJSString val) => FontFace -> val -> m ()
setUnicodeRange self val
= liftDOM (self ^. jss "unicodeRange" (toJSVal val))
getUnicodeRange ::
(MonadDOM m, FromJSString result) => FontFace -> m result
getUnicodeRange self
= liftDOM ((self ^. js "unicodeRange") >>= fromJSValUnchecked)
setVariant ::
(MonadDOM m, ToJSString val) => FontFace -> val -> m ()
setVariant self val = liftDOM (self ^. jss "variant" (toJSVal val))
getVariant ::
(MonadDOM m, FromJSString result) => FontFace -> m result
getVariant self
= liftDOM ((self ^. js "variant") >>= fromJSValUnchecked)
setFeatureSettings ::
(MonadDOM m, ToJSString val) => FontFace -> val -> m ()
setFeatureSettings self val
= liftDOM (self ^. jss "featureSettings" (toJSVal val))
getFeatureSettings ::
(MonadDOM m, FromJSString result) => FontFace -> m result
getFeatureSettings self
= liftDOM ((self ^. js "featureSettings") >>= fromJSValUnchecked)
getStatus :: (MonadDOM m) => FontFace -> m FontFaceLoadStatus
getStatus self
= liftDOM ((self ^. js "status") >>= fromJSValUnchecked)
getLoaded :: (MonadDOM m) => FontFace -> m FontFace
getLoaded self
= liftDOM
(((self ^. js "loaded") >>= readPromise) >>= fromJSValUnchecked)