#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.WebKit2.Structs.WebsiteData
(
WebsiteData(..) ,
noWebsiteData ,
#if ENABLE_OVERLOADING
WebsiteDataGetNameMethodInfo ,
#endif
websiteDataGetName ,
#if ENABLE_OVERLOADING
WebsiteDataGetSizeMethodInfo ,
#endif
websiteDataGetSize ,
#if ENABLE_OVERLOADING
WebsiteDataGetTypesMethodInfo ,
#endif
websiteDataGetTypes ,
#if ENABLE_OVERLOADING
WebsiteDataRefMethodInfo ,
#endif
websiteDataRef ,
#if ENABLE_OVERLOADING
WebsiteDataUnrefMethodInfo ,
#endif
websiteDataUnref ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.WebKit2.Flags as WebKit2.Flags
newtype WebsiteData = WebsiteData (ManagedPtr WebsiteData)
foreign import ccall "webkit_website_data_get_type" c_webkit_website_data_get_type ::
IO GType
instance BoxedObject WebsiteData where
boxedType _ = c_webkit_website_data_get_type
noWebsiteData :: Maybe WebsiteData
noWebsiteData = Nothing
#if ENABLE_OVERLOADING
instance O.HasAttributeList WebsiteData
type instance O.AttributeList WebsiteData = WebsiteDataAttributeList
type WebsiteDataAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_website_data_get_name" webkit_website_data_get_name ::
Ptr WebsiteData ->
IO CString
websiteDataGetName ::
(B.CallStack.HasCallStack, MonadIO m) =>
WebsiteData
-> m T.Text
websiteDataGetName websiteData = liftIO $ do
websiteData' <- unsafeManagedPtrGetPtr websiteData
result <- webkit_website_data_get_name websiteData'
checkUnexpectedReturnNULL "websiteDataGetName" result
result' <- cstringToText result
touchManagedPtr websiteData
return result'
#if ENABLE_OVERLOADING
data WebsiteDataGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo WebsiteDataGetNameMethodInfo WebsiteData signature where
overloadedMethod _ = websiteDataGetName
#endif
foreign import ccall "webkit_website_data_get_size" webkit_website_data_get_size ::
Ptr WebsiteData ->
CUInt ->
IO Word64
websiteDataGetSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
WebsiteData
-> [WebKit2.Flags.WebsiteDataTypes]
-> m Word64
websiteDataGetSize websiteData types = liftIO $ do
websiteData' <- unsafeManagedPtrGetPtr websiteData
let types' = gflagsToWord types
result <- webkit_website_data_get_size websiteData' types'
touchManagedPtr websiteData
return result
#if ENABLE_OVERLOADING
data WebsiteDataGetSizeMethodInfo
instance (signature ~ ([WebKit2.Flags.WebsiteDataTypes] -> m Word64), MonadIO m) => O.MethodInfo WebsiteDataGetSizeMethodInfo WebsiteData signature where
overloadedMethod _ = websiteDataGetSize
#endif
foreign import ccall "webkit_website_data_get_types" webkit_website_data_get_types ::
Ptr WebsiteData ->
IO CUInt
websiteDataGetTypes ::
(B.CallStack.HasCallStack, MonadIO m) =>
WebsiteData
-> m [WebKit2.Flags.WebsiteDataTypes]
websiteDataGetTypes websiteData = liftIO $ do
websiteData' <- unsafeManagedPtrGetPtr websiteData
result <- webkit_website_data_get_types websiteData'
let result' = wordToGFlags result
touchManagedPtr websiteData
return result'
#if ENABLE_OVERLOADING
data WebsiteDataGetTypesMethodInfo
instance (signature ~ (m [WebKit2.Flags.WebsiteDataTypes]), MonadIO m) => O.MethodInfo WebsiteDataGetTypesMethodInfo WebsiteData signature where
overloadedMethod _ = websiteDataGetTypes
#endif
foreign import ccall "webkit_website_data_ref" webkit_website_data_ref ::
Ptr WebsiteData ->
IO (Ptr WebsiteData)
websiteDataRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
WebsiteData
-> m WebsiteData
websiteDataRef websiteData = liftIO $ do
websiteData' <- unsafeManagedPtrGetPtr websiteData
result <- webkit_website_data_ref websiteData'
checkUnexpectedReturnNULL "websiteDataRef" result
result' <- (wrapBoxed WebsiteData) result
touchManagedPtr websiteData
return result'
#if ENABLE_OVERLOADING
data WebsiteDataRefMethodInfo
instance (signature ~ (m WebsiteData), MonadIO m) => O.MethodInfo WebsiteDataRefMethodInfo WebsiteData signature where
overloadedMethod _ = websiteDataRef
#endif
foreign import ccall "webkit_website_data_unref" webkit_website_data_unref ::
Ptr WebsiteData ->
IO ()
websiteDataUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
WebsiteData
-> m ()
websiteDataUnref websiteData = liftIO $ do
websiteData' <- unsafeManagedPtrGetPtr websiteData
webkit_website_data_unref websiteData'
touchManagedPtr websiteData
return ()
#if ENABLE_OVERLOADING
data WebsiteDataUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo WebsiteDataUnrefMethodInfo WebsiteData signature where
overloadedMethod _ = websiteDataUnref
#endif
#if ENABLE_OVERLOADING
type family ResolveWebsiteDataMethod (t :: Symbol) (o :: *) :: * where
ResolveWebsiteDataMethod "ref" o = WebsiteDataRefMethodInfo
ResolveWebsiteDataMethod "unref" o = WebsiteDataUnrefMethodInfo
ResolveWebsiteDataMethod "getName" o = WebsiteDataGetNameMethodInfo
ResolveWebsiteDataMethod "getSize" o = WebsiteDataGetSizeMethodInfo
ResolveWebsiteDataMethod "getTypes" o = WebsiteDataGetTypesMethodInfo
ResolveWebsiteDataMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveWebsiteDataMethod t WebsiteData, O.MethodInfo info WebsiteData p) => OL.IsLabel t (WebsiteData -> 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