#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Poppler.Objects.Document
(
Document(..) ,
IsDocument ,
toDocument ,
noDocument ,
#if ENABLE_OVERLOADING
DocumentFindDestMethodInfo ,
#endif
documentFindDest ,
#if ENABLE_OVERLOADING
DocumentGetAttachmentsMethodInfo ,
#endif
documentGetAttachments ,
#if ENABLE_OVERLOADING
DocumentGetAuthorMethodInfo ,
#endif
documentGetAuthor ,
#if ENABLE_OVERLOADING
DocumentGetCreationDateMethodInfo ,
#endif
documentGetCreationDate ,
#if ENABLE_OVERLOADING
DocumentGetCreatorMethodInfo ,
#endif
documentGetCreator ,
#if ENABLE_OVERLOADING
DocumentGetFormFieldMethodInfo ,
#endif
documentGetFormField ,
#if ENABLE_OVERLOADING
DocumentGetIdMethodInfo ,
#endif
documentGetId ,
#if ENABLE_OVERLOADING
DocumentGetKeywordsMethodInfo ,
#endif
documentGetKeywords ,
#if ENABLE_OVERLOADING
DocumentGetMetadataMethodInfo ,
#endif
documentGetMetadata ,
#if ENABLE_OVERLOADING
DocumentGetModificationDateMethodInfo ,
#endif
documentGetModificationDate ,
#if ENABLE_OVERLOADING
DocumentGetNAttachmentsMethodInfo ,
#endif
documentGetNAttachments ,
#if ENABLE_OVERLOADING
DocumentGetNPagesMethodInfo ,
#endif
documentGetNPages ,
#if ENABLE_OVERLOADING
DocumentGetPageMethodInfo ,
#endif
documentGetPage ,
#if ENABLE_OVERLOADING
DocumentGetPageByLabelMethodInfo ,
#endif
documentGetPageByLabel ,
#if ENABLE_OVERLOADING
DocumentGetPageLayoutMethodInfo ,
#endif
documentGetPageLayout ,
#if ENABLE_OVERLOADING
DocumentGetPageModeMethodInfo ,
#endif
documentGetPageMode ,
#if ENABLE_OVERLOADING
DocumentGetPdfConformanceMethodInfo ,
#endif
documentGetPdfConformance ,
#if ENABLE_OVERLOADING
DocumentGetPdfPartMethodInfo ,
#endif
documentGetPdfPart ,
#if ENABLE_OVERLOADING
DocumentGetPdfSubtypeMethodInfo ,
#endif
documentGetPdfSubtype ,
#if ENABLE_OVERLOADING
DocumentGetPdfSubtypeStringMethodInfo ,
#endif
documentGetPdfSubtypeString ,
#if ENABLE_OVERLOADING
DocumentGetPdfVersionMethodInfo ,
#endif
documentGetPdfVersion ,
#if ENABLE_OVERLOADING
DocumentGetPdfVersionStringMethodInfo ,
#endif
documentGetPdfVersionString ,
#if ENABLE_OVERLOADING
DocumentGetPermissionsMethodInfo ,
#endif
documentGetPermissions ,
#if ENABLE_OVERLOADING
DocumentGetPrintScalingMethodInfo ,
#endif
documentGetPrintScaling ,
#if ENABLE_OVERLOADING
DocumentGetProducerMethodInfo ,
#endif
documentGetProducer ,
#if ENABLE_OVERLOADING
DocumentGetSubjectMethodInfo ,
#endif
documentGetSubject ,
#if ENABLE_OVERLOADING
DocumentGetTitleMethodInfo ,
#endif
documentGetTitle ,
#if ENABLE_OVERLOADING
DocumentHasAttachmentsMethodInfo ,
#endif
documentHasAttachments ,
#if ENABLE_OVERLOADING
DocumentIsLinearizedMethodInfo ,
#endif
documentIsLinearized ,
documentNewFromData ,
documentNewFromFile ,
documentNewFromGfile ,
documentNewFromStream ,
#if ENABLE_OVERLOADING
DocumentSaveMethodInfo ,
#endif
documentSave ,
#if ENABLE_OVERLOADING
DocumentSaveACopyMethodInfo ,
#endif
documentSaveACopy ,
#if ENABLE_OVERLOADING
DocumentSetAuthorMethodInfo ,
#endif
documentSetAuthor ,
#if ENABLE_OVERLOADING
DocumentSetCreationDateMethodInfo ,
#endif
documentSetCreationDate ,
#if ENABLE_OVERLOADING
DocumentSetCreatorMethodInfo ,
#endif
documentSetCreator ,
#if ENABLE_OVERLOADING
DocumentSetKeywordsMethodInfo ,
#endif
documentSetKeywords ,
#if ENABLE_OVERLOADING
DocumentSetModificationDateMethodInfo ,
#endif
documentSetModificationDate ,
#if ENABLE_OVERLOADING
DocumentSetProducerMethodInfo ,
#endif
documentSetProducer ,
#if ENABLE_OVERLOADING
DocumentSetSubjectMethodInfo ,
#endif
documentSetSubject ,
#if ENABLE_OVERLOADING
DocumentSetTitleMethodInfo ,
#endif
documentSetTitle ,
#if ENABLE_OVERLOADING
DocumentAuthorPropertyInfo ,
#endif
constructDocumentAuthor ,
#if ENABLE_OVERLOADING
documentAuthor ,
#endif
getDocumentAuthor ,
setDocumentAuthor ,
#if ENABLE_OVERLOADING
DocumentCreationDatePropertyInfo ,
#endif
constructDocumentCreationDate ,
#if ENABLE_OVERLOADING
documentCreationDate ,
#endif
getDocumentCreationDate ,
setDocumentCreationDate ,
#if ENABLE_OVERLOADING
DocumentCreatorPropertyInfo ,
#endif
constructDocumentCreator ,
#if ENABLE_OVERLOADING
documentCreator ,
#endif
getDocumentCreator ,
setDocumentCreator ,
#if ENABLE_OVERLOADING
DocumentFormatPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentFormat ,
#endif
getDocumentFormat ,
#if ENABLE_OVERLOADING
DocumentFormatMajorPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentFormatMajor ,
#endif
getDocumentFormatMajor ,
#if ENABLE_OVERLOADING
DocumentFormatMinorPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentFormatMinor ,
#endif
getDocumentFormatMinor ,
#if ENABLE_OVERLOADING
DocumentKeywordsPropertyInfo ,
#endif
constructDocumentKeywords ,
#if ENABLE_OVERLOADING
documentKeywords ,
#endif
getDocumentKeywords ,
setDocumentKeywords ,
#if ENABLE_OVERLOADING
DocumentLinearizedPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentLinearized ,
#endif
getDocumentLinearized ,
#if ENABLE_OVERLOADING
DocumentMetadataPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentMetadata ,
#endif
getDocumentMetadata ,
#if ENABLE_OVERLOADING
DocumentModDatePropertyInfo ,
#endif
constructDocumentModDate ,
#if ENABLE_OVERLOADING
documentModDate ,
#endif
getDocumentModDate ,
setDocumentModDate ,
#if ENABLE_OVERLOADING
DocumentPageLayoutPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentPageLayout ,
#endif
getDocumentPageLayout ,
#if ENABLE_OVERLOADING
DocumentPageModePropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentPageMode ,
#endif
getDocumentPageMode ,
#if ENABLE_OVERLOADING
DocumentPermissionsPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentPermissions ,
#endif
getDocumentPermissions ,
#if ENABLE_OVERLOADING
DocumentPrintScalingPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentPrintScaling ,
#endif
getDocumentPrintScaling ,
#if ENABLE_OVERLOADING
DocumentProducerPropertyInfo ,
#endif
constructDocumentProducer ,
#if ENABLE_OVERLOADING
documentProducer ,
#endif
getDocumentProducer ,
setDocumentProducer ,
#if ENABLE_OVERLOADING
DocumentSubjectPropertyInfo ,
#endif
constructDocumentSubject ,
#if ENABLE_OVERLOADING
documentSubject ,
#endif
getDocumentSubject ,
setDocumentSubject ,
#if ENABLE_OVERLOADING
DocumentSubtypePropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentSubtype ,
#endif
getDocumentSubtype ,
#if ENABLE_OVERLOADING
DocumentSubtypeConformancePropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentSubtypeConformance ,
#endif
getDocumentSubtypeConformance ,
#if ENABLE_OVERLOADING
DocumentSubtypePartPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentSubtypePart ,
#endif
getDocumentSubtypePart ,
#if ENABLE_OVERLOADING
DocumentSubtypeStringPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentSubtypeString ,
#endif
getDocumentSubtypeString ,
#if ENABLE_OVERLOADING
DocumentTitlePropertyInfo ,
#endif
constructDocumentTitle ,
#if ENABLE_OVERLOADING
documentTitle ,
#endif
getDocumentTitle ,
setDocumentTitle ,
#if ENABLE_OVERLOADING
DocumentViewerPreferencesPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
documentViewerPreferences ,
#endif
getDocumentViewerPreferences ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Poppler.Enums as Poppler.Enums
import {-# SOURCE #-} qualified GI.Poppler.Flags as Poppler.Flags
import {-# SOURCE #-} qualified GI.Poppler.Objects.Attachment as Poppler.Attachment
import {-# SOURCE #-} qualified GI.Poppler.Objects.FormField as Poppler.FormField
import {-# SOURCE #-} qualified GI.Poppler.Objects.Page as Poppler.Page
import {-# SOURCE #-} qualified GI.Poppler.Structs.Dest as Poppler.Dest
newtype Document = Document (ManagedPtr Document)
foreign import ccall "poppler_document_get_type"
c_poppler_document_get_type :: IO GType
instance GObject Document where
gobjectType = c_poppler_document_get_type
class (GObject o, O.IsDescendantOf Document o) => IsDocument o
instance (GObject o, O.IsDescendantOf Document o) => IsDocument o
instance O.HasParentTypes Document
type instance O.ParentTypes Document = '[GObject.Object.Object]
toDocument :: (MonadIO m, IsDocument o) => o -> m Document
toDocument = liftIO . unsafeCastTo Document
noDocument :: Maybe Document
noDocument = Nothing
#if ENABLE_OVERLOADING
type family ResolveDocumentMethod (t :: Symbol) (o :: *) :: * where
ResolveDocumentMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDocumentMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDocumentMethod "findDest" o = DocumentFindDestMethodInfo
ResolveDocumentMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDocumentMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDocumentMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDocumentMethod "hasAttachments" o = DocumentHasAttachmentsMethodInfo
ResolveDocumentMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDocumentMethod "isLinearized" o = DocumentIsLinearizedMethodInfo
ResolveDocumentMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDocumentMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDocumentMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDocumentMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDocumentMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDocumentMethod "save" o = DocumentSaveMethodInfo
ResolveDocumentMethod "saveACopy" o = DocumentSaveACopyMethodInfo
ResolveDocumentMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDocumentMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDocumentMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDocumentMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDocumentMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDocumentMethod "getAttachments" o = DocumentGetAttachmentsMethodInfo
ResolveDocumentMethod "getAuthor" o = DocumentGetAuthorMethodInfo
ResolveDocumentMethod "getCreationDate" o = DocumentGetCreationDateMethodInfo
ResolveDocumentMethod "getCreator" o = DocumentGetCreatorMethodInfo
ResolveDocumentMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDocumentMethod "getFormField" o = DocumentGetFormFieldMethodInfo
ResolveDocumentMethod "getId" o = DocumentGetIdMethodInfo
ResolveDocumentMethod "getKeywords" o = DocumentGetKeywordsMethodInfo
ResolveDocumentMethod "getMetadata" o = DocumentGetMetadataMethodInfo
ResolveDocumentMethod "getModificationDate" o = DocumentGetModificationDateMethodInfo
ResolveDocumentMethod "getNAttachments" o = DocumentGetNAttachmentsMethodInfo
ResolveDocumentMethod "getNPages" o = DocumentGetNPagesMethodInfo
ResolveDocumentMethod "getPage" o = DocumentGetPageMethodInfo
ResolveDocumentMethod "getPageByLabel" o = DocumentGetPageByLabelMethodInfo
ResolveDocumentMethod "getPageLayout" o = DocumentGetPageLayoutMethodInfo
ResolveDocumentMethod "getPageMode" o = DocumentGetPageModeMethodInfo
ResolveDocumentMethod "getPdfConformance" o = DocumentGetPdfConformanceMethodInfo
ResolveDocumentMethod "getPdfPart" o = DocumentGetPdfPartMethodInfo
ResolveDocumentMethod "getPdfSubtype" o = DocumentGetPdfSubtypeMethodInfo
ResolveDocumentMethod "getPdfSubtypeString" o = DocumentGetPdfSubtypeStringMethodInfo
ResolveDocumentMethod "getPdfVersion" o = DocumentGetPdfVersionMethodInfo
ResolveDocumentMethod "getPdfVersionString" o = DocumentGetPdfVersionStringMethodInfo
ResolveDocumentMethod "getPermissions" o = DocumentGetPermissionsMethodInfo
ResolveDocumentMethod "getPrintScaling" o = DocumentGetPrintScalingMethodInfo
ResolveDocumentMethod "getProducer" o = DocumentGetProducerMethodInfo
ResolveDocumentMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDocumentMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDocumentMethod "getSubject" o = DocumentGetSubjectMethodInfo
ResolveDocumentMethod "getTitle" o = DocumentGetTitleMethodInfo
ResolveDocumentMethod "setAuthor" o = DocumentSetAuthorMethodInfo
ResolveDocumentMethod "setCreationDate" o = DocumentSetCreationDateMethodInfo
ResolveDocumentMethod "setCreator" o = DocumentSetCreatorMethodInfo
ResolveDocumentMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDocumentMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDocumentMethod "setKeywords" o = DocumentSetKeywordsMethodInfo
ResolveDocumentMethod "setModificationDate" o = DocumentSetModificationDateMethodInfo
ResolveDocumentMethod "setProducer" o = DocumentSetProducerMethodInfo
ResolveDocumentMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDocumentMethod "setSubject" o = DocumentSetSubjectMethodInfo
ResolveDocumentMethod "setTitle" o = DocumentSetTitleMethodInfo
ResolveDocumentMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDocumentMethod t Document, O.MethodInfo info Document p) => OL.IsLabel t (Document -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
getDocumentAuthor :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentAuthor obj = liftIO $ B.Properties.getObjectPropertyString obj "author"
setDocumentAuthor :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentAuthor obj val = liftIO $ B.Properties.setObjectPropertyString obj "author" (Just val)
constructDocumentAuthor :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentAuthor val = B.Properties.constructObjectPropertyString "author" (Just val)
#if ENABLE_OVERLOADING
data DocumentAuthorPropertyInfo
instance AttrInfo DocumentAuthorPropertyInfo where
type AttrAllowedOps DocumentAuthorPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DocumentAuthorPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint DocumentAuthorPropertyInfo = IsDocument
type AttrGetType DocumentAuthorPropertyInfo = (Maybe T.Text)
type AttrLabel DocumentAuthorPropertyInfo = "author"
type AttrOrigin DocumentAuthorPropertyInfo = Document
attrGet _ = getDocumentAuthor
attrSet _ = setDocumentAuthor
attrConstruct _ = constructDocumentAuthor
attrClear _ = undefined
#endif
getDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> m Int32
getDocumentCreationDate obj = liftIO $ B.Properties.getObjectPropertyInt32 obj "creation-date"
setDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m ()
setDocumentCreationDate obj val = liftIO $ B.Properties.setObjectPropertyInt32 obj "creation-date" val
constructDocumentCreationDate :: (IsDocument o) => Int32 -> IO (GValueConstruct o)
constructDocumentCreationDate val = B.Properties.constructObjectPropertyInt32 "creation-date" val
#if ENABLE_OVERLOADING
data DocumentCreationDatePropertyInfo
instance AttrInfo DocumentCreationDatePropertyInfo where
type AttrAllowedOps DocumentCreationDatePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DocumentCreationDatePropertyInfo = (~) Int32
type AttrBaseTypeConstraint DocumentCreationDatePropertyInfo = IsDocument
type AttrGetType DocumentCreationDatePropertyInfo = Int32
type AttrLabel DocumentCreationDatePropertyInfo = "creation-date"
type AttrOrigin DocumentCreationDatePropertyInfo = Document
attrGet _ = getDocumentCreationDate
attrSet _ = setDocumentCreationDate
attrConstruct _ = constructDocumentCreationDate
attrClear _ = undefined
#endif
getDocumentCreator :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentCreator obj = liftIO $ B.Properties.getObjectPropertyString obj "creator"
setDocumentCreator :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentCreator obj val = liftIO $ B.Properties.setObjectPropertyString obj "creator" (Just val)
constructDocumentCreator :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentCreator val = B.Properties.constructObjectPropertyString "creator" (Just val)
#if ENABLE_OVERLOADING
data DocumentCreatorPropertyInfo
instance AttrInfo DocumentCreatorPropertyInfo where
type AttrAllowedOps DocumentCreatorPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DocumentCreatorPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint DocumentCreatorPropertyInfo = IsDocument
type AttrGetType DocumentCreatorPropertyInfo = (Maybe T.Text)
type AttrLabel DocumentCreatorPropertyInfo = "creator"
type AttrOrigin DocumentCreatorPropertyInfo = Document
attrGet _ = getDocumentCreator
attrSet _ = setDocumentCreator
attrConstruct _ = constructDocumentCreator
attrClear _ = undefined
#endif
getDocumentFormat :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentFormat obj = liftIO $ B.Properties.getObjectPropertyString obj "format"
#if ENABLE_OVERLOADING
data DocumentFormatPropertyInfo
instance AttrInfo DocumentFormatPropertyInfo where
type AttrAllowedOps DocumentFormatPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DocumentFormatPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentFormatPropertyInfo = IsDocument
type AttrGetType DocumentFormatPropertyInfo = (Maybe T.Text)
type AttrLabel DocumentFormatPropertyInfo = "format"
type AttrOrigin DocumentFormatPropertyInfo = Document
attrGet _ = getDocumentFormat
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentFormatMajor :: (MonadIO m, IsDocument o) => o -> m Word32
getDocumentFormatMajor obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "format-major"
#if ENABLE_OVERLOADING
data DocumentFormatMajorPropertyInfo
instance AttrInfo DocumentFormatMajorPropertyInfo where
type AttrAllowedOps DocumentFormatMajorPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentFormatMajorPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentFormatMajorPropertyInfo = IsDocument
type AttrGetType DocumentFormatMajorPropertyInfo = Word32
type AttrLabel DocumentFormatMajorPropertyInfo = "format-major"
type AttrOrigin DocumentFormatMajorPropertyInfo = Document
attrGet _ = getDocumentFormatMajor
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentFormatMinor :: (MonadIO m, IsDocument o) => o -> m Word32
getDocumentFormatMinor obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "format-minor"
#if ENABLE_OVERLOADING
data DocumentFormatMinorPropertyInfo
instance AttrInfo DocumentFormatMinorPropertyInfo where
type AttrAllowedOps DocumentFormatMinorPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentFormatMinorPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentFormatMinorPropertyInfo = IsDocument
type AttrGetType DocumentFormatMinorPropertyInfo = Word32
type AttrLabel DocumentFormatMinorPropertyInfo = "format-minor"
type AttrOrigin DocumentFormatMinorPropertyInfo = Document
attrGet _ = getDocumentFormatMinor
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentKeywords :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentKeywords obj = liftIO $ B.Properties.getObjectPropertyString obj "keywords"
setDocumentKeywords :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentKeywords obj val = liftIO $ B.Properties.setObjectPropertyString obj "keywords" (Just val)
constructDocumentKeywords :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentKeywords val = B.Properties.constructObjectPropertyString "keywords" (Just val)
#if ENABLE_OVERLOADING
data DocumentKeywordsPropertyInfo
instance AttrInfo DocumentKeywordsPropertyInfo where
type AttrAllowedOps DocumentKeywordsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DocumentKeywordsPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint DocumentKeywordsPropertyInfo = IsDocument
type AttrGetType DocumentKeywordsPropertyInfo = (Maybe T.Text)
type AttrLabel DocumentKeywordsPropertyInfo = "keywords"
type AttrOrigin DocumentKeywordsPropertyInfo = Document
attrGet _ = getDocumentKeywords
attrSet _ = setDocumentKeywords
attrConstruct _ = constructDocumentKeywords
attrClear _ = undefined
#endif
getDocumentLinearized :: (MonadIO m, IsDocument o) => o -> m Bool
getDocumentLinearized obj = liftIO $ B.Properties.getObjectPropertyBool obj "linearized"
#if ENABLE_OVERLOADING
data DocumentLinearizedPropertyInfo
instance AttrInfo DocumentLinearizedPropertyInfo where
type AttrAllowedOps DocumentLinearizedPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentLinearizedPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentLinearizedPropertyInfo = IsDocument
type AttrGetType DocumentLinearizedPropertyInfo = Bool
type AttrLabel DocumentLinearizedPropertyInfo = "linearized"
type AttrOrigin DocumentLinearizedPropertyInfo = Document
attrGet _ = getDocumentLinearized
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentMetadata :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentMetadata obj = liftIO $ B.Properties.getObjectPropertyString obj "metadata"
#if ENABLE_OVERLOADING
data DocumentMetadataPropertyInfo
instance AttrInfo DocumentMetadataPropertyInfo where
type AttrAllowedOps DocumentMetadataPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DocumentMetadataPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentMetadataPropertyInfo = IsDocument
type AttrGetType DocumentMetadataPropertyInfo = (Maybe T.Text)
type AttrLabel DocumentMetadataPropertyInfo = "metadata"
type AttrOrigin DocumentMetadataPropertyInfo = Document
attrGet _ = getDocumentMetadata
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentModDate :: (MonadIO m, IsDocument o) => o -> m Int32
getDocumentModDate obj = liftIO $ B.Properties.getObjectPropertyInt32 obj "mod-date"
setDocumentModDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m ()
setDocumentModDate obj val = liftIO $ B.Properties.setObjectPropertyInt32 obj "mod-date" val
constructDocumentModDate :: (IsDocument o) => Int32 -> IO (GValueConstruct o)
constructDocumentModDate val = B.Properties.constructObjectPropertyInt32 "mod-date" val
#if ENABLE_OVERLOADING
data DocumentModDatePropertyInfo
instance AttrInfo DocumentModDatePropertyInfo where
type AttrAllowedOps DocumentModDatePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DocumentModDatePropertyInfo = (~) Int32
type AttrBaseTypeConstraint DocumentModDatePropertyInfo = IsDocument
type AttrGetType DocumentModDatePropertyInfo = Int32
type AttrLabel DocumentModDatePropertyInfo = "mod-date"
type AttrOrigin DocumentModDatePropertyInfo = Document
attrGet _ = getDocumentModDate
attrSet _ = setDocumentModDate
attrConstruct _ = constructDocumentModDate
attrClear _ = undefined
#endif
getDocumentPageLayout :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PageLayout
getDocumentPageLayout obj = liftIO $ B.Properties.getObjectPropertyEnum obj "page-layout"
#if ENABLE_OVERLOADING
data DocumentPageLayoutPropertyInfo
instance AttrInfo DocumentPageLayoutPropertyInfo where
type AttrAllowedOps DocumentPageLayoutPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentPageLayoutPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentPageLayoutPropertyInfo = IsDocument
type AttrGetType DocumentPageLayoutPropertyInfo = Poppler.Enums.PageLayout
type AttrLabel DocumentPageLayoutPropertyInfo = "page-layout"
type AttrOrigin DocumentPageLayoutPropertyInfo = Document
attrGet _ = getDocumentPageLayout
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentPageMode :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PageMode
getDocumentPageMode obj = liftIO $ B.Properties.getObjectPropertyEnum obj "page-mode"
#if ENABLE_OVERLOADING
data DocumentPageModePropertyInfo
instance AttrInfo DocumentPageModePropertyInfo where
type AttrAllowedOps DocumentPageModePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentPageModePropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentPageModePropertyInfo = IsDocument
type AttrGetType DocumentPageModePropertyInfo = Poppler.Enums.PageMode
type AttrLabel DocumentPageModePropertyInfo = "page-mode"
type AttrOrigin DocumentPageModePropertyInfo = Document
attrGet _ = getDocumentPageMode
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentPermissions :: (MonadIO m, IsDocument o) => o -> m [Poppler.Flags.Permissions]
getDocumentPermissions obj = liftIO $ B.Properties.getObjectPropertyFlags obj "permissions"
#if ENABLE_OVERLOADING
data DocumentPermissionsPropertyInfo
instance AttrInfo DocumentPermissionsPropertyInfo where
type AttrAllowedOps DocumentPermissionsPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentPermissionsPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentPermissionsPropertyInfo = IsDocument
type AttrGetType DocumentPermissionsPropertyInfo = [Poppler.Flags.Permissions]
type AttrLabel DocumentPermissionsPropertyInfo = "permissions"
type AttrOrigin DocumentPermissionsPropertyInfo = Document
attrGet _ = getDocumentPermissions
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentPrintScaling :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PrintScaling
getDocumentPrintScaling obj = liftIO $ B.Properties.getObjectPropertyEnum obj "print-scaling"
#if ENABLE_OVERLOADING
data DocumentPrintScalingPropertyInfo
instance AttrInfo DocumentPrintScalingPropertyInfo where
type AttrAllowedOps DocumentPrintScalingPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentPrintScalingPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentPrintScalingPropertyInfo = IsDocument
type AttrGetType DocumentPrintScalingPropertyInfo = Poppler.Enums.PrintScaling
type AttrLabel DocumentPrintScalingPropertyInfo = "print-scaling"
type AttrOrigin DocumentPrintScalingPropertyInfo = Document
attrGet _ = getDocumentPrintScaling
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentProducer :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentProducer obj = liftIO $ B.Properties.getObjectPropertyString obj "producer"
setDocumentProducer :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentProducer obj val = liftIO $ B.Properties.setObjectPropertyString obj "producer" (Just val)
constructDocumentProducer :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentProducer val = B.Properties.constructObjectPropertyString "producer" (Just val)
#if ENABLE_OVERLOADING
data DocumentProducerPropertyInfo
instance AttrInfo DocumentProducerPropertyInfo where
type AttrAllowedOps DocumentProducerPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DocumentProducerPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint DocumentProducerPropertyInfo = IsDocument
type AttrGetType DocumentProducerPropertyInfo = (Maybe T.Text)
type AttrLabel DocumentProducerPropertyInfo = "producer"
type AttrOrigin DocumentProducerPropertyInfo = Document
attrGet _ = getDocumentProducer
attrSet _ = setDocumentProducer
attrConstruct _ = constructDocumentProducer
attrClear _ = undefined
#endif
getDocumentSubject :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentSubject obj = liftIO $ B.Properties.getObjectPropertyString obj "subject"
setDocumentSubject :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentSubject obj val = liftIO $ B.Properties.setObjectPropertyString obj "subject" (Just val)
constructDocumentSubject :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentSubject val = B.Properties.constructObjectPropertyString "subject" (Just val)
#if ENABLE_OVERLOADING
data DocumentSubjectPropertyInfo
instance AttrInfo DocumentSubjectPropertyInfo where
type AttrAllowedOps DocumentSubjectPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DocumentSubjectPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint DocumentSubjectPropertyInfo = IsDocument
type AttrGetType DocumentSubjectPropertyInfo = (Maybe T.Text)
type AttrLabel DocumentSubjectPropertyInfo = "subject"
type AttrOrigin DocumentSubjectPropertyInfo = Document
attrGet _ = getDocumentSubject
attrSet _ = setDocumentSubject
attrConstruct _ = constructDocumentSubject
attrClear _ = undefined
#endif
getDocumentSubtype :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PDFSubtype
getDocumentSubtype obj = liftIO $ B.Properties.getObjectPropertyEnum obj "subtype"
#if ENABLE_OVERLOADING
data DocumentSubtypePropertyInfo
instance AttrInfo DocumentSubtypePropertyInfo where
type AttrAllowedOps DocumentSubtypePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentSubtypePropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentSubtypePropertyInfo = IsDocument
type AttrGetType DocumentSubtypePropertyInfo = Poppler.Enums.PDFSubtype
type AttrLabel DocumentSubtypePropertyInfo = "subtype"
type AttrOrigin DocumentSubtypePropertyInfo = Document
attrGet _ = getDocumentSubtype
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentSubtypeConformance :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PDFConformance
getDocumentSubtypeConformance obj = liftIO $ B.Properties.getObjectPropertyEnum obj "subtype-conformance"
#if ENABLE_OVERLOADING
data DocumentSubtypeConformancePropertyInfo
instance AttrInfo DocumentSubtypeConformancePropertyInfo where
type AttrAllowedOps DocumentSubtypeConformancePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentSubtypeConformancePropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentSubtypeConformancePropertyInfo = IsDocument
type AttrGetType DocumentSubtypeConformancePropertyInfo = Poppler.Enums.PDFConformance
type AttrLabel DocumentSubtypeConformancePropertyInfo = "subtype-conformance"
type AttrOrigin DocumentSubtypeConformancePropertyInfo = Document
attrGet _ = getDocumentSubtypeConformance
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentSubtypePart :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PDFPart
getDocumentSubtypePart obj = liftIO $ B.Properties.getObjectPropertyEnum obj "subtype-part"
#if ENABLE_OVERLOADING
data DocumentSubtypePartPropertyInfo
instance AttrInfo DocumentSubtypePartPropertyInfo where
type AttrAllowedOps DocumentSubtypePartPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentSubtypePartPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentSubtypePartPropertyInfo = IsDocument
type AttrGetType DocumentSubtypePartPropertyInfo = Poppler.Enums.PDFPart
type AttrLabel DocumentSubtypePartPropertyInfo = "subtype-part"
type AttrOrigin DocumentSubtypePartPropertyInfo = Document
attrGet _ = getDocumentSubtypePart
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentSubtypeString :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentSubtypeString obj = liftIO $ B.Properties.getObjectPropertyString obj "subtype-string"
#if ENABLE_OVERLOADING
data DocumentSubtypeStringPropertyInfo
instance AttrInfo DocumentSubtypeStringPropertyInfo where
type AttrAllowedOps DocumentSubtypeStringPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DocumentSubtypeStringPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentSubtypeStringPropertyInfo = IsDocument
type AttrGetType DocumentSubtypeStringPropertyInfo = (Maybe T.Text)
type AttrLabel DocumentSubtypeStringPropertyInfo = "subtype-string"
type AttrOrigin DocumentSubtypeStringPropertyInfo = Document
attrGet _ = getDocumentSubtypeString
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getDocumentTitle :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentTitle obj = liftIO $ B.Properties.getObjectPropertyString obj "title"
setDocumentTitle :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentTitle obj val = liftIO $ B.Properties.setObjectPropertyString obj "title" (Just val)
constructDocumentTitle :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentTitle val = B.Properties.constructObjectPropertyString "title" (Just val)
#if ENABLE_OVERLOADING
data DocumentTitlePropertyInfo
instance AttrInfo DocumentTitlePropertyInfo where
type AttrAllowedOps DocumentTitlePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DocumentTitlePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint DocumentTitlePropertyInfo = IsDocument
type AttrGetType DocumentTitlePropertyInfo = (Maybe T.Text)
type AttrLabel DocumentTitlePropertyInfo = "title"
type AttrOrigin DocumentTitlePropertyInfo = Document
attrGet _ = getDocumentTitle
attrSet _ = setDocumentTitle
attrConstruct _ = constructDocumentTitle
attrClear _ = undefined
#endif
getDocumentViewerPreferences :: (MonadIO m, IsDocument o) => o -> m [Poppler.Flags.ViewerPreferences]
getDocumentViewerPreferences obj = liftIO $ B.Properties.getObjectPropertyFlags obj "viewer-preferences"
#if ENABLE_OVERLOADING
data DocumentViewerPreferencesPropertyInfo
instance AttrInfo DocumentViewerPreferencesPropertyInfo where
type AttrAllowedOps DocumentViewerPreferencesPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DocumentViewerPreferencesPropertyInfo = (~) ()
type AttrBaseTypeConstraint DocumentViewerPreferencesPropertyInfo = IsDocument
type AttrGetType DocumentViewerPreferencesPropertyInfo = [Poppler.Flags.ViewerPreferences]
type AttrLabel DocumentViewerPreferencesPropertyInfo = "viewer-preferences"
type AttrOrigin DocumentViewerPreferencesPropertyInfo = Document
attrGet _ = getDocumentViewerPreferences
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList Document
type instance O.AttributeList Document = DocumentAttributeList
type DocumentAttributeList = ('[ '("author", DocumentAuthorPropertyInfo), '("creationDate", DocumentCreationDatePropertyInfo), '("creator", DocumentCreatorPropertyInfo), '("format", DocumentFormatPropertyInfo), '("formatMajor", DocumentFormatMajorPropertyInfo), '("formatMinor", DocumentFormatMinorPropertyInfo), '("keywords", DocumentKeywordsPropertyInfo), '("linearized", DocumentLinearizedPropertyInfo), '("metadata", DocumentMetadataPropertyInfo), '("modDate", DocumentModDatePropertyInfo), '("pageLayout", DocumentPageLayoutPropertyInfo), '("pageMode", DocumentPageModePropertyInfo), '("permissions", DocumentPermissionsPropertyInfo), '("printScaling", DocumentPrintScalingPropertyInfo), '("producer", DocumentProducerPropertyInfo), '("subject", DocumentSubjectPropertyInfo), '("subtype", DocumentSubtypePropertyInfo), '("subtypeConformance", DocumentSubtypeConformancePropertyInfo), '("subtypePart", DocumentSubtypePartPropertyInfo), '("subtypeString", DocumentSubtypeStringPropertyInfo), '("title", DocumentTitlePropertyInfo), '("viewerPreferences", DocumentViewerPreferencesPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
documentAuthor :: AttrLabelProxy "author"
documentAuthor = AttrLabelProxy
documentCreationDate :: AttrLabelProxy "creationDate"
documentCreationDate = AttrLabelProxy
documentCreator :: AttrLabelProxy "creator"
documentCreator = AttrLabelProxy
documentFormat :: AttrLabelProxy "format"
documentFormat = AttrLabelProxy
documentFormatMajor :: AttrLabelProxy "formatMajor"
documentFormatMajor = AttrLabelProxy
documentFormatMinor :: AttrLabelProxy "formatMinor"
documentFormatMinor = AttrLabelProxy
documentKeywords :: AttrLabelProxy "keywords"
documentKeywords = AttrLabelProxy
documentLinearized :: AttrLabelProxy "linearized"
documentLinearized = AttrLabelProxy
documentMetadata :: AttrLabelProxy "metadata"
documentMetadata = AttrLabelProxy
documentModDate :: AttrLabelProxy "modDate"
documentModDate = AttrLabelProxy
documentPageLayout :: AttrLabelProxy "pageLayout"
documentPageLayout = AttrLabelProxy
documentPageMode :: AttrLabelProxy "pageMode"
documentPageMode = AttrLabelProxy
documentPermissions :: AttrLabelProxy "permissions"
documentPermissions = AttrLabelProxy
documentPrintScaling :: AttrLabelProxy "printScaling"
documentPrintScaling = AttrLabelProxy
documentProducer :: AttrLabelProxy "producer"
documentProducer = AttrLabelProxy
documentSubject :: AttrLabelProxy "subject"
documentSubject = AttrLabelProxy
documentSubtype :: AttrLabelProxy "subtype"
documentSubtype = AttrLabelProxy
documentSubtypeConformance :: AttrLabelProxy "subtypeConformance"
documentSubtypeConformance = AttrLabelProxy
documentSubtypePart :: AttrLabelProxy "subtypePart"
documentSubtypePart = AttrLabelProxy
documentSubtypeString :: AttrLabelProxy "subtypeString"
documentSubtypeString = AttrLabelProxy
documentTitle :: AttrLabelProxy "title"
documentTitle = AttrLabelProxy
documentViewerPreferences :: AttrLabelProxy "viewerPreferences"
documentViewerPreferences = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList Document = DocumentSignalList
type DocumentSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "poppler_document_new_from_data" poppler_document_new_from_data ::
CString ->
Int32 ->
CString ->
Ptr (Ptr GError) ->
IO (Ptr Document)
documentNewFromData ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Int32
-> Maybe (T.Text)
-> m Document
documentNewFromData data_ length_ password = liftIO $ do
data_' <- textToCString data_
maybePassword <- case password of
Nothing -> return nullPtr
Just jPassword -> do
jPassword' <- textToCString jPassword
return jPassword'
onException (do
result <- propagateGError $ poppler_document_new_from_data data_' length_ maybePassword
checkUnexpectedReturnNULL "documentNewFromData" result
result' <- (wrapObject Document) result
freeMem data_'
freeMem maybePassword
return result'
) (do
freeMem data_'
freeMem maybePassword
)
#if ENABLE_OVERLOADING
#endif
foreign import ccall "poppler_document_new_from_file" poppler_document_new_from_file ::
CString ->
CString ->
Ptr (Ptr GError) ->
IO (Ptr Document)
documentNewFromFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Maybe (T.Text)
-> m Document
documentNewFromFile uri password = liftIO $ do
uri' <- textToCString uri
maybePassword <- case password of
Nothing -> return nullPtr
Just jPassword -> do
jPassword' <- textToCString jPassword
return jPassword'
onException (do
result <- propagateGError $ poppler_document_new_from_file uri' maybePassword
checkUnexpectedReturnNULL "documentNewFromFile" result
result' <- (wrapObject Document) result
freeMem uri'
freeMem maybePassword
return result'
) (do
freeMem uri'
freeMem maybePassword
)
#if ENABLE_OVERLOADING
#endif
foreign import ccall "poppler_document_new_from_gfile" poppler_document_new_from_gfile ::
Ptr Gio.File.File ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Document)
documentNewFromGfile ::
(B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> Maybe (b)
-> m Document
documentNewFromGfile file password cancellable = liftIO $ do
file' <- unsafeManagedPtrCastPtr file
maybePassword <- case password of
Nothing -> return nullPtr
Just jPassword -> do
jPassword' <- textToCString jPassword
return jPassword'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
result <- propagateGError $ poppler_document_new_from_gfile file' maybePassword maybeCancellable
checkUnexpectedReturnNULL "documentNewFromGfile" result
result' <- (wrapObject Document) result
touchManagedPtr file
whenJust cancellable touchManagedPtr
freeMem maybePassword
return result'
) (do
freeMem maybePassword
)
#if ENABLE_OVERLOADING
#endif
foreign import ccall "poppler_document_new_from_stream" poppler_document_new_from_stream ::
Ptr Gio.InputStream.InputStream ->
Int64 ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Document)
documentNewFromStream ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Int64
-> Maybe (T.Text)
-> Maybe (b)
-> m Document
documentNewFromStream stream length_ password cancellable = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
maybePassword <- case password of
Nothing -> return nullPtr
Just jPassword -> do
jPassword' <- textToCString jPassword
return jPassword'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
result <- propagateGError $ poppler_document_new_from_stream stream' length_ maybePassword maybeCancellable
checkUnexpectedReturnNULL "documentNewFromStream" result
result' <- (wrapObject Document) result
touchManagedPtr stream
whenJust cancellable touchManagedPtr
freeMem maybePassword
return result'
) (do
freeMem maybePassword
)
#if ENABLE_OVERLOADING
#endif
foreign import ccall "poppler_document_find_dest" poppler_document_find_dest ::
Ptr Document ->
CString ->
IO (Ptr Poppler.Dest.Dest)
documentFindDest ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> T.Text
-> m Poppler.Dest.Dest
documentFindDest document linkName = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
linkName' <- textToCString linkName
result <- poppler_document_find_dest document' linkName'
checkUnexpectedReturnNULL "documentFindDest" result
result' <- (wrapBoxed Poppler.Dest.Dest) result
touchManagedPtr document
freeMem linkName'
return result'
#if ENABLE_OVERLOADING
data DocumentFindDestMethodInfo
instance (signature ~ (T.Text -> m Poppler.Dest.Dest), MonadIO m, IsDocument a) => O.MethodInfo DocumentFindDestMethodInfo a signature where
overloadedMethod _ = documentFindDest
#endif
foreign import ccall "poppler_document_get_attachments" poppler_document_get_attachments ::
Ptr Document ->
IO (Ptr (GList (Ptr Poppler.Attachment.Attachment)))
documentGetAttachments ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m [Poppler.Attachment.Attachment]
documentGetAttachments document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_attachments document'
result' <- unpackGList result
result'' <- mapM (wrapObject Poppler.Attachment.Attachment) result'
g_list_free result
touchManagedPtr document
return result''
#if ENABLE_OVERLOADING
data DocumentGetAttachmentsMethodInfo
instance (signature ~ (m [Poppler.Attachment.Attachment]), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetAttachmentsMethodInfo a signature where
overloadedMethod _ = documentGetAttachments
#endif
foreign import ccall "poppler_document_get_author" poppler_document_get_author ::
Ptr Document ->
IO CString
documentGetAuthor ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m T.Text
documentGetAuthor document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_author document'
checkUnexpectedReturnNULL "documentGetAuthor" result
result' <- cstringToText result
freeMem result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetAuthorMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetAuthorMethodInfo a signature where
overloadedMethod _ = documentGetAuthor
#endif
foreign import ccall "poppler_document_get_creation_date" poppler_document_get_creation_date ::
Ptr Document ->
IO CLong
documentGetCreationDate ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m CLong
documentGetCreationDate document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_creation_date document'
touchManagedPtr document
return result
#if ENABLE_OVERLOADING
data DocumentGetCreationDateMethodInfo
instance (signature ~ (m CLong), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetCreationDateMethodInfo a signature where
overloadedMethod _ = documentGetCreationDate
#endif
foreign import ccall "poppler_document_get_creator" poppler_document_get_creator ::
Ptr Document ->
IO CString
documentGetCreator ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m T.Text
documentGetCreator document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_creator document'
checkUnexpectedReturnNULL "documentGetCreator" result
result' <- cstringToText result
freeMem result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetCreatorMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetCreatorMethodInfo a signature where
overloadedMethod _ = documentGetCreator
#endif
foreign import ccall "poppler_document_get_form_field" poppler_document_get_form_field ::
Ptr Document ->
Int32 ->
IO (Ptr Poppler.FormField.FormField)
documentGetFormField ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> Int32
-> m Poppler.FormField.FormField
documentGetFormField document id = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_form_field document' id
checkUnexpectedReturnNULL "documentGetFormField" result
result' <- (wrapObject Poppler.FormField.FormField) result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetFormFieldMethodInfo
instance (signature ~ (Int32 -> m Poppler.FormField.FormField), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetFormFieldMethodInfo a signature where
overloadedMethod _ = documentGetFormField
#endif
foreign import ccall "poppler_document_get_id" poppler_document_get_id ::
Ptr Document ->
Ptr CString ->
Ptr CString ->
IO CInt
documentGetId ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m ((Bool, T.Text, T.Text))
documentGetId document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
permanentId <- allocMem :: IO (Ptr CString)
updateId <- allocMem :: IO (Ptr CString)
result <- poppler_document_get_id document' permanentId updateId
let result' = (/= 0) result
permanentId' <- peek permanentId
permanentId'' <- cstringToText permanentId'
freeMem permanentId'
updateId' <- peek updateId
updateId'' <- cstringToText updateId'
freeMem updateId'
touchManagedPtr document
freeMem permanentId
freeMem updateId
return (result', permanentId'', updateId'')
#if ENABLE_OVERLOADING
data DocumentGetIdMethodInfo
instance (signature ~ (m ((Bool, T.Text, T.Text))), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetIdMethodInfo a signature where
overloadedMethod _ = documentGetId
#endif
foreign import ccall "poppler_document_get_keywords" poppler_document_get_keywords ::
Ptr Document ->
IO CString
documentGetKeywords ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m T.Text
documentGetKeywords document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_keywords document'
checkUnexpectedReturnNULL "documentGetKeywords" result
result' <- cstringToText result
freeMem result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetKeywordsMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetKeywordsMethodInfo a signature where
overloadedMethod _ = documentGetKeywords
#endif
foreign import ccall "poppler_document_get_metadata" poppler_document_get_metadata ::
Ptr Document ->
IO CString
documentGetMetadata ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m T.Text
documentGetMetadata document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_metadata document'
checkUnexpectedReturnNULL "documentGetMetadata" result
result' <- cstringToText result
freeMem result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetMetadataMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetMetadataMethodInfo a signature where
overloadedMethod _ = documentGetMetadata
#endif
foreign import ccall "poppler_document_get_modification_date" poppler_document_get_modification_date ::
Ptr Document ->
IO CLong
documentGetModificationDate ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m CLong
documentGetModificationDate document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_modification_date document'
touchManagedPtr document
return result
#if ENABLE_OVERLOADING
data DocumentGetModificationDateMethodInfo
instance (signature ~ (m CLong), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetModificationDateMethodInfo a signature where
overloadedMethod _ = documentGetModificationDate
#endif
foreign import ccall "poppler_document_get_n_attachments" poppler_document_get_n_attachments ::
Ptr Document ->
IO Word32
documentGetNAttachments ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m Word32
documentGetNAttachments document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_n_attachments document'
touchManagedPtr document
return result
#if ENABLE_OVERLOADING
data DocumentGetNAttachmentsMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetNAttachmentsMethodInfo a signature where
overloadedMethod _ = documentGetNAttachments
#endif
foreign import ccall "poppler_document_get_n_pages" poppler_document_get_n_pages ::
Ptr Document ->
IO Int32
documentGetNPages ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m Int32
documentGetNPages document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_n_pages document'
touchManagedPtr document
return result
#if ENABLE_OVERLOADING
data DocumentGetNPagesMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetNPagesMethodInfo a signature where
overloadedMethod _ = documentGetNPages
#endif
foreign import ccall "poppler_document_get_page" poppler_document_get_page ::
Ptr Document ->
Int32 ->
IO (Ptr Poppler.Page.Page)
documentGetPage ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> Int32
-> m Poppler.Page.Page
documentGetPage document index = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_page document' index
checkUnexpectedReturnNULL "documentGetPage" result
result' <- (wrapObject Poppler.Page.Page) result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetPageMethodInfo
instance (signature ~ (Int32 -> m Poppler.Page.Page), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPageMethodInfo a signature where
overloadedMethod _ = documentGetPage
#endif
foreign import ccall "poppler_document_get_page_by_label" poppler_document_get_page_by_label ::
Ptr Document ->
CString ->
IO (Ptr Poppler.Page.Page)
documentGetPageByLabel ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> T.Text
-> m Poppler.Page.Page
documentGetPageByLabel document label = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
label' <- textToCString label
result <- poppler_document_get_page_by_label document' label'
checkUnexpectedReturnNULL "documentGetPageByLabel" result
result' <- (wrapObject Poppler.Page.Page) result
touchManagedPtr document
freeMem label'
return result'
#if ENABLE_OVERLOADING
data DocumentGetPageByLabelMethodInfo
instance (signature ~ (T.Text -> m Poppler.Page.Page), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPageByLabelMethodInfo a signature where
overloadedMethod _ = documentGetPageByLabel
#endif
foreign import ccall "poppler_document_get_page_layout" poppler_document_get_page_layout ::
Ptr Document ->
IO CUInt
documentGetPageLayout ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m Poppler.Enums.PageLayout
documentGetPageLayout document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_page_layout document'
let result' = (toEnum . fromIntegral) result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetPageLayoutMethodInfo
instance (signature ~ (m Poppler.Enums.PageLayout), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPageLayoutMethodInfo a signature where
overloadedMethod _ = documentGetPageLayout
#endif
foreign import ccall "poppler_document_get_page_mode" poppler_document_get_page_mode ::
Ptr Document ->
IO CUInt
documentGetPageMode ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m Poppler.Enums.PageMode
documentGetPageMode document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_page_mode document'
let result' = (toEnum . fromIntegral) result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetPageModeMethodInfo
instance (signature ~ (m Poppler.Enums.PageMode), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPageModeMethodInfo a signature where
overloadedMethod _ = documentGetPageMode
#endif
foreign import ccall "poppler_document_get_pdf_conformance" poppler_document_get_pdf_conformance ::
Ptr Document ->
IO CUInt
documentGetPdfConformance ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m Poppler.Enums.PDFConformance
documentGetPdfConformance document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_pdf_conformance document'
let result' = (toEnum . fromIntegral) result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetPdfConformanceMethodInfo
instance (signature ~ (m Poppler.Enums.PDFConformance), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfConformanceMethodInfo a signature where
overloadedMethod _ = documentGetPdfConformance
#endif
foreign import ccall "poppler_document_get_pdf_part" poppler_document_get_pdf_part ::
Ptr Document ->
IO CUInt
documentGetPdfPart ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m Poppler.Enums.PDFPart
documentGetPdfPart document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_pdf_part document'
let result' = (toEnum . fromIntegral) result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetPdfPartMethodInfo
instance (signature ~ (m Poppler.Enums.PDFPart), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfPartMethodInfo a signature where
overloadedMethod _ = documentGetPdfPart
#endif
foreign import ccall "poppler_document_get_pdf_subtype" poppler_document_get_pdf_subtype ::
Ptr Document ->
IO CUInt
documentGetPdfSubtype ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m Poppler.Enums.PDFSubtype
documentGetPdfSubtype document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_pdf_subtype document'
let result' = (toEnum . fromIntegral) result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetPdfSubtypeMethodInfo
instance (signature ~ (m Poppler.Enums.PDFSubtype), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfSubtypeMethodInfo a signature where
overloadedMethod _ = documentGetPdfSubtype
#endif
foreign import ccall "poppler_document_get_pdf_subtype_string" poppler_document_get_pdf_subtype_string ::
Ptr Document ->
IO CString
documentGetPdfSubtypeString ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m (Maybe T.Text)
documentGetPdfSubtypeString document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_pdf_subtype_string document'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
freeMem result'
return result''
touchManagedPtr document
return maybeResult
#if ENABLE_OVERLOADING
data DocumentGetPdfSubtypeStringMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfSubtypeStringMethodInfo a signature where
overloadedMethod _ = documentGetPdfSubtypeString
#endif
foreign import ccall "poppler_document_get_pdf_version" poppler_document_get_pdf_version ::
Ptr Document ->
Ptr Word32 ->
Ptr Word32 ->
IO ()
documentGetPdfVersion ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m ((Word32, Word32))
documentGetPdfVersion document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
majorVersion <- allocMem :: IO (Ptr Word32)
minorVersion <- allocMem :: IO (Ptr Word32)
poppler_document_get_pdf_version document' majorVersion minorVersion
majorVersion' <- peek majorVersion
minorVersion' <- peek minorVersion
touchManagedPtr document
freeMem majorVersion
freeMem minorVersion
return (majorVersion', minorVersion')
#if ENABLE_OVERLOADING
data DocumentGetPdfVersionMethodInfo
instance (signature ~ (m ((Word32, Word32))), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfVersionMethodInfo a signature where
overloadedMethod _ = documentGetPdfVersion
#endif
foreign import ccall "poppler_document_get_pdf_version_string" poppler_document_get_pdf_version_string ::
Ptr Document ->
IO CString
documentGetPdfVersionString ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m T.Text
documentGetPdfVersionString document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_pdf_version_string document'
checkUnexpectedReturnNULL "documentGetPdfVersionString" result
result' <- cstringToText result
freeMem result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetPdfVersionStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfVersionStringMethodInfo a signature where
overloadedMethod _ = documentGetPdfVersionString
#endif
foreign import ccall "poppler_document_get_permissions" poppler_document_get_permissions ::
Ptr Document ->
IO CUInt
documentGetPermissions ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m [Poppler.Flags.Permissions]
documentGetPermissions document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_permissions document'
let result' = wordToGFlags result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetPermissionsMethodInfo
instance (signature ~ (m [Poppler.Flags.Permissions]), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPermissionsMethodInfo a signature where
overloadedMethod _ = documentGetPermissions
#endif
foreign import ccall "poppler_document_get_print_scaling" poppler_document_get_print_scaling ::
Ptr Document ->
IO CUInt
documentGetPrintScaling ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m Poppler.Enums.PrintScaling
documentGetPrintScaling document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_print_scaling document'
let result' = (toEnum . fromIntegral) result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetPrintScalingMethodInfo
instance (signature ~ (m Poppler.Enums.PrintScaling), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPrintScalingMethodInfo a signature where
overloadedMethod _ = documentGetPrintScaling
#endif
foreign import ccall "poppler_document_get_producer" poppler_document_get_producer ::
Ptr Document ->
IO CString
documentGetProducer ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m T.Text
documentGetProducer document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_producer document'
checkUnexpectedReturnNULL "documentGetProducer" result
result' <- cstringToText result
freeMem result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetProducerMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetProducerMethodInfo a signature where
overloadedMethod _ = documentGetProducer
#endif
foreign import ccall "poppler_document_get_subject" poppler_document_get_subject ::
Ptr Document ->
IO CString
documentGetSubject ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m T.Text
documentGetSubject document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_subject document'
checkUnexpectedReturnNULL "documentGetSubject" result
result' <- cstringToText result
freeMem result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetSubjectMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetSubjectMethodInfo a signature where
overloadedMethod _ = documentGetSubject
#endif
foreign import ccall "poppler_document_get_title" poppler_document_get_title ::
Ptr Document ->
IO CString
documentGetTitle ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m T.Text
documentGetTitle document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_get_title document'
checkUnexpectedReturnNULL "documentGetTitle" result
result' <- cstringToText result
freeMem result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentGetTitleMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetTitleMethodInfo a signature where
overloadedMethod _ = documentGetTitle
#endif
foreign import ccall "poppler_document_has_attachments" poppler_document_has_attachments ::
Ptr Document ->
IO CInt
documentHasAttachments ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m Bool
documentHasAttachments document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_has_attachments document'
let result' = (/= 0) result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentHasAttachmentsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDocument a) => O.MethodInfo DocumentHasAttachmentsMethodInfo a signature where
overloadedMethod _ = documentHasAttachments
#endif
foreign import ccall "poppler_document_is_linearized" poppler_document_is_linearized ::
Ptr Document ->
IO CInt
documentIsLinearized ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> m Bool
documentIsLinearized document = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
result <- poppler_document_is_linearized document'
let result' = (/= 0) result
touchManagedPtr document
return result'
#if ENABLE_OVERLOADING
data DocumentIsLinearizedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDocument a) => O.MethodInfo DocumentIsLinearizedMethodInfo a signature where
overloadedMethod _ = documentIsLinearized
#endif
foreign import ccall "poppler_document_save" poppler_document_save ::
Ptr Document ->
CString ->
Ptr (Ptr GError) ->
IO CInt
documentSave ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> T.Text
-> m ()
documentSave document uri = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
uri' <- textToCString uri
onException (do
_ <- propagateGError $ poppler_document_save document' uri'
touchManagedPtr document
freeMem uri'
return ()
) (do
freeMem uri'
)
#if ENABLE_OVERLOADING
data DocumentSaveMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSaveMethodInfo a signature where
overloadedMethod _ = documentSave
#endif
foreign import ccall "poppler_document_save_a_copy" poppler_document_save_a_copy ::
Ptr Document ->
CString ->
Ptr (Ptr GError) ->
IO CInt
documentSaveACopy ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> T.Text
-> m ()
documentSaveACopy document uri = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
uri' <- textToCString uri
onException (do
_ <- propagateGError $ poppler_document_save_a_copy document' uri'
touchManagedPtr document
freeMem uri'
return ()
) (do
freeMem uri'
)
#if ENABLE_OVERLOADING
data DocumentSaveACopyMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSaveACopyMethodInfo a signature where
overloadedMethod _ = documentSaveACopy
#endif
foreign import ccall "poppler_document_set_author" poppler_document_set_author ::
Ptr Document ->
CString ->
IO ()
documentSetAuthor ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> T.Text
-> m ()
documentSetAuthor document author = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
author' <- textToCString author
poppler_document_set_author document' author'
touchManagedPtr document
freeMem author'
return ()
#if ENABLE_OVERLOADING
data DocumentSetAuthorMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetAuthorMethodInfo a signature where
overloadedMethod _ = documentSetAuthor
#endif
foreign import ccall "poppler_document_set_creation_date" poppler_document_set_creation_date ::
Ptr Document ->
CLong ->
IO ()
documentSetCreationDate ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> CLong
-> m ()
documentSetCreationDate document creationDate = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
poppler_document_set_creation_date document' creationDate
touchManagedPtr document
return ()
#if ENABLE_OVERLOADING
data DocumentSetCreationDateMethodInfo
instance (signature ~ (CLong -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetCreationDateMethodInfo a signature where
overloadedMethod _ = documentSetCreationDate
#endif
foreign import ccall "poppler_document_set_creator" poppler_document_set_creator ::
Ptr Document ->
CString ->
IO ()
documentSetCreator ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> T.Text
-> m ()
documentSetCreator document creator = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
creator' <- textToCString creator
poppler_document_set_creator document' creator'
touchManagedPtr document
freeMem creator'
return ()
#if ENABLE_OVERLOADING
data DocumentSetCreatorMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetCreatorMethodInfo a signature where
overloadedMethod _ = documentSetCreator
#endif
foreign import ccall "poppler_document_set_keywords" poppler_document_set_keywords ::
Ptr Document ->
CString ->
IO ()
documentSetKeywords ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> T.Text
-> m ()
documentSetKeywords document keywords = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
keywords' <- textToCString keywords
poppler_document_set_keywords document' keywords'
touchManagedPtr document
freeMem keywords'
return ()
#if ENABLE_OVERLOADING
data DocumentSetKeywordsMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetKeywordsMethodInfo a signature where
overloadedMethod _ = documentSetKeywords
#endif
foreign import ccall "poppler_document_set_modification_date" poppler_document_set_modification_date ::
Ptr Document ->
CLong ->
IO ()
documentSetModificationDate ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> CLong
-> m ()
documentSetModificationDate document modificationDate = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
poppler_document_set_modification_date document' modificationDate
touchManagedPtr document
return ()
#if ENABLE_OVERLOADING
data DocumentSetModificationDateMethodInfo
instance (signature ~ (CLong -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetModificationDateMethodInfo a signature where
overloadedMethod _ = documentSetModificationDate
#endif
foreign import ccall "poppler_document_set_producer" poppler_document_set_producer ::
Ptr Document ->
CString ->
IO ()
documentSetProducer ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> T.Text
-> m ()
documentSetProducer document producer = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
producer' <- textToCString producer
poppler_document_set_producer document' producer'
touchManagedPtr document
freeMem producer'
return ()
#if ENABLE_OVERLOADING
data DocumentSetProducerMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetProducerMethodInfo a signature where
overloadedMethod _ = documentSetProducer
#endif
foreign import ccall "poppler_document_set_subject" poppler_document_set_subject ::
Ptr Document ->
CString ->
IO ()
documentSetSubject ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> T.Text
-> m ()
documentSetSubject document subject = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
subject' <- textToCString subject
poppler_document_set_subject document' subject'
touchManagedPtr document
freeMem subject'
return ()
#if ENABLE_OVERLOADING
data DocumentSetSubjectMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetSubjectMethodInfo a signature where
overloadedMethod _ = documentSetSubject
#endif
foreign import ccall "poppler_document_set_title" poppler_document_set_title ::
Ptr Document ->
CString ->
IO ()
documentSetTitle ::
(B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
a
-> T.Text
-> m ()
documentSetTitle document title = liftIO $ do
document' <- unsafeManagedPtrCastPtr document
title' <- textToCString title
poppler_document_set_title document' title'
touchManagedPtr document
freeMem title'
return ()
#if ENABLE_OVERLOADING
data DocumentSetTitleMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetTitleMethodInfo a signature where
overloadedMethod _ = documentSetTitle
#endif