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

-- * Exported types
    AnnotMovie(..)                          ,
    IsAnnotMovie                            ,
    toAnnotMovie                            ,
    noAnnotMovie                            ,


 -- * Methods
-- ** getMovie #method:getMovie#

#if ENABLE_OVERLOADING
    AnnotMovieGetMovieMethodInfo            ,
#endif
    annotMovieGetMovie                      ,


-- ** getTitle #method:getTitle#

#if ENABLE_OVERLOADING
    AnnotMovieGetTitleMethodInfo            ,
#endif
    annotMovieGetTitle                      ,




    ) 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.Objects.Movie as Poppler.Movie

-- | Memory-managed wrapper type.
newtype AnnotMovie = AnnotMovie (ManagedPtr AnnotMovie)
foreign import ccall "poppler_annot_movie_get_type"
    c_poppler_annot_movie_get_type :: IO GType

instance GObject AnnotMovie where
    gobjectType = c_poppler_annot_movie_get_type


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

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

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

-- | A convenience alias for `Nothing` :: `Maybe` `AnnotMovie`.
noAnnotMovie :: Maybe AnnotMovie
noAnnotMovie = Nothing

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

instance (info ~ ResolveAnnotMovieMethod t AnnotMovie, O.MethodInfo info AnnotMovie p) => OL.IsLabel t (AnnotMovie -> 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 AnnotMovie
type instance O.AttributeList AnnotMovie = AnnotMovieAttributeList
type AnnotMovieAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
#endif

#if ENABLE_OVERLOADING
type instance O.SignalList AnnotMovie = AnnotMovieSignalList
type AnnotMovieSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method AnnotMovie::get_movie
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMovie"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMovie", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "Movie"}))
-- throws : False
-- Skip return : False

foreign import ccall "poppler_annot_movie_get_movie" poppler_annot_movie_get_movie ::
    Ptr AnnotMovie ->                       -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMovie"})
    IO (Ptr Poppler.Movie.Movie)

{- |
Retrieves the movie object (PopplerMovie) stored in the /@popplerAnnot@/.

/Since: 0.14/
-}
annotMovieGetMovie ::
    (B.CallStack.HasCallStack, MonadIO m, IsAnnotMovie a) =>
    a
    {- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMovie.AnnotMovie' -}
    -> m Poppler.Movie.Movie
    {- ^ __Returns:__ the movie object stored in the /@popplerAnnot@/. The returned
              object is owned by 'GI.Poppler.Objects.AnnotMovie.AnnotMovie' and should not be freed -}
annotMovieGetMovie popplerAnnot = liftIO $ do
    popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
    result <- poppler_annot_movie_get_movie popplerAnnot'
    checkUnexpectedReturnNULL "annotMovieGetMovie" result
    result' <- (newObject Poppler.Movie.Movie) result
    touchManagedPtr popplerAnnot
    return result'

#if ENABLE_OVERLOADING
data AnnotMovieGetMovieMethodInfo
instance (signature ~ (m Poppler.Movie.Movie), MonadIO m, IsAnnotMovie a) => O.MethodInfo AnnotMovieGetMovieMethodInfo a signature where
    overloadedMethod _ = annotMovieGetMovie

#endif

-- method AnnotMovie::get_title
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMovie"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMovie", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "poppler_annot_movie_get_title" poppler_annot_movie_get_title ::
    Ptr AnnotMovie ->                       -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMovie"})
    IO CString

{- |
Retrieves the movie title of /@popplerAnnot@/.

/Since: 0.14/
-}
annotMovieGetTitle ::
    (B.CallStack.HasCallStack, MonadIO m, IsAnnotMovie a) =>
    a
    {- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMovie.AnnotMovie' -}
    -> m T.Text
    {- ^ __Returns:__ the title text of /@popplerAnnot@/. -}
annotMovieGetTitle popplerAnnot = liftIO $ do
    popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
    result <- poppler_annot_movie_get_title popplerAnnot'
    checkUnexpectedReturnNULL "annotMovieGetTitle" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr popplerAnnot
    return result'

#if ENABLE_OVERLOADING
data AnnotMovieGetTitleMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAnnotMovie a) => O.MethodInfo AnnotMovieGetTitleMethodInfo a signature where
    overloadedMethod _ = annotMovieGetTitle

#endif