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

-- * Exported types
    ActionOCGState(..)                      ,
    noActionOCGState                        ,


 -- * Properties
-- ** StateList
    actionOCGStateReadStateList             ,


-- ** Title
    actionOCGStateReadTitle                 ,


-- ** Type
    actionOCGStateReadType                  ,




    ) 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 ActionOCGState = ActionOCGState (ForeignPtr ActionOCGState)
noActionOCGState :: Maybe ActionOCGState
noActionOCGState = Nothing

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

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

actionOCGStateReadStateList :: ActionOCGState -> IO ([Ptr ()])
actionOCGStateReadStateList s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO (Ptr (GList (Ptr ())))
    val' <- unpackGList val
    return val'