{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.WebKit2.Objects.GeolocationPermissionRequest
    ( 

-- * Exported types
    GeolocationPermissionRequest(..)        ,
    IsGeolocationPermissionRequest          ,
    toGeolocationPermissionRequest          ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [allow]("GI.WebKit2.Interfaces.PermissionRequest#g:method:allow"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [deny]("GI.WebKit2.Interfaces.PermissionRequest#g:method:deny"), [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"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [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").
-- 
-- ==== 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").
-- 
-- ==== 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)
    ResolveGeolocationPermissionRequestMethod,
#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.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.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 qualified GHC.Records as R

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.WebKit2.Interfaces.PermissionRequest as WebKit2.PermissionRequest

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

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

foreign import ccall "webkit_geolocation_permission_request_get_type"
    c_webkit_geolocation_permission_request_get_type :: IO B.Types.GType

instance B.Types.TypedObject GeolocationPermissionRequest where
    glibType :: IO GType
glibType = IO GType
c_webkit_geolocation_permission_request_get_type

instance B.Types.GObject GeolocationPermissionRequest

-- | Type class for types which can be safely cast to `GeolocationPermissionRequest`, for instance with `toGeolocationPermissionRequest`.
class (SP.GObject o, O.IsDescendantOf GeolocationPermissionRequest o) => IsGeolocationPermissionRequest o
instance (SP.GObject o, O.IsDescendantOf GeolocationPermissionRequest o) => IsGeolocationPermissionRequest o

instance O.HasParentTypes GeolocationPermissionRequest
type instance O.ParentTypes GeolocationPermissionRequest = '[GObject.Object.Object, WebKit2.PermissionRequest.PermissionRequest]

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveGeolocationPermissionRequestMethod (t :: Symbol) (o :: *) :: * where
    ResolveGeolocationPermissionRequestMethod "allow" o = WebKit2.PermissionRequest.PermissionRequestAllowMethodInfo
    ResolveGeolocationPermissionRequestMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveGeolocationPermissionRequestMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveGeolocationPermissionRequestMethod "deny" o = WebKit2.PermissionRequest.PermissionRequestDenyMethodInfo
    ResolveGeolocationPermissionRequestMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveGeolocationPermissionRequestMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveGeolocationPermissionRequestMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveGeolocationPermissionRequestMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveGeolocationPermissionRequestMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveGeolocationPermissionRequestMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveGeolocationPermissionRequestMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveGeolocationPermissionRequestMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveGeolocationPermissionRequestMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveGeolocationPermissionRequestMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveGeolocationPermissionRequestMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveGeolocationPermissionRequestMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveGeolocationPermissionRequestMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveGeolocationPermissionRequestMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveGeolocationPermissionRequestMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveGeolocationPermissionRequestMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveGeolocationPermissionRequestMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveGeolocationPermissionRequestMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveGeolocationPermissionRequestMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveGeolocationPermissionRequestMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveGeolocationPermissionRequestMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveGeolocationPermissionRequestMethod t GeolocationPermissionRequest, O.OverloadedMethod info GeolocationPermissionRequest p) => OL.IsLabel t (GeolocationPermissionRequest -> 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 ~ ResolveGeolocationPermissionRequestMethod t GeolocationPermissionRequest, O.OverloadedMethod info GeolocationPermissionRequest p, R.HasField t GeolocationPermissionRequest p) => R.HasField t GeolocationPermissionRequest p where
    getField = O.overloadedMethod @info

#endif

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

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList GeolocationPermissionRequest
type instance O.AttributeList GeolocationPermissionRequest = GeolocationPermissionRequestAttributeList
type GeolocationPermissionRequestAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList GeolocationPermissionRequest = GeolocationPermissionRequestSignalList
type GeolocationPermissionRequestSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif