{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)

/No description available in the introspection data./
-}

#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
       && !defined(__HADDOCK_VERSION__))

module GI.Poppler.Objects.Document
    (

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


 -- * Methods
-- ** findDest #method:findDest#

#if ENABLE_OVERLOADING
    DocumentFindDestMethodInfo              ,
#endif
    documentFindDest                        ,


-- ** getAttachments #method:getAttachments#

#if ENABLE_OVERLOADING
    DocumentGetAttachmentsMethodInfo        ,
#endif
    documentGetAttachments                  ,


-- ** getAuthor #method:getAuthor#

#if ENABLE_OVERLOADING
    DocumentGetAuthorMethodInfo             ,
#endif
    documentGetAuthor                       ,


-- ** getCreationDate #method:getCreationDate#

#if ENABLE_OVERLOADING
    DocumentGetCreationDateMethodInfo       ,
#endif
    documentGetCreationDate                 ,


-- ** getCreator #method:getCreator#

#if ENABLE_OVERLOADING
    DocumentGetCreatorMethodInfo            ,
#endif
    documentGetCreator                      ,


-- ** getFormField #method:getFormField#

#if ENABLE_OVERLOADING
    DocumentGetFormFieldMethodInfo          ,
#endif
    documentGetFormField                    ,


-- ** getId #method:getId#

#if ENABLE_OVERLOADING
    DocumentGetIdMethodInfo                 ,
#endif
    documentGetId                           ,


-- ** getKeywords #method:getKeywords#

#if ENABLE_OVERLOADING
    DocumentGetKeywordsMethodInfo           ,
#endif
    documentGetKeywords                     ,


-- ** getMetadata #method:getMetadata#

#if ENABLE_OVERLOADING
    DocumentGetMetadataMethodInfo           ,
#endif
    documentGetMetadata                     ,


-- ** getModificationDate #method:getModificationDate#

#if ENABLE_OVERLOADING
    DocumentGetModificationDateMethodInfo   ,
#endif
    documentGetModificationDate             ,


-- ** getNAttachments #method:getNAttachments#

#if ENABLE_OVERLOADING
    DocumentGetNAttachmentsMethodInfo       ,
#endif
    documentGetNAttachments                 ,


-- ** getNPages #method:getNPages#

#if ENABLE_OVERLOADING
    DocumentGetNPagesMethodInfo             ,
#endif
    documentGetNPages                       ,


-- ** getPage #method:getPage#

#if ENABLE_OVERLOADING
    DocumentGetPageMethodInfo               ,
#endif
    documentGetPage                         ,


-- ** getPageByLabel #method:getPageByLabel#

#if ENABLE_OVERLOADING
    DocumentGetPageByLabelMethodInfo        ,
#endif
    documentGetPageByLabel                  ,


-- ** getPageLayout #method:getPageLayout#

#if ENABLE_OVERLOADING
    DocumentGetPageLayoutMethodInfo         ,
#endif
    documentGetPageLayout                   ,


-- ** getPageMode #method:getPageMode#

#if ENABLE_OVERLOADING
    DocumentGetPageModeMethodInfo           ,
#endif
    documentGetPageMode                     ,


-- ** getPdfConformance #method:getPdfConformance#

#if ENABLE_OVERLOADING
    DocumentGetPdfConformanceMethodInfo     ,
#endif
    documentGetPdfConformance               ,


-- ** getPdfPart #method:getPdfPart#

#if ENABLE_OVERLOADING
    DocumentGetPdfPartMethodInfo            ,
#endif
    documentGetPdfPart                      ,


-- ** getPdfSubtype #method:getPdfSubtype#

#if ENABLE_OVERLOADING
    DocumentGetPdfSubtypeMethodInfo         ,
#endif
    documentGetPdfSubtype                   ,


-- ** getPdfSubtypeString #method:getPdfSubtypeString#

#if ENABLE_OVERLOADING
    DocumentGetPdfSubtypeStringMethodInfo   ,
#endif
    documentGetPdfSubtypeString             ,


-- ** getPdfVersion #method:getPdfVersion#

#if ENABLE_OVERLOADING
    DocumentGetPdfVersionMethodInfo         ,
#endif
    documentGetPdfVersion                   ,


-- ** getPdfVersionString #method:getPdfVersionString#

#if ENABLE_OVERLOADING
    DocumentGetPdfVersionStringMethodInfo   ,
#endif
    documentGetPdfVersionString             ,


-- ** getPermissions #method:getPermissions#

#if ENABLE_OVERLOADING
    DocumentGetPermissionsMethodInfo        ,
#endif
    documentGetPermissions                  ,


-- ** getPrintScaling #method:getPrintScaling#

#if ENABLE_OVERLOADING
    DocumentGetPrintScalingMethodInfo       ,
#endif
    documentGetPrintScaling                 ,


-- ** getProducer #method:getProducer#

#if ENABLE_OVERLOADING
    DocumentGetProducerMethodInfo           ,
#endif
    documentGetProducer                     ,


-- ** getSubject #method:getSubject#

#if ENABLE_OVERLOADING
    DocumentGetSubjectMethodInfo            ,
#endif
    documentGetSubject                      ,


-- ** getTitle #method:getTitle#

#if ENABLE_OVERLOADING
    DocumentGetTitleMethodInfo              ,
#endif
    documentGetTitle                        ,


-- ** hasAttachments #method:hasAttachments#

#if ENABLE_OVERLOADING
    DocumentHasAttachmentsMethodInfo        ,
#endif
    documentHasAttachments                  ,


-- ** isLinearized #method:isLinearized#

#if ENABLE_OVERLOADING
    DocumentIsLinearizedMethodInfo          ,
#endif
    documentIsLinearized                    ,


-- ** newFromData #method:newFromData#

    documentNewFromData                     ,


-- ** newFromFile #method:newFromFile#

    documentNewFromFile                     ,


-- ** newFromGfile #method:newFromGfile#

    documentNewFromGfile                    ,


-- ** newFromStream #method:newFromStream#

    documentNewFromStream                   ,


-- ** save #method:save#

#if ENABLE_OVERLOADING
    DocumentSaveMethodInfo                  ,
#endif
    documentSave                            ,


-- ** saveACopy #method:saveACopy#

#if ENABLE_OVERLOADING
    DocumentSaveACopyMethodInfo             ,
#endif
    documentSaveACopy                       ,


-- ** setAuthor #method:setAuthor#

#if ENABLE_OVERLOADING
    DocumentSetAuthorMethodInfo             ,
#endif
    documentSetAuthor                       ,


-- ** setCreationDate #method:setCreationDate#

#if ENABLE_OVERLOADING
    DocumentSetCreationDateMethodInfo       ,
#endif
    documentSetCreationDate                 ,


-- ** setCreator #method:setCreator#

#if ENABLE_OVERLOADING
    DocumentSetCreatorMethodInfo            ,
#endif
    documentSetCreator                      ,


-- ** setKeywords #method:setKeywords#

#if ENABLE_OVERLOADING
    DocumentSetKeywordsMethodInfo           ,
#endif
    documentSetKeywords                     ,


-- ** setModificationDate #method:setModificationDate#

#if ENABLE_OVERLOADING
    DocumentSetModificationDateMethodInfo   ,
#endif
    documentSetModificationDate             ,


-- ** setProducer #method:setProducer#

#if ENABLE_OVERLOADING
    DocumentSetProducerMethodInfo           ,
#endif
    documentSetProducer                     ,


-- ** setSubject #method:setSubject#

#if ENABLE_OVERLOADING
    DocumentSetSubjectMethodInfo            ,
#endif
    documentSetSubject                      ,


-- ** setTitle #method:setTitle#

#if ENABLE_OVERLOADING
    DocumentSetTitleMethodInfo              ,
#endif
    documentSetTitle                        ,




 -- * Properties
-- ** author #attr:author#
{- | The author of the document
-}
#if ENABLE_OVERLOADING
    DocumentAuthorPropertyInfo              ,
#endif
    constructDocumentAuthor                 ,
#if ENABLE_OVERLOADING
    documentAuthor                          ,
#endif
    getDocumentAuthor                       ,
    setDocumentAuthor                       ,


-- ** creationDate #attr:creationDate#
{- | The date the document was created as seconds since the Epoch, or -1
-}
#if ENABLE_OVERLOADING
    DocumentCreationDatePropertyInfo        ,
#endif
    constructDocumentCreationDate           ,
#if ENABLE_OVERLOADING
    documentCreationDate                    ,
#endif
    getDocumentCreationDate                 ,
    setDocumentCreationDate                 ,


-- ** creator #attr:creator#
{- | The creator of the document. See also 'GI.Poppler.Objects.Document.documentGetCreator'
-}
#if ENABLE_OVERLOADING
    DocumentCreatorPropertyInfo             ,
#endif
    constructDocumentCreator                ,
#if ENABLE_OVERLOADING
    documentCreator                         ,
#endif
    getDocumentCreator                      ,
    setDocumentCreator                      ,


-- ** format #attr:format#
{- | The PDF version as string. See also 'GI.Poppler.Objects.Document.documentGetPdfVersionString'
-}
#if ENABLE_OVERLOADING
    DocumentFormatPropertyInfo              ,
#endif
#if ENABLE_OVERLOADING
    documentFormat                          ,
#endif
    getDocumentFormat                       ,


-- ** formatMajor #attr:formatMajor#
{- | The PDF major version number. See also 'GI.Poppler.Objects.Document.documentGetPdfVersion'
-}
#if ENABLE_OVERLOADING
    DocumentFormatMajorPropertyInfo         ,
#endif
#if ENABLE_OVERLOADING
    documentFormatMajor                     ,
#endif
    getDocumentFormatMajor                  ,


-- ** formatMinor #attr:formatMinor#
{- | The PDF minor version number. See also 'GI.Poppler.Objects.Document.documentGetPdfVersion'
-}
#if ENABLE_OVERLOADING
    DocumentFormatMinorPropertyInfo         ,
#endif
#if ENABLE_OVERLOADING
    documentFormatMinor                     ,
#endif
    getDocumentFormatMinor                  ,


-- ** keywords #attr:keywords#
{- | The keywords associated to the document
-}
#if ENABLE_OVERLOADING
    DocumentKeywordsPropertyInfo            ,
#endif
    constructDocumentKeywords               ,
#if ENABLE_OVERLOADING
    documentKeywords                        ,
#endif
    getDocumentKeywords                     ,
    setDocumentKeywords                     ,


-- ** linearized #attr:linearized#
{- | Whether document is linearized. See also 'GI.Poppler.Objects.Document.documentIsLinearized'
-}
#if ENABLE_OVERLOADING
    DocumentLinearizedPropertyInfo          ,
#endif
#if ENABLE_OVERLOADING
    documentLinearized                      ,
#endif
    getDocumentLinearized                   ,


-- ** metadata #attr:metadata#
{- | Document metadata in XML format, or 'Nothing'
-}
#if ENABLE_OVERLOADING
    DocumentMetadataPropertyInfo            ,
#endif
#if ENABLE_OVERLOADING
    documentMetadata                        ,
#endif
    getDocumentMetadata                     ,


-- ** modDate #attr:modDate#
{- | The date the document was most recently modified as seconds since the Epoch, or -1
-}
#if ENABLE_OVERLOADING
    DocumentModDatePropertyInfo             ,
#endif
    constructDocumentModDate                ,
#if ENABLE_OVERLOADING
    documentModDate                         ,
#endif
    getDocumentModDate                      ,
    setDocumentModDate                      ,


-- ** pageLayout #attr:pageLayout#
{- | The page layout that should be used when the document is opened
-}
#if ENABLE_OVERLOADING
    DocumentPageLayoutPropertyInfo          ,
#endif
#if ENABLE_OVERLOADING
    documentPageLayout                      ,
#endif
    getDocumentPageLayout                   ,


-- ** pageMode #attr:pageMode#
{- | The mode that should be used when the document is opened
-}
#if ENABLE_OVERLOADING
    DocumentPageModePropertyInfo            ,
#endif
#if ENABLE_OVERLOADING
    documentPageMode                        ,
#endif
    getDocumentPageMode                     ,


-- ** permissions #attr:permissions#
{- | Flags specifying which operations are permitted when the document is opened
-}
#if ENABLE_OVERLOADING
    DocumentPermissionsPropertyInfo         ,
#endif
#if ENABLE_OVERLOADING
    documentPermissions                     ,
#endif
    getDocumentPermissions                  ,


-- ** printScaling #attr:printScaling#
{- | /No description available in the introspection data./

/Since: 0.73/
-}
#if ENABLE_OVERLOADING
    DocumentPrintScalingPropertyInfo        ,
#endif
#if ENABLE_OVERLOADING
    documentPrintScaling                    ,
#endif
    getDocumentPrintScaling                 ,


-- ** producer #attr:producer#
{- | The producer of the document. See also 'GI.Poppler.Objects.Document.documentGetProducer'
-}
#if ENABLE_OVERLOADING
    DocumentProducerPropertyInfo            ,
#endif
    constructDocumentProducer               ,
#if ENABLE_OVERLOADING
    documentProducer                        ,
#endif
    getDocumentProducer                     ,
    setDocumentProducer                     ,


-- ** subject #attr:subject#
{- | The subject of the document
-}
#if ENABLE_OVERLOADING
    DocumentSubjectPropertyInfo             ,
#endif
    constructDocumentSubject                ,
#if ENABLE_OVERLOADING
    documentSubject                         ,
#endif
    getDocumentSubject                      ,
    setDocumentSubject                      ,


-- ** subtype #attr:subtype#
{- | Document PDF subtype type
-}
#if ENABLE_OVERLOADING
    DocumentSubtypePropertyInfo             ,
#endif
#if ENABLE_OVERLOADING
    documentSubtype                         ,
#endif
    getDocumentSubtype                      ,


-- ** subtypeConformance #attr:subtypeConformance#
{- | Document PDF subtype conformance
-}
#if ENABLE_OVERLOADING
    DocumentSubtypeConformancePropertyInfo  ,
#endif
#if ENABLE_OVERLOADING
    documentSubtypeConformance              ,
#endif
    getDocumentSubtypeConformance           ,


-- ** subtypePart #attr:subtypePart#
{- | Document PDF subtype part
-}
#if ENABLE_OVERLOADING
    DocumentSubtypePartPropertyInfo         ,
#endif
#if ENABLE_OVERLOADING
    documentSubtypePart                     ,
#endif
    getDocumentSubtypePart                  ,


-- ** subtypeString #attr:subtypeString#
{- | Document PDF subtype. See also 'GI.Poppler.Objects.Document.documentGetPdfSubtypeString'
-}
#if ENABLE_OVERLOADING
    DocumentSubtypeStringPropertyInfo       ,
#endif
#if ENABLE_OVERLOADING
    documentSubtypeString                   ,
#endif
    getDocumentSubtypeString                ,


-- ** title #attr:title#
{- | The document\'s title or 'Nothing'
-}
#if ENABLE_OVERLOADING
    DocumentTitlePropertyInfo               ,
#endif
    constructDocumentTitle                  ,
#if ENABLE_OVERLOADING
    documentTitle                           ,
#endif
    getDocumentTitle                        ,
    setDocumentTitle                        ,


-- ** viewerPreferences #attr:viewerPreferences#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DocumentViewerPreferencesPropertyInfo   ,
#endif
#if ENABLE_OVERLOADING
    documentViewerPreferences               ,
#endif
    getDocumentViewerPreferences            ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Poppler.Enums as Poppler.Enums
import {-# SOURCE #-} qualified GI.Poppler.Flags as Poppler.Flags
import {-# SOURCE #-} qualified GI.Poppler.Objects.Attachment as Poppler.Attachment
import {-# SOURCE #-} qualified GI.Poppler.Objects.FormField as Poppler.FormField
import {-# SOURCE #-} qualified GI.Poppler.Objects.Page as Poppler.Page
import {-# SOURCE #-} qualified GI.Poppler.Structs.Dest as Poppler.Dest

-- | Memory-managed wrapper type.
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


-- | Type class for types which can be safely cast to `Document`, for instance with `toDocument`.
class (GObject o, O.IsDescendantOf Document o) => IsDocument o
instance (GObject o, O.IsDescendantOf Document o) => IsDocument o

instance O.HasParentTypes Document
type instance O.ParentTypes Document = '[GObject.Object.Object]

-- | Cast to `Document`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toDocument :: (MonadIO m, IsDocument o) => o -> m Document
toDocument = liftIO . unsafeCastTo Document

-- | A convenience alias for `Nothing` :: `Maybe` `Document`.
noDocument :: Maybe Document
noDocument = Nothing

#if ENABLE_OVERLOADING
type family ResolveDocumentMethod (t :: Symbol) (o :: *) :: * where
    ResolveDocumentMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDocumentMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDocumentMethod "findDest" o = DocumentFindDestMethodInfo
    ResolveDocumentMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDocumentMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDocumentMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDocumentMethod "hasAttachments" o = DocumentHasAttachmentsMethodInfo
    ResolveDocumentMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDocumentMethod "isLinearized" o = DocumentIsLinearizedMethodInfo
    ResolveDocumentMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDocumentMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDocumentMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDocumentMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDocumentMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDocumentMethod "save" o = DocumentSaveMethodInfo
    ResolveDocumentMethod "saveACopy" o = DocumentSaveACopyMethodInfo
    ResolveDocumentMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDocumentMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDocumentMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDocumentMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDocumentMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDocumentMethod "getAttachments" o = DocumentGetAttachmentsMethodInfo
    ResolveDocumentMethod "getAuthor" o = DocumentGetAuthorMethodInfo
    ResolveDocumentMethod "getCreationDate" o = DocumentGetCreationDateMethodInfo
    ResolveDocumentMethod "getCreator" o = DocumentGetCreatorMethodInfo
    ResolveDocumentMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDocumentMethod "getFormField" o = DocumentGetFormFieldMethodInfo
    ResolveDocumentMethod "getId" o = DocumentGetIdMethodInfo
    ResolveDocumentMethod "getKeywords" o = DocumentGetKeywordsMethodInfo
    ResolveDocumentMethod "getMetadata" o = DocumentGetMetadataMethodInfo
    ResolveDocumentMethod "getModificationDate" o = DocumentGetModificationDateMethodInfo
    ResolveDocumentMethod "getNAttachments" o = DocumentGetNAttachmentsMethodInfo
    ResolveDocumentMethod "getNPages" o = DocumentGetNPagesMethodInfo
    ResolveDocumentMethod "getPage" o = DocumentGetPageMethodInfo
    ResolveDocumentMethod "getPageByLabel" o = DocumentGetPageByLabelMethodInfo
    ResolveDocumentMethod "getPageLayout" o = DocumentGetPageLayoutMethodInfo
    ResolveDocumentMethod "getPageMode" o = DocumentGetPageModeMethodInfo
    ResolveDocumentMethod "getPdfConformance" o = DocumentGetPdfConformanceMethodInfo
    ResolveDocumentMethod "getPdfPart" o = DocumentGetPdfPartMethodInfo
    ResolveDocumentMethod "getPdfSubtype" o = DocumentGetPdfSubtypeMethodInfo
    ResolveDocumentMethod "getPdfSubtypeString" o = DocumentGetPdfSubtypeStringMethodInfo
    ResolveDocumentMethod "getPdfVersion" o = DocumentGetPdfVersionMethodInfo
    ResolveDocumentMethod "getPdfVersionString" o = DocumentGetPdfVersionStringMethodInfo
    ResolveDocumentMethod "getPermissions" o = DocumentGetPermissionsMethodInfo
    ResolveDocumentMethod "getPrintScaling" o = DocumentGetPrintScalingMethodInfo
    ResolveDocumentMethod "getProducer" o = DocumentGetProducerMethodInfo
    ResolveDocumentMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDocumentMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDocumentMethod "getSubject" o = DocumentGetSubjectMethodInfo
    ResolveDocumentMethod "getTitle" o = DocumentGetTitleMethodInfo
    ResolveDocumentMethod "setAuthor" o = DocumentSetAuthorMethodInfo
    ResolveDocumentMethod "setCreationDate" o = DocumentSetCreationDateMethodInfo
    ResolveDocumentMethod "setCreator" o = DocumentSetCreatorMethodInfo
    ResolveDocumentMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDocumentMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveDocumentMethod "setKeywords" o = DocumentSetKeywordsMethodInfo
    ResolveDocumentMethod "setModificationDate" o = DocumentSetModificationDateMethodInfo
    ResolveDocumentMethod "setProducer" o = DocumentSetProducerMethodInfo
    ResolveDocumentMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDocumentMethod "setSubject" o = DocumentSetSubjectMethodInfo
    ResolveDocumentMethod "setTitle" o = DocumentSetTitleMethodInfo
    ResolveDocumentMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDocumentMethod t Document, O.MethodInfo info Document p) => OL.IsLabel t (Document -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

#endif

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

{- |
Get the value of the “@author@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #author
@
-}
getDocumentAuthor :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentAuthor obj = liftIO $ B.Properties.getObjectPropertyString obj "author"

{- |
Set the value of the “@author@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' document [ #author 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDocumentAuthor :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentAuthor obj val = liftIO $ B.Properties.setObjectPropertyString obj "author" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@author@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDocumentAuthor :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentAuthor val = B.Properties.constructObjectPropertyString "author" (Just val)

#if ENABLE_OVERLOADING
data DocumentAuthorPropertyInfo
instance AttrInfo DocumentAuthorPropertyInfo where
    type AttrAllowedOps DocumentAuthorPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DocumentAuthorPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DocumentAuthorPropertyInfo = IsDocument
    type AttrGetType DocumentAuthorPropertyInfo = (Maybe T.Text)
    type AttrLabel DocumentAuthorPropertyInfo = "author"
    type AttrOrigin DocumentAuthorPropertyInfo = Document
    attrGet _ = getDocumentAuthor
    attrSet _ = setDocumentAuthor
    attrConstruct _ = constructDocumentAuthor
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@creation-date@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #creationDate
@
-}
getDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> m Int32
getDocumentCreationDate obj = liftIO $ B.Properties.getObjectPropertyInt32 obj "creation-date"

{- |
Set the value of the “@creation-date@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' document [ #creationDate 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m ()
setDocumentCreationDate obj val = liftIO $ B.Properties.setObjectPropertyInt32 obj "creation-date" val

{- |
Construct a `GValueConstruct` with valid value for the “@creation-date@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDocumentCreationDate :: (IsDocument o) => Int32 -> IO (GValueConstruct o)
constructDocumentCreationDate val = B.Properties.constructObjectPropertyInt32 "creation-date" val

#if ENABLE_OVERLOADING
data DocumentCreationDatePropertyInfo
instance AttrInfo DocumentCreationDatePropertyInfo where
    type AttrAllowedOps DocumentCreationDatePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DocumentCreationDatePropertyInfo = (~) Int32
    type AttrBaseTypeConstraint DocumentCreationDatePropertyInfo = IsDocument
    type AttrGetType DocumentCreationDatePropertyInfo = Int32
    type AttrLabel DocumentCreationDatePropertyInfo = "creation-date"
    type AttrOrigin DocumentCreationDatePropertyInfo = Document
    attrGet _ = getDocumentCreationDate
    attrSet _ = setDocumentCreationDate
    attrConstruct _ = constructDocumentCreationDate
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@creator@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #creator
@
-}
getDocumentCreator :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentCreator obj = liftIO $ B.Properties.getObjectPropertyString obj "creator"

{- |
Set the value of the “@creator@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' document [ #creator 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDocumentCreator :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentCreator obj val = liftIO $ B.Properties.setObjectPropertyString obj "creator" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@creator@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDocumentCreator :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentCreator val = B.Properties.constructObjectPropertyString "creator" (Just val)

#if ENABLE_OVERLOADING
data DocumentCreatorPropertyInfo
instance AttrInfo DocumentCreatorPropertyInfo where
    type AttrAllowedOps DocumentCreatorPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DocumentCreatorPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DocumentCreatorPropertyInfo = IsDocument
    type AttrGetType DocumentCreatorPropertyInfo = (Maybe T.Text)
    type AttrLabel DocumentCreatorPropertyInfo = "creator"
    type AttrOrigin DocumentCreatorPropertyInfo = Document
    attrGet _ = getDocumentCreator
    attrSet _ = setDocumentCreator
    attrConstruct _ = constructDocumentCreator
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@format@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #format
@
-}
getDocumentFormat :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentFormat obj = liftIO $ B.Properties.getObjectPropertyString obj "format"

#if ENABLE_OVERLOADING
data DocumentFormatPropertyInfo
instance AttrInfo DocumentFormatPropertyInfo where
    type AttrAllowedOps DocumentFormatPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DocumentFormatPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentFormatPropertyInfo = IsDocument
    type AttrGetType DocumentFormatPropertyInfo = (Maybe T.Text)
    type AttrLabel DocumentFormatPropertyInfo = "format"
    type AttrOrigin DocumentFormatPropertyInfo = Document
    attrGet _ = getDocumentFormat
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@format-major@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #formatMajor
@
-}
getDocumentFormatMajor :: (MonadIO m, IsDocument o) => o -> m Word32
getDocumentFormatMajor obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "format-major"

#if ENABLE_OVERLOADING
data DocumentFormatMajorPropertyInfo
instance AttrInfo DocumentFormatMajorPropertyInfo where
    type AttrAllowedOps DocumentFormatMajorPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentFormatMajorPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentFormatMajorPropertyInfo = IsDocument
    type AttrGetType DocumentFormatMajorPropertyInfo = Word32
    type AttrLabel DocumentFormatMajorPropertyInfo = "format-major"
    type AttrOrigin DocumentFormatMajorPropertyInfo = Document
    attrGet _ = getDocumentFormatMajor
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@format-minor@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #formatMinor
@
-}
getDocumentFormatMinor :: (MonadIO m, IsDocument o) => o -> m Word32
getDocumentFormatMinor obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "format-minor"

#if ENABLE_OVERLOADING
data DocumentFormatMinorPropertyInfo
instance AttrInfo DocumentFormatMinorPropertyInfo where
    type AttrAllowedOps DocumentFormatMinorPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentFormatMinorPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentFormatMinorPropertyInfo = IsDocument
    type AttrGetType DocumentFormatMinorPropertyInfo = Word32
    type AttrLabel DocumentFormatMinorPropertyInfo = "format-minor"
    type AttrOrigin DocumentFormatMinorPropertyInfo = Document
    attrGet _ = getDocumentFormatMinor
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@keywords@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #keywords
@
-}
getDocumentKeywords :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentKeywords obj = liftIO $ B.Properties.getObjectPropertyString obj "keywords"

{- |
Set the value of the “@keywords@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' document [ #keywords 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDocumentKeywords :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentKeywords obj val = liftIO $ B.Properties.setObjectPropertyString obj "keywords" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@keywords@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDocumentKeywords :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentKeywords val = B.Properties.constructObjectPropertyString "keywords" (Just val)

#if ENABLE_OVERLOADING
data DocumentKeywordsPropertyInfo
instance AttrInfo DocumentKeywordsPropertyInfo where
    type AttrAllowedOps DocumentKeywordsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DocumentKeywordsPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DocumentKeywordsPropertyInfo = IsDocument
    type AttrGetType DocumentKeywordsPropertyInfo = (Maybe T.Text)
    type AttrLabel DocumentKeywordsPropertyInfo = "keywords"
    type AttrOrigin DocumentKeywordsPropertyInfo = Document
    attrGet _ = getDocumentKeywords
    attrSet _ = setDocumentKeywords
    attrConstruct _ = constructDocumentKeywords
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@linearized@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #linearized
@
-}
getDocumentLinearized :: (MonadIO m, IsDocument o) => o -> m Bool
getDocumentLinearized obj = liftIO $ B.Properties.getObjectPropertyBool obj "linearized"

#if ENABLE_OVERLOADING
data DocumentLinearizedPropertyInfo
instance AttrInfo DocumentLinearizedPropertyInfo where
    type AttrAllowedOps DocumentLinearizedPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentLinearizedPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentLinearizedPropertyInfo = IsDocument
    type AttrGetType DocumentLinearizedPropertyInfo = Bool
    type AttrLabel DocumentLinearizedPropertyInfo = "linearized"
    type AttrOrigin DocumentLinearizedPropertyInfo = Document
    attrGet _ = getDocumentLinearized
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@metadata@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #metadata
@
-}
getDocumentMetadata :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentMetadata obj = liftIO $ B.Properties.getObjectPropertyString obj "metadata"

#if ENABLE_OVERLOADING
data DocumentMetadataPropertyInfo
instance AttrInfo DocumentMetadataPropertyInfo where
    type AttrAllowedOps DocumentMetadataPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DocumentMetadataPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentMetadataPropertyInfo = IsDocument
    type AttrGetType DocumentMetadataPropertyInfo = (Maybe T.Text)
    type AttrLabel DocumentMetadataPropertyInfo = "metadata"
    type AttrOrigin DocumentMetadataPropertyInfo = Document
    attrGet _ = getDocumentMetadata
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@mod-date@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #modDate
@
-}
getDocumentModDate :: (MonadIO m, IsDocument o) => o -> m Int32
getDocumentModDate obj = liftIO $ B.Properties.getObjectPropertyInt32 obj "mod-date"

{- |
Set the value of the “@mod-date@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' document [ #modDate 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDocumentModDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m ()
setDocumentModDate obj val = liftIO $ B.Properties.setObjectPropertyInt32 obj "mod-date" val

{- |
Construct a `GValueConstruct` with valid value for the “@mod-date@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDocumentModDate :: (IsDocument o) => Int32 -> IO (GValueConstruct o)
constructDocumentModDate val = B.Properties.constructObjectPropertyInt32 "mod-date" val

#if ENABLE_OVERLOADING
data DocumentModDatePropertyInfo
instance AttrInfo DocumentModDatePropertyInfo where
    type AttrAllowedOps DocumentModDatePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DocumentModDatePropertyInfo = (~) Int32
    type AttrBaseTypeConstraint DocumentModDatePropertyInfo = IsDocument
    type AttrGetType DocumentModDatePropertyInfo = Int32
    type AttrLabel DocumentModDatePropertyInfo = "mod-date"
    type AttrOrigin DocumentModDatePropertyInfo = Document
    attrGet _ = getDocumentModDate
    attrSet _ = setDocumentModDate
    attrConstruct _ = constructDocumentModDate
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@page-layout@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #pageLayout
@
-}
getDocumentPageLayout :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PageLayout
getDocumentPageLayout obj = liftIO $ B.Properties.getObjectPropertyEnum obj "page-layout"

#if ENABLE_OVERLOADING
data DocumentPageLayoutPropertyInfo
instance AttrInfo DocumentPageLayoutPropertyInfo where
    type AttrAllowedOps DocumentPageLayoutPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentPageLayoutPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentPageLayoutPropertyInfo = IsDocument
    type AttrGetType DocumentPageLayoutPropertyInfo = Poppler.Enums.PageLayout
    type AttrLabel DocumentPageLayoutPropertyInfo = "page-layout"
    type AttrOrigin DocumentPageLayoutPropertyInfo = Document
    attrGet _ = getDocumentPageLayout
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@page-mode@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #pageMode
@
-}
getDocumentPageMode :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PageMode
getDocumentPageMode obj = liftIO $ B.Properties.getObjectPropertyEnum obj "page-mode"

#if ENABLE_OVERLOADING
data DocumentPageModePropertyInfo
instance AttrInfo DocumentPageModePropertyInfo where
    type AttrAllowedOps DocumentPageModePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentPageModePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentPageModePropertyInfo = IsDocument
    type AttrGetType DocumentPageModePropertyInfo = Poppler.Enums.PageMode
    type AttrLabel DocumentPageModePropertyInfo = "page-mode"
    type AttrOrigin DocumentPageModePropertyInfo = Document
    attrGet _ = getDocumentPageMode
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@permissions@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #permissions
@
-}
getDocumentPermissions :: (MonadIO m, IsDocument o) => o -> m [Poppler.Flags.Permissions]
getDocumentPermissions obj = liftIO $ B.Properties.getObjectPropertyFlags obj "permissions"

#if ENABLE_OVERLOADING
data DocumentPermissionsPropertyInfo
instance AttrInfo DocumentPermissionsPropertyInfo where
    type AttrAllowedOps DocumentPermissionsPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentPermissionsPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentPermissionsPropertyInfo = IsDocument
    type AttrGetType DocumentPermissionsPropertyInfo = [Poppler.Flags.Permissions]
    type AttrLabel DocumentPermissionsPropertyInfo = "permissions"
    type AttrOrigin DocumentPermissionsPropertyInfo = Document
    attrGet _ = getDocumentPermissions
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@print-scaling@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #printScaling
@
-}
getDocumentPrintScaling :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PrintScaling
getDocumentPrintScaling obj = liftIO $ B.Properties.getObjectPropertyEnum obj "print-scaling"

#if ENABLE_OVERLOADING
data DocumentPrintScalingPropertyInfo
instance AttrInfo DocumentPrintScalingPropertyInfo where
    type AttrAllowedOps DocumentPrintScalingPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentPrintScalingPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentPrintScalingPropertyInfo = IsDocument
    type AttrGetType DocumentPrintScalingPropertyInfo = Poppler.Enums.PrintScaling
    type AttrLabel DocumentPrintScalingPropertyInfo = "print-scaling"
    type AttrOrigin DocumentPrintScalingPropertyInfo = Document
    attrGet _ = getDocumentPrintScaling
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@producer@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #producer
@
-}
getDocumentProducer :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentProducer obj = liftIO $ B.Properties.getObjectPropertyString obj "producer"

{- |
Set the value of the “@producer@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' document [ #producer 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDocumentProducer :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentProducer obj val = liftIO $ B.Properties.setObjectPropertyString obj "producer" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@producer@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDocumentProducer :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentProducer val = B.Properties.constructObjectPropertyString "producer" (Just val)

#if ENABLE_OVERLOADING
data DocumentProducerPropertyInfo
instance AttrInfo DocumentProducerPropertyInfo where
    type AttrAllowedOps DocumentProducerPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DocumentProducerPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DocumentProducerPropertyInfo = IsDocument
    type AttrGetType DocumentProducerPropertyInfo = (Maybe T.Text)
    type AttrLabel DocumentProducerPropertyInfo = "producer"
    type AttrOrigin DocumentProducerPropertyInfo = Document
    attrGet _ = getDocumentProducer
    attrSet _ = setDocumentProducer
    attrConstruct _ = constructDocumentProducer
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@subject@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #subject
@
-}
getDocumentSubject :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentSubject obj = liftIO $ B.Properties.getObjectPropertyString obj "subject"

{- |
Set the value of the “@subject@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' document [ #subject 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDocumentSubject :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentSubject obj val = liftIO $ B.Properties.setObjectPropertyString obj "subject" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@subject@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDocumentSubject :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentSubject val = B.Properties.constructObjectPropertyString "subject" (Just val)

#if ENABLE_OVERLOADING
data DocumentSubjectPropertyInfo
instance AttrInfo DocumentSubjectPropertyInfo where
    type AttrAllowedOps DocumentSubjectPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DocumentSubjectPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DocumentSubjectPropertyInfo = IsDocument
    type AttrGetType DocumentSubjectPropertyInfo = (Maybe T.Text)
    type AttrLabel DocumentSubjectPropertyInfo = "subject"
    type AttrOrigin DocumentSubjectPropertyInfo = Document
    attrGet _ = getDocumentSubject
    attrSet _ = setDocumentSubject
    attrConstruct _ = constructDocumentSubject
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@subtype@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #subtype
@
-}
getDocumentSubtype :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PDFSubtype
getDocumentSubtype obj = liftIO $ B.Properties.getObjectPropertyEnum obj "subtype"

#if ENABLE_OVERLOADING
data DocumentSubtypePropertyInfo
instance AttrInfo DocumentSubtypePropertyInfo where
    type AttrAllowedOps DocumentSubtypePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentSubtypePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentSubtypePropertyInfo = IsDocument
    type AttrGetType DocumentSubtypePropertyInfo = Poppler.Enums.PDFSubtype
    type AttrLabel DocumentSubtypePropertyInfo = "subtype"
    type AttrOrigin DocumentSubtypePropertyInfo = Document
    attrGet _ = getDocumentSubtype
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "subtype-conformance"
   -- Type: TInterface (Name {namespace = "Poppler", name = "PDFConformance"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@subtype-conformance@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #subtypeConformance
@
-}
getDocumentSubtypeConformance :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PDFConformance
getDocumentSubtypeConformance obj = liftIO $ B.Properties.getObjectPropertyEnum obj "subtype-conformance"

#if ENABLE_OVERLOADING
data DocumentSubtypeConformancePropertyInfo
instance AttrInfo DocumentSubtypeConformancePropertyInfo where
    type AttrAllowedOps DocumentSubtypeConformancePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentSubtypeConformancePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentSubtypeConformancePropertyInfo = IsDocument
    type AttrGetType DocumentSubtypeConformancePropertyInfo = Poppler.Enums.PDFConformance
    type AttrLabel DocumentSubtypeConformancePropertyInfo = "subtype-conformance"
    type AttrOrigin DocumentSubtypeConformancePropertyInfo = Document
    attrGet _ = getDocumentSubtypeConformance
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "subtype-part"
   -- Type: TInterface (Name {namespace = "Poppler", name = "PDFPart"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@subtype-part@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #subtypePart
@
-}
getDocumentSubtypePart :: (MonadIO m, IsDocument o) => o -> m Poppler.Enums.PDFPart
getDocumentSubtypePart obj = liftIO $ B.Properties.getObjectPropertyEnum obj "subtype-part"

#if ENABLE_OVERLOADING
data DocumentSubtypePartPropertyInfo
instance AttrInfo DocumentSubtypePartPropertyInfo where
    type AttrAllowedOps DocumentSubtypePartPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentSubtypePartPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentSubtypePartPropertyInfo = IsDocument
    type AttrGetType DocumentSubtypePartPropertyInfo = Poppler.Enums.PDFPart
    type AttrLabel DocumentSubtypePartPropertyInfo = "subtype-part"
    type AttrOrigin DocumentSubtypePartPropertyInfo = Document
    attrGet _ = getDocumentSubtypePart
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@subtype-string@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #subtypeString
@
-}
getDocumentSubtypeString :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentSubtypeString obj = liftIO $ B.Properties.getObjectPropertyString obj "subtype-string"

#if ENABLE_OVERLOADING
data DocumentSubtypeStringPropertyInfo
instance AttrInfo DocumentSubtypeStringPropertyInfo where
    type AttrAllowedOps DocumentSubtypeStringPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DocumentSubtypeStringPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentSubtypeStringPropertyInfo = IsDocument
    type AttrGetType DocumentSubtypeStringPropertyInfo = (Maybe T.Text)
    type AttrLabel DocumentSubtypeStringPropertyInfo = "subtype-string"
    type AttrOrigin DocumentSubtypeStringPropertyInfo = Document
    attrGet _ = getDocumentSubtypeString
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@title@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #title
@
-}
getDocumentTitle :: (MonadIO m, IsDocument o) => o -> m (Maybe T.Text)
getDocumentTitle obj = liftIO $ B.Properties.getObjectPropertyString obj "title"

{- |
Set the value of the “@title@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' document [ #title 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDocumentTitle :: (MonadIO m, IsDocument o) => o -> T.Text -> m ()
setDocumentTitle obj val = liftIO $ B.Properties.setObjectPropertyString obj "title" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@title@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDocumentTitle :: (IsDocument o) => T.Text -> IO (GValueConstruct o)
constructDocumentTitle val = B.Properties.constructObjectPropertyString "title" (Just val)

#if ENABLE_OVERLOADING
data DocumentTitlePropertyInfo
instance AttrInfo DocumentTitlePropertyInfo where
    type AttrAllowedOps DocumentTitlePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DocumentTitlePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DocumentTitlePropertyInfo = IsDocument
    type AttrGetType DocumentTitlePropertyInfo = (Maybe T.Text)
    type AttrLabel DocumentTitlePropertyInfo = "title"
    type AttrOrigin DocumentTitlePropertyInfo = Document
    attrGet _ = getDocumentTitle
    attrSet _ = setDocumentTitle
    attrConstruct _ = constructDocumentTitle
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@viewer-preferences@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' document #viewerPreferences
@
-}
getDocumentViewerPreferences :: (MonadIO m, IsDocument o) => o -> m [Poppler.Flags.ViewerPreferences]
getDocumentViewerPreferences obj = liftIO $ B.Properties.getObjectPropertyFlags obj "viewer-preferences"

#if ENABLE_OVERLOADING
data DocumentViewerPreferencesPropertyInfo
instance AttrInfo DocumentViewerPreferencesPropertyInfo where
    type AttrAllowedOps DocumentViewerPreferencesPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DocumentViewerPreferencesPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DocumentViewerPreferencesPropertyInfo = IsDocument
    type AttrGetType DocumentViewerPreferencesPropertyInfo = [Poppler.Flags.ViewerPreferences]
    type AttrLabel DocumentViewerPreferencesPropertyInfo = "viewer-preferences"
    type AttrOrigin DocumentViewerPreferencesPropertyInfo = Document
    attrGet _ = getDocumentViewerPreferences
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList Document
type instance O.AttributeList Document = DocumentAttributeList
type DocumentAttributeList = ('[ '("author", DocumentAuthorPropertyInfo), '("creationDate", DocumentCreationDatePropertyInfo), '("creator", DocumentCreatorPropertyInfo), '("format", DocumentFormatPropertyInfo), '("formatMajor", DocumentFormatMajorPropertyInfo), '("formatMinor", DocumentFormatMinorPropertyInfo), '("keywords", DocumentKeywordsPropertyInfo), '("linearized", DocumentLinearizedPropertyInfo), '("metadata", DocumentMetadataPropertyInfo), '("modDate", DocumentModDatePropertyInfo), '("pageLayout", DocumentPageLayoutPropertyInfo), '("pageMode", DocumentPageModePropertyInfo), '("permissions", DocumentPermissionsPropertyInfo), '("printScaling", DocumentPrintScalingPropertyInfo), '("producer", DocumentProducerPropertyInfo), '("subject", DocumentSubjectPropertyInfo), '("subtype", DocumentSubtypePropertyInfo), '("subtypeConformance", DocumentSubtypeConformancePropertyInfo), '("subtypePart", DocumentSubtypePartPropertyInfo), '("subtypeString", DocumentSubtypeStringPropertyInfo), '("title", DocumentTitlePropertyInfo), '("viewerPreferences", DocumentViewerPreferencesPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
documentAuthor :: AttrLabelProxy "author"
documentAuthor = AttrLabelProxy

documentCreationDate :: AttrLabelProxy "creationDate"
documentCreationDate = AttrLabelProxy

documentCreator :: AttrLabelProxy "creator"
documentCreator = AttrLabelProxy

documentFormat :: AttrLabelProxy "format"
documentFormat = AttrLabelProxy

documentFormatMajor :: AttrLabelProxy "formatMajor"
documentFormatMajor = AttrLabelProxy

documentFormatMinor :: AttrLabelProxy "formatMinor"
documentFormatMinor = AttrLabelProxy

documentKeywords :: AttrLabelProxy "keywords"
documentKeywords = AttrLabelProxy

documentLinearized :: AttrLabelProxy "linearized"
documentLinearized = AttrLabelProxy

documentMetadata :: AttrLabelProxy "metadata"
documentMetadata = AttrLabelProxy

documentModDate :: AttrLabelProxy "modDate"
documentModDate = AttrLabelProxy

documentPageLayout :: AttrLabelProxy "pageLayout"
documentPageLayout = AttrLabelProxy

documentPageMode :: AttrLabelProxy "pageMode"
documentPageMode = AttrLabelProxy

documentPermissions :: AttrLabelProxy "permissions"
documentPermissions = AttrLabelProxy

documentPrintScaling :: AttrLabelProxy "printScaling"
documentPrintScaling = AttrLabelProxy

documentProducer :: AttrLabelProxy "producer"
documentProducer = AttrLabelProxy

documentSubject :: AttrLabelProxy "subject"
documentSubject = AttrLabelProxy

documentSubtype :: AttrLabelProxy "subtype"
documentSubtype = AttrLabelProxy

documentSubtypeConformance :: AttrLabelProxy "subtypeConformance"
documentSubtypeConformance = AttrLabelProxy

documentSubtypePart :: AttrLabelProxy "subtypePart"
documentSubtypePart = AttrLabelProxy

documentSubtypeString :: AttrLabelProxy "subtypeString"
documentSubtypeString = AttrLabelProxy

documentTitle :: AttrLabelProxy "title"
documentTitle = AttrLabelProxy

documentViewerPreferences :: AttrLabelProxy "viewerPreferences"
documentViewerPreferences = AttrLabelProxy

#endif

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

#endif

-- 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 ENABLE_OVERLOADING
#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 ENABLE_OVERLOADING
#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 ENABLE_OVERLOADING
#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 ENABLE_OVERLOADING
#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)

{- |
Creates a 'GI.Poppler.Structs.Dest.Dest' for the named destination /@linkName@/ in /@document@/.

Note that named destinations are bytestrings, not string. That means that
unless /@linkName@/ was returned by a poppler function (e.g. is
'GI.Poppler.Structs.Dest.Dest'.@/named_dest/@), it needs to be converted to string
using 'GI.Poppler.Functions.namedDestFromBytestring' before being passed to this
function.

The returned value must be freed with 'GI.Poppler.Structs.Dest.destFree'.
-}
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:__ a new 'GI.Poppler.Structs.Dest.Dest' destination, or 'Nothing' if
  /@linkName@/ is not a destination. -}
documentFindDest document linkName = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    linkName' <- textToCString linkName
    result <- poppler_document_find_dest document' linkName'
    checkUnexpectedReturnNULL "documentFindDest" result
    result' <- (wrapBoxed Poppler.Dest.Dest) result
    touchManagedPtr document
    freeMem linkName'
    return result'

#if ENABLE_OVERLOADING
data DocumentFindDestMethodInfo
instance (signature ~ (T.Text -> m Poppler.Dest.Dest), MonadIO m, IsDocument a) => O.MethodInfo DocumentFindDestMethodInfo a signature where
    overloadedMethod _ = documentFindDest

#endif

-- 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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
data DocumentGetIdMethodInfo
instance (signature ~ (m ((Bool, T.Text, T.Text))), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetIdMethodInfo a signature where
    overloadedMethod _ = documentGetId

#endif

-- 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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
data DocumentGetPageByLabelMethodInfo
instance (signature ~ (T.Text -> m Poppler.Page.Page), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPageByLabelMethodInfo a signature where
    overloadedMethod _ = documentGetPageByLabel

#endif

-- 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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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_conformance
-- 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 = "PDFConformance"}))
-- throws : False
-- Skip return : False

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

{- |
Returns the conformance level of the /@document@/ as 'GI.Poppler.Enums.PDFConformance'.

/Since: 0.70/
-}
documentGetPdfConformance ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m Poppler.Enums.PDFConformance
    {- ^ __Returns:__ the document\'s subtype conformance level -}
documentGetPdfConformance document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_pdf_conformance document'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr document
    return result'

#if ENABLE_OVERLOADING
data DocumentGetPdfConformanceMethodInfo
instance (signature ~ (m Poppler.Enums.PDFConformance), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfConformanceMethodInfo a signature where
    overloadedMethod _ = documentGetPdfConformance

#endif

-- method Document::get_pdf_part
-- 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 = "PDFPart"}))
-- throws : False
-- Skip return : False

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

{- |
Returns the part of the conforming standard that the /@document@/ adheres to
as a 'GI.Poppler.Enums.PDFSubtype'.

/Since: 0.70/
-}
documentGetPdfPart ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m Poppler.Enums.PDFPart
    {- ^ __Returns:__ the document\'s subtype part -}
documentGetPdfPart document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_pdf_part document'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr document
    return result'

#if ENABLE_OVERLOADING
data DocumentGetPdfPartMethodInfo
instance (signature ~ (m Poppler.Enums.PDFPart), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfPartMethodInfo a signature where
    overloadedMethod _ = documentGetPdfPart

#endif

-- method Document::get_pdf_subtype
-- 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 = "PDFSubtype"}))
-- throws : False
-- Skip return : False

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

{- |
Returns the subtype of /@document@/ as a 'GI.Poppler.Enums.PDFSubtype'.

/Since: 0.70/
-}
documentGetPdfSubtype ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m Poppler.Enums.PDFSubtype
    {- ^ __Returns:__ the document\'s subtype -}
documentGetPdfSubtype document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_pdf_subtype document'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr document
    return result'

#if ENABLE_OVERLOADING
data DocumentGetPdfSubtypeMethodInfo
instance (signature ~ (m Poppler.Enums.PDFSubtype), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfSubtypeMethodInfo a signature where
    overloadedMethod _ = documentGetPdfSubtype

#endif

-- method Document::get_pdf_subtype_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_subtype_string" poppler_document_get_pdf_subtype_string ::
    Ptr Document ->                         -- document : TInterface (Name {namespace = "Poppler", name = "Document"})
    IO CString

{- |
Returns the PDF subtype version of /@document@/ as a string.

/Since: 0.70/
-}
documentGetPdfSubtypeString ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ a newly allocated string containing
the PDF subtype version of /@document@/, or 'Nothing' -}
documentGetPdfSubtypeString document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_pdf_subtype_string document'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        freeMem result'
        return result''
    touchManagedPtr document
    return maybeResult

#if ENABLE_OVERLOADING
data DocumentGetPdfSubtypeStringMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPdfSubtypeStringMethodInfo a signature where
    overloadedMethod _ = documentGetPdfSubtypeString

#endif

-- 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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 flags 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 ENABLE_OVERLOADING
data DocumentGetPermissionsMethodInfo
instance (signature ~ (m [Poppler.Flags.Permissions]), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPermissionsMethodInfo a signature where
    overloadedMethod _ = documentGetPermissions

#endif

-- method Document::get_print_scaling
-- 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 = "PrintScaling"}))
-- throws : False
-- Skip return : False

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

{- |
Returns the print scaling value suggested by author of the document.

/Since: 0.73/
-}
documentGetPrintScaling ::
    (B.CallStack.HasCallStack, MonadIO m, IsDocument a) =>
    a
    {- ^ /@document@/: A 'GI.Poppler.Objects.Document.Document' -}
    -> m Poppler.Enums.PrintScaling
    {- ^ __Returns:__ a 'GI.Poppler.Enums.PrintScaling' that should be used when document is printed -}
documentGetPrintScaling document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_get_print_scaling document'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr document
    return result'

#if ENABLE_OVERLOADING
data DocumentGetPrintScalingMethodInfo
instance (signature ~ (m Poppler.Enums.PrintScaling), MonadIO m, IsDocument a) => O.MethodInfo DocumentGetPrintScalingMethodInfo a signature where
    overloadedMethod _ = documentGetPrintScaling

#endif

-- 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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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' otherwise -}
documentIsLinearized document = liftIO $ do
    document' <- unsafeManagedPtrCastPtr document
    result <- poppler_document_is_linearized document'
    let result' = (/= 0) result
    touchManagedPtr document
    return result'

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

#endif

-- 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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
data DocumentSetTitleMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDocument a) => O.MethodInfo DocumentSetTitleMethodInfo a signature where
    overloadedMethod _ = documentSetTitle

#endif