    {-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}

    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- Provides content for the clipboard or for drag-and-drop operations
    -- in a number of formats.
    --
    -- To create a @GdkContentProvider@, use 'GI.Gdk.Objects.ContentProvider.contentProviderNewForValue'
    -- or 'GI.Gdk.Objects.ContentProvider.contentProviderNewForBytes'.
    --
    -- GDK knows how to handle common text and image formats out-of-the-box. See
    -- t'GI.Gdk.Objects.ContentSerializer.ContentSerializer' and t'GI.Gdk.Objects.ContentDeserializer.ContentDeserializer' if you want
    -- to add support for application-specific data formats.

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

    module GI.Gdk.Objects.ContentProvider
        (

    -- * Exported types
        ContentProvider(..)                     ,
        IsContentProvider                       ,
        toContentProvider                       ,

     -- * Methods
    -- |
    --
    --  === __Click to display all available methods, including inherited ones__
    -- ==== Methods
    -- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [contentChanged]("GI.Gdk.Objects.ContentProvider#g:method:contentChanged"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refFormats]("GI.Gdk.Objects.ContentProvider#g:method:refFormats"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [refStorableFormats]("GI.Gdk.Objects.ContentProvider#g:method:refStorableFormats"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure"), [writeMimeTypeAsync]("GI.Gdk.Objects.ContentProvider#g:method:writeMimeTypeAsync"), [writeMimeTypeFinish]("GI.Gdk.Objects.ContentProvider#g:method:writeMimeTypeFinish").
    --
    -- ==== Getters
    -- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getValue]("GI.Gdk.Objects.ContentProvider#g:method:getValue").
    --
    -- ==== Setters
    -- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

    #if defined(ENABLE_OVERLOADING)
        ResolveContentProviderMethod            ,
    #endif

    -- ** contentChanged #method:contentChanged#

    #if defined(ENABLE_OVERLOADING)
        ContentProviderContentChangedMethodInfo ,
    #endif
        contentProviderContentChanged           ,

    -- ** getValue #method:getValue#

    #if defined(ENABLE_OVERLOADING)
        ContentProviderGetValueMethodInfo       ,
    #endif
        contentProviderGetValue                 ,

    -- ** newForBytes #method:newForBytes#

        contentProviderNewForBytes              ,

    -- ** newForValue #method:newForValue#

        contentProviderNewForValue              ,

    -- ** newUnion #method:newUnion#

        contentProviderNewUnion                 ,

    -- ** refFormats #method:refFormats#

    #if defined(ENABLE_OVERLOADING)
        ContentProviderRefFormatsMethodInfo     ,
    #endif
        contentProviderRefFormats               ,

    -- ** refStorableFormats #method:refStorableFormats#

    #if defined(ENABLE_OVERLOADING)
        ContentProviderRefStorableFormatsMethodInfo,
    #endif
        contentProviderRefStorableFormats       ,

    -- ** writeMimeTypeAsync #method:writeMimeTypeAsync#

    #if defined(ENABLE_OVERLOADING)
        ContentProviderWriteMimeTypeAsyncMethodInfo,
    #endif
        contentProviderWriteMimeTypeAsync       ,

    -- ** writeMimeTypeFinish #method:writeMimeTypeFinish#

    #if defined(ENABLE_OVERLOADING)
        ContentProviderWriteMimeTypeFinishMethodInfo,
    #endif
        contentProviderWriteMimeTypeFinish      ,

     -- * Properties

    -- ** formats #attr:formats#
    -- | The possible formats that the provider can provide its data in.

    #if defined(ENABLE_OVERLOADING)
        ContentProviderFormatsPropertyInfo      ,
    #endif
    #if defined(ENABLE_OVERLOADING)
        contentProviderFormats                  ,
    #endif
        getContentProviderFormats               ,

    -- ** storableFormats #attr:storableFormats#
    -- | The subset of formats that clipboard managers should store this provider\'s data in.

    #if defined(ENABLE_OVERLOADING)
        ContentProviderStorableFormatsPropertyInfo,
    #endif
    #if defined(ENABLE_OVERLOADING)
        contentProviderStorableFormats          ,
    #endif
        getContentProviderStorableFormats       ,

     -- * Signals

    -- ** contentChanged #signal:contentChanged#

        ContentProviderContentChangedCallback   ,
    #if defined(ENABLE_OVERLOADING)
        ContentProviderContentChangedSignalInfo ,
    #endif
        afterContentProviderContentChanged      ,
        onContentProviderContentChanged         ,

        ) 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.BasicTypes as B.Types
    import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
    import qualified Data.GI.Base.GArray as B.GArray
    import qualified Data.GI.Base.GClosure as B.GClosure
    import qualified Data.GI.Base.GError as B.GError
    import qualified Data.GI.Base.GHashTable as B.GHT
    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.GI.Base.Signals as B.Signals
    import qualified Control.Monad.IO.Class as MIO
    import qualified Data.Coerce as Coerce
    import qualified Data.Text as T
    import qualified Data.Kind as DK
    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 GHC.Records as R
    import qualified Data.Word as DW
    import qualified Data.Int as DI
    import qualified System.Posix.Types as SPT
    import qualified Foreign.C.Types as FCT

    -- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
    #if MIN_VERSION_base(4,18,0)
    import qualified GI.GLib.Structs.Bytes as GLib.Bytes
    import qualified GI.GLib.Structs.String as GLib.String
    import qualified GI.GObject.Objects.Object as GObject.Object
    import {-# SOURCE #-} qualified GI.Gdk.Structs.ContentFormats as Gdk.ContentFormats
    import qualified GI.Gio.Callbacks as Gio.Callbacks
    import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
    import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
    import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream

    #else
    import qualified GI.GLib.Structs.Bytes as GLib.Bytes
    import qualified GI.GObject.Objects.Object as GObject.Object
    import {-# SOURCE #-} qualified GI.Gdk.Structs.ContentFormats as Gdk.ContentFormats
    import qualified GI.Gio.Callbacks as Gio.Callbacks
    import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
    import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
    import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream

    #endif

    -- | Memory-managed wrapper type.
    newtype ContentProvider = ContentProvider (SP.ManagedPtr ContentProvider)
        deriving (ContentProvider -> ContentProvider -> Bool
    (ContentProvider -> ContentProvider -> Bool)
    -> (ContentProvider -> ContentProvider -> Bool)
    -> Eq ContentProvider
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ContentProvider -> ContentProvider -> Bool
    == :: ContentProvider -> ContentProvider -> Bool
    $c/= :: ContentProvider -> ContentProvider -> Bool
    /= :: ContentProvider -> ContentProvider -> Bool
    Eq)

    instance SP.ManagedPtrNewtype ContentProvider where
        toManagedPtr :: ContentProvider -> ManagedPtr ContentProvider
    toManagedPtr (ContentProvider ManagedPtr ContentProvider
    p) = ManagedPtr ContentProvider
    p

    foreign import ccall "gdk_content_provider_get_type"
        c_gdk_content_provider_get_type :: IO B.Types.GType

    instance B.Types.TypedObject ContentProvider where
        glibType :: IO GType
    glibType = IO GType
    c_gdk_content_provider_get_type

    instance B.Types.GObject ContentProvider

    -- | Type class for types which can be safely cast to t'ContentProvider', for instance with `toContentProvider`.
    class (SP.GObject o, O.IsDescendantOf ContentProvider o) => IsContentProvider o
    instance (SP.GObject o, O.IsDescendantOf ContentProvider o) => IsContentProvider o

    instance O.HasParentTypes ContentProvider
    type instance O.ParentTypes ContentProvider = '[GObject.Object.Object]

    -- | Cast to t'ContentProvider', for types for which this is known to be safe. For general casts, use 'Data.GI.Base.ManagedPtr.castTo'.
    toContentProvider :: (MIO.MonadIO m, IsContentProvider o) => o -> m ContentProvider
    toContentProvider :: forall (m :: * -> *) o.
    (MonadIO m, IsContentProvider o) =>
    o -> m ContentProvider
    toContentProvider = IO ContentProvider -> m ContentProvider
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO ContentProvider -> m ContentProvider)
    -> (o -> IO ContentProvider) -> o -> m ContentProvider
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (ManagedPtr ContentProvider -> ContentProvider)
    -> o -> IO ContentProvider
    forall o o'.
    (HasCallStack, ManagedPtrNewtype o, TypedObject o,
     ManagedPtrNewtype o', TypedObject o') =>
    (ManagedPtr o' -> o') -> o -> IO o'
    B.ManagedPtr.unsafeCastTo ManagedPtr ContentProvider -> ContentProvider
    ContentProvider

    -- | Convert t'ContentProvider' to and from t'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
    instance B.GValue.IsGValue (Maybe ContentProvider) where
        gvalueGType_ :: IO GType
    gvalueGType_ = IO GType
    c_gdk_content_provider_get_type
        gvalueSet_ :: Ptr GValue -> Maybe ContentProvider -> IO ()
    gvalueSet_ Ptr GValue
    gv Maybe ContentProvider
    P.Nothing = Ptr GValue -> Ptr ContentProvider -> IO ()
    forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
    B.GValue.set_object Ptr GValue
    gv (Ptr ContentProvider
    forall a. Ptr a
    FP.nullPtr :: FP.Ptr ContentProvider)
        gvalueSet_ Ptr GValue
    gv (P.Just ContentProvider
    obj) = ContentProvider -> (Ptr ContentProvider -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    B.ManagedPtr.withManagedPtr ContentProvider
    obj (Ptr GValue -> Ptr ContentProvider -> IO ()
    forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
    B.GValue.set_object Ptr GValue
    gv)
        gvalueGet_ :: Ptr GValue -> IO (Maybe ContentProvider)
    gvalueGet_ Ptr GValue
    gv = do
            ptr <- Ptr GValue -> IO (Ptr ContentProvider)
    forall a. GObject a => Ptr GValue -> IO (Ptr a)
    B.GValue.get_object Ptr GValue
    gv :: IO (FP.Ptr ContentProvider)
            if ptr /= FP.nullPtr
            then P.Just <$> B.ManagedPtr.newObject ContentProvider ptr
            else return P.Nothing

    #if defined(ENABLE_OVERLOADING)
    type family ResolveContentProviderMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
        ResolveContentProviderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
        ResolveContentProviderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
        ResolveContentProviderMethod "contentChanged" o = ContentProviderContentChangedMethodInfo
        ResolveContentProviderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
        ResolveContentProviderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
        ResolveContentProviderMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
        ResolveContentProviderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
        ResolveContentProviderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
        ResolveContentProviderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
        ResolveContentProviderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
        ResolveContentProviderMethod "refFormats" o = ContentProviderRefFormatsMethodInfo
        ResolveContentProviderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
        ResolveContentProviderMethod "refStorableFormats" o = ContentProviderRefStorableFormatsMethodInfo
        ResolveContentProviderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
        ResolveContentProviderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
        ResolveContentProviderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
        ResolveContentProviderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
        ResolveContentProviderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
        ResolveContentProviderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
        ResolveContentProviderMethod "writeMimeTypeAsync" o = ContentProviderWriteMimeTypeAsyncMethodInfo
        ResolveContentProviderMethod "writeMimeTypeFinish" o = ContentProviderWriteMimeTypeFinishMethodInfo
        ResolveContentProviderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
        ResolveContentProviderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
        ResolveContentProviderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
        ResolveContentProviderMethod "getValue" o = ContentProviderGetValueMethodInfo
        ResolveContentProviderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
        ResolveContentProviderMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
        ResolveContentProviderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
        ResolveContentProviderMethod l o = O.MethodResolutionFailed l o

    instance (info ~ ResolveContentProviderMethod t ContentProvider, O.OverloadedMethod info ContentProvider p) => OL.IsLabel t (ContentProvider -> p) where
    #if MIN_VERSION_base(4,10,0)
        fromLabel = O.overloadedMethod @info
    #else
        fromLabel _ = O.overloadedMethod @info
    #endif

    #if MIN_VERSION_base(4,13,0)
    instance (info ~ ResolveContentProviderMethod t ContentProvider, O.OverloadedMethod info ContentProvider p, R.HasField t ContentProvider p) => R.HasField t ContentProvider p where
        getField = O.overloadedMethod @info

    #endif

    instance (info ~ ResolveContentProviderMethod t ContentProvider, O.OverloadedMethodInfo info ContentProvider) => OL.IsLabel t (O.MethodProxy info ContentProvider) where
    #if MIN_VERSION_base(4,10,0)
        fromLabel = O.MethodProxy
    #else
        fromLabel _ = O.MethodProxy
    #endif

    #endif

    -- signal ContentProvider::content-changed
    -- | Emitted whenever the content provided by this provider has changed.
    type ContentProviderContentChangedCallback =
        IO ()

    type C_ContentProviderContentChangedCallback =
        Ptr ContentProvider ->                  -- object
        Ptr () ->                               -- user_data
        IO ()

    -- | Generate a function pointer callable from C code, from a `C_ContentProviderContentChangedCallback`.
    foreign import ccall "wrapper"
        mk_ContentProviderContentChangedCallback :: C_ContentProviderContentChangedCallback -> IO (FunPtr C_ContentProviderContentChangedCallback)

    wrap_ContentProviderContentChangedCallback ::
        GObject a => (a -> ContentProviderContentChangedCallback) ->
        C_ContentProviderContentChangedCallback
    wrap_ContentProviderContentChangedCallback :: forall a.
    GObject a =>
    (a -> IO ()) -> C_ContentProviderContentChangedCallback
    wrap_ContentProviderContentChangedCallback a -> IO ()
    gi'cb Ptr ContentProvider
    gi'selfPtr Ptr ()
    _ = do
        Ptr ContentProvider -> (ContentProvider -> IO ()) -> IO ()
    forall o b.
    (HasCallStack, GObject o) =>
    Ptr o -> (o -> IO b) -> IO b
    B.ManagedPtr.withNewObject Ptr ContentProvider
    gi'selfPtr ((ContentProvider -> IO ()) -> IO ())
    -> (ContentProvider -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \ContentProvider
    gi'self -> a -> IO ()
    gi'cb (ContentProvider -> a
    forall a b. Coercible a b => a -> b
    Coerce.coerce ContentProvider
    gi'self)

    -- | Connect a signal handler for the [contentChanged](#signal:contentChanged) signal, to be run before the default handler.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Signals.on' contentProvider #contentChanged callback
    -- @
    --
    --
    onContentProviderContentChanged :: (IsContentProvider a, MonadIO m) => a -> ((?self :: a) => ContentProviderContentChangedCallback) -> m SignalHandlerId
    onContentProviderContentChanged :: forall a (m :: * -> *).
    (IsContentProvider a, MonadIO m) =>
    a -> ((?self::a) => IO ()) -> m SignalHandlerId
    onContentProviderContentChanged a
    obj (?self::a) => IO ()
    cb = IO SignalHandlerId -> m SignalHandlerId
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO SignalHandlerId -> m SignalHandlerId)
    -> IO SignalHandlerId -> m SignalHandlerId
    forall a b. (a -> b) -> a -> b
    $ do
        let wrapped :: a -> IO ()
    wrapped a
    self = let ?self = a
    ?self::a
    self in IO ()
    (?self::a) => IO ()
    cb
        let wrapped' :: C_ContentProviderContentChangedCallback
    wrapped' = (a -> IO ()) -> C_ContentProviderContentChangedCallback
    forall a.
    GObject a =>
    (a -> IO ()) -> C_ContentProviderContentChangedCallback
    wrap_ContentProviderContentChangedCallback a -> IO ()
    wrapped
        wrapped'' <- C_ContentProviderContentChangedCallback
    -> IO (FunPtr C_ContentProviderContentChangedCallback)
    mk_ContentProviderContentChangedCallback C_ContentProviderContentChangedCallback
    wrapped'
        connectSignalFunPtr obj "content-changed" wrapped'' SignalConnectBefore Nothing

    -- | Connect a signal handler for the [contentChanged](#signal:contentChanged) signal, to be run after the default handler.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Signals.after' contentProvider #contentChanged callback
    -- @
    --
    --
    --
    -- By default the object invoking the signal is not passed to the callback.
    -- If you need to access it, you can use the implit @?self@ parameter.
    -- Note that this requires activating the @ImplicitParams@ GHC extension.
    --
    afterContentProviderContentChanged :: (IsContentProvider a, MonadIO m) => a -> ((?self :: a) => ContentProviderContentChangedCallback) -> m SignalHandlerId
    afterContentProviderContentChanged :: forall a (m :: * -> *).
    (IsContentProvider a, MonadIO m) =>
    a -> ((?self::a) => IO ()) -> m SignalHandlerId
    afterContentProviderContentChanged a
    obj (?self::a) => IO ()
    cb = IO SignalHandlerId -> m SignalHandlerId
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO SignalHandlerId -> m SignalHandlerId)
    -> IO SignalHandlerId -> m SignalHandlerId
    forall a b. (a -> b) -> a -> b
    $ do
        let wrapped :: a -> IO ()
    wrapped a
    self = let ?self = a
    ?self::a
    self in IO ()
    (?self::a) => IO ()
    cb
        let wrapped' :: C_ContentProviderContentChangedCallback
    wrapped' = (a -> IO ()) -> C_ContentProviderContentChangedCallback
    forall a.
    GObject a =>
    (a -> IO ()) -> C_ContentProviderContentChangedCallback
    wrap_ContentProviderContentChangedCallback a -> IO ()
    wrapped
        wrapped'' <- C_ContentProviderContentChangedCallback
    -> IO (FunPtr C_ContentProviderContentChangedCallback)
    mk_ContentProviderContentChangedCallback C_ContentProviderContentChangedCallback
    wrapped'
        connectSignalFunPtr obj "content-changed" wrapped'' SignalConnectAfter Nothing

    #if defined(ENABLE_OVERLOADING)
    data ContentProviderContentChangedSignalInfo
    instance SignalInfo ContentProviderContentChangedSignalInfo where
        type HaskellCallbackType ContentProviderContentChangedSignalInfo = ContentProviderContentChangedCallback
        connectSignal obj cb connectMode detail = do
            let cb' = wrap_ContentProviderContentChangedCallback cb
            cb'' <- mk_ContentProviderContentChangedCallback cb'
            connectSignalFunPtr obj "content-changed" cb'' connectMode detail
        dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider::content-changed"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Objects-ContentProvider.html#g:signal:contentChanged"})

    #endif

    -- VVV Prop "formats"
       -- Type: TInterface (Name {namespace = "Gdk", name = "ContentFormats"})
       -- Flags: [PropertyReadable]
       -- Nullable: (Nothing,Nothing)

    -- | Get the value of the “@formats@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' contentProvider #formats
    -- @
    getContentProviderFormats :: (MonadIO m, IsContentProvider o) => o -> m (Maybe Gdk.ContentFormats.ContentFormats)
    getContentProviderFormats :: forall (m :: * -> *) o.
    (MonadIO m, IsContentProvider o) =>
    o -> m (Maybe ContentFormats)
    getContentProviderFormats o
    obj = IO (Maybe ContentFormats) -> m (Maybe ContentFormats)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO (Maybe ContentFormats) -> m (Maybe ContentFormats))
    -> IO (Maybe ContentFormats) -> m (Maybe ContentFormats)
    forall a b. (a -> b) -> a -> b
    $ o
    -> String
    -> (ManagedPtr ContentFormats -> ContentFormats)
    -> IO (Maybe ContentFormats)
    forall a b.
    (GObject a, GBoxed b) =>
    a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
    B.Properties.getObjectPropertyBoxed o
    obj String
    "formats" ManagedPtr ContentFormats -> ContentFormats
    Gdk.ContentFormats.ContentFormats

    #if defined(ENABLE_OVERLOADING)
    data ContentProviderFormatsPropertyInfo
    instance AttrInfo ContentProviderFormatsPropertyInfo where
        type AttrAllowedOps ContentProviderFormatsPropertyInfo = '[ 'AttrGet, 'AttrClear]
        type AttrBaseTypeConstraint ContentProviderFormatsPropertyInfo = IsContentProvider
        type AttrSetTypeConstraint ContentProviderFormatsPropertyInfo = (~) ()
        type AttrTransferTypeConstraint ContentProviderFormatsPropertyInfo = (~) ()
        type AttrTransferType ContentProviderFormatsPropertyInfo = ()
        type AttrGetType ContentProviderFormatsPropertyInfo = (Maybe Gdk.ContentFormats.ContentFormats)
        type AttrLabel ContentProviderFormatsPropertyInfo = "formats"
        type AttrOrigin ContentProviderFormatsPropertyInfo = ContentProvider
        attrGet = getContentProviderFormats
        attrSet = undefined
        attrPut = undefined
        attrTransfer _ = undefined
        attrConstruct = undefined
        attrClear = undefined
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.formats"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Objects-ContentProvider.html#g:attr:formats"
            })
    #endif

    -- VVV Prop "storable-formats"
       -- Type: TInterface (Name {namespace = "Gdk", name = "ContentFormats"})
       -- Flags: [PropertyReadable]
       -- Nullable: (Nothing,Nothing)

    -- | Get the value of the “@storable-formats@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' contentProvider #storableFormats
    -- @
    getContentProviderStorableFormats :: (MonadIO m, IsContentProvider o) => o -> m (Maybe Gdk.ContentFormats.ContentFormats)
    getContentProviderStorableFormats :: forall (m :: * -> *) o.
    (MonadIO m, IsContentProvider o) =>
    o -> m (Maybe ContentFormats)
    getContentProviderStorableFormats o
    obj = IO (Maybe ContentFormats) -> m (Maybe ContentFormats)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO (Maybe ContentFormats) -> m (Maybe ContentFormats))
    -> IO (Maybe ContentFormats) -> m (Maybe ContentFormats)
    forall a b. (a -> b) -> a -> b
    $ o
    -> String
    -> (ManagedPtr ContentFormats -> ContentFormats)
    -> IO (Maybe ContentFormats)
    forall a b.
    (GObject a, GBoxed b) =>
    a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
    B.Properties.getObjectPropertyBoxed o
    obj String
    "storable-formats" ManagedPtr ContentFormats -> ContentFormats
    Gdk.ContentFormats.ContentFormats

    #if defined(ENABLE_OVERLOADING)
    data ContentProviderStorableFormatsPropertyInfo
    instance AttrInfo ContentProviderStorableFormatsPropertyInfo where
        type AttrAllowedOps ContentProviderStorableFormatsPropertyInfo = '[ 'AttrGet, 'AttrClear]
        type AttrBaseTypeConstraint ContentProviderStorableFormatsPropertyInfo = IsContentProvider
        type AttrSetTypeConstraint ContentProviderStorableFormatsPropertyInfo = (~) ()
        type AttrTransferTypeConstraint ContentProviderStorableFormatsPropertyInfo = (~) ()
        type AttrTransferType ContentProviderStorableFormatsPropertyInfo = ()
        type AttrGetType ContentProviderStorableFormatsPropertyInfo = (Maybe Gdk.ContentFormats.ContentFormats)
        type AttrLabel ContentProviderStorableFormatsPropertyInfo = "storable-formats"
        type AttrOrigin ContentProviderStorableFormatsPropertyInfo = ContentProvider
        attrGet = getContentProviderStorableFormats
        attrSet = undefined
        attrPut = undefined
        attrTransfer _ = undefined
        attrConstruct = undefined
        attrClear = undefined
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.storableFormats"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Objects-ContentProvider.html#g:attr:storableFormats"
            })
    #endif

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList ContentProvider
    type instance O.AttributeList ContentProvider = ContentProviderAttributeList
    type ContentProviderAttributeList = ('[ '("formats", ContentProviderFormatsPropertyInfo), '("storableFormats", ContentProviderStorableFormatsPropertyInfo)] :: [(Symbol, DK.Type)])
    #endif

    #if defined(ENABLE_OVERLOADING)
    contentProviderFormats :: AttrLabelProxy "formats"
    contentProviderFormats = AttrLabelProxy

    contentProviderStorableFormats :: AttrLabelProxy "storableFormats"
    contentProviderStorableFormats = AttrLabelProxy

    #endif

    #if defined(ENABLE_OVERLOADING)
    type instance O.SignalList ContentProvider = ContentProviderSignalList
    type ContentProviderSignalList = ('[ '("contentChanged", ContentProviderContentChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

    #endif

    -- method ContentProvider::new_for_bytes
    -- method type : Constructor
    -- Args: [ Arg
    --           { argCName = "mime_type"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const char*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the mime type" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "bytes"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
    --           , argCType = Just "GBytes*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GBytes` with the data for @mime_type"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just
    --               (TInterface Name { namespace = "Gdk" , name = "ContentProvider" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_content_provider_new_for_bytes" gdk_content_provider_new_for_bytes ::
        CString ->                              -- mime_type : TBasicType TUTF8
        Ptr GLib.Bytes.Bytes ->                 -- bytes : TInterface (Name {namespace = "GLib", name = "Bytes"})
        IO (Ptr ContentProvider)

    -- | Create a content provider that provides the given /@bytes@/ as data for
    -- the given /@mimeType@/.
    contentProviderNewForBytes ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        T.Text
        -- ^ /@mimeType@/: the mime type
        -> GLib.Bytes.Bytes
        -- ^ /@bytes@/: a @GBytes@ with the data for /@mimeType@/
        -> m ContentProvider
        -- ^ __Returns:__ a new @GdkContentProvider@
    contentProviderNewForBytes :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Text -> Bytes -> m ContentProvider
    contentProviderNewForBytes Text
    mimeType Bytes
    bytes = IO ContentProvider -> m ContentProvider
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO ContentProvider -> m ContentProvider)
    -> IO ContentProvider -> m ContentProvider
    forall a b. (a -> b) -> a -> b
    $ do
        mimeType' <- Text -> IO CString
    textToCString Text
    mimeType
        bytes' <- unsafeManagedPtrGetPtr bytes
        result <- gdk_content_provider_new_for_bytes mimeType' bytes'
        checkUnexpectedReturnNULL "contentProviderNewForBytes" result
        result' <- (wrapObject ContentProvider) result
        touchManagedPtr bytes
        freeMem mimeType'
        return result'

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method ContentProvider::new_for_value
    -- method type : Constructor
    -- Args: [ Arg
    --           { argCName = "value"
    --           , argType = TGValue
    --           , argCType = Just "const GValue*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GValue`" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just
    --               (TInterface Name { namespace = "Gdk" , name = "ContentProvider" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_content_provider_new_for_value" gdk_content_provider_new_for_value ::
        Ptr GValue ->                           -- value : TGValue
        IO (Ptr ContentProvider)

    -- | Create a content provider that provides the given /@value@/.
    contentProviderNewForValue ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        GValue
        -- ^ /@value@/: a @GValue@
        -> m ContentProvider
        -- ^ __Returns:__ a new @GdkContentProvider@
    contentProviderNewForValue :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    GValue -> m ContentProvider
    contentProviderNewForValue GValue
    value = IO ContentProvider -> m ContentProvider
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO ContentProvider -> m ContentProvider)
    -> IO ContentProvider -> m ContentProvider
    forall a b. (a -> b) -> a -> b
    $ do
        value' <- GValue -> IO (Ptr GValue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr GValue
    value
        result <- gdk_content_provider_new_for_value value'
        checkUnexpectedReturnNULL "contentProviderNewForValue" result
        result' <- (wrapObject ContentProvider) result
        touchManagedPtr value
        return result'

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method ContentProvider::new_union
    -- method type : Constructor
    -- Args: [ Arg
    --           { argCName = "providers"
    --           , argType =
    --               TCArray
    --                 False
    --                 (-1)
    --                 1
    --                 (TInterface Name { namespace = "Gdk" , name = "ContentProvider" })
    --           , argCType = Just "GdkContentProvider**"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just "\n  The `GdkContentProvider`s to present the union of"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferEverything
    --           }
    --       , Arg
    --           { argCName = "n_providers"
    --           , argType = TBasicType TSize
    --           , argCType = Just "gsize"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the number of providers"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: [ Arg
    --              { argCName = "n_providers"
    --              , argType = TBasicType TSize
    --              , argCType = Just "gsize"
    --              , direction = DirectionIn
    --              , mayBeNull = False
    --              , argDoc =
    --                  Documentation
    --                    { rawDocText = Just "the number of providers"
    --                    , sinceVersion = Nothing
    --                    }
    --              , argScope = ScopeTypeInvalid
    --              , argClosure = -1
    --              , argDestroy = -1
    --              , argCallerAllocates = False
    --              , argCallbackUserData = False
    --              , transfer = TransferNothing
    --              }
    --          ]
    -- returnType: Just
    --               (TInterface Name { namespace = "Gdk" , name = "ContentProvider" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_content_provider_new_union" gdk_content_provider_new_union ::
        Ptr (Ptr ContentProvider) ->            -- providers : TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "ContentProvider"}))
        FCT.CSize ->                            -- n_providers : TBasicType TSize
        IO (Ptr ContentProvider)

    -- | Creates a content provider that represents all the given /@providers@/.
    --
    -- Whenever data needs to be written, the union provider will try the given
    -- /@providers@/ in the given order and the first one supporting a format will
    -- be chosen to provide it.
    --
    -- This allows an easy way to support providing data in different formats.
    -- For example, an image may be provided by its file and by the image
    -- contents with a call such as
    --
    -- === /c code/
    -- >gdk_content_provider_new_union ((GdkContentProvider *[2]) {
    -- >                                  gdk_content_provider_new_typed (G_TYPE_FILE, file),
    -- >                                  gdk_content_provider_new_typed (GDK_TYPE_TEXTURE, texture)
    -- >                                }, 2);
    contentProviderNewUnion ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Maybe ([ContentProvider])
        -- ^ /@providers@/:
        --   The @GdkContentProvider@s to present the union of
        -> m ContentProvider
        -- ^ __Returns:__ a new @GdkContentProvider@
    contentProviderNewUnion :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Maybe [ContentProvider] -> m ContentProvider
    contentProviderNewUnion Maybe [ContentProvider]
    providers = IO ContentProvider -> m ContentProvider
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO ContentProvider -> m ContentProvider)
    -> IO ContentProvider -> m ContentProvider
    forall a b. (a -> b) -> a -> b
    $ do
        let nProviders :: CSize
    nProviders = case Maybe [ContentProvider]
    providers of
                Maybe [ContentProvider]
    Nothing -> CSize
    0
                Just [ContentProvider]
    jProviders -> Int -> CSize
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CSize) -> Int -> CSize
    forall a b. (a -> b) -> a -> b
    $ [ContentProvider] -> Int
    forall a. [a] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    P.length [ContentProvider]
    jProviders
        maybeProviders <- case Maybe [ContentProvider]
    providers of
            Maybe [ContentProvider]
    Nothing -> Ptr (Ptr ContentProvider) -> IO (Ptr (Ptr ContentProvider))
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr (Ptr ContentProvider)
    forall a. Ptr a
    FP.nullPtr
            Just [ContentProvider]
    jProviders -> do
                jProviders' <- (ContentProvider -> IO (Ptr ContentProvider))
    -> [ContentProvider] -> IO [Ptr ContentProvider]
    forall (t :: * -> *) (m :: * -> *) a b.
    (Traversable t, Monad m) =>
    (a -> m b) -> t a -> m (t b)
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
    mapM ContentProvider -> IO (Ptr ContentProvider)
    forall a b. (HasCallStack, GObject a) => a -> IO (Ptr b)
    B.ManagedPtr.disownObject [ContentProvider]
    jProviders
                jProviders'' <- packPtrArray jProviders'
                return jProviders''
        result <- gdk_content_provider_new_union maybeProviders nProviders
        checkUnexpectedReturnNULL "contentProviderNewUnion" result
        result' <- (wrapObject ContentProvider) result
        whenJust providers (mapM_ touchManagedPtr)
        return result'

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method ContentProvider::content_changed
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "provider"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "ContentProvider" }
    --           , argCType = Just "GdkContentProvider*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkContentProvider`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_content_provider_content_changed" gdk_content_provider_content_changed ::
        Ptr ContentProvider ->                  -- provider : TInterface (Name {namespace = "Gdk", name = "ContentProvider"})
        IO ()

    -- | Emits the [contentChanged](#g:signal:contentChanged) signal.
    contentProviderContentChanged ::
        (B.CallStack.HasCallStack, MonadIO m, IsContentProvider a) =>
        a
        -- ^ /@provider@/: a @GdkContentProvider@
        -> m ()
    contentProviderContentChanged :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsContentProvider a) =>
    a -> m ()
    contentProviderContentChanged a
    provider = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        provider' <- a -> IO (Ptr ContentProvider)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    provider
        gdk_content_provider_content_changed provider'
        touchManagedPtr provider
        return ()

    #if defined(ENABLE_OVERLOADING)
    data ContentProviderContentChangedMethodInfo
    instance (signature ~ (m ()), MonadIO m, IsContentProvider a) => O.OverloadedMethod ContentProviderContentChangedMethodInfo a signature where
        overloadedMethod = contentProviderContentChanged

    instance O.OverloadedMethodInfo ContentProviderContentChangedMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderContentChanged",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderContentChanged"
            })

    #endif

    -- method ContentProvider::get_value
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "provider"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "ContentProvider" }
    --           , argCType = Just "GdkContentProvider*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkContentProvider`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "value"
    --           , argType = TGValue
    --           , argCType = Just "GValue*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the `GValue` to fill"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TBoolean)
    -- throws : True
    -- Skip return : False

    foreign import ccall "gdk_content_provider_get_value" gdk_content_provider_get_value ::
        Ptr ContentProvider ->                  -- provider : TInterface (Name {namespace = "Gdk", name = "ContentProvider"})
        Ptr GValue ->                           -- value : TGValue
        Ptr (Ptr GError) ->                     -- error
        IO CInt

    -- | Gets the contents of /@provider@/ stored in /@value@/.
    --
    -- The /@value@/ will have been initialized to the @GType@ the value should be
    -- provided in. This given @GType@ does not need to be listed in the formats
    -- returned by 'GI.Gdk.Objects.ContentProvider.contentProviderRefFormats'. However, if the
    -- given @GType@ is not supported, this operation can fail and
    -- @G_IO_ERROR_NOT_SUPPORTED@ will be reported.
    contentProviderGetValue ::
        (B.CallStack.HasCallStack, MonadIO m, IsContentProvider a) =>
        a
        -- ^ /@provider@/: a @GdkContentProvider@
        -> GValue
        -- ^ /@value@/: the @GValue@ to fill
        -> m ()
        -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
    contentProviderGetValue :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsContentProvider a) =>
    a -> GValue -> m ()
    contentProviderGetValue a
    provider GValue
    value = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        provider' <- a -> IO (Ptr ContentProvider)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    provider
        value' <- unsafeManagedPtrGetPtr value
        onException (do
            _ <- propagateGError $ gdk_content_provider_get_value provider' value'
            touchManagedPtr provider
            touchManagedPtr value
            return ()
         ) (do
            return ()
         )

    #if defined(ENABLE_OVERLOADING)
    data ContentProviderGetValueMethodInfo
    instance (signature ~ (GValue -> m ()), MonadIO m, IsContentProvider a) => O.OverloadedMethod ContentProviderGetValueMethodInfo a signature where
        overloadedMethod = contentProviderGetValue

    instance O.OverloadedMethodInfo ContentProviderGetValueMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderGetValue",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderGetValue"
            })

    #endif

    -- method ContentProvider::ref_formats
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "provider"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "ContentProvider" }
    --           , argCType = Just "GdkContentProvider*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkContentProvider`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just
    --               (TInterface Name { namespace = "Gdk" , name = "ContentFormats" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_content_provider_ref_formats" gdk_content_provider_ref_formats ::
        Ptr ContentProvider ->                  -- provider : TInterface (Name {namespace = "Gdk", name = "ContentProvider"})
        IO (Ptr Gdk.ContentFormats.ContentFormats)

    -- | Gets the formats that the provider can provide its current contents in.
    contentProviderRefFormats ::
        (B.CallStack.HasCallStack, MonadIO m, IsContentProvider a) =>
        a
        -- ^ /@provider@/: a @GdkContentProvider@
        -> m Gdk.ContentFormats.ContentFormats
        -- ^ __Returns:__ The formats of the provider
    contentProviderRefFormats :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsContentProvider a) =>
    a -> m ContentFormats
    contentProviderRefFormats a
    provider = IO ContentFormats -> m ContentFormats
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO ContentFormats -> m ContentFormats)
    -> IO ContentFormats -> m ContentFormats
    forall a b. (a -> b) -> a -> b
    $ do
        provider' <- a -> IO (Ptr ContentProvider)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    provider
        result <- gdk_content_provider_ref_formats provider'
        checkUnexpectedReturnNULL "contentProviderRefFormats" result
        result' <- (wrapBoxed Gdk.ContentFormats.ContentFormats) result
        touchManagedPtr provider
        return result'

    #if defined(ENABLE_OVERLOADING)
    data ContentProviderRefFormatsMethodInfo
    instance (signature ~ (m Gdk.ContentFormats.ContentFormats), MonadIO m, IsContentProvider a) => O.OverloadedMethod ContentProviderRefFormatsMethodInfo a signature where
        overloadedMethod = contentProviderRefFormats

    instance O.OverloadedMethodInfo ContentProviderRefFormatsMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderRefFormats",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderRefFormats"
            })

    #endif

    -- method ContentProvider::ref_storable_formats
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "provider"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "ContentProvider" }
    --           , argCType = Just "GdkContentProvider*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkContentProvider`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just
    --               (TInterface Name { namespace = "Gdk" , name = "ContentFormats" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_content_provider_ref_storable_formats" gdk_content_provider_ref_storable_formats ::
        Ptr ContentProvider ->                  -- provider : TInterface (Name {namespace = "Gdk", name = "ContentProvider"})
        IO (Ptr Gdk.ContentFormats.ContentFormats)

    -- | Gets the formats that the provider suggests other applications to store
    -- the data in.
    --
    -- An example of such an application would be a clipboard manager.
    --
    -- This can be assumed to be a subset of 'GI.Gdk.Objects.ContentProvider.contentProviderRefFormats'.
    contentProviderRefStorableFormats ::
        (B.CallStack.HasCallStack, MonadIO m, IsContentProvider a) =>
        a
        -- ^ /@provider@/: a @GdkContentProvider@
        -> m Gdk.ContentFormats.ContentFormats
        -- ^ __Returns:__ The storable formats of the provider
    contentProviderRefStorableFormats :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsContentProvider a) =>
    a -> m ContentFormats
    contentProviderRefStorableFormats a
    provider = IO ContentFormats -> m ContentFormats
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO ContentFormats -> m ContentFormats)
    -> IO ContentFormats -> m ContentFormats
    forall a b. (a -> b) -> a -> b
    $ do
        provider' <- a -> IO (Ptr ContentProvider)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    provider
        result <- gdk_content_provider_ref_storable_formats provider'
        checkUnexpectedReturnNULL "contentProviderRefStorableFormats" result
        result' <- (wrapBoxed Gdk.ContentFormats.ContentFormats) result
        touchManagedPtr provider
        return result'

    #if defined(ENABLE_OVERLOADING)
    data ContentProviderRefStorableFormatsMethodInfo
    instance (signature ~ (m Gdk.ContentFormats.ContentFormats), MonadIO m, IsContentProvider a) => O.OverloadedMethod ContentProviderRefStorableFormatsMethodInfo a signature where
        overloadedMethod = contentProviderRefStorableFormats

    instance O.OverloadedMethodInfo ContentProviderRefStorableFormatsMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderRefStorableFormats",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderRefStorableFormats"
            })

    #endif

    -- method ContentProvider::write_mime_type_async
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "provider"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "ContentProvider" }
    --           , argCType = Just "GdkContentProvider*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkContentProvider`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "mime_type"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const char*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the mime type to provide the data in"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "stream"
    --           , argType =
    --               TInterface Name { namespace = "Gio" , name = "OutputStream" }
    --           , argCType = Just "GOutputStream*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the `GOutputStream` to write to"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "io_priority"
    --           , argType = TBasicType TInt
    --           , argCType = Just "int"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "I/O priority of the request."
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "cancellable"
    --           , argType =
    --               TInterface Name { namespace = "Gio" , name = "Cancellable" }
    --           , argCType = Just "GCancellable*"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just "optional `GCancellable` object, %NULL to ignore."
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "callback"
    --           , argType =
    --               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
    --           , argCType = Just "GAsyncReadyCallback"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just "callback to call when the request is satisfied"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeAsync
    --           , argClosure = 6
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "user_data"
    --           , argType = TBasicType TPtr
    --           , argCType = Just "gpointer"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the data to pass to callback function"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_content_provider_write_mime_type_async" gdk_content_provider_write_mime_type_async ::
        Ptr ContentProvider ->                  -- provider : TInterface (Name {namespace = "Gdk", name = "ContentProvider"})
        CString ->                              -- mime_type : TBasicType TUTF8
        Ptr Gio.OutputStream.OutputStream ->    -- stream : TInterface (Name {namespace = "Gio", name = "OutputStream"})
        Int32 ->                                -- io_priority : TBasicType TInt
        Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
        FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
        Ptr () ->                               -- user_data : TBasicType TPtr
        IO ()

    -- | Asynchronously writes the contents of /@provider@/ to /@stream@/ in the given
    -- /@mimeType@/.
    --
    -- The given mime type does not need to be listed in the formats returned by
    -- 'GI.Gdk.Objects.ContentProvider.contentProviderRefFormats'. However, if the given @GType@ is
    -- not supported, @G_IO_ERROR_NOT_SUPPORTED@ will be reported.
    --
    -- The given /@stream@/ will not be closed.
    contentProviderWriteMimeTypeAsync ::
        (B.CallStack.HasCallStack, MonadIO m, IsContentProvider a, Gio.OutputStream.IsOutputStream b, Gio.Cancellable.IsCancellable c) =>
        a
        -- ^ /@provider@/: a @GdkContentProvider@
        -> T.Text
        -- ^ /@mimeType@/: the mime type to provide the data in
        -> b
        -- ^ /@stream@/: the @GOutputStream@ to write to
        -> Int32
        -- ^ /@ioPriority@/: I\/O priority of the request.
        -> Maybe (c)
        -- ^ /@cancellable@/: optional @GCancellable@ object, 'P.Nothing' to ignore.
        -> Maybe (Gio.Callbacks.AsyncReadyCallback)
        -- ^ /@callback@/: callback to call when the request is satisfied
        -> m ()
    contentProviderWriteMimeTypeAsync :: forall (m :: * -> *) a b c.
    (HasCallStack, MonadIO m, IsContentProvider a, IsOutputStream b,
     IsCancellable c) =>
    a
    -> Text
    -> b
    -> Int32
    -> Maybe c
    -> Maybe AsyncReadyCallback
    -> m ()
    contentProviderWriteMimeTypeAsync a
    provider Text
    mimeType b
    stream Int32
    ioPriority Maybe c
    cancellable Maybe AsyncReadyCallback
    callback = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        provider' <- a -> IO (Ptr ContentProvider)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    provider
        mimeType' <- textToCString mimeType
        stream' <- unsafeManagedPtrCastPtr stream
        maybeCancellable <- case cancellable of
            Maybe c
    Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr Cancellable
    forall a. Ptr a
    FP.nullPtr
            Just c
    jCancellable -> do
                jCancellable' <- c -> IO (Ptr Cancellable)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr c
    jCancellable
                return jCancellable'
        maybeCallback <- case callback of
            Maybe AsyncReadyCallback
    Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return FunPtr C_AsyncReadyCallback
    forall a. FunPtr a
    FP.nullFunPtr
            Just AsyncReadyCallback
    jCallback -> do
                ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
    forall a. Storable a => IO (Ptr a)
    callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
                jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
                poke ptrcallback jCallback'
                return jCallback'
        let userData = Ptr a
    forall a. Ptr a
    nullPtr
        gdk_content_provider_write_mime_type_async provider' mimeType' stream' ioPriority maybeCancellable maybeCallback userData
        touchManagedPtr provider
        touchManagedPtr stream
        whenJust cancellable touchManagedPtr
        freeMem mimeType'
        return ()

    #if defined(ENABLE_OVERLOADING)
    data ContentProviderWriteMimeTypeAsyncMethodInfo
    instance (signature ~ (T.Text -> b -> Int32 -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsContentProvider a, Gio.OutputStream.IsOutputStream b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod ContentProviderWriteMimeTypeAsyncMethodInfo a signature where
        overloadedMethod = contentProviderWriteMimeTypeAsync

    instance O.OverloadedMethodInfo ContentProviderWriteMimeTypeAsyncMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderWriteMimeTypeAsync",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderWriteMimeTypeAsync"
            })

    #endif

    -- method ContentProvider::write_mime_type_finish
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "provider"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "ContentProvider" }
    --           , argCType = Just "GdkContentProvider*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkContentProvider`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "result"
    --           , argType =
    --               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
    --           , argCType = Just "GAsyncResult*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GAsyncResult`" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TBoolean)
    -- throws : True
    -- Skip return : False

    foreign import ccall "gdk_content_provider_write_mime_type_finish" gdk_content_provider_write_mime_type_finish ::
        Ptr ContentProvider ->                  -- provider : TInterface (Name {namespace = "Gdk", name = "ContentProvider"})
        Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
        Ptr (Ptr GError) ->                     -- error
        IO CInt

    -- | Finishes an asynchronous write operation.
    --
    -- See 'GI.Gdk.Objects.ContentProvider.contentProviderWriteMimeTypeAsync'.
    contentProviderWriteMimeTypeFinish ::
        (B.CallStack.HasCallStack, MonadIO m, IsContentProvider a, Gio.AsyncResult.IsAsyncResult b) =>
        a
        -- ^ /@provider@/: a @GdkContentProvider@
        -> b
        -- ^ /@result@/: a @GAsyncResult@
        -> m ()
        -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
    contentProviderWriteMimeTypeFinish :: forall (m :: * -> *) a b.
    (HasCallStack, MonadIO m, IsContentProvider a, IsAsyncResult b) =>
    a -> b -> m ()
    contentProviderWriteMimeTypeFinish a
    provider b
    result_ = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        provider' <- a -> IO (Ptr ContentProvider)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    provider
        result_' <- unsafeManagedPtrCastPtr result_
        onException (do
            _ <- propagateGError $ gdk_content_provider_write_mime_type_finish provider' result_'
            touchManagedPtr provider
            touchManagedPtr result_
            return ()
         ) (do
            return ()
         )

    #if defined(ENABLE_OVERLOADING)
    data ContentProviderWriteMimeTypeFinishMethodInfo
    instance (signature ~ (b -> m ()), MonadIO m, IsContentProvider a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ContentProviderWriteMimeTypeFinishMethodInfo a signature where
        overloadedMethod = contentProviderWriteMimeTypeFinish

    instance O.OverloadedMethodInfo ContentProviderWriteMimeTypeFinishMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderWriteMimeTypeFinish",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderWriteMimeTypeFinish"
            })

    #endif