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

-- * Exported types
    AnnotScreen(..)                         ,
    IsAnnotScreen                           ,
    toAnnotScreen                           ,
    noAnnotScreen                           ,


 -- * Methods
-- ** getAction #method:getAction#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    AnnotScreenGetActionMethodInfo          ,
#endif
    annotScreenGetAction                    ,




    ) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Poppler.Objects.Annot as Poppler.Annot
import {-# SOURCE #-} qualified GI.Poppler.Unions.Action as Poppler.Action

newtype AnnotScreen = AnnotScreen (ManagedPtr AnnotScreen)
foreign import ccall "poppler_annot_screen_get_type"
    c_poppler_annot_screen_get_type :: IO GType

instance GObject AnnotScreen where
    gobjectType _ = c_poppler_annot_screen_get_type
    

class GObject o => IsAnnotScreen o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError AnnotScreen a) =>
    IsAnnotScreen a
#endif
instance IsAnnotScreen AnnotScreen
instance Poppler.Annot.IsAnnot AnnotScreen
instance GObject.Object.IsObject AnnotScreen

toAnnotScreen :: (MonadIO m, IsAnnotScreen o) => o -> m AnnotScreen
toAnnotScreen = liftIO . unsafeCastTo AnnotScreen

noAnnotScreen :: Maybe AnnotScreen
noAnnotScreen = Nothing

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveAnnotScreenMethod (t :: Symbol) (o :: *) :: * where
    ResolveAnnotScreenMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveAnnotScreenMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveAnnotScreenMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveAnnotScreenMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveAnnotScreenMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveAnnotScreenMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveAnnotScreenMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveAnnotScreenMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveAnnotScreenMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveAnnotScreenMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveAnnotScreenMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveAnnotScreenMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveAnnotScreenMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveAnnotScreenMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveAnnotScreenMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveAnnotScreenMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveAnnotScreenMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveAnnotScreenMethod "getAction" o = AnnotScreenGetActionMethodInfo
    ResolveAnnotScreenMethod "getAnnotType" o = Poppler.Annot.AnnotGetAnnotTypeMethodInfo
    ResolveAnnotScreenMethod "getColor" o = Poppler.Annot.AnnotGetColorMethodInfo
    ResolveAnnotScreenMethod "getContents" o = Poppler.Annot.AnnotGetContentsMethodInfo
    ResolveAnnotScreenMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveAnnotScreenMethod "getFlags" o = Poppler.Annot.AnnotGetFlagsMethodInfo
    ResolveAnnotScreenMethod "getModified" o = Poppler.Annot.AnnotGetModifiedMethodInfo
    ResolveAnnotScreenMethod "getName" o = Poppler.Annot.AnnotGetNameMethodInfo
    ResolveAnnotScreenMethod "getPageIndex" o = Poppler.Annot.AnnotGetPageIndexMethodInfo
    ResolveAnnotScreenMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveAnnotScreenMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveAnnotScreenMethod "getRectangle" o = Poppler.Annot.AnnotGetRectangleMethodInfo
    ResolveAnnotScreenMethod "setColor" o = Poppler.Annot.AnnotSetColorMethodInfo
    ResolveAnnotScreenMethod "setContents" o = Poppler.Annot.AnnotSetContentsMethodInfo
    ResolveAnnotScreenMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveAnnotScreenMethod "setFlags" o = Poppler.Annot.AnnotSetFlagsMethodInfo
    ResolveAnnotScreenMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveAnnotScreenMethod "setRectangle" o = Poppler.Annot.AnnotSetRectangleMethodInfo
    ResolveAnnotScreenMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveAnnotScreenMethod t AnnotScreen, O.MethodInfo info AnnotScreen p) => O.IsLabelProxy t (AnnotScreen -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAnnotScreenMethod t AnnotScreen, O.MethodInfo info AnnotScreen p) => O.IsLabel t (AnnotScreen -> 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

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList AnnotScreen
type instance O.AttributeList AnnotScreen = AnnotScreenAttributeList
type AnnotScreenAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList AnnotScreen = AnnotScreenSignalList
type AnnotScreenSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method AnnotScreen::get_action
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotScreen"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotScreen", 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_annot_screen_get_action" poppler_annot_screen_get_action :: 
    Ptr AnnotScreen ->                      -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotScreen"})
    IO (Ptr Poppler.Action.Action)

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

@since 0.14
-}
annotScreenGetAction ::
    (B.CallStack.HasCallStack, MonadIO m, IsAnnotScreen a) =>
    a
    {- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotScreen.AnnotScreen' -}
    -> m Poppler.Action.Action
    {- ^ __Returns:__ the action to perform. The returned
              object is owned by /@popplerAnnot@/ and should not be freed -}
annotScreenGetAction popplerAnnot = liftIO $ do
    popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
    result <- poppler_annot_screen_get_action popplerAnnot'
    checkUnexpectedReturnNULL "annotScreenGetAction" result
    result' <- (newBoxed Poppler.Action.Action) result
    touchManagedPtr popplerAnnot
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AnnotScreenGetActionMethodInfo
instance (signature ~ (m Poppler.Action.Action), MonadIO m, IsAnnotScreen a) => O.MethodInfo AnnotScreenGetActionMethodInfo a signature where
    overloadedMethod _ = annotScreenGetAction

#endif