Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- newtype Media = Media (ManagedPtr Media)
- class GObject o => IsMedia o
- toMedia :: (MonadIO m, IsMedia o) => o -> m Media
- noMedia :: Maybe Media
- mediaGetFilename :: (HasCallStack, MonadIO m, IsMedia a) => a -> m Text
- mediaGetMimeType :: (HasCallStack, MonadIO m, IsMedia a) => a -> m Text
- mediaIsEmbedded :: (HasCallStack, MonadIO m, IsMedia a) => a -> m Bool
- mediaSave :: (HasCallStack, MonadIO m, IsMedia a) => a -> Text -> m ()
- mediaSaveToCallback :: (HasCallStack, MonadIO m, IsMedia a) => a -> FunPtr C_MediaSaveFunc -> m ()
Exported types
Methods
getFilename
:: (HasCallStack, MonadIO m, IsMedia a) | |
=> a |
|
-> m Text | Returns: a filename, return value is owned by |
Returns the media clip filename, in case of non-embedded media. filename might be a local relative or absolute path or a URI
Since: 0.14
getMimeType
:: (HasCallStack, MonadIO m, IsMedia a) | |
=> a |
|
-> m Text | Returns: the mime-type, return value is owned by |
Returns the media clip mime-type
Since: 0.14
isEmbedded
:: (HasCallStack, MonadIO m, IsMedia a) | |
=> a |
|
-> m Bool |
Whether the media clip is embedded in the PDF. If the result is True
, the embedded stream
can be saved with mediaSave
or mediaSaveToCallback
function.
If the result is False
, the media clip filename can be retrieved with
mediaGetFilename
function.
Since: 0.14
save
:: (HasCallStack, MonadIO m, IsMedia a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Saves embedded stream of popplerMedia
to a file indicated by filename
.
If error
is set, False
will be returned.
Possible errors include those in the G_FILE_ERROR
domain
and whatever the save function generates.
Since: 0.14
saveToCallback
:: (HasCallStack, MonadIO m, IsMedia a) | |
=> a |
|
-> FunPtr C_MediaSaveFunc |
|
-> m () | (Can throw |
Saves embedded stream of popplerMedia
by feeding the produced data to saveFunc
. Can be used
when you want to store the media clip stream to something other than a file, such as
an in-memory buffer or a socket. If error
is set, False
will be
returned. Possible errors include those in the G_FILE_ERROR
domain and
whatever the save function generates.
Since: 0.14