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

module GI.Poppler.Objects.AnnotFreeText
    ( 

-- * Exported types
    AnnotFreeText(..)                       ,
    AnnotFreeTextK                          ,
    toAnnotFreeText                         ,
    noAnnotFreeText                         ,


 -- * Methods
-- ** annotFreeTextGetCalloutLine
    annotFreeTextGetCalloutLine             ,


-- ** annotFreeTextGetQuadding
    annotFreeTextGetQuadding                ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Poppler.Types
import GI.Poppler.Callbacks
import qualified GI.GObject as GObject

newtype AnnotFreeText = AnnotFreeText (ForeignPtr AnnotFreeText)
foreign import ccall "poppler_annot_free_text_get_type"
    c_poppler_annot_free_text_get_type :: IO GType

type instance ParentTypes AnnotFreeText = AnnotFreeTextParentTypes
type AnnotFreeTextParentTypes = '[AnnotMarkup, Annot, GObject.Object]

instance GObject AnnotFreeText where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_poppler_annot_free_text_get_type
    

class GObject o => AnnotFreeTextK o
instance (GObject o, IsDescendantOf AnnotFreeText o) => AnnotFreeTextK o

toAnnotFreeText :: AnnotFreeTextK o => o -> IO AnnotFreeText
toAnnotFreeText = unsafeCastTo AnnotFreeText

noAnnotFreeText :: Maybe AnnotFreeText
noAnnotFreeText = Nothing

type instance AttributeList AnnotFreeText = AnnotFreeTextAttributeList
type AnnotFreeTextAttributeList = ('[ ] :: [(Symbol, *)])

type instance SignalList AnnotFreeText = AnnotFreeTextSignalList
type AnnotFreeTextSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method AnnotFreeText::get_callout_line
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Poppler" "AnnotFreeText", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Poppler" "AnnotFreeText", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Poppler" "AnnotCalloutLine"
-- throws : False
-- Skip return : False

foreign import ccall "poppler_annot_free_text_get_callout_line" poppler_annot_free_text_get_callout_line :: 
    Ptr AnnotFreeText ->                    -- _obj : TInterface "Poppler" "AnnotFreeText"
    IO (Ptr AnnotCalloutLine)


annotFreeTextGetCalloutLine ::
    (MonadIO m, AnnotFreeTextK a) =>
    a ->                                    -- _obj
    m AnnotCalloutLine
annotFreeTextGetCalloutLine _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- poppler_annot_free_text_get_callout_line _obj'
    checkUnexpectedReturnNULL "poppler_annot_free_text_get_callout_line" result
    result' <- (wrapBoxed AnnotCalloutLine) result
    touchManagedPtr _obj
    return result'

-- method AnnotFreeText::get_quadding
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Poppler" "AnnotFreeText", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Poppler" "AnnotFreeText", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Poppler" "AnnotFreeTextQuadding"
-- throws : False
-- Skip return : False

foreign import ccall "poppler_annot_free_text_get_quadding" poppler_annot_free_text_get_quadding :: 
    Ptr AnnotFreeText ->                    -- _obj : TInterface "Poppler" "AnnotFreeText"
    IO CUInt


annotFreeTextGetQuadding ::
    (MonadIO m, AnnotFreeTextK a) =>
    a ->                                    -- _obj
    m AnnotFreeTextQuadding
annotFreeTextGetQuadding _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- poppler_annot_free_text_get_quadding _obj'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr _obj
    return result'