{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.Poppler.Objects.Document
    ( 

-- * Exported types
    Document(..)                            ,
    IsDocument                              ,
    toDocument                              ,
    noDocument                              ,


 -- * Methods
-- ** findDest #method:findDest#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentFindDestMethodInfo              ,
#endif
    documentFindDest                        ,


-- ** getAttachments #method:getAttachments#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetAttachmentsMethodInfo        ,
#endif
    documentGetAttachments                  ,


-- ** getAuthor #method:getAuthor#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetAuthorMethodInfo             ,
#endif
    documentGetAuthor                       ,


-- ** getCreationDate #method:getCreationDate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetCreationDateMethodInfo       ,
#endif
    documentGetCreationDate                 ,


-- ** getCreator #method:getCreator#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetCreatorMethodInfo            ,
#endif
    documentGetCreator                      ,


-- ** getFormField #method:getFormField#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetFormFieldMethodInfo          ,
#endif
    documentGetFormField                    ,


-- ** getId #method:getId#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetIdMethodInfo                 ,
#endif
    documentGetId                           ,


-- ** getKeywords #method:getKeywords#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetKeywordsMethodInfo           ,
#endif
    documentGetKeywords                     ,


-- ** getMetadata #method:getMetadata#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetMetadataMethodInfo           ,
#endif
    documentGetMetadata                     ,


-- ** getModificationDate #method:getModificationDate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetModificationDateMethodInfo   ,
#endif
    documentGetModificationDate             ,


-- ** getNAttachments #method:getNAttachments#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetNAttachmentsMethodInfo       ,
#endif
    documentGetNAttachments                 ,


-- ** getNPages #method:getNPages#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetNPagesMethodInfo             ,
#endif
    documentGetNPages                       ,


-- ** getPage #method:getPage#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetPageMethodInfo               ,
#endif
    documentGetPage                         ,


-- ** getPageByLabel #method:getPageByLabel#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetPageByLabelMethodInfo        ,
#endif
    documentGetPageByLabel                  ,


-- ** getPageLayout #method:getPageLayout#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetPageLayoutMethodInfo         ,
#endif
    documentGetPageLayout                   ,


-- ** getPageMode #method:getPageMode#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetPageModeMethodInfo           ,
#endif
    documentGetPageMode                     ,


-- ** getPdfVersion #method:getPdfVersion#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetPdfVersionMethodInfo         ,
#endif
    documentGetPdfVersion                   ,


-- ** getPdfVersionString #method:getPdfVersionString#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetPdfVersionStringMethodInfo   ,
#endif
    documentGetPdfVersionString             ,


-- ** getPermissions #method:getPermissions#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetPermissionsMethodInfo        ,
#endif
    documentGetPermissions                  ,


-- ** getProducer #method:getProducer#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetProducerMethodInfo           ,
#endif
    documentGetProducer                     ,


-- ** getSubject #method:getSubject#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetSubjectMethodInfo            ,
#endif
    documentGetSubject                      ,


-- ** getTitle #method:getTitle#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentGetTitleMethodInfo              ,
#endif
    documentGetTitle                        ,


-- ** hasAttachments #method:hasAttachments#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentHasAttachmentsMethodInfo        ,
#endif
    documentHasAttachments                  ,


-- ** isLinearized #method:isLinearized#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentIsLinearizedMethodInfo          ,
#endif
    documentIsLinearized                    ,


-- ** newFromData #method:newFromData#
    documentNewFromData                     ,


-- ** newFromFile #method:newFromFile#
    documentNewFromFile                     ,


-- ** newFromGfile #method:newFromGfile#
    documentNewFromGfile                    ,


-- ** newFromStream #method:newFromStream#
    documentNewFromStream                   ,


-- ** save #method:save#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSaveMethodInfo                  ,
#endif
    documentSave                            ,


-- ** saveACopy #method:saveACopy#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSaveACopyMethodInfo             ,
#endif
    documentSaveACopy                       ,


-- ** setAuthor #method:setAuthor#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSetAuthorMethodInfo             ,
#endif
    documentSetAuthor                       ,


-- ** setCreationDate #method:setCreationDate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSetCreationDateMethodInfo       ,
#endif
    documentSetCreationDate                 ,


-- ** setCreator #method:setCreator#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSetCreatorMethodInfo            ,
#endif
    documentSetCreator                      ,


-- ** setKeywords #method:setKeywords#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSetKeywordsMethodInfo           ,
#endif
    documentSetKeywords                     ,


-- ** setModificationDate #method:setModificationDate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSetModificationDateMethodInfo   ,
#endif
    documentSetModificationDate             ,


-- ** setProducer #method:setProducer#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSetProducerMethodInfo           ,
#endif
    documentSetProducer                     ,


-- ** setSubject #method:setSubject#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSetSubjectMethodInfo            ,
#endif
    documentSetSubject                      ,


-- ** setTitle #method:setTitle#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSetTitleMethodInfo              ,
#endif
    documentSetTitle                        ,




 -- * Properties
-- ** author #attr:author#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentAuthorPropertyInfo              ,
#endif
    constructDocumentAuthor                 ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentAuthor                          ,
#endif
    getDocumentAuthor                       ,
    setDocumentAuthor                       ,


-- ** creationDate #attr:creationDate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentCreationDatePropertyInfo        ,
#endif
    constructDocumentCreationDate           ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentCreationDate                    ,
#endif
    getDocumentCreationDate                 ,
    setDocumentCreationDate                 ,


-- ** creator #attr:creator#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentCreatorPropertyInfo             ,
#endif
    constructDocumentCreator                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentCreator                         ,
#endif
    getDocumentCreator                      ,
    setDocumentCreator                      ,


-- ** format #attr:format#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentFormatPropertyInfo              ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentFormat                          ,
#endif
    getDocumentFormat                       ,


-- ** formatMajor #attr:formatMajor#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentFormatMajorPropertyInfo         ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentFormatMajor                     ,
#endif
    getDocumentFormatMajor                  ,


-- ** formatMinor #attr:formatMinor#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentFormatMinorPropertyInfo         ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentFormatMinor                     ,
#endif
    getDocumentFormatMinor                  ,


-- ** keywords #attr:keywords#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentKeywordsPropertyInfo            ,
#endif
    constructDocumentKeywords               ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentKeywords                        ,
#endif
    getDocumentKeywords                     ,
    setDocumentKeywords                     ,


-- ** linearized #attr:linearized#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentLinearizedPropertyInfo          ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentLinearized                      ,
#endif
    getDocumentLinearized                   ,


-- ** metadata #attr:metadata#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentMetadataPropertyInfo            ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentMetadata                        ,
#endif
    getDocumentMetadata                     ,


-- ** modDate #attr:modDate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentModDatePropertyInfo             ,
#endif
    constructDocumentModDate                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentModDate                         ,
#endif
    getDocumentModDate                      ,
    setDocumentModDate                      ,


-- ** pageLayout #attr:pageLayout#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentPageLayoutPropertyInfo          ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentPageLayout                      ,
#endif
    getDocumentPageLayout                   ,


-- ** pageMode #attr:pageMode#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentPageModePropertyInfo            ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentPageMode                        ,
#endif
    getDocumentPageMode                     ,


-- ** permissions #attr:permissions#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentPermissionsPropertyInfo         ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentPermissions                     ,
#endif
    getDocumentPermissions                  ,


-- ** producer #attr:producer#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentProducerPropertyInfo            ,
#endif
    constructDocumentProducer               ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentProducer                        ,
#endif
    getDocumentProducer                     ,
    setDocumentProducer                     ,


-- ** subject #attr:subject#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentSubjectPropertyInfo             ,
#endif
    constructDocumentSubject                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentSubject                         ,
#endif
    getDocumentSubject                      ,
    setDocumentSubject                      ,


-- ** title #attr:title#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentTitlePropertyInfo               ,
#endif
    constructDocumentTitle                  ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    documentTitle                           ,
#endif
    getDocumentTitle                        ,
    setDocumentTitle                        ,


-- ** viewerPreferences #attr:viewerPreferences#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DocumentViewerPreferencesPropertyInfo   ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 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 => IsDocument o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError Document a) =>
    IsDocument a
#endif
instance IsDocument Document
instance GObject.Object.IsObject Document

toDocument :: (MonadIO m, IsDocument o) => o -> m Document
toDocument = liftIO . unsafeCastTo Document

noDocument :: Maybe Document
noDocument = Nothing

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveDocumentMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    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 "getPdfVersion" o = DocumentGetPdfVersionMethodInfo
    ResolveDocumentMethod "getPdfVersionString" o = DocumentGetPdfVersionStringMethodInfo
    ResolveDocumentMethod "getPermissions" o = DocumentGetPermissionsMethodInfo
    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 "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) => O.IsLabelProxy t (Document -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDocumentMethod t Document, O.MethodInfo info Document p) => O.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

#endif

-- VVV Prop "author"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getDocumentAuthor :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentAuthor obj = liftIO $ getObjectPropertyString obj "author"

setDocumentAuthor :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentAuthor obj val = liftIO $ setObjectPropertyString obj "author" (Just val)

constructDocumentAuthor :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentAuthor val = constructObjectPropertyString "author" (Just val)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "creation-date"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> m Int32
getDocumentCreationDate obj = liftIO $ getObjectPropertyInt32 obj "creation-date"

setDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m ()
setDocumentCreationDate obj val = liftIO $ setObjectPropertyInt32 obj "creation-date" val

constructDocumentCreationDate :: (IsDocument o) => Int32 -> IO (GValueConstruct o)
constructDocumentCreationDate val = constructObjectPropertyInt32 "creation-date" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "creator"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getDocumentCreator :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentCreator obj = liftIO $ getObjectPropertyString obj "creator"

setDocumentCreator :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentCreator obj val = liftIO $ setObjectPropertyString obj "creator" (Just val)

constructDocumentCreator :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentCreator val = constructObjectPropertyString "creator" (Just val)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "format"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDocumentFormat :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentFormat obj = liftIO $ getObjectPropertyString obj "format"

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "format-major"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDocumentFormatMajor :: (MonadIO m, IsDocument o) => o -> m Word32
getDocumentFormatMajor obj = liftIO $ getObjectPropertyUInt32 obj "format-major"

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "format-minor"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDocumentFormatMinor :: (MonadIO m, IsDocument o) => o -> m Word32
getDocumentFormatMinor obj = liftIO $ getObjectPropertyUInt32 obj "format-minor"

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "keywords"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getDocumentKeywords :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentKeywords obj = liftIO $ getObjectPropertyString obj "keywords"

setDocumentKeywords :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentKeywords obj val = liftIO $ setObjectPropertyString obj "keywords" (Just val)

constructDocumentKeywords :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentKeywords val = constructObjectPropertyString "keywords" (Just val)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "linearized"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDocumentLinearized :: (MonadIO m, IsDocument o) => o -> m Bool
getDocumentLinearized obj = liftIO $ getObjectPropertyBool obj "linearized"

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "metadata"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDocumentMetadata :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentMetadata obj = liftIO $ getObjectPropertyString obj "metadata"

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "mod-date"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getDocumentModDate :: (MonadIO m, IsDocument o) => o -> m Int32
getDocumentModDate obj = liftIO $ getObjectPropertyInt32 obj "mod-date"

setDocumentModDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m ()
setDocumentModDate obj val = liftIO $ setObjectPropertyInt32 obj "mod-date" val

constructDocumentModDate :: (IsDocument o) => Int32 -> IO (GValueConstruct o)
constructDocumentModDate val = constructObjectPropertyInt32 "mod-date" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "page-layout"
   -- Type: TInterface (Name {namespace = "Poppler", name = "PageLayout"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getDocumentPageLayout :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PageLayout
getDocumentPageLayout obj = liftIO $ getObjectPropertyEnum obj "page-layout"

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "page-mode"
   -- Type: TInterface (Name {namespace = "Poppler", name = "PageMode"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getDocumentPageMode :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PageMode
getDocumentPageMode obj = liftIO $ getObjectPropertyEnum obj "page-mode"

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "permissions"
   -- Type: TInterface (Name {namespace = "Poppler", name = "Permissions"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getDocumentPermissions :: (MonadIO m, IsDocument o) => o -> m [Poppler.Flags.Permissions]
getDocumentPermissions obj = liftIO $ getObjectPropertyFlags obj "permissions"

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "producer"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getDocumentProducer :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentProducer obj = liftIO $ getObjectPropertyString obj "producer"

setDocumentProducer :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentProducer obj val = liftIO $ setObjectPropertyString obj "producer" (Just val)

constructDocumentProducer :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentProducer val = constructObjectPropertyString "producer" (Just val)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "subject"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getDocumentSubject :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentSubject obj = liftIO $ getObjectPropertyString obj "subject"

setDocumentSubject :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentSubject obj val = liftIO $ setObjectPropertyString obj "subject" (Just val)

constructDocumentSubject :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentSubject val = constructObjectPropertyString "subject" (Just val)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "title"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

getDocumentTitle :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentTitle obj = liftIO $ getObjectPropertyString obj "title"

setDocumentTitle :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentTitle obj val = liftIO $ setObjectPropertyString obj "title" (Just val)

constructDocumentTitle :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentTitle val = constructObjectPropertyString "title" (Just val)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

-- VVV Prop "viewer-preferences"
   -- Type: TInterface (Name {namespace = "Poppler", name = "ViewerPreferences"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDocumentViewerPreferences :: (MonadIO m, IsDocument o) => o -> m [Poppler.Flags.ViewerPreferences]
getDocumentViewerPreferences obj = liftIO $ getObjectPropertyFlags obj "viewer-preferences"

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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), '("producer", DocumentProducerPropertyInfo), '("subject", DocumentSubjectPropertyInfo), '("title", DocumentTitlePropertyInfo), '("viewerPreferences", DocumentViewerPreferencesPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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

documentProducer :: AttrLabelProxy "producer"
documentProducer = AttrLabelProxy

documentSubject :: AttrLabelProxy "subject"
documentSubject = AttrLabelProxy

documentTitle :: AttrLabelProxy "title"
documentTitle = AttrLabelProxy

documentViewerPreferences :: AttrLabelProxy "viewerPreferences"
documentViewerPreferences = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList Document = DocumentSignalList
type DocumentSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method Document::new_from_data
-- method type : Constructor
-- Args : [Arg {argCName = "data", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the pdf data contained in a char array", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "length", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of #data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "password", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "password to unlock the file with, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "Document"}))
-- throws : True
-- Skip return : False

foreign import ccall "poppler_document_new_from_data" poppler_document_new_from_data :: 
    CString ->                              -- data : TBasicType TUTF8
    Int32 ->                                -- length : TBasicType TInt
    CString ->                              -- password : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Document)

{- |
Creates a new 'GI.Poppler.Objects.Document.Document'.  If 'Nothing' is returned, then /@error@/ will be
set. Possible errors include those in the @/POPPLER_ERROR/@ and @/G_FILE_ERROR/@
domains.
-}
documentNewFromData ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@data@/: the pdf data contained in a char array -}
    -> Int32
    {- ^ /@length@/: the length of @/data/@ -}
    -> Maybe (T.Text)
    {- ^ /@password@/: password to unlock the file with, or 'Nothing' -}
    -> m Document
    {- ^ __Returns:__ A newly created 'GI.Poppler.Objects.Document.Document', or 'Nothing' /(Can throw 'Data.GI.Base.GError.GError')/ -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif

-- method Document::new_from_file
-- method type : Constructor
-- Args : [Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "uri of the file to load", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "password", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "password to unlock the file with, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "Document"}))
-- throws : True
-- Skip return : False

foreign import ccall "poppler_document_new_from_file" poppler_document_new_from_file :: 
    CString ->                              -- uri : TBasicType TUTF8
    CString ->                              -- password : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Document)

{- |
Creates a new 'GI.Poppler.Objects.Document.Document'.  If 'Nothing' is returned, then /@error@/ will be
set. Possible errors include those in the @/POPPLER_ERROR/@ and @/G_FILE_ERROR/@
domains.
-}
documentNewFromFile ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@uri@/: uri of the file to load -}
    -> Maybe (T.Text)
    {- ^ /@password@/: password to unlock the file with, or 'Nothing' -}
    -> m Document
    {- ^ __Returns:__ A newly created 'GI.Poppler.Objects.Document.Document', or 'Nothing' /(Can throw 'Data.GI.Base.GError.GError')/ -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif

-- method Document::new_from_gfile
-- method type : Constructor
-- Args : [Arg {argCName = "file", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GFile to load", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "password", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "password to unlock the file with, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "Document"}))
-- throws : True
-- Skip return : False

foreign import ccall "poppler_document_new_from_gfile" poppler_document_new_from_gfile :: 
    Ptr Gio.File.File ->                    -- file : TInterface (Name {namespace = "Gio", name = "File"})
    CString ->                              -- password : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Document)

{- |
Creates a new 'GI.Poppler.Objects.Document.Document' reading the PDF contents from /@file@/.
Possible errors include those in the @/POPPLER_ERROR/@ and @/G_FILE_ERROR/@
domains.

@since 0.22
-}
documentNewFromGfile ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@file@/: a 'GI.Gio.Interfaces.File.File' to load -}
    -> Maybe (T.Text)
    {- ^ /@password@/: password to unlock the file with, or 'Nothing' -}
    -> Maybe (b)
    {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable', or 'Nothing' -}
    -> m Document
    {- ^ __Returns:__ a new 'GI.Poppler.Objects.Document.Document', or 'Nothing' /(Can throw 'Data.GI.Base.GError.GError')/ -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif

-- method Document::new_from_stream
-- method type : Constructor
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "InputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GInputStream to read from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "length", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the stream length, or -1 if not known", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "password", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "password to unlock the file with, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "Document"}))
-- throws : True
-- Skip return : False

foreign import ccall "poppler_document_new_from_stream" poppler_document_new_from_stream :: 
    Ptr Gio.InputStream.InputStream ->      -- stream : TInterface (Name {namespace = "Gio", name = "InputStream"})
    Int64 ->                                -- length : TBasicType TInt64
    CString ->                              -- password : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Document)

{- |
Creates a new 'GI.Poppler.Objects.Document.Document' reading the PDF contents from /@stream@/.
Note that the given 'GI.Gio.Objects.InputStream.InputStream' must be seekable or 'GI.Gio.Enums.IOErrorEnumNotSupported'
will be returned.
Possible errors include those in the @/POPPLER_ERROR/@ and @/G_FILE_ERROR/@
domains.

@since 0.22
-}
documentNewFromStream ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.InputStream.InputStream' to read from -}
    -> Int64
    {- ^ /@length@/: the stream length, or -1 if not known -}
    -> Maybe (T.Text)
    {- ^ /@password@/: password to unlock the file with, or 'Nothing' -}
    -> Maybe (b)
    {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable', or 'Nothing' -}
    -> m Document
    {- ^ __Returns:__ a new 'GI.Poppler.Objects.Document.Document', or 'Nothing' /(Can throw 'Data.GI.Base.GError.GError')/ -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif

-- method Document::find_dest
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "link_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a named destination", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "Dest"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_find_dest" poppler_document_find_dest :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CString ->                              -- link_name : TBasicType TUTF8
    IO (Ptr Poppler.Dest.Dest)

{- |
Finds named destination /@linkName@/ in /@document@/
-}
documentFindDest ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> T.Text
    {- ^ /@linkName@/: a named destination -}
    -> m Poppler.Dest.Dest
    {- ^ __Returns:__ The 'GI.Poppler.Structs.Dest.Dest' destination or 'Nothing' if
/@linkName@/ is not a destination. Returned value must
be freed with @/poppler_dest_free/@ -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentFindDestMethodInfo
instance (signature ~ (T.Text -> m Poppler.Dest.Dest), MonadIO m, IsDocument a) => O.MethodInfo DocumentFindDestMethodInfo a signature where
    overloadedMethod _ = documentFindDest

#endif

-- method Document::get_attachments
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGList (TInterface (Name {namespace = "Poppler", name = "Attachment"})))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_attachments" poppler_document_get_attachments :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO (Ptr (GList (Ptr Poppler.Attachment.Attachment)))

{- |
Returns a 'GI.GLib.Structs.List.List' containing 'GI.Poppler.Objects.Attachment.Attachment'\<!-- -->s.  These attachments
are unowned, and must be unreffed, and the list must be freed with
@/g_list_free()/@.
-}
documentGetAttachments ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m [Poppler.Attachment.Attachment]
    {- ^ __Returns:__ a list of available attachments. -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetAttachmentsMethodInfo
instance (signature ~ (m [Poppler.Attachment.Attachment]), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetAttachmentsMethodInfo a signature where
    overloadedMethod _ = documentGetAttachments

#endif

-- method Document::get_author
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_author" poppler_document_get_author :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CString

{- |
Returns the author of the document

@since 0.16
-}
documentGetAuthor ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string containing the author
              of /@document@/, or 'Nothing' -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetAuthorMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetAuthorMethodInfo a signature where
    overloadedMethod _ = documentGetAuthor

#endif

-- method Document::get_creation_date
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TLong)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_creation_date" poppler_document_get_creation_date :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CLong

{- |
Returns the date the document was created as seconds since the Epoch

@since 0.16
-}
documentGetCreationDate ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m CLong
    {- ^ __Returns:__ the date the document was created, or -1 -}
documentGetCreationDate document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_creation_date document'
    touchManagedPtr document
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetCreationDateMethodInfo
instance (signature ~ (m CLong), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetCreationDateMethodInfo a signature where
    overloadedMethod _ = documentGetCreationDate

#endif

-- method Document::get_creator
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_creator" poppler_document_get_creator :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CString

{- |
Returns the creator of the document. If the document was converted
from another format, the creator is the name of the product
that created the original document from which it was converted.

@since 0.16
-}
documentGetCreator ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string containing the creator
              of /@document@/, or 'Nothing' -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetCreatorMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetCreatorMethodInfo a signature where
    overloadedMethod _ = documentGetCreator

#endif

-- method Document::get_form_field
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "id", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an id of a #PopplerFormField", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "FormField"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_form_field" poppler_document_get_form_field :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    Int32 ->                                -- id : TBasicType TInt
    IO (Ptr Poppler.FormField.FormField)

{- |
Returns the 'GI.Poppler.Objects.FormField.FormField' for the given /@id@/. It must be freed with
'GI.GObject.Objects.Object.objectUnref'
-}
documentGetFormField ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: a 'GI.Poppler.Objects.Document.Document' -}
    -> Int32
    {- ^ /@id@/: an id of a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Poppler.FormField.FormField
    {- ^ __Returns:__ a new 'GI.Poppler.Objects.FormField.FormField' or 'Nothing' if
not found -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetFormFieldMethodInfo
instance (signature ~ (Int32 -> m Poppler.FormField.FormField), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetFormFieldMethodInfo a signature where
    overloadedMethod _ = documentGetFormField

#endif

-- method Document::get_id
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "permanent_id", argType = TBasicType TUTF8, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "location to store an allocated string, use g_free() to free the returned string", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "update_id", argType = TBasicType TUTF8, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "location to store an allocated string, use g_free() to free the returned string", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_id" poppler_document_get_id :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    Ptr CString ->                          -- permanent_id : TBasicType TUTF8
    Ptr CString ->                          -- update_id : TBasicType TUTF8
    IO CInt

{- |
Returns the PDF file identifier represented as two byte string arrays of size 32.
/@permanentId@/ is the permanent identifier that is built based on the file
contents at the time it was originally created, so that this identifer
never changes. /@updateId@/ is the update identifier that is built based on
the file contents at the time it was last updated.

Note that returned strings are not null-terminated, they have a fixed
size of 32 bytes.

@since 0.16
-}
documentGetId ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m ((Bool, T.Text, T.Text))
    {- ^ __Returns:__ 'True' if the /@document@/ contains an id, 'False' otherwise -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetIdMethodInfo
instance (signature ~ (m ((Bool, T.Text, T.Text))), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetIdMethodInfo a signature where
    overloadedMethod _ = documentGetId

#endif

-- method Document::get_keywords
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_keywords" poppler_document_get_keywords :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CString

{- |
Returns the keywords associated to the document

@since 0.16
-}
documentGetKeywords ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string containing keywords associated
              to /@document@/, or 'Nothing' -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetKeywordsMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetKeywordsMethodInfo a signature where
    overloadedMethod _ = documentGetKeywords

#endif

-- method Document::get_metadata
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_metadata" poppler_document_get_metadata :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CString

{- |
Returns the XML metadata string of the document

@since 0.16
-}
documentGetMetadata ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string containing the XML
              metadata, or 'Nothing' -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetMetadataMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetMetadataMethodInfo a signature where
    overloadedMethod _ = documentGetMetadata

#endif

-- method Document::get_modification_date
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TLong)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_modification_date" poppler_document_get_modification_date :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CLong

{- |
Returns the date the document was most recently modified as seconds since the Epoch

@since 0.16
-}
documentGetModificationDate ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m CLong
    {- ^ __Returns:__ the date the document was most recently modified, or -1 -}
documentGetModificationDate document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_modification_date document'
    touchManagedPtr document
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetModificationDateMethodInfo
instance (signature ~ (m CLong), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetModificationDateMethodInfo a signature where
    overloadedMethod _ = documentGetModificationDate

#endif

-- method Document::get_n_attachments
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_n_attachments" poppler_document_get_n_attachments :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO Word32

{- |
Returns the number of attachments in a loaded document.
See also 'GI.Poppler.Objects.Document.documentGetAttachments'

@since 0.18
-}
documentGetNAttachments ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m Word32
    {- ^ __Returns:__ Number of attachments -}
documentGetNAttachments document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_n_attachments document'
    touchManagedPtr document
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetNAttachmentsMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetNAttachmentsMethodInfo a signature where
    overloadedMethod _ = documentGetNAttachments

#endif

-- method Document::get_n_pages
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_n_pages" poppler_document_get_n_pages :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO Int32

{- |
Returns the number of pages in a loaded document.
-}
documentGetNPages ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m Int32
    {- ^ __Returns:__ Number of pages -}
documentGetNPages document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_n_pages document'
    touchManagedPtr document
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetNPagesMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetNPagesMethodInfo a signature where
    overloadedMethod _ = documentGetNPages

#endif

-- method Document::get_page
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "index", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a page index", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "Page"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_page" poppler_document_get_page :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    Int32 ->                                -- index : TBasicType TInt
    IO (Ptr Poppler.Page.Page)

{- |
Returns the 'GI.Poppler.Objects.Page.Page' indexed at /@index@/.  This object is owned by the
caller.
-}
documentGetPage ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> Int32
    {- ^ /@index@/: a page index -}
    -> m Poppler.Page.Page
    {- ^ __Returns:__ The 'GI.Poppler.Objects.Page.Page' at /@index@/ -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetPageMethodInfo
instance (signature ~ (Int32 -> m Poppler.Page.Page), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPageMethodInfo a signature where
    overloadedMethod _ = documentGetPage

#endif

-- method Document::get_page_by_label
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a page label", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "Page"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_page_by_label" poppler_document_get_page_by_label :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CString ->                              -- label : TBasicType TUTF8
    IO (Ptr Poppler.Page.Page)

{- |
Returns the 'GI.Poppler.Objects.Page.Page' reference by /@label@/.  This object is owned by the
caller.  /@label@/ is a human-readable string representation of the page number,
and can be document specific.  Typically, it is a value such as \"iii\" or \"3\".

By default, \"1\" refers to the first page.
-}
documentGetPageByLabel ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> T.Text
    {- ^ /@label@/: a page label -}
    -> m Poppler.Page.Page
    {- ^ __Returns:__ The 'GI.Poppler.Objects.Page.Page' referenced by /@label@/ -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetPageByLabelMethodInfo
instance (signature ~ (T.Text -> m Poppler.Page.Page), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPageByLabelMethodInfo a signature where
    overloadedMethod _ = documentGetPageByLabel

#endif

-- method Document::get_page_layout
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "PageLayout"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_page_layout" poppler_document_get_page_layout :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CUInt

{- |
Returns the page layout that should be used when the document is opened

@since 0.16
-}
documentGetPageLayout ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m Poppler.Enums.PageLayout
    {- ^ __Returns:__ a 'GI.Poppler.Enums.PageLayout' that should be used when the document is opened -}
documentGetPageLayout document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_page_layout document'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr document
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetPageLayoutMethodInfo
instance (signature ~ (m Poppler.Enums.PageLayout), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPageLayoutMethodInfo a signature where
    overloadedMethod _ = documentGetPageLayout

#endif

-- method Document::get_page_mode
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "PageMode"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_page_mode" poppler_document_get_page_mode :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CUInt

{- |
Returns a 'GI.Poppler.Enums.PageMode' representing how the document should
be initially displayed when opened.

@since 0.16
-}
documentGetPageMode ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m Poppler.Enums.PageMode
    {- ^ __Returns:__ a 'GI.Poppler.Enums.PageMode' that should be used when document is opened -}
documentGetPageMode document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_page_mode document'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr document
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetPageModeMethodInfo
instance (signature ~ (m Poppler.Enums.PageMode), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPageModeMethodInfo a signature where
    overloadedMethod _ = documentGetPageMode

#endif

-- method Document::get_pdf_version
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "major_version", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the PDF major version number", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "minor_version", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the PDF minor version number", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_pdf_version" poppler_document_get_pdf_version :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    Ptr Word32 ->                           -- major_version : TBasicType TUInt
    Ptr Word32 ->                           -- minor_version : TBasicType TUInt
    IO ()

{- |
/No description available in the introspection data./

@since 0.16
-}
documentGetPdfVersion ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> 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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetPdfVersionMethodInfo
instance (signature ~ (m ((Word32, Word32))), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfVersionMethodInfo a signature where
    overloadedMethod _ = documentGetPdfVersion

#endif

-- method Document::get_pdf_version_string
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_pdf_version_string" poppler_document_get_pdf_version_string :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CString

{- |
Returns the PDF version of /@document@/ as a string (e.g. PDF-1.6)

@since 0.16
-}
documentGetPdfVersionString ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string containing the PDF version
              of /@document@/, or 'Nothing' -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetPdfVersionStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfVersionStringMethodInfo a signature where
    overloadedMethod _ = documentGetPdfVersionString

#endif

-- method Document::get_permissions
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "Permissions"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_permissions" poppler_document_get_permissions :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CUInt

{- |
Returns the flags specifying which operations are permitted when the document is opened.

@since 0.16
-}
documentGetPermissions ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m [Poppler.Flags.Permissions]
    {- ^ __Returns:__ a set of falgs from  'GI.Poppler.Flags.Permissions' enumeration -}
documentGetPermissions document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_permissions document'
    let result' = wordToGFlags result
    touchManagedPtr document
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetPermissionsMethodInfo
instance (signature ~ (m [Poppler.Flags.Permissions]), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPermissionsMethodInfo a signature where
    overloadedMethod _ = documentGetPermissions

#endif

-- method Document::get_producer
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_producer" poppler_document_get_producer :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CString

{- |
Returns the producer of the document. If the document was converted
from another format, the producer is the name of the product
that converted it to PDF

@since 0.16
-}
documentGetProducer ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string containing the producer
              of /@document@/, or 'Nothing' -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetProducerMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetProducerMethodInfo a signature where
    overloadedMethod _ = documentGetProducer

#endif

-- method Document::get_subject
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_subject" poppler_document_get_subject :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CString

{- |
Returns the subject of the document

@since 0.16
-}
documentGetSubject ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string containing the subject
              of /@document@/, or 'Nothing' -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetSubjectMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetSubjectMethodInfo a signature where
    overloadedMethod _ = documentGetSubject

#endif

-- method Document::get_title
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_get_title" poppler_document_get_title :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CString

{- |
Returns the document\'s title

@since 0.16
-}
documentGetTitle ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string containing the title
              of /@document@/, or 'Nothing' -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentGetTitleMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetTitleMethodInfo a signature where
    overloadedMethod _ = documentGetTitle

#endif

-- method Document::has_attachments
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_has_attachments" poppler_document_has_attachments :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CInt

{- |
Returns 'True' of /@document@/ has any attachments.
-}
documentHasAttachments ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m Bool
    {- ^ __Returns:__ 'True', if /@document@/ has attachments. -}
documentHasAttachments document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_has_attachments document'
    let result' = (/= 0) result
    touchManagedPtr document
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentHasAttachmentsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDocument a) => O.MethodInfo DocumentHasAttachmentsMethodInfo a signature where
    overloadedMethod _ = documentHasAttachments

#endif

-- method Document::is_linearized
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_is_linearized" poppler_document_is_linearized :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CInt

{- |
Returns whether /@document@/ is linearized or not. Linearization of PDF
enables efficient incremental access of the PDF file in a network environment.

@since 0.16
-}
documentIsLinearized ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@document@/ is linearized, 'False' otherwhise -}
documentIsLinearized document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_is_linearized document'
    let result' = (/= 0) result
    touchManagedPtr document
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentIsLinearizedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDocument a) => O.MethodInfo DocumentIsLinearizedMethodInfo a signature where
    overloadedMethod _ = documentIsLinearized

#endif

-- method Document::save
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "uri of file to save", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "poppler_document_save" poppler_document_save :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CString ->                              -- uri : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Saves /@document@/. Any change made in the document such as
form fields filled, annotations added or modified
will be saved.
If /@error@/ is set, 'False' will be returned. Possible errors
include those in the @/G_FILE_ERROR/@ domain.
-}
documentSave ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: a 'GI.Poppler.Objects.Document.Document' -}
    -> T.Text
    {- ^ /@uri@/: uri of file to save -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentSaveMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSaveMethodInfo a signature where
    overloadedMethod _ = documentSave

#endif

-- method Document::save_a_copy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "uri of file to save", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "poppler_document_save_a_copy" poppler_document_save_a_copy :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CString ->                              -- uri : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Saves a copy of the original /@document@/.
Any change made in the document such as
form fields filled by the user will not be saved.
If /@error@/ is set, 'False' will be returned. Possible errors
include those in the @/G_FILE_ERROR/@ domain.
-}
documentSaveACopy ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: a 'GI.Poppler.Objects.Document.Document' -}
    -> T.Text
    {- ^ /@uri@/: uri of file to save -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentSaveACopyMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSaveACopyMethodInfo a signature where
    overloadedMethod _ = documentSaveACopy

#endif

-- method Document::set_author
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "author", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A new author", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_set_author" poppler_document_set_author :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CString ->                              -- author : TBasicType TUTF8
    IO ()

{- |
Sets the document\'s author. If /@author@/ is 'Nothing', Author
entry is removed from the document\'s Info dictionary.

@since 0.46
-}
documentSetAuthor ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> T.Text
    {- ^ /@author@/: A new author -}
    -> m ()
documentSetAuthor document author = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    author' <- textToCString author
    poppler_document_set_author document' author'
    touchManagedPtr document
    freeMem author'
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentSetAuthorMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetAuthorMethodInfo a signature where
    overloadedMethod _ = documentSetAuthor

#endif

-- method Document::set_creation_date
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "creation_date", argType = TBasicType TLong, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A new creation date", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_set_creation_date" poppler_document_set_creation_date :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CLong ->                                -- creation_date : TBasicType TLong
    IO ()

{- |
Sets the document\'s creation date. If /@creationDate@/ is -1, CreationDate
entry is removed from the document\'s Info dictionary.

@since 0.46
-}
documentSetCreationDate ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> CLong
    {- ^ /@creationDate@/: A new creation date -}
    -> m ()
documentSetCreationDate document creationDate = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    poppler_document_set_creation_date document' creationDate
    touchManagedPtr document
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentSetCreationDateMethodInfo
instance (signature ~ (CLong -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetCreationDateMethodInfo a signature where
    overloadedMethod _ = documentSetCreationDate

#endif

-- method Document::set_creator
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "creator", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A new creator", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_set_creator" poppler_document_set_creator :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CString ->                              -- creator : TBasicType TUTF8
    IO ()

{- |
Sets the document\'s creator. If /@creator@/ is 'Nothing', Creator
entry is removed from the document\'s Info dictionary.

@since 0.46
-}
documentSetCreator ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> T.Text
    {- ^ /@creator@/: A new creator -}
    -> m ()
documentSetCreator document creator = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    creator' <- textToCString creator
    poppler_document_set_creator document' creator'
    touchManagedPtr document
    freeMem creator'
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentSetCreatorMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetCreatorMethodInfo a signature where
    overloadedMethod _ = documentSetCreator

#endif

-- method Document::set_keywords
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "keywords", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "New keywords", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_set_keywords" poppler_document_set_keywords :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CString ->                              -- keywords : TBasicType TUTF8
    IO ()

{- |
Sets the document\'s keywords. If /@keywords@/ is 'Nothing',
Keywords entry is removed from the document\'s Info dictionary.

@since 0.46
-}
documentSetKeywords ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> T.Text
    {- ^ /@keywords@/: New keywords -}
    -> m ()
documentSetKeywords document keywords = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    keywords' <- textToCString keywords
    poppler_document_set_keywords document' keywords'
    touchManagedPtr document
    freeMem keywords'
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentSetKeywordsMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetKeywordsMethodInfo a signature where
    overloadedMethod _ = documentSetKeywords

#endif

-- method Document::set_modification_date
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "modification_date", argType = TBasicType TLong, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A new modification date", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_set_modification_date" poppler_document_set_modification_date :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CLong ->                                -- modification_date : TBasicType TLong
    IO ()

{- |
Sets the document\'s modification date. If /@modificationDate@/ is -1, ModDate
entry is removed from the document\'s Info dictionary.

@since 0.46
-}
documentSetModificationDate ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> CLong
    {- ^ /@modificationDate@/: A new modification date -}
    -> m ()
documentSetModificationDate document modificationDate = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    poppler_document_set_modification_date document' modificationDate
    touchManagedPtr document
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentSetModificationDateMethodInfo
instance (signature ~ (CLong -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetModificationDateMethodInfo a signature where
    overloadedMethod _ = documentSetModificationDate

#endif

-- method Document::set_producer
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "producer", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A new producer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_set_producer" poppler_document_set_producer :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CString ->                              -- producer : TBasicType TUTF8
    IO ()

{- |
Sets the document\'s producer. If /@producer@/ is 'Nothing',
Producer entry is removed from the document\'s Info dictionary.

@since 0.46
-}
documentSetProducer ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> T.Text
    {- ^ /@producer@/: A new producer -}
    -> m ()
documentSetProducer document producer = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    producer' <- textToCString producer
    poppler_document_set_producer document' producer'
    touchManagedPtr document
    freeMem producer'
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentSetProducerMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetProducerMethodInfo a signature where
    overloadedMethod _ = documentSetProducer

#endif

-- method Document::set_subject
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "subject", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A new subject", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_set_subject" poppler_document_set_subject :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CString ->                              -- subject : TBasicType TUTF8
    IO ()

{- |
Sets the document\'s subject. If /@subject@/ is 'Nothing', Subject
entry is removed from the document\'s Info dictionary.

@since 0.46
-}
documentSetSubject ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> T.Text
    {- ^ /@subject@/: A new subject -}
    -> m ()
documentSetSubject document subject = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    subject' <- textToCString subject
    poppler_document_set_subject document' subject'
    touchManagedPtr document
    freeMem subject'
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentSetSubjectMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetSubjectMethodInfo a signature where
    overloadedMethod _ = documentSetSubject

#endif

-- method Document::set_title
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "document", argType = TInterface (Name {namespace = "Poppler", name = "Document"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerDocument", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "title", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A new title", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_document_set_title" poppler_document_set_title :: 
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    CString ->                              -- title : TBasicType TUTF8
    IO ()

{- |
Sets the document\'s title. If /@title@/ is 'Nothing', Title entry
is removed from the document\'s Info dictionary.

@since 0.46
-}
documentSetTitle ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> T.Text
    {- ^ /@title@/: A new title -}
    -> m ()
documentSetTitle document title = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    title' <- textToCString title
    poppler_document_set_title document' title'
    touchManagedPtr document
    freeMem title'
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DocumentSetTitleMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetTitleMethodInfo a signature where
    overloadedMethod _ = documentSetTitle

#endif