{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

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

module GI.Poppler.Structs.TextSpan
    ( 

-- * Exported types
    TextSpan(..)                            ,
    noTextSpan                              ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveTextSpanMethod                   ,
#endif


-- ** copy #method:copy#

#if defined(ENABLE_OVERLOADING)
    TextSpanCopyMethodInfo                  ,
#endif
    textSpanCopy                            ,


-- ** free #method:free#

#if defined(ENABLE_OVERLOADING)
    TextSpanFreeMethodInfo                  ,
#endif
    textSpanFree                            ,


-- ** getColor #method:getColor#

#if defined(ENABLE_OVERLOADING)
    TextSpanGetColorMethodInfo              ,
#endif
    textSpanGetColor                        ,


-- ** getFontName #method:getFontName#

#if defined(ENABLE_OVERLOADING)
    TextSpanGetFontNameMethodInfo           ,
#endif
    textSpanGetFontName                     ,


-- ** getText #method:getText#

#if defined(ENABLE_OVERLOADING)
    TextSpanGetTextMethodInfo               ,
#endif
    textSpanGetText                         ,


-- ** isBoldFont #method:isBoldFont#

#if defined(ENABLE_OVERLOADING)
    TextSpanIsBoldFontMethodInfo            ,
#endif
    textSpanIsBoldFont                      ,


-- ** isFixedWidthFont #method:isFixedWidthFont#

#if defined(ENABLE_OVERLOADING)
    TextSpanIsFixedWidthFontMethodInfo      ,
#endif
    textSpanIsFixedWidthFont                ,


-- ** isSerifFont #method:isSerifFont#

#if defined(ENABLE_OVERLOADING)
    TextSpanIsSerifFontMethodInfo           ,
#endif
    textSpanIsSerifFont                     ,




    ) 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.GI.Base.Signals as B.Signals
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 {-# SOURCE #-} qualified GI.Poppler.Structs.Color as Poppler.Color

-- | Memory-managed wrapper type.
newtype TextSpan = TextSpan (ManagedPtr TextSpan)
    deriving (TextSpan -> TextSpan -> Bool
(TextSpan -> TextSpan -> Bool)
-> (TextSpan -> TextSpan -> Bool) -> Eq TextSpan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextSpan -> TextSpan -> Bool
$c/= :: TextSpan -> TextSpan -> Bool
== :: TextSpan -> TextSpan -> Bool
$c== :: TextSpan -> TextSpan -> Bool
Eq)
foreign import ccall "poppler_text_span_get_type" c_poppler_text_span_get_type :: 
    IO GType

instance BoxedObject TextSpan where
    boxedType :: TextSpan -> IO GType
boxedType _ = IO GType
c_poppler_text_span_get_type

-- | Convert 'TextSpan' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue TextSpan where
    toGValue :: TextSpan -> IO GValue
toGValue o :: TextSpan
o = do
        GType
gtype <- IO GType
c_poppler_text_span_get_type
        TextSpan -> (Ptr TextSpan -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TextSpan
o (GType
-> (GValue -> Ptr TextSpan -> IO ()) -> Ptr TextSpan -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr TextSpan -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
        
    fromGValue :: GValue -> IO TextSpan
fromGValue gv :: GValue
gv = do
        Ptr TextSpan
ptr <- GValue -> IO (Ptr TextSpan)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr TextSpan)
        (ManagedPtr TextSpan -> TextSpan) -> Ptr TextSpan -> IO TextSpan
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr TextSpan -> TextSpan
TextSpan Ptr TextSpan
ptr
        
    

-- | A convenience alias for `Nothing` :: `Maybe` `TextSpan`.
noTextSpan :: Maybe TextSpan
noTextSpan :: Maybe TextSpan
noTextSpan = Maybe TextSpan
forall a. Maybe a
Nothing


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

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

foreign import ccall "poppler_text_span_copy" poppler_text_span_copy :: 
    Ptr TextSpan ->                         -- poppler_text_span : TInterface (Name {namespace = "Poppler", name = "TextSpan"})
    IO (Ptr TextSpan)

-- | Makes a copy of a text span.
-- 
-- /Since: 0.26/
textSpanCopy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    TextSpan
    -- ^ /@popplerTextSpan@/: a t'GI.Poppler.Structs.TextSpan.TextSpan'
    -> m TextSpan
    -- ^ __Returns:__ A new t'GI.Poppler.Structs.TextSpan.TextSpan'
textSpanCopy :: TextSpan -> m TextSpan
textSpanCopy popplerTextSpan :: TextSpan
popplerTextSpan = IO TextSpan -> m TextSpan
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TextSpan -> m TextSpan) -> IO TextSpan -> m TextSpan
forall a b. (a -> b) -> a -> b
$ do
    Ptr TextSpan
popplerTextSpan' <- TextSpan -> IO (Ptr TextSpan)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextSpan
popplerTextSpan
    Ptr TextSpan
result <- Ptr TextSpan -> IO (Ptr TextSpan)
poppler_text_span_copy Ptr TextSpan
popplerTextSpan'
    Text -> Ptr TextSpan -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "textSpanCopy" Ptr TextSpan
result
    TextSpan
result' <- ((ManagedPtr TextSpan -> TextSpan) -> Ptr TextSpan -> IO TextSpan
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextSpan -> TextSpan
TextSpan) Ptr TextSpan
result
    TextSpan -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextSpan
popplerTextSpan
    TextSpan -> IO TextSpan
forall (m :: * -> *) a. Monad m => a -> m a
return TextSpan
result'

#if defined(ENABLE_OVERLOADING)
data TextSpanCopyMethodInfo
instance (signature ~ (m TextSpan), MonadIO m) => O.MethodInfo TextSpanCopyMethodInfo TextSpan signature where
    overloadedMethod = textSpanCopy

#endif

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

foreign import ccall "poppler_text_span_free" poppler_text_span_free :: 
    Ptr TextSpan ->                         -- poppler_text_span : TInterface (Name {namespace = "Poppler", name = "TextSpan"})
    IO ()

-- | Frees a text span.
-- 
-- /Since: 0.26/
textSpanFree ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    TextSpan
    -- ^ /@popplerTextSpan@/: A t'GI.Poppler.Structs.TextSpan.TextSpan'
    -> m ()
textSpanFree :: TextSpan -> m ()
textSpanFree popplerTextSpan :: TextSpan
popplerTextSpan = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr TextSpan
popplerTextSpan' <- TextSpan -> IO (Ptr TextSpan)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextSpan
popplerTextSpan
    Ptr TextSpan -> IO ()
poppler_text_span_free Ptr TextSpan
popplerTextSpan'
    TextSpan -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextSpan
popplerTextSpan
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data TextSpanFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo TextSpanFreeMethodInfo TextSpan signature where
    overloadedMethod = textSpanFree

#endif

-- method TextSpan::get_color
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "poppler_text_span"
--           , argType =
--               TInterface Name { namespace = "Poppler" , name = "TextSpan" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PopplerTextSpan" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "color"
--           , argType =
--               TInterface Name { namespace = "Poppler" , name = "Color" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a return location for a #PopplerColor"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "poppler_text_span_get_color" poppler_text_span_get_color :: 
    Ptr TextSpan ->                         -- poppler_text_span : TInterface (Name {namespace = "Poppler", name = "TextSpan"})
    Ptr Poppler.Color.Color ->              -- color : TInterface (Name {namespace = "Poppler", name = "Color"})
    IO ()

-- | Obtains the color in which the text is to be rendered.
-- 
-- /Since: 0.26/
textSpanGetColor ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    TextSpan
    -- ^ /@popplerTextSpan@/: a t'GI.Poppler.Structs.TextSpan.TextSpan'
    -> m (Poppler.Color.Color)
textSpanGetColor :: TextSpan -> m Color
textSpanGetColor popplerTextSpan :: TextSpan
popplerTextSpan = IO Color -> m Color
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Color -> m Color) -> IO Color -> m Color
forall a b. (a -> b) -> a -> b
$ do
    Ptr TextSpan
popplerTextSpan' <- TextSpan -> IO (Ptr TextSpan)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextSpan
popplerTextSpan
    Ptr Color
color <- Int -> IO (Ptr Color)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 6 :: IO (Ptr Poppler.Color.Color)
    Ptr TextSpan -> Ptr Color -> IO ()
poppler_text_span_get_color Ptr TextSpan
popplerTextSpan' Ptr Color
color
    Color
color' <- ((ManagedPtr Color -> Color) -> Ptr Color -> IO Color
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Color -> Color
Poppler.Color.Color) Ptr Color
color
    TextSpan -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextSpan
popplerTextSpan
    Color -> IO Color
forall (m :: * -> *) a. Monad m => a -> m a
return Color
color'

#if defined(ENABLE_OVERLOADING)
data TextSpanGetColorMethodInfo
instance (signature ~ (m (Poppler.Color.Color)), MonadIO m) => O.MethodInfo TextSpanGetColorMethodInfo TextSpan signature where
    overloadedMethod = textSpanGetColor

#endif

-- method TextSpan::get_font_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "poppler_text_span"
--           , argType =
--               TInterface Name { namespace = "Poppler" , name = "TextSpan" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PopplerTextSpan" , 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_text_span_get_font_name" poppler_text_span_get_font_name :: 
    Ptr TextSpan ->                         -- poppler_text_span : TInterface (Name {namespace = "Poppler", name = "TextSpan"})
    IO CString

-- | Obtains the name of the font in which the span is to be rendered.
-- 
-- /Since: 0.26/
textSpanGetFontName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    TextSpan
    -- ^ /@popplerTextSpan@/: a t'GI.Poppler.Structs.TextSpan.TextSpan'
    -> m T.Text
    -- ^ __Returns:__ A string containing the font name, or
    --   'P.Nothing' if a font is not defined.
textSpanGetFontName :: TextSpan -> m Text
textSpanGetFontName popplerTextSpan :: TextSpan
popplerTextSpan = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr TextSpan
popplerTextSpan' <- TextSpan -> IO (Ptr TextSpan)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextSpan
popplerTextSpan
    CString
result <- Ptr TextSpan -> IO CString
poppler_text_span_get_font_name Ptr TextSpan
popplerTextSpan'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "textSpanGetFontName" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    TextSpan -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextSpan
popplerTextSpan
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data TextSpanGetFontNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo TextSpanGetFontNameMethodInfo TextSpan signature where
    overloadedMethod = textSpanGetFontName

#endif

-- method TextSpan::get_text
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "poppler_text_span"
--           , argType =
--               TInterface Name { namespace = "Poppler" , name = "TextSpan" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PopplerTextSpan" , 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_text_span_get_text" poppler_text_span_get_text :: 
    Ptr TextSpan ->                         -- poppler_text_span : TInterface (Name {namespace = "Poppler", name = "TextSpan"})
    IO CString

-- | Obtains the text contained in the span.
-- 
-- /Since: 0.26/
textSpanGetText ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    TextSpan
    -- ^ /@popplerTextSpan@/: a t'GI.Poppler.Structs.TextSpan.TextSpan'
    -> m T.Text
    -- ^ __Returns:__ A string.
textSpanGetText :: TextSpan -> m Text
textSpanGetText popplerTextSpan :: TextSpan
popplerTextSpan = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr TextSpan
popplerTextSpan' <- TextSpan -> IO (Ptr TextSpan)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextSpan
popplerTextSpan
    CString
result <- Ptr TextSpan -> IO CString
poppler_text_span_get_text Ptr TextSpan
popplerTextSpan'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "textSpanGetText" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    TextSpan -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextSpan
popplerTextSpan
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data TextSpanGetTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo TextSpanGetTextMethodInfo TextSpan signature where
    overloadedMethod = textSpanGetText

#endif

-- method TextSpan::is_bold_font
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "poppler_text_span"
--           , argType =
--               TInterface Name { namespace = "Poppler" , name = "TextSpan" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PopplerTextSpan" , 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_text_span_is_bold_font" poppler_text_span_is_bold_font :: 
    Ptr TextSpan ->                         -- poppler_text_span : TInterface (Name {namespace = "Poppler", name = "TextSpan"})
    IO CInt

-- | Check whether a text span is meant to be rendered using a bold font.
-- 
-- /Since: 0.26/
textSpanIsBoldFont ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    TextSpan
    -- ^ /@popplerTextSpan@/: a t'GI.Poppler.Structs.TextSpan.TextSpan'
    -> m Bool
    -- ^ __Returns:__ Whether the span uses bold font.
textSpanIsBoldFont :: TextSpan -> m Bool
textSpanIsBoldFont popplerTextSpan :: TextSpan
popplerTextSpan = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr TextSpan
popplerTextSpan' <- TextSpan -> IO (Ptr TextSpan)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextSpan
popplerTextSpan
    CInt
result <- Ptr TextSpan -> IO CInt
poppler_text_span_is_bold_font Ptr TextSpan
popplerTextSpan'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    TextSpan -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextSpan
popplerTextSpan
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data TextSpanIsBoldFontMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo TextSpanIsBoldFontMethodInfo TextSpan signature where
    overloadedMethod = textSpanIsBoldFont

#endif

-- method TextSpan::is_fixed_width_font
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "poppler_text_span"
--           , argType =
--               TInterface Name { namespace = "Poppler" , name = "TextSpan" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PopplerTextSpan" , 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_text_span_is_fixed_width_font" poppler_text_span_is_fixed_width_font :: 
    Ptr TextSpan ->                         -- poppler_text_span : TInterface (Name {namespace = "Poppler", name = "TextSpan"})
    IO CInt

-- | Check wether a text span is meant to be rendered using a fixed-width font.
-- 
-- /Since: 0.26/
textSpanIsFixedWidthFont ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    TextSpan
    -- ^ /@popplerTextSpan@/: a t'GI.Poppler.Structs.TextSpan.TextSpan'
    -> m Bool
    -- ^ __Returns:__ Whether the span uses a fixed-width font.
textSpanIsFixedWidthFont :: TextSpan -> m Bool
textSpanIsFixedWidthFont popplerTextSpan :: TextSpan
popplerTextSpan = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr TextSpan
popplerTextSpan' <- TextSpan -> IO (Ptr TextSpan)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextSpan
popplerTextSpan
    CInt
result <- Ptr TextSpan -> IO CInt
poppler_text_span_is_fixed_width_font Ptr TextSpan
popplerTextSpan'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    TextSpan -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextSpan
popplerTextSpan
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data TextSpanIsFixedWidthFontMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo TextSpanIsFixedWidthFontMethodInfo TextSpan signature where
    overloadedMethod = textSpanIsFixedWidthFont

#endif

-- method TextSpan::is_serif_font
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "poppler_text_span"
--           , argType =
--               TInterface Name { namespace = "Poppler" , name = "TextSpan" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PopplerTextSpan" , 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_text_span_is_serif_font" poppler_text_span_is_serif_font :: 
    Ptr TextSpan ->                         -- poppler_text_span : TInterface (Name {namespace = "Poppler", name = "TextSpan"})
    IO CInt

-- | Check whether a text span is meant to be rendered using a serif font.
-- 
-- /Since: 0.26/
textSpanIsSerifFont ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    TextSpan
    -- ^ /@popplerTextSpan@/: a t'GI.Poppler.Structs.TextSpan.TextSpan'
    -> m Bool
    -- ^ __Returns:__ Whether the span uses a serif font.
textSpanIsSerifFont :: TextSpan -> m Bool
textSpanIsSerifFont popplerTextSpan :: TextSpan
popplerTextSpan = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr TextSpan
popplerTextSpan' <- TextSpan -> IO (Ptr TextSpan)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextSpan
popplerTextSpan
    CInt
result <- Ptr TextSpan -> IO CInt
poppler_text_span_is_serif_font Ptr TextSpan
popplerTextSpan'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    TextSpan -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextSpan
popplerTextSpan
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data TextSpanIsSerifFontMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo TextSpanIsSerifFontMethodInfo TextSpan signature where
    overloadedMethod = textSpanIsSerifFont

#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveTextSpanMethod (t :: Symbol) (o :: *) :: * where
    ResolveTextSpanMethod "copy" o = TextSpanCopyMethodInfo
    ResolveTextSpanMethod "free" o = TextSpanFreeMethodInfo
    ResolveTextSpanMethod "isBoldFont" o = TextSpanIsBoldFontMethodInfo
    ResolveTextSpanMethod "isFixedWidthFont" o = TextSpanIsFixedWidthFontMethodInfo
    ResolveTextSpanMethod "isSerifFont" o = TextSpanIsSerifFontMethodInfo
    ResolveTextSpanMethod "getColor" o = TextSpanGetColorMethodInfo
    ResolveTextSpanMethod "getFontName" o = TextSpanGetFontNameMethodInfo
    ResolveTextSpanMethod "getText" o = TextSpanGetTextMethodInfo
    ResolveTextSpanMethod l o = O.MethodResolutionFailed l o

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

#endif