gi-poppler-0.18.20: Poppler bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Poppler.Objects.Media

Contents

Description

No description available in the introspection data.

Synopsis

Exported types

newtype Media Source #

Memory-managed wrapper type.

Constructors

Media (ManagedPtr Media) 
Instances
GObject Media Source # 
Instance details

Defined in GI.Poppler.Objects.Media

Methods

gobjectType :: IO GType #

HasParentTypes Media Source # 
Instance details

Defined in GI.Poppler.Objects.Media

type ParentTypes Media Source # 
Instance details

Defined in GI.Poppler.Objects.Media

type ParentTypes Media = Object ': ([] :: [Type])

class (GObject o, IsDescendantOf Media o) => IsMedia o Source #

Type class for types which can be safely cast to Media, for instance with toMedia.

Instances
(GObject o, IsDescendantOf Media o) => IsMedia o Source # 
Instance details

Defined in GI.Poppler.Objects.Media

toMedia :: (MonadIO m, IsMedia o) => o -> m Media Source #

Cast to Media, for types for which this is known to be safe. For general casts, use castTo.

noMedia :: Maybe Media Source #

A convenience alias for Nothing :: Maybe Media.

Methods

getFilename

mediaGetFilename Source #

Arguments

:: (HasCallStack, MonadIO m, IsMedia a) 
=> a

popplerMedia: a Media

-> m Text

Returns: a filename, return value is owned by Media and should not be freed

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

mediaGetMimeType Source #

Arguments

:: (HasCallStack, MonadIO m, IsMedia a) 
=> a

popplerMedia: a Media

-> m Text

Returns: the mime-type, return value is owned by Media and should not be freed

Returns the media clip mime-type

Since: 0.14

isEmbedded

mediaIsEmbedded Source #

Arguments

:: (HasCallStack, MonadIO m, IsMedia a) 
=> a

popplerMedia: a Media

-> m Bool

Returns: True if media clip is embedded, False otherwise

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

mediaSave Source #

Arguments

:: (HasCallStack, MonadIO m, IsMedia a) 
=> a

popplerMedia: a Media

-> Text

filename: name of file to save

-> m ()

(Can throw GError)

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

mediaSaveToCallback Source #

Arguments

:: (HasCallStack, MonadIO m, IsMedia a) 
=> a

popplerMedia: a Media

-> FunPtr C_MediaSaveFunc

saveFunc: a function that is called to save each block of data that the save routine generates.

-> m ()

(Can throw GError)

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