{- |
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.WebKit.Objects.DOMGeolocation
    ( 

-- * Exported types
    DOMGeolocation(..)                      ,
    IsDOMGeolocation                        ,
    toDOMGeolocation                        ,
    noDOMGeolocation                        ,


 -- * Methods
-- ** clearWatch #method:clearWatch#
    DOMGeolocationClearWatchMethodInfo      ,
    dOMGeolocationClearWatch                ,




    ) 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.WebKit.Objects.DOMObject as WebKit.DOMObject

newtype DOMGeolocation = DOMGeolocation (ManagedPtr DOMGeolocation)
foreign import ccall "webkit_dom_geolocation_get_type"
    c_webkit_dom_geolocation_get_type :: IO GType

instance GObject DOMGeolocation where
    gobjectType _ = c_webkit_dom_geolocation_get_type
    

class GObject o => IsDOMGeolocation o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DOMGeolocation a) =>
    IsDOMGeolocation a
#endif
instance IsDOMGeolocation DOMGeolocation
instance WebKit.DOMObject.IsDOMObject DOMGeolocation
instance GObject.Object.IsObject DOMGeolocation

toDOMGeolocation :: IsDOMGeolocation o => o -> IO DOMGeolocation
toDOMGeolocation = unsafeCastTo DOMGeolocation

noDOMGeolocation :: Maybe DOMGeolocation
noDOMGeolocation = Nothing

type family ResolveDOMGeolocationMethod (t :: Symbol) (o :: *) :: * where
    ResolveDOMGeolocationMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDOMGeolocationMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDOMGeolocationMethod "clearWatch" o = DOMGeolocationClearWatchMethodInfo
    ResolveDOMGeolocationMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDOMGeolocationMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDOMGeolocationMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDOMGeolocationMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDOMGeolocationMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDOMGeolocationMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDOMGeolocationMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDOMGeolocationMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveDOMGeolocationMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveDOMGeolocationMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDOMGeolocationMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDOMGeolocationMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDOMGeolocationMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDOMGeolocationMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDOMGeolocationMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDOMGeolocationMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDOMGeolocationMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDOMGeolocationMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDOMGeolocationMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDOMGeolocationMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDOMGeolocationMethod l o = O.MethodResolutionFailed l o

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

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

instance O.HasAttributeList DOMGeolocation
type instance O.AttributeList DOMGeolocation = DOMGeolocationAttributeList
type DOMGeolocationAttributeList = ('[ '("coreObject", WebKit.DOMObject.DOMObjectCoreObjectPropertyInfo)] :: [(Symbol, *)])

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

-- method DOMGeolocation::clear_watch
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit", name = "DOMGeolocation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMGeolocation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "watchID", argType = TBasicType TLong, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #glong", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_geolocation_clear_watch" webkit_dom_geolocation_clear_watch :: 
    Ptr DOMGeolocation ->                   -- self : TInterface (Name {namespace = "WebKit", name = "DOMGeolocation"})
    CLong ->                                -- watchID : TBasicType TLong
    IO ()

{- |
/No description available in the introspection data./
-}
dOMGeolocationClearWatch ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMGeolocation a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMGeolocation.DOMGeolocation' -}
    -> CLong
    {- ^ /@watchID@/: A @/glong/@ -}
    -> m ()
dOMGeolocationClearWatch self watchID = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    webkit_dom_geolocation_clear_watch self' watchID
    touchManagedPtr self
    return ()

data DOMGeolocationClearWatchMethodInfo
instance (signature ~ (CLong -> m ()), MonadIO m, IsDOMGeolocation a) => O.MethodInfo DOMGeolocationClearWatchMethodInfo a signature where
    overloadedMethod _ = dOMGeolocationClearWatch