{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)

/No description available in the introspection data./
-}

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

module GI.Poppler.Objects.AnnotScreen
    (

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


 -- * Methods
-- ** getAction #method:getAction#

#if ENABLE_OVERLOADING
    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.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.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 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

-- | Memory-managed wrapper type.
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


-- | Type class for types which can be safely cast to `AnnotScreen`, for instance with `toAnnotScreen`.
class (GObject o, O.IsDescendantOf AnnotScreen o) => IsAnnotScreen o
instance (GObject o, O.IsDescendantOf AnnotScreen o) => IsAnnotScreen o

instance O.HasParentTypes AnnotScreen
type instance O.ParentTypes AnnotScreen = '[Poppler.Annot.Annot, GObject.Object.Object]

-- | Cast to `AnnotScreen`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toAnnotScreen :: (MonadIO m, IsAnnotScreen o) => o -> m AnnotScreen
toAnnotScreen = liftIO . unsafeCastTo AnnotScreen

-- | A convenience alias for `Nothing` :: `Maybe` `AnnotScreen`.
noAnnotScreen :: Maybe AnnotScreen
noAnnotScreen = Nothing

#if ENABLE_OVERLOADING
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 "getv" o = GObject.Object.ObjectGetvMethodInfo
    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 "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) => OL.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

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

#if ENABLE_OVERLOADING
#endif

#if ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
data AnnotScreenGetActionMethodInfo
instance (signature ~ (m Poppler.Action.Action), MonadIO m, IsAnnotScreen a) => O.MethodInfo AnnotScreenGetActionMethodInfo a signature where
    overloadedMethod _ = annotScreenGetAction

#endif