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

module GI.Poppler.Objects.AnnotText
    ( 

-- * Exported types
    AnnotText(..)                           ,
    IsAnnotText                             ,
    toAnnotText                             ,
    noAnnotText                             ,


 -- * Methods
-- ** getIcon #method:getIcon#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    AnnotTextGetIconMethodInfo              ,
#endif
    annotTextGetIcon                        ,


-- ** getIsOpen #method:getIsOpen#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    AnnotTextGetIsOpenMethodInfo            ,
#endif
    annotTextGetIsOpen                      ,


-- ** getState #method:getState#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    AnnotTextGetStateMethodInfo             ,
#endif
    annotTextGetState                       ,


-- ** new #method:new#
    annotTextNew                            ,


-- ** setIcon #method:setIcon#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    AnnotTextSetIconMethodInfo              ,
#endif
    annotTextSetIcon                        ,


-- ** setIsOpen #method:setIsOpen#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    AnnotTextSetIsOpenMethodInfo            ,
#endif
    annotTextSetIsOpen                      ,




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Poppler.Enums as Poppler.Enums
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.Rectangle as Poppler.Rectangle

newtype AnnotText = AnnotText (ManagedPtr AnnotText)
foreign import ccall "poppler_annot_text_get_type"
    c_poppler_annot_text_get_type :: IO GType

instance GObject AnnotText where
    gobjectType _ = c_poppler_annot_text_get_type
    

class GObject o => IsAnnotText o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError AnnotText a) =>
    IsAnnotText a
#endif
instance IsAnnotText AnnotText
instance Poppler.AnnotMarkup.IsAnnotMarkup AnnotText
instance Poppler.Annot.IsAnnot AnnotText
instance GObject.Object.IsObject AnnotText

toAnnotText :: (MonadIO m, IsAnnotText o) => o -> m AnnotText
toAnnotText = liftIO . unsafeCastTo AnnotText

noAnnotText :: Maybe AnnotText
noAnnotText = Nothing

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

instance (info ~ ResolveAnnotTextMethod t AnnotText, O.MethodInfo info AnnotText p) => O.IsLabelProxy t (AnnotText -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

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

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList AnnotText
type instance O.AttributeList AnnotText = AnnotTextAttributeList
type AnnotTextAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif

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

#endif

-- method AnnotText::new
-- 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}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "AnnotText"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_annot_text_new" poppler_annot_text_new :: 
    Ptr Poppler.Document.Document ->        -- doc : TInterface (Name {namespace = "Poppler", name = "Document"})
    Ptr Poppler.Rectangle.Rectangle ->      -- rect : TInterface (Name {namespace = "Poppler", name = "Rectangle"})
    IO (Ptr AnnotText)

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

@since 0.16
-}
annotTextNew ::
    (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' -}
    -> m AnnotText
    {- ^ __Returns:__ A newly created 'GI.Poppler.Objects.AnnotText.AnnotText' annotation -}
annotTextNew doc rect = liftIO $ do
    doc' <- unsafeManagedPtrCastPtr doc
    rect' <- unsafeManagedPtrGetPtr rect
    result <- poppler_annot_text_new doc' rect'
    checkUnexpectedReturnNULL "annotTextNew" result
    result' <- (wrapObject AnnotText) result
    touchManagedPtr doc
    touchManagedPtr rect
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif

-- method AnnotText::get_icon
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotText"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotText", 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_annot_text_get_icon" poppler_annot_text_get_icon :: 
    Ptr AnnotText ->                        -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotText"})
    IO CString

{- |
Gets name of the icon of /@popplerAnnot@/.
-}
annotTextGetIcon ::
    (B.CallStack.HasCallStack, MonadIO m, IsAnnotText a) =>
    a
    {- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotText.AnnotText' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string containing the icon name -}
annotTextGetIcon popplerAnnot = liftIO $ do
    popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
    result <- poppler_annot_text_get_icon popplerAnnot'
    checkUnexpectedReturnNULL "annotTextGetIcon" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr popplerAnnot
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AnnotTextGetIconMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAnnotText a) => O.MethodInfo AnnotTextGetIconMethodInfo a signature where
    overloadedMethod _ = annotTextGetIcon

#endif

-- method AnnotText::get_is_open
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotText"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotText", 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_annot_text_get_is_open" poppler_annot_text_get_is_open :: 
    Ptr AnnotText ->                        -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotText"})
    IO CInt

{- |
Retrieves the state of /@popplerAnnot@/.
-}
annotTextGetIsOpen ::
    (B.CallStack.HasCallStack, MonadIO m, IsAnnotText a) =>
    a
    {- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotText.AnnotText' -}
    -> m Bool
    {- ^ __Returns:__ the state of /@popplerAnnot@/. 'True' if it\'s open, 'False' in
              other case. -}
annotTextGetIsOpen popplerAnnot = liftIO $ do
    popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
    result <- poppler_annot_text_get_is_open popplerAnnot'
    let result' = (/= 0) result
    touchManagedPtr popplerAnnot
    return result'

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

#endif

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

foreign import ccall "poppler_annot_text_get_state" poppler_annot_text_get_state :: 
    Ptr AnnotText ->                        -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotText"})
    IO CUInt

{- |
Retrieves the state of /@popplerAnnot@/.
-}
annotTextGetState ::
    (B.CallStack.HasCallStack, MonadIO m, IsAnnotText a) =>
    a
    {- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotText.AnnotText' -}
    -> m Poppler.Enums.AnnotTextState
    {- ^ __Returns:__ 'GI.Poppler.Enums.AnnotTextState' of /@popplerAnnot@/. -}
annotTextGetState popplerAnnot = liftIO $ do
    popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
    result <- poppler_annot_text_get_state popplerAnnot'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr popplerAnnot
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AnnotTextGetStateMethodInfo
instance (signature ~ (m Poppler.Enums.AnnotTextState), MonadIO m, IsAnnotText a) => O.MethodInfo AnnotTextGetStateMethodInfo a signature where
    overloadedMethod _ = annotTextGetState

#endif

-- method AnnotText::set_icon
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotText"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotText", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "icon", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of an icon", 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_set_icon" poppler_annot_text_set_icon :: 
    Ptr AnnotText ->                        -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotText"})
    CString ->                              -- icon : TBasicType TUTF8
    IO ()

{- |
Sets the icon of /@popplerAnnot@/. The following predefined
icons are currently supported:
\<variablelist>
 \<varlistentry>
  \<term>'GI.Poppler.Constants.ANNOT_TEXT_ICON_NOTE'\<\/term>
 \<\/varlistentry>
 \<varlistentry>
  \<term>'GI.Poppler.Constants.ANNOT_TEXT_ICON_COMMENT'\<\/term>
 \<\/varlistentry>
 \<varlistentry>
  \<term>'GI.Poppler.Constants.ANNOT_TEXT_ICON_KEY'\<\/term>
 \<\/varlistentry>
 \<varlistentry>
  \<term>'GI.Poppler.Constants.ANNOT_TEXT_ICON_HELP'\<\/term>
 \<\/varlistentry>
 \<varlistentry>
  \<term>'GI.Poppler.Constants.ANNOT_TEXT_ICON_NEW_PARAGRAPH'\<\/term>
 \<\/varlistentry>
 \<varlistentry>
  \<term>'GI.Poppler.Constants.ANNOT_TEXT_ICON_PARAGRAPH'\<\/term>
 \<\/varlistentry>
 \<varlistentry>
  \<term>'GI.Poppler.Constants.ANNOT_TEXT_ICON_INSERT'\<\/term>
 \<\/varlistentry>
 \<varlistentry>
  \<term>'GI.Poppler.Constants.ANNOT_TEXT_ICON_CROSS'\<\/term>
 \<\/varlistentry>
 \<varlistentry>
  \<term>'GI.Poppler.Constants.ANNOT_TEXT_ICON_CIRCLE'\<\/term>
 \<\/varlistentry>
\<\/variablelist>

@since 0.16
-}
annotTextSetIcon ::
    (B.CallStack.HasCallStack, MonadIO m, IsAnnotText a) =>
    a
    {- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotText.AnnotText' -}
    -> T.Text
    {- ^ /@icon@/: the name of an icon -}
    -> m ()
annotTextSetIcon popplerAnnot icon = liftIO $ do
    popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
    icon' <- textToCString icon
    poppler_annot_text_set_icon popplerAnnot' icon'
    touchManagedPtr popplerAnnot
    freeMem icon'
    return ()

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

#endif

-- method AnnotText::set_is_open
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotText"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotText", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "is_open", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether annotation should initially be displayed open", 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_set_is_open" poppler_annot_text_set_is_open :: 
    Ptr AnnotText ->                        -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotText"})
    CInt ->                                 -- is_open : TBasicType TBoolean
    IO ()

{- |
Sets whether /@popplerAnnot@/ should initially be displayed open

@since 0.16
-}
annotTextSetIsOpen ::
    (B.CallStack.HasCallStack, MonadIO m, IsAnnotText a) =>
    a
    {- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotText.AnnotText' -}
    -> Bool
    {- ^ /@isOpen@/: whether annotation should initially be displayed open -}
    -> m ()
annotTextSetIsOpen popplerAnnot isOpen = liftIO $ do
    popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
    let isOpen' = (fromIntegral . fromEnum) isOpen
    poppler_annot_text_set_is_open popplerAnnot' isOpen'
    touchManagedPtr popplerAnnot
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AnnotTextSetIsOpenMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsAnnotText a) => O.MethodInfo AnnotTextSetIsOpenMethodInfo a signature where
    overloadedMethod _ = annotTextSetIsOpen

#endif