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

-- * Exported types
    FormField(..)                           ,
    IsFormField                             ,
    toFormField                             ,
    noFormField                             ,


 -- * Methods
-- ** buttonGetButtonType #method:buttonGetButtonType#

#if ENABLE_OVERLOADING
    FormFieldButtonGetButtonTypeMethodInfo  ,
#endif
    formFieldButtonGetButtonType            ,


-- ** buttonGetState #method:buttonGetState#

#if ENABLE_OVERLOADING
    FormFieldButtonGetStateMethodInfo       ,
#endif
    formFieldButtonGetState                 ,


-- ** buttonSetState #method:buttonSetState#

#if ENABLE_OVERLOADING
    FormFieldButtonSetStateMethodInfo       ,
#endif
    formFieldButtonSetState                 ,


-- ** choiceCanSelectMultiple #method:choiceCanSelectMultiple#

#if ENABLE_OVERLOADING
    FormFieldChoiceCanSelectMultipleMethodInfo,
#endif
    formFieldChoiceCanSelectMultiple        ,


-- ** choiceCommitOnChange #method:choiceCommitOnChange#

#if ENABLE_OVERLOADING
    FormFieldChoiceCommitOnChangeMethodInfo ,
#endif
    formFieldChoiceCommitOnChange           ,


-- ** choiceDoSpellCheck #method:choiceDoSpellCheck#

#if ENABLE_OVERLOADING
    FormFieldChoiceDoSpellCheckMethodInfo   ,
#endif
    formFieldChoiceDoSpellCheck             ,


-- ** choiceGetChoiceType #method:choiceGetChoiceType#

#if ENABLE_OVERLOADING
    FormFieldChoiceGetChoiceTypeMethodInfo  ,
#endif
    formFieldChoiceGetChoiceType            ,


-- ** choiceGetItem #method:choiceGetItem#

#if ENABLE_OVERLOADING
    FormFieldChoiceGetItemMethodInfo        ,
#endif
    formFieldChoiceGetItem                  ,


-- ** choiceGetNItems #method:choiceGetNItems#

#if ENABLE_OVERLOADING
    FormFieldChoiceGetNItemsMethodInfo      ,
#endif
    formFieldChoiceGetNItems                ,


-- ** choiceGetText #method:choiceGetText#

#if ENABLE_OVERLOADING
    FormFieldChoiceGetTextMethodInfo        ,
#endif
    formFieldChoiceGetText                  ,


-- ** choiceIsEditable #method:choiceIsEditable#

#if ENABLE_OVERLOADING
    FormFieldChoiceIsEditableMethodInfo     ,
#endif
    formFieldChoiceIsEditable               ,


-- ** choiceIsItemSelected #method:choiceIsItemSelected#

#if ENABLE_OVERLOADING
    FormFieldChoiceIsItemSelectedMethodInfo ,
#endif
    formFieldChoiceIsItemSelected           ,


-- ** choiceSelectItem #method:choiceSelectItem#

#if ENABLE_OVERLOADING
    FormFieldChoiceSelectItemMethodInfo     ,
#endif
    formFieldChoiceSelectItem               ,


-- ** choiceSetText #method:choiceSetText#

#if ENABLE_OVERLOADING
    FormFieldChoiceSetTextMethodInfo        ,
#endif
    formFieldChoiceSetText                  ,


-- ** choiceToggleItem #method:choiceToggleItem#

#if ENABLE_OVERLOADING
    FormFieldChoiceToggleItemMethodInfo     ,
#endif
    formFieldChoiceToggleItem               ,


-- ** choiceUnselectAll #method:choiceUnselectAll#

#if ENABLE_OVERLOADING
    FormFieldChoiceUnselectAllMethodInfo    ,
#endif
    formFieldChoiceUnselectAll              ,


-- ** getAction #method:getAction#

#if ENABLE_OVERLOADING
    FormFieldGetActionMethodInfo            ,
#endif
    formFieldGetAction                      ,


-- ** getAdditionalAction #method:getAdditionalAction#

#if ENABLE_OVERLOADING
    FormFieldGetAdditionalActionMethodInfo  ,
#endif
    formFieldGetAdditionalAction            ,


-- ** getFieldType #method:getFieldType#

#if ENABLE_OVERLOADING
    FormFieldGetFieldTypeMethodInfo         ,
#endif
    formFieldGetFieldType                   ,


-- ** getFontSize #method:getFontSize#

#if ENABLE_OVERLOADING
    FormFieldGetFontSizeMethodInfo          ,
#endif
    formFieldGetFontSize                    ,


-- ** getId #method:getId#

#if ENABLE_OVERLOADING
    FormFieldGetIdMethodInfo                ,
#endif
    formFieldGetId                          ,


-- ** getMappingName #method:getMappingName#

#if ENABLE_OVERLOADING
    FormFieldGetMappingNameMethodInfo       ,
#endif
    formFieldGetMappingName                 ,


-- ** getName #method:getName#

#if ENABLE_OVERLOADING
    FormFieldGetNameMethodInfo              ,
#endif
    formFieldGetName                        ,


-- ** getPartialName #method:getPartialName#

#if ENABLE_OVERLOADING
    FormFieldGetPartialNameMethodInfo       ,
#endif
    formFieldGetPartialName                 ,


-- ** isReadOnly #method:isReadOnly#

#if ENABLE_OVERLOADING
    FormFieldIsReadOnlyMethodInfo           ,
#endif
    formFieldIsReadOnly                     ,


-- ** textDoScroll #method:textDoScroll#

#if ENABLE_OVERLOADING
    FormFieldTextDoScrollMethodInfo         ,
#endif
    formFieldTextDoScroll                   ,


-- ** textDoSpellCheck #method:textDoSpellCheck#

#if ENABLE_OVERLOADING
    FormFieldTextDoSpellCheckMethodInfo     ,
#endif
    formFieldTextDoSpellCheck               ,


-- ** textGetMaxLen #method:textGetMaxLen#

#if ENABLE_OVERLOADING
    FormFieldTextGetMaxLenMethodInfo        ,
#endif
    formFieldTextGetMaxLen                  ,


-- ** textGetText #method:textGetText#

#if ENABLE_OVERLOADING
    FormFieldTextGetTextMethodInfo          ,
#endif
    formFieldTextGetText                    ,


-- ** textGetTextType #method:textGetTextType#

#if ENABLE_OVERLOADING
    FormFieldTextGetTextTypeMethodInfo      ,
#endif
    formFieldTextGetTextType                ,


-- ** textIsPassword #method:textIsPassword#

#if ENABLE_OVERLOADING
    FormFieldTextIsPasswordMethodInfo       ,
#endif
    formFieldTextIsPassword                 ,


-- ** textIsRichText #method:textIsRichText#

#if ENABLE_OVERLOADING
    FormFieldTextIsRichTextMethodInfo       ,
#endif
    formFieldTextIsRichText                 ,


-- ** textSetText #method:textSetText#

#if ENABLE_OVERLOADING
    FormFieldTextSetTextMethodInfo          ,
#endif
    formFieldTextSetText                    ,




    ) 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.Enums as Poppler.Enums
import {-# SOURCE #-} qualified GI.Poppler.Unions.Action as Poppler.Action

-- | Memory-managed wrapper type.
newtype FormField = FormField (ManagedPtr FormField)
foreign import ccall "poppler_form_field_get_type"
    c_poppler_form_field_get_type :: IO GType

instance GObject FormField where
    gobjectType = c_poppler_form_field_get_type


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

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

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

-- | A convenience alias for `Nothing` :: `Maybe` `FormField`.
noFormField :: Maybe FormField
noFormField = Nothing

#if ENABLE_OVERLOADING
type family ResolveFormFieldMethod (t :: Symbol) (o :: *) :: * where
    ResolveFormFieldMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveFormFieldMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveFormFieldMethod "buttonGetButtonType" o = FormFieldButtonGetButtonTypeMethodInfo
    ResolveFormFieldMethod "buttonGetState" o = FormFieldButtonGetStateMethodInfo
    ResolveFormFieldMethod "buttonSetState" o = FormFieldButtonSetStateMethodInfo
    ResolveFormFieldMethod "choiceCanSelectMultiple" o = FormFieldChoiceCanSelectMultipleMethodInfo
    ResolveFormFieldMethod "choiceCommitOnChange" o = FormFieldChoiceCommitOnChangeMethodInfo
    ResolveFormFieldMethod "choiceDoSpellCheck" o = FormFieldChoiceDoSpellCheckMethodInfo
    ResolveFormFieldMethod "choiceGetChoiceType" o = FormFieldChoiceGetChoiceTypeMethodInfo
    ResolveFormFieldMethod "choiceGetItem" o = FormFieldChoiceGetItemMethodInfo
    ResolveFormFieldMethod "choiceGetNItems" o = FormFieldChoiceGetNItemsMethodInfo
    ResolveFormFieldMethod "choiceGetText" o = FormFieldChoiceGetTextMethodInfo
    ResolveFormFieldMethod "choiceIsEditable" o = FormFieldChoiceIsEditableMethodInfo
    ResolveFormFieldMethod "choiceIsItemSelected" o = FormFieldChoiceIsItemSelectedMethodInfo
    ResolveFormFieldMethod "choiceSelectItem" o = FormFieldChoiceSelectItemMethodInfo
    ResolveFormFieldMethod "choiceSetText" o = FormFieldChoiceSetTextMethodInfo
    ResolveFormFieldMethod "choiceToggleItem" o = FormFieldChoiceToggleItemMethodInfo
    ResolveFormFieldMethod "choiceUnselectAll" o = FormFieldChoiceUnselectAllMethodInfo
    ResolveFormFieldMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveFormFieldMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveFormFieldMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveFormFieldMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveFormFieldMethod "isReadOnly" o = FormFieldIsReadOnlyMethodInfo
    ResolveFormFieldMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveFormFieldMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveFormFieldMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveFormFieldMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveFormFieldMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveFormFieldMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveFormFieldMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveFormFieldMethod "textDoScroll" o = FormFieldTextDoScrollMethodInfo
    ResolveFormFieldMethod "textDoSpellCheck" o = FormFieldTextDoSpellCheckMethodInfo
    ResolveFormFieldMethod "textGetMaxLen" o = FormFieldTextGetMaxLenMethodInfo
    ResolveFormFieldMethod "textGetText" o = FormFieldTextGetTextMethodInfo
    ResolveFormFieldMethod "textGetTextType" o = FormFieldTextGetTextTypeMethodInfo
    ResolveFormFieldMethod "textIsPassword" o = FormFieldTextIsPasswordMethodInfo
    ResolveFormFieldMethod "textIsRichText" o = FormFieldTextIsRichTextMethodInfo
    ResolveFormFieldMethod "textSetText" o = FormFieldTextSetTextMethodInfo
    ResolveFormFieldMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveFormFieldMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveFormFieldMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveFormFieldMethod "getAction" o = FormFieldGetActionMethodInfo
    ResolveFormFieldMethod "getAdditionalAction" o = FormFieldGetAdditionalActionMethodInfo
    ResolveFormFieldMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveFormFieldMethod "getFieldType" o = FormFieldGetFieldTypeMethodInfo
    ResolveFormFieldMethod "getFontSize" o = FormFieldGetFontSizeMethodInfo
    ResolveFormFieldMethod "getId" o = FormFieldGetIdMethodInfo
    ResolveFormFieldMethod "getMappingName" o = FormFieldGetMappingNameMethodInfo
    ResolveFormFieldMethod "getName" o = FormFieldGetNameMethodInfo
    ResolveFormFieldMethod "getPartialName" o = FormFieldGetPartialNameMethodInfo
    ResolveFormFieldMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveFormFieldMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveFormFieldMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveFormFieldMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveFormFieldMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveFormFieldMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveFormFieldMethod t FormField, O.MethodInfo info FormField p) => OL.IsLabel t (FormField -> 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 FormField
type instance O.AttributeList FormField = FormFieldAttributeList
type FormFieldAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
#endif

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

#endif

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

foreign import ccall "poppler_form_field_button_get_button_type" poppler_form_field_button_get_button_type ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CUInt

{- |
Gets the button type of /@field@/
-}
formFieldButtonGetButtonType ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Poppler.Enums.FormButtonType
    {- ^ __Returns:__ 'GI.Poppler.Enums.FormButtonType' of /@field@/ -}
formFieldButtonGetButtonType field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_button_get_button_type field'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldButtonGetButtonTypeMethodInfo
instance (signature ~ (m Poppler.Enums.FormButtonType), MonadIO m, IsFormField a) => O.MethodInfo FormFieldButtonGetButtonTypeMethodInfo a signature where
    overloadedMethod _ = formFieldButtonGetButtonType

#endif

-- method FormField::button_get_state
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_button_get_state" poppler_form_field_button_get_state ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CInt

{- |
Queries a 'GI.Poppler.Objects.FormField.FormField' and returns its current state. Returns 'True' if
/@field@/ is pressed in and 'False' if it is raised.
-}
formFieldButtonGetState ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Bool
    {- ^ __Returns:__ current state of /@field@/ -}
formFieldButtonGetState field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_button_get_state field'
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldButtonGetStateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldButtonGetStateMethodInfo a signature where
    overloadedMethod _ = formFieldButtonGetState

#endif

-- method FormField::button_set_state
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "state", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE or %FALSE", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_form_field_button_set_state" poppler_form_field_button_set_state ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    CInt ->                                 -- state : TBasicType TBoolean
    IO ()

{- |
Sets the status of /@field@/. Set to 'True' if you want the 'GI.Poppler.Objects.FormField.FormField'
to be \'pressed in\', and 'False' to raise it.
-}
formFieldButtonSetState ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> Bool
    {- ^ /@state@/: 'True' or 'False' -}
    -> m ()
formFieldButtonSetState field state = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    let state' = (fromIntegral . fromEnum) state
    poppler_form_field_button_set_state field' state'
    touchManagedPtr field
    return ()

#if ENABLE_OVERLOADING
data FormFieldButtonSetStateMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFormField a) => O.MethodInfo FormFieldButtonSetStateMethodInfo a signature where
    overloadedMethod _ = formFieldButtonSetState

#endif

-- method FormField::choice_can_select_multiple
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_choice_can_select_multiple" poppler_form_field_choice_can_select_multiple ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CInt

{- |
Checks whether /@field@/ allows multiple choices to be selected
-}
formFieldChoiceCanSelectMultiple ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@field@/ allows multiple choices to be selected -}
formFieldChoiceCanSelectMultiple field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_choice_can_select_multiple field'
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldChoiceCanSelectMultipleMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceCanSelectMultipleMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceCanSelectMultiple

#endif

-- method FormField::choice_commit_on_change
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, 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_form_field_choice_commit_on_change" poppler_form_field_choice_commit_on_change ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CInt

{- |
/No description available in the introspection data./
-}
formFieldChoiceCommitOnChange ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    -> m Bool
formFieldChoiceCommitOnChange field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_choice_commit_on_change field'
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldChoiceCommitOnChangeMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceCommitOnChangeMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceCommitOnChange

#endif

-- method FormField::choice_do_spell_check
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_choice_do_spell_check" poppler_form_field_choice_do_spell_check ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CInt

{- |
Checks whether spell checking should be done for the contents of /@field@/
-}
formFieldChoiceDoSpellCheck ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if spell checking should be done for /@field@/ -}
formFieldChoiceDoSpellCheck field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_choice_do_spell_check field'
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldChoiceDoSpellCheckMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceDoSpellCheckMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceDoSpellCheck

#endif

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

foreign import ccall "poppler_form_field_choice_get_choice_type" poppler_form_field_choice_get_choice_type ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CUInt

{- |
Gets the choice type of /@field@/
-}
formFieldChoiceGetChoiceType ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Poppler.Enums.FormChoiceType
    {- ^ __Returns:__ 'GI.Poppler.Enums.FormChoiceType' of /@field@/ -}
formFieldChoiceGetChoiceType field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_choice_get_choice_type field'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldChoiceGetChoiceTypeMethodInfo
instance (signature ~ (m Poppler.Enums.FormChoiceType), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceGetChoiceTypeMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceGetChoiceType

#endif

-- method FormField::choice_get_item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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 "the index of the item", 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_form_field_choice_get_item" poppler_form_field_choice_get_item ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    Int32 ->                                -- index : TBasicType TInt
    IO CString

{- |
Returns the contents of the item on /@field@/ at the given index
-}
formFieldChoiceGetItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> Int32
    {- ^ /@index@/: the index of the item -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string. It must be freed with 'GI.GLib.Functions.free' when done. -}
formFieldChoiceGetItem field index = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_choice_get_item field' index
    checkUnexpectedReturnNULL "formFieldChoiceGetItem" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldChoiceGetItemMethodInfo
instance (signature ~ (Int32 -> m T.Text), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceGetItemMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceGetItem

#endif

-- method FormField::choice_get_n_items
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_choice_get_n_items" poppler_form_field_choice_get_n_items ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO Int32

{- |
Returns the number of items on /@field@/
-}
formFieldChoiceGetNItems ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Int32
    {- ^ __Returns:__ the number of items on /@field@/ -}
formFieldChoiceGetNItems field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_choice_get_n_items field'
    touchManagedPtr field
    return result

#if ENABLE_OVERLOADING
data FormFieldChoiceGetNItemsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceGetNItemsMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceGetNItems

#endif

-- method FormField::choice_get_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_choice_get_text" poppler_form_field_choice_get_text ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CString

{- |
Retrieves the contents of /@field@/.
-}
formFieldChoiceGetText ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string. It must be freed with 'GI.GLib.Functions.free' when done. -}
formFieldChoiceGetText field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_choice_get_text field'
    checkUnexpectedReturnNULL "formFieldChoiceGetText" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldChoiceGetTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceGetTextMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceGetText

#endif

-- method FormField::choice_is_editable
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_choice_is_editable" poppler_form_field_choice_is_editable ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CInt

{- |
Checks whether /@field@/ is editable
-}
formFieldChoiceIsEditable ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@field@/ is editable -}
formFieldChoiceIsEditable field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_choice_is_editable field'
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldChoiceIsEditableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceIsEditableMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceIsEditable

#endif

-- method FormField::choice_is_item_selected
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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 "the index of the item", 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_form_field_choice_is_item_selected" poppler_form_field_choice_is_item_selected ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    Int32 ->                                -- index : TBasicType TInt
    IO CInt

{- |
Checks whether the item at the given index on /@field@/ is currently selected
-}
formFieldChoiceIsItemSelected ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> Int32
    {- ^ /@index@/: the index of the item -}
    -> m Bool
    {- ^ __Returns:__ 'True' if item at /@index@/ is currently selected -}
formFieldChoiceIsItemSelected field index = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_choice_is_item_selected field' index
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldChoiceIsItemSelectedMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceIsItemSelectedMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceIsItemSelected

#endif

-- method FormField::choice_select_item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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 "the index of the item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_form_field_choice_select_item" poppler_form_field_choice_select_item ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    Int32 ->                                -- index : TBasicType TInt
    IO ()

{- |
Selects the item at the given index on /@field@/
-}
formFieldChoiceSelectItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> Int32
    {- ^ /@index@/: the index of the item -}
    -> m ()
formFieldChoiceSelectItem field index = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    poppler_form_field_choice_select_item field' index
    touchManagedPtr field
    return ()

#if ENABLE_OVERLOADING
data FormFieldChoiceSelectItemMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceSelectItemMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceSelectItem

#endif

-- method FormField::choice_set_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the new text", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_form_field_choice_set_text" poppler_form_field_choice_set_text ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    CString ->                              -- text : TBasicType TUTF8
    IO ()

{- |
Sets the text in /@field@/ to the given value, replacing the current contents
-}
formFieldChoiceSetText ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> T.Text
    {- ^ /@text@/: the new text -}
    -> m ()
formFieldChoiceSetText field text = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    text' <- textToCString text
    poppler_form_field_choice_set_text field' text'
    touchManagedPtr field
    freeMem text'
    return ()

#if ENABLE_OVERLOADING
data FormFieldChoiceSetTextMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceSetTextMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceSetText

#endif

-- method FormField::choice_toggle_item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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 "the index of the item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_form_field_choice_toggle_item" poppler_form_field_choice_toggle_item ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    Int32 ->                                -- index : TBasicType TInt
    IO ()

{- |
Changes the state of the item at the given index
-}
formFieldChoiceToggleItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> Int32
    {- ^ /@index@/: the index of the item -}
    -> m ()
formFieldChoiceToggleItem field index = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    poppler_form_field_choice_toggle_item field' index
    touchManagedPtr field
    return ()

#if ENABLE_OVERLOADING
data FormFieldChoiceToggleItemMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceToggleItemMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceToggleItem

#endif

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

foreign import ccall "poppler_form_field_choice_unselect_all" poppler_form_field_choice_unselect_all ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO ()

{- |
Unselects all the items on /@field@/
-}
formFieldChoiceUnselectAll ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m ()
formFieldChoiceUnselectAll field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    poppler_form_field_choice_unselect_all field'
    touchManagedPtr field
    return ()

#if ENABLE_OVERLOADING
data FormFieldChoiceUnselectAllMethodInfo
instance (signature ~ (m ()), MonadIO m, IsFormField a) => O.MethodInfo FormFieldChoiceUnselectAllMethodInfo a signature where
    overloadedMethod _ = formFieldChoiceUnselectAll

#endif

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

foreign import ccall "poppler_form_field_get_action" poppler_form_field_get_action ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO (Ptr Poppler.Action.Action)

{- |
Retrieves the action ('GI.Poppler.Unions.Action.Action') that shall be
performed when /@field@/ is activated, or 'Nothing'

/Since: 0.18/
-}
formFieldGetAction ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Poppler.Action.Action
    {- ^ __Returns:__ the action to perform. The returned
              object is owned by /@field@/ and should not be freed -}
formFieldGetAction field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_get_action field'
    checkUnexpectedReturnNULL "formFieldGetAction" result
    result' <- (newBoxed Poppler.Action.Action) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldGetActionMethodInfo
instance (signature ~ (m Poppler.Action.Action), MonadIO m, IsFormField a) => O.MethodInfo FormFieldGetActionMethodInfo a signature where
    overloadedMethod _ = formFieldGetAction

#endif

-- method FormField::get_additional_action
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "type", argType = TInterface (Name {namespace = "Poppler", name = "AdditionalActionType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the type of additional action", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "Action"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_form_field_get_additional_action" poppler_form_field_get_additional_action ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    CUInt ->                                -- type : TInterface (Name {namespace = "Poppler", name = "AdditionalActionType"})
    IO (Ptr Poppler.Action.Action)

{- |
Retrieves the action ('GI.Poppler.Unions.Action.Action') that shall be performed when
an additional action is triggered on /@field@/, or 'Nothing'.

/Since: 0.72/
-}
formFieldGetAdditionalAction ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> Poppler.Enums.AdditionalActionType
    {- ^ /@type@/: the type of additional action -}
    -> m Poppler.Action.Action
    {- ^ __Returns:__ the action to perform. The returned
              object is owned by /@field@/ and should not be freed. -}
formFieldGetAdditionalAction field type_ = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    let type_' = (fromIntegral . fromEnum) type_
    result <- poppler_form_field_get_additional_action field' type_'
    checkUnexpectedReturnNULL "formFieldGetAdditionalAction" result
    result' <- (newBoxed Poppler.Action.Action) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldGetAdditionalActionMethodInfo
instance (signature ~ (Poppler.Enums.AdditionalActionType -> m Poppler.Action.Action), MonadIO m, IsFormField a) => O.MethodInfo FormFieldGetAdditionalActionMethodInfo a signature where
    overloadedMethod _ = formFieldGetAdditionalAction

#endif

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

foreign import ccall "poppler_form_field_get_field_type" poppler_form_field_get_field_type ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CUInt

{- |
Gets the type of /@field@/
-}
formFieldGetFieldType ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Poppler.Enums.FormFieldType
    {- ^ __Returns:__ 'GI.Poppler.Enums.FormFieldType' of /@field@/ -}
formFieldGetFieldType field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_get_field_type field'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldGetFieldTypeMethodInfo
instance (signature ~ (m Poppler.Enums.FormFieldType), MonadIO m, IsFormField a) => O.MethodInfo FormFieldGetFieldTypeMethodInfo a signature where
    overloadedMethod _ = formFieldGetFieldType

#endif

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

foreign import ccall "poppler_form_field_get_font_size" poppler_form_field_get_font_size ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CDouble

{- |
Gets the font size of /@field@/

WARNING: This function always returns 0. Contact the poppler
mailing list if you\'re interested in implementing it properly
-}
formFieldGetFontSize ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Double
    {- ^ __Returns:__ the font size of /@field@/ -}
formFieldGetFontSize field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_get_font_size field'
    let result' = realToFrac result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldGetFontSizeMethodInfo
instance (signature ~ (m Double), MonadIO m, IsFormField a) => O.MethodInfo FormFieldGetFontSizeMethodInfo a signature where
    overloadedMethod _ = formFieldGetFontSize

#endif

-- method FormField::get_id
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_get_id" poppler_form_field_get_id ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO Int32

{- |
Gets the id of /@field@/
-}
formFieldGetId ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Int32
    {- ^ __Returns:__ the id of /@field@/ -}
formFieldGetId field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_get_id field'
    touchManagedPtr field
    return result

#if ENABLE_OVERLOADING
data FormFieldGetIdMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsFormField a) => O.MethodInfo FormFieldGetIdMethodInfo a signature where
    overloadedMethod _ = formFieldGetId

#endif

-- method FormField::get_mapping_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_get_mapping_name" poppler_form_field_get_mapping_name ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CString

{- |
Gets the mapping name of /@field@/ that is used when
exporting interactive form field data from the document

/Since: 0.16/
-}
formFieldGetMappingName ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string. It must be freed with 'GI.GLib.Functions.free' when done. -}
formFieldGetMappingName field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_get_mapping_name field'
    checkUnexpectedReturnNULL "formFieldGetMappingName" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldGetMappingNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFormField a) => O.MethodInfo FormFieldGetMappingNameMethodInfo a signature where
    overloadedMethod _ = formFieldGetMappingName

#endif

-- method FormField::get_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_get_name" poppler_form_field_get_name ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CString

{- |
Gets the fully qualified name of /@field@/. It\'s constructed by concatenating
the partial field names of the field and all of its ancestors.

/Since: 0.16/
-}
formFieldGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string. It must be freed with 'GI.GLib.Functions.free' when done. -}
formFieldGetName field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_get_name field'
    checkUnexpectedReturnNULL "formFieldGetName" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFormField a) => O.MethodInfo FormFieldGetNameMethodInfo a signature where
    overloadedMethod _ = formFieldGetName

#endif

-- method FormField::get_partial_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_get_partial_name" poppler_form_field_get_partial_name ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CString

{- |
Gets the partial name of /@field@/.

/Since: 0.16/
-}
formFieldGetPartialName ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string. It must be freed with 'GI.GLib.Functions.free' when done. -}
formFieldGetPartialName field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_get_partial_name field'
    checkUnexpectedReturnNULL "formFieldGetPartialName" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldGetPartialNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFormField a) => O.MethodInfo FormFieldGetPartialNameMethodInfo a signature where
    overloadedMethod _ = formFieldGetPartialName

#endif

-- method FormField::is_read_only
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_is_read_only" poppler_form_field_is_read_only ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CInt

{- |
Checks whether /@field@/ is read only
-}
formFieldIsReadOnly ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@field@/ is read only -}
formFieldIsReadOnly field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_is_read_only field'
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldIsReadOnlyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldIsReadOnlyMethodInfo a signature where
    overloadedMethod _ = formFieldIsReadOnly

#endif

-- method FormField::text_do_scroll
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, 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_form_field_text_do_scroll" poppler_form_field_text_do_scroll ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CInt

{- |
/No description available in the introspection data./
-}
formFieldTextDoScroll ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    -> m Bool
formFieldTextDoScroll field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_text_do_scroll field'
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldTextDoScrollMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldTextDoScrollMethodInfo a signature where
    overloadedMethod _ = formFieldTextDoScroll

#endif

-- method FormField::text_do_spell_check
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_text_do_spell_check" poppler_form_field_text_do_spell_check ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CInt

{- |
Checks whether spell checking should be done for the contents of /@field@/
-}
formFieldTextDoSpellCheck ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if spell checking should be done for /@field@/ -}
formFieldTextDoSpellCheck field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_text_do_spell_check field'
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldTextDoSpellCheckMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldTextDoSpellCheckMethodInfo a signature where
    overloadedMethod _ = formFieldTextDoSpellCheck

#endif

-- method FormField::text_get_max_len
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_text_get_max_len" poppler_form_field_text_get_max_len ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO Int32

{- |
Retrieves the maximum allowed length of the text in /@field@/
-}
formFieldTextGetMaxLen ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Int32
    {- ^ __Returns:__ the maximum allowed number of characters in /@field@/, or -1 if there is no maximum. -}
formFieldTextGetMaxLen field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_text_get_max_len field'
    touchManagedPtr field
    return result

#if ENABLE_OVERLOADING
data FormFieldTextGetMaxLenMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsFormField a) => O.MethodInfo FormFieldTextGetMaxLenMethodInfo a signature where
    overloadedMethod _ = formFieldTextGetMaxLen

#endif

-- method FormField::text_get_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_text_get_text" poppler_form_field_text_get_text ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CString

{- |
Retrieves the contents of /@field@/.
-}
formFieldTextGetText ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m T.Text
    {- ^ __Returns:__ a new allocated string. It must be freed with 'GI.GLib.Functions.free' when done. -}
formFieldTextGetText field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_text_get_text field'
    checkUnexpectedReturnNULL "formFieldTextGetText" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldTextGetTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFormField a) => O.MethodInfo FormFieldTextGetTextMethodInfo a signature where
    overloadedMethod _ = formFieldTextGetText

#endif

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

foreign import ccall "poppler_form_field_text_get_text_type" poppler_form_field_text_get_text_type ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CUInt

{- |
Gets the text type of /@field@/.
-}
formFieldTextGetTextType ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Poppler.Enums.FormTextType
    {- ^ __Returns:__ 'GI.Poppler.Enums.FormTextType' of /@field@/ -}
formFieldTextGetTextType field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_text_get_text_type field'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldTextGetTextTypeMethodInfo
instance (signature ~ (m Poppler.Enums.FormTextType), MonadIO m, IsFormField a) => O.MethodInfo FormFieldTextGetTextTypeMethodInfo a signature where
    overloadedMethod _ = formFieldTextGetTextType

#endif

-- method FormField::text_is_password
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_text_is_password" poppler_form_field_text_is_password ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CInt

{- |
Checks whether content of /@field@/ is a password and it must be hidden
-}
formFieldTextIsPassword ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the content of /@field@/ is a password -}
formFieldTextIsPassword field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_text_is_password field'
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldTextIsPasswordMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldTextIsPasswordMethodInfo a signature where
    overloadedMethod _ = formFieldTextIsPassword

#endif

-- method FormField::text_is_rich_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", 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_form_field_text_is_rich_text" poppler_form_field_text_is_rich_text ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    IO CInt

{- |
Checks whether the contents of /@field@/ are rich text
-}
formFieldTextIsRichText ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the contents of /@field@/ are rich text -}
formFieldTextIsRichText field = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    result <- poppler_form_field_text_is_rich_text field'
    let result' = (/= 0) result
    touchManagedPtr field
    return result'

#if ENABLE_OVERLOADING
data FormFieldTextIsRichTextMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFormField a) => O.MethodInfo FormFieldTextIsRichTextMethodInfo a signature where
    overloadedMethod _ = formFieldTextIsRichText

#endif

-- method FormField::text_set_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "field", argType = TInterface (Name {namespace = "Poppler", name = "FormField"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerFormField", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the new text", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_form_field_text_set_text" poppler_form_field_text_set_text ::
    Ptr FormField ->                        -- field : TInterface (Name {namespace = "Poppler", name = "FormField"})
    CString ->                              -- text : TBasicType TUTF8
    IO ()

{- |
Sets the text in /@field@/ to the given value, replacing the current contents.
-}
formFieldTextSetText ::
    (B.CallStack.HasCallStack, MonadIO m, IsFormField a) =>
    a
    {- ^ /@field@/: a 'GI.Poppler.Objects.FormField.FormField' -}
    -> T.Text
    {- ^ /@text@/: the new text -}
    -> m ()
formFieldTextSetText field text = liftIO $ do
    field' <- unsafeManagedPtrCastPtr field
    text' <- textToCString text
    poppler_form_field_text_set_text field' text'
    touchManagedPtr field
    freeMem text'
    return ()

#if ENABLE_OVERLOADING
data FormFieldTextSetTextMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsFormField a) => O.MethodInfo FormFieldTextSetTextMethodInfo a signature where
    overloadedMethod _ = formFieldTextSetText

#endif