module GI.WebKit2WebExtension.Objects.DOMBlob
(
DOMBlob(..) ,
DOMBlobK ,
toDOMBlob ,
noDOMBlob ,
dOMBlobGetSize ,
DOMBlobSizePropertyInfo ,
getDOMBlobSize ,
DOMBlobTypePropertyInfo ,
getDOMBlobType ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.WebKit2WebExtension.Types
import GI.WebKit2WebExtension.Callbacks
import qualified GI.GObject as GObject
newtype DOMBlob = DOMBlob (ForeignPtr DOMBlob)
foreign import ccall "webkit_dom_blob_get_type"
c_webkit_dom_blob_get_type :: IO GType
type instance ParentTypes DOMBlob = DOMBlobParentTypes
type DOMBlobParentTypes = '[DOMObject, GObject.Object]
instance GObject DOMBlob where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_dom_blob_get_type
class GObject o => DOMBlobK o
instance (GObject o, IsDescendantOf DOMBlob o) => DOMBlobK o
toDOMBlob :: DOMBlobK o => o -> IO DOMBlob
toDOMBlob = unsafeCastTo DOMBlob
noDOMBlob :: Maybe DOMBlob
noDOMBlob = Nothing
getDOMBlobSize :: (MonadIO m, DOMBlobK o) => o -> m Word64
getDOMBlobSize obj = liftIO $ getObjectPropertyUInt64 obj "size"
data DOMBlobSizePropertyInfo
instance AttrInfo DOMBlobSizePropertyInfo where
type AttrAllowedOps DOMBlobSizePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMBlobSizePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMBlobSizePropertyInfo = DOMBlobK
type AttrGetType DOMBlobSizePropertyInfo = Word64
type AttrLabel DOMBlobSizePropertyInfo = "DOMBlob::size"
attrGet _ = getDOMBlobSize
attrSet _ = undefined
attrConstruct _ = undefined
getDOMBlobType :: (MonadIO m, DOMBlobK o) => o -> m T.Text
getDOMBlobType obj = liftIO $ getObjectPropertyString obj "type"
data DOMBlobTypePropertyInfo
instance AttrInfo DOMBlobTypePropertyInfo where
type AttrAllowedOps DOMBlobTypePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMBlobTypePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMBlobTypePropertyInfo = DOMBlobK
type AttrGetType DOMBlobTypePropertyInfo = T.Text
type AttrLabel DOMBlobTypePropertyInfo = "DOMBlob::type"
attrGet _ = getDOMBlobType
attrSet _ = undefined
attrConstruct _ = undefined
type instance AttributeList DOMBlob = DOMBlobAttributeList
type DOMBlobAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo), '("size", DOMBlobSizePropertyInfo), '("type", DOMBlobTypePropertyInfo)] :: [(Symbol, *)])
type instance SignalList DOMBlob = DOMBlobSignalList
type DOMBlobSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_dom_blob_get_size" webkit_dom_blob_get_size ::
Ptr DOMBlob ->
IO Word64
dOMBlobGetSize ::
(MonadIO m, DOMBlobK a) =>
a ->
m Word64
dOMBlobGetSize _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_blob_get_size _obj'
touchManagedPtr _obj
return result