{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Objects.ContentDecoder
(
ContentDecoder(..) ,
IsContentDecoder ,
toContentDecoder ,
#if defined(ENABLE_OVERLOADING)
ResolveContentDecoderMethod ,
#endif
) 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
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Enums as Gio.Enums
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Interfaces.ProxyResolver as Gio.ProxyResolver
import qualified GI.Gio.Interfaces.SocketConnectable as Gio.SocketConnectable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.IOStream as Gio.IOStream
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.Socket as Gio.Socket
import qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
import qualified GI.Gio.Objects.TlsCertificate as Gio.TlsCertificate
import qualified GI.Gio.Objects.TlsDatabase as Gio.TlsDatabase
import qualified GI.Gio.Objects.TlsInteraction as Gio.TlsInteraction
import qualified GI.Soup.Callbacks as Soup.Callbacks
import {-# SOURCE #-} qualified GI.Soup.Enums as Soup.Enums
import {-# SOURCE #-} qualified GI.Soup.Flags as Soup.Flags
import {-# SOURCE #-} qualified GI.Soup.Interfaces.SessionFeature as Soup.SessionFeature
import {-# SOURCE #-} qualified GI.Soup.Objects.Address as Soup.Address
import {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth
import {-# SOURCE #-} qualified GI.Soup.Objects.Message as Soup.Message
import {-# SOURCE #-} qualified GI.Soup.Objects.Request as Soup.Request
import {-# SOURCE #-} qualified GI.Soup.Objects.RequestHTTP as Soup.RequestHTTP
import {-# SOURCE #-} qualified GI.Soup.Objects.Session as Soup.Session
import {-# SOURCE #-} qualified GI.Soup.Objects.Socket as Soup.Socket
import {-# SOURCE #-} qualified GI.Soup.Objects.WebsocketConnection as Soup.WebsocketConnection
import {-# SOURCE #-} qualified GI.Soup.Objects.WebsocketExtension as Soup.WebsocketExtension
import {-# SOURCE #-} qualified GI.Soup.Structs.Buffer as Soup.Buffer
import {-# SOURCE #-} qualified GI.Soup.Structs.MessageBody as Soup.MessageBody
import {-# SOURCE #-} qualified GI.Soup.Structs.MessageHeaders as Soup.MessageHeaders
import {-# SOURCE #-} qualified GI.Soup.Structs.Range as Soup.Range
import {-# SOURCE #-} qualified GI.Soup.Structs.URI as Soup.URI
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Soup.Interfaces.SessionFeature as Soup.SessionFeature
#endif
newtype ContentDecoder = ContentDecoder (SP.ManagedPtr ContentDecoder)
deriving (ContentDecoder -> ContentDecoder -> Bool
(ContentDecoder -> ContentDecoder -> Bool)
-> (ContentDecoder -> ContentDecoder -> Bool) -> Eq ContentDecoder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ContentDecoder -> ContentDecoder -> Bool
== :: ContentDecoder -> ContentDecoder -> Bool
$c/= :: ContentDecoder -> ContentDecoder -> Bool
/= :: ContentDecoder -> ContentDecoder -> Bool
Eq)
instance SP.ManagedPtrNewtype ContentDecoder where
toManagedPtr :: ContentDecoder -> ManagedPtr ContentDecoder
toManagedPtr (ContentDecoder ManagedPtr ContentDecoder
p) = ManagedPtr ContentDecoder
p
foreign import ccall "soup_content_decoder_get_type"
c_soup_content_decoder_get_type :: IO B.Types.GType
instance B.Types.TypedObject ContentDecoder where
glibType :: IO GType
glibType = IO GType
c_soup_content_decoder_get_type
instance B.Types.GObject ContentDecoder
class (SP.GObject o, O.IsDescendantOf ContentDecoder o) => IsContentDecoder o
instance (SP.GObject o, O.IsDescendantOf ContentDecoder o) => IsContentDecoder o
instance O.HasParentTypes ContentDecoder
type instance O.ParentTypes ContentDecoder = '[GObject.Object.Object, Soup.SessionFeature.SessionFeature]
toContentDecoder :: (MIO.MonadIO m, IsContentDecoder o) => o -> m ContentDecoder
toContentDecoder :: forall (m :: * -> *) o.
(MonadIO m, IsContentDecoder o) =>
o -> m ContentDecoder
toContentDecoder = IO ContentDecoder -> m ContentDecoder
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO ContentDecoder -> m ContentDecoder)
-> (o -> IO ContentDecoder) -> o -> m ContentDecoder
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr ContentDecoder -> ContentDecoder)
-> o -> IO ContentDecoder
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr ContentDecoder -> ContentDecoder
ContentDecoder
instance B.GValue.IsGValue (Maybe ContentDecoder) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_content_decoder_get_type
gvalueSet_ :: Ptr GValue -> Maybe ContentDecoder -> IO ()
gvalueSet_ Ptr GValue
gv Maybe ContentDecoder
P.Nothing = Ptr GValue -> Ptr ContentDecoder -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr ContentDecoder
forall a. Ptr a
FP.nullPtr :: FP.Ptr ContentDecoder)
gvalueSet_ Ptr GValue
gv (P.Just ContentDecoder
obj) = ContentDecoder -> (Ptr ContentDecoder -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ContentDecoder
obj (Ptr GValue -> Ptr ContentDecoder -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe ContentDecoder)
gvalueGet_ Ptr GValue
gv = do
Ptr ContentDecoder
ptr <- Ptr GValue -> IO (Ptr ContentDecoder)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr ContentDecoder)
if Ptr ContentDecoder
ptr Ptr ContentDecoder -> Ptr ContentDecoder -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr ContentDecoder
forall a. Ptr a
FP.nullPtr
then ContentDecoder -> Maybe ContentDecoder
forall a. a -> Maybe a
P.Just (ContentDecoder -> Maybe ContentDecoder)
-> IO ContentDecoder -> IO (Maybe ContentDecoder)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr ContentDecoder -> ContentDecoder)
-> Ptr ContentDecoder -> IO ContentDecoder
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr ContentDecoder -> ContentDecoder
ContentDecoder Ptr ContentDecoder
ptr
else Maybe ContentDecoder -> IO (Maybe ContentDecoder)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ContentDecoder
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveContentDecoderMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveContentDecoderMethod "addFeature" o = Soup.SessionFeature.SessionFeatureAddFeatureMethodInfo
ResolveContentDecoderMethod "attach" o = Soup.SessionFeature.SessionFeatureAttachMethodInfo
ResolveContentDecoderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveContentDecoderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveContentDecoderMethod "detach" o = Soup.SessionFeature.SessionFeatureDetachMethodInfo
ResolveContentDecoderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveContentDecoderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveContentDecoderMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveContentDecoderMethod "hasFeature" o = Soup.SessionFeature.SessionFeatureHasFeatureMethodInfo
ResolveContentDecoderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveContentDecoderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveContentDecoderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveContentDecoderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveContentDecoderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveContentDecoderMethod "removeFeature" o = Soup.SessionFeature.SessionFeatureRemoveFeatureMethodInfo
ResolveContentDecoderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveContentDecoderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveContentDecoderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveContentDecoderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveContentDecoderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveContentDecoderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveContentDecoderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveContentDecoderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveContentDecoderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveContentDecoderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveContentDecoderMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveContentDecoderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveContentDecoderMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveContentDecoderMethod t ContentDecoder, O.OverloadedMethod info ContentDecoder p) => OL.IsLabel t (ContentDecoder -> 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 ~ ResolveContentDecoderMethod t ContentDecoder, O.OverloadedMethod info ContentDecoder p, R.HasField t ContentDecoder p) => R.HasField t ContentDecoder p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveContentDecoderMethod t ContentDecoder, O.OverloadedMethodInfo info ContentDecoder) => OL.IsLabel t (O.MethodProxy info ContentDecoder) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ContentDecoder
type instance O.AttributeList ContentDecoder = ContentDecoderAttributeList
type ContentDecoderAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList ContentDecoder = ContentDecoderSignalList
type ContentDecoderSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif