{- |
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.AnnotTextMarkup
    (

-- * Exported types
    AnnotTextMarkup(..)                     ,
    IsAnnotTextMarkup                       ,
    toAnnotTextMarkup                       ,
    noAnnotTextMarkup                       ,


 -- * Methods
-- ** getQuadrilaterals #method:getQuadrilaterals#

#if ENABLE_OVERLOADING
    AnnotTextMarkupGetQuadrilateralsMethodInfo,
#endif
    annotTextMarkupGetQuadrilaterals        ,


-- ** newHighlight #method:newHighlight#

    annotTextMarkupNewHighlight             ,


-- ** newSquiggly #method:newSquiggly#

    annotTextMarkupNewSquiggly              ,


-- ** newStrikeout #method:newStrikeout#

    annotTextMarkupNewStrikeout             ,


-- ** newUnderline #method:newUnderline#

    annotTextMarkupNewUnderline             ,


-- ** setQuadrilaterals #method:setQuadrilaterals#

#if ENABLE_OVERLOADING
    AnnotTextMarkupSetQuadrilateralsMethodInfo,
#endif
    annotTextMarkupSetQuadrilaterals        ,




    ) 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 {-# SOURCE #-} qualified GI.Poppler.Objects.Annot as Poppler.Annot
import {-# SOURCE #-} qualified GI.Poppler.Objects.AnnotMarkup as Poppler.AnnotMarkup
import {-# SOURCE #-} qualified GI.Poppler.Objects.Document as Poppler.Document
import {-# SOURCE #-} qualified GI.Poppler.Structs.Quadrilateral as Poppler.Quadrilateral
import {-# SOURCE #-} qualified GI.Poppler.Structs.Rectangle as Poppler.Rectangle

-- | Memory-managed wrapper type.
newtype AnnotTextMarkup = AnnotTextMarkup (ManagedPtr AnnotTextMarkup)
foreign import ccall "poppler_annot_text_markup_get_type"
    c_poppler_annot_text_markup_get_type :: IO GType

instance GObject AnnotTextMarkup where
    gobjectType = c_poppler_annot_text_markup_get_type


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

instance O.HasParentTypes AnnotTextMarkup
type instance O.ParentTypes AnnotTextMarkup = '[Poppler.AnnotMarkup.AnnotMarkup, Poppler.Annot.Annot, GObject.Object.Object]

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

-- | A convenience alias for `Nothing` :: `Maybe` `AnnotTextMarkup`.
noAnnotTextMarkup :: Maybe AnnotTextMarkup
noAnnotTextMarkup = Nothing

#if ENABLE_OVERLOADING
type family ResolveAnnotTextMarkupMethod (t :: Symbol) (o :: *) :: * where
    ResolveAnnotTextMarkupMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveAnnotTextMarkupMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveAnnotTextMarkupMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveAnnotTextMarkupMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveAnnotTextMarkupMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveAnnotTextMarkupMethod "hasPopup" o = Poppler.AnnotMarkup.AnnotMarkupHasPopupMethodInfo
    ResolveAnnotTextMarkupMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveAnnotTextMarkupMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveAnnotTextMarkupMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveAnnotTextMarkupMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveAnnotTextMarkupMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveAnnotTextMarkupMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveAnnotTextMarkupMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveAnnotTextMarkupMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveAnnotTextMarkupMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveAnnotTextMarkupMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveAnnotTextMarkupMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveAnnotTextMarkupMethod "getAnnotType" o = Poppler.Annot.AnnotGetAnnotTypeMethodInfo
    ResolveAnnotTextMarkupMethod "getColor" o = Poppler.Annot.AnnotGetColorMethodInfo
    ResolveAnnotTextMarkupMethod "getContents" o = Poppler.Annot.AnnotGetContentsMethodInfo
    ResolveAnnotTextMarkupMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveAnnotTextMarkupMethod "getDate" o = Poppler.AnnotMarkup.AnnotMarkupGetDateMethodInfo
    ResolveAnnotTextMarkupMethod "getExternalData" o = Poppler.AnnotMarkup.AnnotMarkupGetExternalDataMethodInfo
    ResolveAnnotTextMarkupMethod "getFlags" o = Poppler.Annot.AnnotGetFlagsMethodInfo
    ResolveAnnotTextMarkupMethod "getLabel" o = Poppler.AnnotMarkup.AnnotMarkupGetLabelMethodInfo
    ResolveAnnotTextMarkupMethod "getModified" o = Poppler.Annot.AnnotGetModifiedMethodInfo
    ResolveAnnotTextMarkupMethod "getName" o = Poppler.Annot.AnnotGetNameMethodInfo
    ResolveAnnotTextMarkupMethod "getOpacity" o = Poppler.AnnotMarkup.AnnotMarkupGetOpacityMethodInfo
    ResolveAnnotTextMarkupMethod "getPageIndex" o = Poppler.Annot.AnnotGetPageIndexMethodInfo
    ResolveAnnotTextMarkupMethod "getPopupIsOpen" o = Poppler.AnnotMarkup.AnnotMarkupGetPopupIsOpenMethodInfo
    ResolveAnnotTextMarkupMethod "getPopupRectangle" o = Poppler.AnnotMarkup.AnnotMarkupGetPopupRectangleMethodInfo
    ResolveAnnotTextMarkupMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveAnnotTextMarkupMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveAnnotTextMarkupMethod "getQuadrilaterals" o = AnnotTextMarkupGetQuadrilateralsMethodInfo
    ResolveAnnotTextMarkupMethod "getRectangle" o = Poppler.Annot.AnnotGetRectangleMethodInfo
    ResolveAnnotTextMarkupMethod "getReplyTo" o = Poppler.AnnotMarkup.AnnotMarkupGetReplyToMethodInfo
    ResolveAnnotTextMarkupMethod "getSubject" o = Poppler.AnnotMarkup.AnnotMarkupGetSubjectMethodInfo
    ResolveAnnotTextMarkupMethod "setColor" o = Poppler.Annot.AnnotSetColorMethodInfo
    ResolveAnnotTextMarkupMethod "setContents" o = Poppler.Annot.AnnotSetContentsMethodInfo
    ResolveAnnotTextMarkupMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveAnnotTextMarkupMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveAnnotTextMarkupMethod "setFlags" o = Poppler.Annot.AnnotSetFlagsMethodInfo
    ResolveAnnotTextMarkupMethod "setLabel" o = Poppler.AnnotMarkup.AnnotMarkupSetLabelMethodInfo
    ResolveAnnotTextMarkupMethod "setOpacity" o = Poppler.AnnotMarkup.AnnotMarkupSetOpacityMethodInfo
    ResolveAnnotTextMarkupMethod "setPopup" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupMethodInfo
    ResolveAnnotTextMarkupMethod "setPopupIsOpen" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupIsOpenMethodInfo
    ResolveAnnotTextMarkupMethod "setPopupRectangle" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupRectangleMethodInfo
    ResolveAnnotTextMarkupMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveAnnotTextMarkupMethod "setQuadrilaterals" o = AnnotTextMarkupSetQuadrilateralsMethodInfo
    ResolveAnnotTextMarkupMethod "setRectangle" o = Poppler.Annot.AnnotSetRectangleMethodInfo
    ResolveAnnotTextMarkupMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveAnnotTextMarkupMethod t AnnotTextMarkup, O.MethodInfo info AnnotTextMarkup p) => OL.IsLabel t (AnnotTextMarkup -> 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

#if ENABLE_OVERLOADING
instance O.HasAttributeList AnnotTextMarkup
type instance O.AttributeList AnnotTextMarkup = AnnotTextMarkupAttributeList
type AnnotTextMarkupAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
#endif

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

#endif

-- method AnnotTextMarkup::new_highlight
-- method type : Constructor
-- Args : [Arg {argCName = "doc", 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 = "rect", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "quadrilaterals", argType = TGArray (TInterface (Name {namespace = "Poppler", name = "Quadrilateral"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GArray of\n  #PopplerQuadrilateral<!-- -->s", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "AnnotTextMarkup"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_annot_text_markup_new_highlight" poppler_annot_text_markup_new_highlight ::
    Ptr Poppler.Document.Document ->        -- doc : TInterface (Name {namespace = "Poppler", name = "Document"})
    Ptr Poppler.Rectangle.Rectangle ->      -- rect : TInterface (Name {namespace = "Poppler", name = "Rectangle"})
    Ptr (GArray (Ptr Poppler.Quadrilateral.Quadrilateral)) -> -- quadrilaterals : TGArray (TInterface (Name {namespace = "Poppler", name = "Quadrilateral"}))
    IO (Ptr AnnotTextMarkup)

{- |
Creates a new Highlight Text annotation that will be
located on /@rect@/ when added to a page. See 'GI.Poppler.Objects.Page.pageAddAnnot'

/Since: 0.26/
-}
annotTextMarkupNewHighlight ::
    (B.CallStack.HasCallStack, MonadIO m, Poppler.Document.IsDocument a) =>
    a
    {- ^ /@doc@/: a 'GI.Poppler.Objects.Document.Document' -}
    -> Poppler.Rectangle.Rectangle
    {- ^ /@rect@/: a 'GI.Poppler.Structs.Rectangle.Rectangle' -}
    -> [Poppler.Quadrilateral.Quadrilateral]
    {- ^ /@quadrilaterals@/: A 'GI.GLib.Structs.Array.Array' of
  'GI.Poppler.Structs.Quadrilateral.Quadrilateral'\<!-- -->s -}
    -> m AnnotTextMarkup
    {- ^ __Returns:__ A newly created 'GI.Poppler.Objects.AnnotTextMarkup.AnnotTextMarkup' annotation -}
annotTextMarkupNewHighlight doc rect quadrilaterals = liftIO $ do
    doc' <- unsafeManagedPtrCastPtr doc
    rect' <- unsafeManagedPtrGetPtr rect
    quadrilaterals' <- mapM unsafeManagedPtrGetPtr quadrilaterals
    quadrilaterals'' <- packGArray quadrilaterals'
    result <- poppler_annot_text_markup_new_highlight doc' rect' quadrilaterals''
    checkUnexpectedReturnNULL "annotTextMarkupNewHighlight" result
    result' <- (wrapObject AnnotTextMarkup) result
    touchManagedPtr doc
    touchManagedPtr rect
    mapM_ touchManagedPtr quadrilaterals
    unrefGArray quadrilaterals''
    return result'

#if ENABLE_OVERLOADING
#endif

-- method AnnotTextMarkup::new_squiggly
-- method type : Constructor
-- Args : [Arg {argCName = "doc", 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 = "rect", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "quadrilaterals", argType = TGArray (TInterface (Name {namespace = "Poppler", name = "Quadrilateral"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GArray of\n  #PopplerQuadrilateral<!-- -->s", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "AnnotTextMarkup"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_annot_text_markup_new_squiggly" poppler_annot_text_markup_new_squiggly ::
    Ptr Poppler.Document.Document ->        -- doc : TInterface (Name {namespace = "Poppler", name = "Document"})
    Ptr Poppler.Rectangle.Rectangle ->      -- rect : TInterface (Name {namespace = "Poppler", name = "Rectangle"})
    Ptr (GArray (Ptr Poppler.Quadrilateral.Quadrilateral)) -> -- quadrilaterals : TGArray (TInterface (Name {namespace = "Poppler", name = "Quadrilateral"}))
    IO (Ptr AnnotTextMarkup)

{- |
Creates a new Squiggly Text annotation that will be
located on /@rect@/ when added to a page. See 'GI.Poppler.Objects.Page.pageAddAnnot'

/Since: 0.26/
-}
annotTextMarkupNewSquiggly ::
    (B.CallStack.HasCallStack, MonadIO m, Poppler.Document.IsDocument a) =>
    a
    {- ^ /@doc@/: a 'GI.Poppler.Objects.Document.Document' -}
    -> Poppler.Rectangle.Rectangle
    {- ^ /@rect@/: a 'GI.Poppler.Structs.Rectangle.Rectangle' -}
    -> [Poppler.Quadrilateral.Quadrilateral]
    {- ^ /@quadrilaterals@/: A 'GI.GLib.Structs.Array.Array' of
  'GI.Poppler.Structs.Quadrilateral.Quadrilateral'\<!-- -->s -}
    -> m AnnotTextMarkup
    {- ^ __Returns:__ A newly created 'GI.Poppler.Objects.AnnotTextMarkup.AnnotTextMarkup' annotation -}
annotTextMarkupNewSquiggly doc rect quadrilaterals = liftIO $ do
    doc' <- unsafeManagedPtrCastPtr doc
    rect' <- unsafeManagedPtrGetPtr rect
    quadrilaterals' <- mapM unsafeManagedPtrGetPtr quadrilaterals
    quadrilaterals'' <- packGArray quadrilaterals'
    result <- poppler_annot_text_markup_new_squiggly doc' rect' quadrilaterals''
    checkUnexpectedReturnNULL "annotTextMarkupNewSquiggly" result
    result' <- (wrapObject AnnotTextMarkup) result
    touchManagedPtr doc
    touchManagedPtr rect
    mapM_ touchManagedPtr quadrilaterals
    unrefGArray quadrilaterals''
    return result'

#if ENABLE_OVERLOADING
#endif

-- method AnnotTextMarkup::new_strikeout
-- method type : Constructor
-- Args : [Arg {argCName = "doc", 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 = "rect", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "quadrilaterals", argType = TGArray (TInterface (Name {namespace = "Poppler", name = "Quadrilateral"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GArray of\n  #PopplerQuadrilateral<!-- -->s", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "AnnotTextMarkup"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_annot_text_markup_new_strikeout" poppler_annot_text_markup_new_strikeout ::
    Ptr Poppler.Document.Document ->        -- doc : TInterface (Name {namespace = "Poppler", name = "Document"})
    Ptr Poppler.Rectangle.Rectangle ->      -- rect : TInterface (Name {namespace = "Poppler", name = "Rectangle"})
    Ptr (GArray (Ptr Poppler.Quadrilateral.Quadrilateral)) -> -- quadrilaterals : TGArray (TInterface (Name {namespace = "Poppler", name = "Quadrilateral"}))
    IO (Ptr AnnotTextMarkup)

{- |
Creates a new Strike Out Text annotation that will be
located on /@rect@/ when added to a page. See 'GI.Poppler.Objects.Page.pageAddAnnot'

/Since: 0.26/
-}
annotTextMarkupNewStrikeout ::
    (B.CallStack.HasCallStack, MonadIO m, Poppler.Document.IsDocument a) =>
    a
    {- ^ /@doc@/: a 'GI.Poppler.Objects.Document.Document' -}
    -> Poppler.Rectangle.Rectangle
    {- ^ /@rect@/: a 'GI.Poppler.Structs.Rectangle.Rectangle' -}
    -> [Poppler.Quadrilateral.Quadrilateral]
    {- ^ /@quadrilaterals@/: A 'GI.GLib.Structs.Array.Array' of
  'GI.Poppler.Structs.Quadrilateral.Quadrilateral'\<!-- -->s -}
    -> m AnnotTextMarkup
    {- ^ __Returns:__ A newly created 'GI.Poppler.Objects.AnnotTextMarkup.AnnotTextMarkup' annotation -}
annotTextMarkupNewStrikeout doc rect quadrilaterals = liftIO $ do
    doc' <- unsafeManagedPtrCastPtr doc
    rect' <- unsafeManagedPtrGetPtr rect
    quadrilaterals' <- mapM unsafeManagedPtrGetPtr quadrilaterals
    quadrilaterals'' <- packGArray quadrilaterals'
    result <- poppler_annot_text_markup_new_strikeout doc' rect' quadrilaterals''
    checkUnexpectedReturnNULL "annotTextMarkupNewStrikeout" result
    result' <- (wrapObject AnnotTextMarkup) result
    touchManagedPtr doc
    touchManagedPtr rect
    mapM_ touchManagedPtr quadrilaterals
    unrefGArray quadrilaterals''
    return result'

#if ENABLE_OVERLOADING
#endif

-- method AnnotTextMarkup::new_underline
-- method type : Constructor
-- Args : [Arg {argCName = "doc", 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 = "rect", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "quadrilaterals", argType = TGArray (TInterface (Name {namespace = "Poppler", name = "Quadrilateral"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GArray of\n  #PopplerQuadrilateral<!-- -->s", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "AnnotTextMarkup"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_annot_text_markup_new_underline" poppler_annot_text_markup_new_underline ::
    Ptr Poppler.Document.Document ->        -- doc : TInterface (Name {namespace = "Poppler", name = "Document"})
    Ptr Poppler.Rectangle.Rectangle ->      -- rect : TInterface (Name {namespace = "Poppler", name = "Rectangle"})
    Ptr (GArray (Ptr Poppler.Quadrilateral.Quadrilateral)) -> -- quadrilaterals : TGArray (TInterface (Name {namespace = "Poppler", name = "Quadrilateral"}))
    IO (Ptr AnnotTextMarkup)

{- |
Creates a new Underline Text annotation that will be
located on /@rect@/ when added to a page. See 'GI.Poppler.Objects.Page.pageAddAnnot'

/Since: 0.26/
-}
annotTextMarkupNewUnderline ::
    (B.CallStack.HasCallStack, MonadIO m, Poppler.Document.IsDocument a) =>
    a
    {- ^ /@doc@/: a 'GI.Poppler.Objects.Document.Document' -}
    -> Poppler.Rectangle.Rectangle
    {- ^ /@rect@/: a 'GI.Poppler.Structs.Rectangle.Rectangle' -}
    -> [Poppler.Quadrilateral.Quadrilateral]
    {- ^ /@quadrilaterals@/: A 'GI.GLib.Structs.Array.Array' of
  'GI.Poppler.Structs.Quadrilateral.Quadrilateral'\<!-- -->s -}
    -> m AnnotTextMarkup
    {- ^ __Returns:__ A newly created 'GI.Poppler.Objects.AnnotTextMarkup.AnnotTextMarkup' annotation -}
annotTextMarkupNewUnderline doc rect quadrilaterals = liftIO $ do
    doc' <- unsafeManagedPtrCastPtr doc
    rect' <- unsafeManagedPtrGetPtr rect
    quadrilaterals' <- mapM unsafeManagedPtrGetPtr quadrilaterals
    quadrilaterals'' <- packGArray quadrilaterals'
    result <- poppler_annot_text_markup_new_underline doc' rect' quadrilaterals''
    checkUnexpectedReturnNULL "annotTextMarkupNewUnderline" result
    result' <- (wrapObject AnnotTextMarkup) result
    touchManagedPtr doc
    touchManagedPtr rect
    mapM_ touchManagedPtr quadrilaterals
    unrefGArray quadrilaterals''
    return result'

#if ENABLE_OVERLOADING
#endif

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

foreign import ccall "poppler_annot_text_markup_get_quadrilaterals" poppler_annot_text_markup_get_quadrilaterals ::
    Ptr AnnotTextMarkup ->                  -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotTextMarkup"})
    IO (Ptr (GArray (Ptr Poppler.Quadrilateral.Quadrilateral)))

{- |
Returns a 'GI.GLib.Structs.Array.Array' of 'GI.Poppler.Structs.Quadrilateral.Quadrilateral' items that map from a
location on /@page@/ to a 'GI.Poppler.Objects.AnnotTextMarkup.AnnotTextMarkup'.  This array must be freed
when done.

/Since: 0.26/
-}
annotTextMarkupGetQuadrilaterals ::
    (B.CallStack.HasCallStack, MonadIO m, IsAnnotTextMarkup a) =>
    a
    {- ^ /@popplerAnnot@/: A 'GI.Poppler.Objects.AnnotTextMarkup.AnnotTextMarkup' -}
    -> m [Poppler.Quadrilateral.Quadrilateral]
    {- ^ __Returns:__ A 'GI.GLib.Structs.Array.Array' of 'GI.Poppler.Structs.Quadrilateral.Quadrilateral' -}
annotTextMarkupGetQuadrilaterals popplerAnnot = liftIO $ do
    popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
    result <- poppler_annot_text_markup_get_quadrilaterals popplerAnnot'
    checkUnexpectedReturnNULL "annotTextMarkupGetQuadrilaterals" result
    result' <- unpackGArray result
    result'' <- mapM (wrapBoxed Poppler.Quadrilateral.Quadrilateral) result'
    unrefGArray result
    touchManagedPtr popplerAnnot
    return result''

#if ENABLE_OVERLOADING
data AnnotTextMarkupGetQuadrilateralsMethodInfo
instance (signature ~ (m [Poppler.Quadrilateral.Quadrilateral]), MonadIO m, IsAnnotTextMarkup a) => O.MethodInfo AnnotTextMarkupGetQuadrilateralsMethodInfo a signature where
    overloadedMethod _ = annotTextMarkupGetQuadrilaterals

#endif

-- method AnnotTextMarkup::set_quadrilaterals
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotTextMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerAnnotTextMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "quadrilaterals", argType = TGArray (TInterface (Name {namespace = "Poppler", name = "Quadrilateral"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GArray of\n  #PopplerQuadrilateral<!-- -->s", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_annot_text_markup_set_quadrilaterals" poppler_annot_text_markup_set_quadrilaterals ::
    Ptr AnnotTextMarkup ->                  -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotTextMarkup"})
    Ptr (GArray (Ptr Poppler.Quadrilateral.Quadrilateral)) -> -- quadrilaterals : TGArray (TInterface (Name {namespace = "Poppler", name = "Quadrilateral"}))
    IO ()

{- |
Set the regions (Quadrilaterals) to apply the text markup in /@popplerAnnot@/.

/Since: 0.26/
-}
annotTextMarkupSetQuadrilaterals ::
    (B.CallStack.HasCallStack, MonadIO m, IsAnnotTextMarkup a) =>
    a
    {- ^ /@popplerAnnot@/: A 'GI.Poppler.Objects.AnnotTextMarkup.AnnotTextMarkup' -}
    -> [Poppler.Quadrilateral.Quadrilateral]
    {- ^ /@quadrilaterals@/: A 'GI.GLib.Structs.Array.Array' of
  'GI.Poppler.Structs.Quadrilateral.Quadrilateral'\<!-- -->s -}
    -> m ()
annotTextMarkupSetQuadrilaterals popplerAnnot quadrilaterals = liftIO $ do
    popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
    quadrilaterals' <- mapM unsafeManagedPtrGetPtr quadrilaterals
    quadrilaterals'' <- packGArray quadrilaterals'
    poppler_annot_text_markup_set_quadrilaterals popplerAnnot' quadrilaterals''
    touchManagedPtr popplerAnnot
    mapM_ touchManagedPtr quadrilaterals
    unrefGArray quadrilaterals''
    return ()

#if ENABLE_OVERLOADING
data AnnotTextMarkupSetQuadrilateralsMethodInfo
instance (signature ~ ([Poppler.Quadrilateral.Quadrilateral] -> m ()), MonadIO m, IsAnnotTextMarkup a) => O.MethodInfo AnnotTextMarkupSetQuadrilateralsMethodInfo a signature where
    overloadedMethod _ = annotTextMarkupSetQuadrilaterals

#endif