{- |
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.Soup.Objects.ContentDecoder
    ( 

-- * Exported types
    ContentDecoder(..)                      ,
    IsContentDecoder                        ,
    toContentDecoder                        ,
    noContentDecoder                        ,


    ) 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.Soup.Interfaces.SessionFeature as Soup.SessionFeature

newtype ContentDecoder = ContentDecoder (ManagedPtr ContentDecoder)
foreign import ccall "soup_content_decoder_get_type"
    c_soup_content_decoder_get_type :: IO GType

instance GObject ContentDecoder where
    gobjectType _ = c_soup_content_decoder_get_type
    

class GObject o => IsContentDecoder o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError ContentDecoder a) =>
    IsContentDecoder a
#endif
instance IsContentDecoder ContentDecoder
instance GObject.Object.IsObject ContentDecoder
instance Soup.SessionFeature.IsSessionFeature ContentDecoder

toContentDecoder :: IsContentDecoder o => o -> IO ContentDecoder
toContentDecoder = unsafeCastTo ContentDecoder

noContentDecoder :: Maybe ContentDecoder
noContentDecoder = Nothing

type family ResolveContentDecoderMethod (t :: Symbol) (o :: *) :: * 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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveContentDecoderMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    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 "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveContentDecoderMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveContentDecoderMethod t ContentDecoder, O.MethodInfo info ContentDecoder p) => O.IsLabelProxy t (ContentDecoder -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveContentDecoderMethod t ContentDecoder, O.MethodInfo info ContentDecoder p) => O.IsLabel t (ContentDecoder -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

instance O.HasAttributeList ContentDecoder
type instance O.AttributeList ContentDecoder = ContentDecoderAttributeList
type ContentDecoderAttributeList = ('[ ] :: [(Symbol, *)])

type instance O.SignalList ContentDecoder = ContentDecoderSignalList
type ContentDecoderSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])