{- |
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.Structs.ActionGotoDest
    ( 

-- * Exported types
    ActionGotoDest(..)                      ,
    noActionGotoDest                        ,


 -- * Properties
-- ** Dest
    actionGotoDestReadDest                  ,


-- ** Title
    actionGotoDestReadTitle                 ,


-- ** Type
    actionGotoDestReadType                  ,




    ) 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

newtype ActionGotoDest = ActionGotoDest (ForeignPtr ActionGotoDest)
noActionGotoDest :: Maybe ActionGotoDest
noActionGotoDest = Nothing

actionGotoDestReadType :: ActionGotoDest -> IO ActionType
actionGotoDestReadType s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO CUInt
    let val' = (toEnum . fromIntegral) val
    return val'

actionGotoDestReadTitle :: ActionGotoDest -> IO T.Text
actionGotoDestReadTitle s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO CString
    val' <- cstringToText val
    return val'

actionGotoDestReadDest :: ActionGotoDest -> IO Dest
actionGotoDestReadDest s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO (Ptr Dest)
    val' <- (newBoxed Dest) val
    return val'