{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.DataTransfer
(setDragImage, getData, getData_, setData, clearData,
setDropEffect, getDropEffect, setEffectAllowed, getEffectAllowed,
getItems, getTypes, getFiles, DataTransfer(..), gTypeDataTransfer)
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
setDragImage ::
(MonadDOM m, IsElement image) =>
DataTransfer -> Maybe image -> Int -> Int -> m ()
setDragImage self image x y
= liftDOM
(void
(self ^. jsf "setDragImage" [toJSVal image, toJSVal x, toJSVal y]))
getData ::
(MonadDOM m, ToJSString format, FromJSString result) =>
DataTransfer -> format -> m result
getData self format
= liftDOM
((self ^. jsf "getData" [toJSVal format]) >>= fromJSValUnchecked)
getData_ ::
(MonadDOM m, ToJSString format) => DataTransfer -> format -> m ()
getData_ self format
= liftDOM (void (self ^. jsf "getData" [toJSVal format]))
setData ::
(MonadDOM m, ToJSString format, ToJSString data') =>
DataTransfer -> format -> data' -> m ()
setData self format data'
= liftDOM
(void (self ^. jsf "setData" [toJSVal format, toJSVal data']))
clearData ::
(MonadDOM m, ToJSString format) =>
DataTransfer -> Maybe format -> m ()
clearData self format
= liftDOM (void (self ^. jsf "clearData" [toJSVal format]))
setDropEffect ::
(MonadDOM m, ToJSString val) => DataTransfer -> val -> m ()
setDropEffect self val
= liftDOM (self ^. jss "dropEffect" (toJSVal val))
getDropEffect ::
(MonadDOM m, FromJSString result) => DataTransfer -> m result
getDropEffect self
= liftDOM ((self ^. js "dropEffect") >>= fromJSValUnchecked)
setEffectAllowed ::
(MonadDOM m, ToJSString val) => DataTransfer -> val -> m ()
setEffectAllowed self val
= liftDOM (self ^. jss "effectAllowed" (toJSVal val))
getEffectAllowed ::
(MonadDOM m, FromJSString result) => DataTransfer -> m result
getEffectAllowed self
= liftDOM ((self ^. js "effectAllowed") >>= fromJSValUnchecked)
getItems :: (MonadDOM m) => DataTransfer -> m DataTransferItemList
getItems self
= liftDOM ((self ^. js "items") >>= fromJSValUnchecked)
getTypes ::
(MonadDOM m, FromJSString result) => DataTransfer -> m [result]
getTypes self
= liftDOM ((self ^. js "types") >>= fromJSArrayUnchecked)
getFiles :: (MonadDOM m) => DataTransfer -> m FileList
getFiles self
= liftDOM ((self ^. js "files") >>= fromJSValUnchecked)