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

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


 -- * Methods
-- ** getMovie #method:getMovie#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    AnnotMovieGetMovieMethodInfo            ,
#endif
    annotMovieGetMovie                      ,


-- ** getTitle #method:getTitle#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    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.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.Objects.Movie as Poppler.Movie

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
    

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

toAnnotMovie :: (MonadIO m, IsAnnotMovie o) => o -> m AnnotMovie
toAnnotMovie = liftIO . unsafeCastTo AnnotMovie

noAnnotMovie :: Maybe AnnotMovie
noAnnotMovie = Nothing

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveAnnotMovieMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    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) => O.IsLabelProxy t (AnnotMovie -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

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

#endif

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

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AnnotMovieGetTitleMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAnnotMovie a) => O.MethodInfo AnnotMovieGetTitleMethodInfo a signature where
    overloadedMethod _ = annotMovieGetTitle

#endif