{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Access to editing capabilities of a t'GI.WebKit2WebExtension.Objects.WebPage.WebPage'.
-- 
-- The WebKitWebEditor provides access to various editing capabilities of
-- a t'GI.WebKit2WebExtension.Objects.WebPage.WebPage' such as a possibility to react to the current selection in
-- t'GI.WebKit2WebExtension.Objects.WebPage.WebPage'.
-- 
-- /Since: 2.10/

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

module GI.WebKit2WebExtension.Objects.WebEditor
    ( 

-- * Exported types
    WebEditor(..)                           ,
    IsWebEditor                             ,
    toWebEditor                             ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [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"), [getPage]("GI.WebKit2WebExtension.Objects.WebEditor#g:method:getPage"), [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)
    ResolveWebEditorMethod                  ,
#endif

-- ** getPage #method:getPage#

#if defined(ENABLE_OVERLOADING)
    WebEditorGetPageMethodInfo              ,
#endif
    webEditorGetPage                        ,




 -- * Signals


-- ** selectionChanged #signal:selectionChanged#

    WebEditorSelectionChangedCallback       ,
#if defined(ENABLE_OVERLOADING)
    WebEditorSelectionChangedSignalInfo     ,
#endif
    afterWebEditorSelectionChanged          ,
    onWebEditorSelectionChanged             ,




    ) 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

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Unions.Event as Gdk.Event
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.Action as Gio.Action
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.UnixFDList as Gio.UnixFDList
import qualified GI.Gtk.Objects.Action as Gtk.Action
import qualified GI.JavaScriptCore.Objects.Context as JavaScriptCore.Context
import qualified GI.JavaScriptCore.Objects.Value as JavaScriptCore.Value
import qualified GI.Soup.Structs.MessageHeaders as Soup.MessageHeaders
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Enums as WebKit2WebExtension.Enums
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Interfaces.DOMEventTarget as WebKit2WebExtension.DOMEventTarget
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Interfaces.DOMNodeFilter as WebKit2WebExtension.DOMNodeFilter
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Interfaces.DOMXPathNSResolver as WebKit2WebExtension.DOMXPathNSResolver
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.ContextMenu as WebKit2WebExtension.ContextMenu
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.ContextMenuItem as WebKit2WebExtension.ContextMenuItem
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMAttr as WebKit2WebExtension.DOMAttr
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMCDATASection as WebKit2WebExtension.DOMCDATASection
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMCSSRule as WebKit2WebExtension.DOMCSSRule
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMCSSRuleList as WebKit2WebExtension.DOMCSSRuleList
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMCSSStyleDeclaration as WebKit2WebExtension.DOMCSSStyleDeclaration
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMCSSStyleSheet as WebKit2WebExtension.DOMCSSStyleSheet
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMCharacterData as WebKit2WebExtension.DOMCharacterData
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMClientRect as WebKit2WebExtension.DOMClientRect
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMClientRectList as WebKit2WebExtension.DOMClientRectList
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMComment as WebKit2WebExtension.DOMComment
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMDOMImplementation as WebKit2WebExtension.DOMDOMImplementation
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMDOMSelection as WebKit2WebExtension.DOMDOMSelection
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMDOMTokenList as WebKit2WebExtension.DOMDOMTokenList
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMDOMWindow as WebKit2WebExtension.DOMDOMWindow
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMDocument as WebKit2WebExtension.DOMDocument
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMDocumentFragment as WebKit2WebExtension.DOMDocumentFragment
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMDocumentType as WebKit2WebExtension.DOMDocumentType
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMElement as WebKit2WebExtension.DOMElement
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMEntityReference as WebKit2WebExtension.DOMEntityReference
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMEvent as WebKit2WebExtension.DOMEvent
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMHTMLCollection as WebKit2WebExtension.DOMHTMLCollection
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMHTMLDocument as WebKit2WebExtension.DOMHTMLDocument
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMHTMLElement as WebKit2WebExtension.DOMHTMLElement
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMHTMLHeadElement as WebKit2WebExtension.DOMHTMLHeadElement
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMHTMLScriptElement as WebKit2WebExtension.DOMHTMLScriptElement
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMMediaList as WebKit2WebExtension.DOMMediaList
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMNamedNodeMap as WebKit2WebExtension.DOMNamedNodeMap
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMNode as WebKit2WebExtension.DOMNode
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMNodeIterator as WebKit2WebExtension.DOMNodeIterator
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMNodeList as WebKit2WebExtension.DOMNodeList
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMObject as WebKit2WebExtension.DOMObject
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMProcessingInstruction as WebKit2WebExtension.DOMProcessingInstruction
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMRange as WebKit2WebExtension.DOMRange
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMStyleSheet as WebKit2WebExtension.DOMStyleSheet
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMStyleSheetList as WebKit2WebExtension.DOMStyleSheetList
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMText as WebKit2WebExtension.DOMText
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMTreeWalker as WebKit2WebExtension.DOMTreeWalker
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMXPathExpression as WebKit2WebExtension.DOMXPathExpression
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMXPathResult as WebKit2WebExtension.DOMXPathResult
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.Frame as WebKit2WebExtension.Frame
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.HitTestResult as WebKit2WebExtension.HitTestResult
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.ScriptWorld as WebKit2WebExtension.ScriptWorld
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.URIRequest as WebKit2WebExtension.URIRequest
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.URIResponse as WebKit2WebExtension.URIResponse
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.UserMessage as WebKit2WebExtension.UserMessage
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.WebFormManager as WebKit2WebExtension.WebFormManager
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.WebHitTestResult as WebKit2WebExtension.WebHitTestResult
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.WebPage as WebKit2WebExtension.WebPage
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Structs.ConsoleMessage as WebKit2WebExtension.ConsoleMessage

#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.WebPage as WebKit2WebExtension.WebPage

#endif

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

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

foreign import ccall "webkit_web_editor_get_type"
    c_webkit_web_editor_get_type :: IO B.Types.GType

instance B.Types.TypedObject WebEditor where
    glibType :: IO GType
glibType = IO GType
c_webkit_web_editor_get_type

instance B.Types.GObject WebEditor

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

instance O.HasParentTypes WebEditor
type instance O.ParentTypes WebEditor = '[GObject.Object.Object]

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

-- | Convert 'WebEditor' 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 WebEditor) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_webkit_web_editor_get_type
    gvalueSet_ :: Ptr GValue -> Maybe WebEditor -> IO ()
gvalueSet_ Ptr GValue
gv Maybe WebEditor
P.Nothing = Ptr GValue -> Ptr WebEditor -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr WebEditor
forall a. Ptr a
FP.nullPtr :: FP.Ptr WebEditor)
    gvalueSet_ Ptr GValue
gv (P.Just WebEditor
obj) = WebEditor -> (Ptr WebEditor -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr WebEditor
obj (Ptr GValue -> Ptr WebEditor -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe WebEditor)
gvalueGet_ Ptr GValue
gv = do
        Ptr WebEditor
ptr <- Ptr GValue -> IO (Ptr WebEditor)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr WebEditor)
        if Ptr WebEditor
ptr Ptr WebEditor -> Ptr WebEditor -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr WebEditor
forall a. Ptr a
FP.nullPtr
        then WebEditor -> Maybe WebEditor
forall a. a -> Maybe a
P.Just (WebEditor -> Maybe WebEditor)
-> IO WebEditor -> IO (Maybe WebEditor)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr WebEditor -> WebEditor)
-> Ptr WebEditor -> IO WebEditor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr WebEditor -> WebEditor
WebEditor Ptr WebEditor
ptr
        else Maybe WebEditor -> IO (Maybe WebEditor)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe WebEditor
forall a. Maybe a
P.Nothing
        
    

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

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

#endif

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

#endif

-- signal WebEditor::selection-changed
-- | This signal is emitted for every selection change inside a t'GI.WebKit2WebExtension.Objects.WebPage.WebPage'
-- as well as for every caret position change as the caret is a collapsed
-- selection.
-- 
-- /Since: 2.10/
type WebEditorSelectionChangedCallback =
    IO ()

type C_WebEditorSelectionChangedCallback =
    Ptr WebEditor ->                        -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_WebEditorSelectionChangedCallback`.
foreign import ccall "wrapper"
    mk_WebEditorSelectionChangedCallback :: C_WebEditorSelectionChangedCallback -> IO (FunPtr C_WebEditorSelectionChangedCallback)

wrap_WebEditorSelectionChangedCallback :: 
    GObject a => (a -> WebEditorSelectionChangedCallback) ->
    C_WebEditorSelectionChangedCallback
wrap_WebEditorSelectionChangedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_WebEditorSelectionChangedCallback
wrap_WebEditorSelectionChangedCallback a -> IO ()
gi'cb Ptr WebEditor
gi'selfPtr Ptr ()
_ = do
    Ptr WebEditor -> (WebEditor -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr WebEditor
gi'selfPtr ((WebEditor -> IO ()) -> IO ()) -> (WebEditor -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \WebEditor
gi'self -> a -> IO ()
gi'cb (WebEditor -> a
forall a b. Coercible a b => a -> b
Coerce.coerce WebEditor
gi'self) 


-- | Connect a signal handler for the [selectionChanged](#signal:selectionChanged) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' webEditor #selectionChanged callback
-- @
-- 
-- 
onWebEditorSelectionChanged :: (IsWebEditor a, MonadIO m) => a -> ((?self :: a) => WebEditorSelectionChangedCallback) -> m SignalHandlerId
onWebEditorSelectionChanged :: forall a (m :: * -> *).
(IsWebEditor a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onWebEditorSelectionChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_WebEditorSelectionChangedCallback
wrapped' = (a -> IO ()) -> C_WebEditorSelectionChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_WebEditorSelectionChangedCallback
wrap_WebEditorSelectionChangedCallback a -> IO ()
wrapped
    FunPtr C_WebEditorSelectionChangedCallback
wrapped'' <- C_WebEditorSelectionChangedCallback
-> IO (FunPtr C_WebEditorSelectionChangedCallback)
mk_WebEditorSelectionChangedCallback C_WebEditorSelectionChangedCallback
wrapped'
    a
-> Text
-> FunPtr C_WebEditorSelectionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"selection-changed" FunPtr C_WebEditorSelectionChangedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [selectionChanged](#signal:selectionChanged) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' webEditor #selectionChanged callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterWebEditorSelectionChanged :: (IsWebEditor a, MonadIO m) => a -> ((?self :: a) => WebEditorSelectionChangedCallback) -> m SignalHandlerId
afterWebEditorSelectionChanged :: forall a (m :: * -> *).
(IsWebEditor a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterWebEditorSelectionChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_WebEditorSelectionChangedCallback
wrapped' = (a -> IO ()) -> C_WebEditorSelectionChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_WebEditorSelectionChangedCallback
wrap_WebEditorSelectionChangedCallback a -> IO ()
wrapped
    FunPtr C_WebEditorSelectionChangedCallback
wrapped'' <- C_WebEditorSelectionChangedCallback
-> IO (FunPtr C_WebEditorSelectionChangedCallback)
mk_WebEditorSelectionChangedCallback C_WebEditorSelectionChangedCallback
wrapped'
    a
-> Text
-> FunPtr C_WebEditorSelectionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"selection-changed" FunPtr C_WebEditorSelectionChangedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data WebEditorSelectionChangedSignalInfo
instance SignalInfo WebEditorSelectionChangedSignalInfo where
    type HaskellCallbackType WebEditorSelectionChangedSignalInfo = WebEditorSelectionChangedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_WebEditorSelectionChangedCallback cb
        cb'' <- mk_WebEditorSelectionChangedCallback cb'
        connectSignalFunPtr obj "selection-changed" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.WebKit2WebExtension.Objects.WebEditor::selection-changed"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2webextension-4.0.31/docs/GI-WebKit2WebExtension-Objects-WebEditor.html#g:signal:selectionChanged"})

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList WebEditor
type instance O.AttributeList WebEditor = WebEditorAttributeList
type WebEditorAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList WebEditor = WebEditorSignalList
type WebEditorSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("selectionChanged", WebEditorSelectionChangedSignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method WebEditor::get_page
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "editor"
--           , argType =
--               TInterface
--                 Name { namespace = "WebKit2WebExtension" , name = "WebEditor" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #WebKitWebEditor" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "WebKit2WebExtension" , name = "WebPage" })
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_editor_get_page" webkit_web_editor_get_page :: 
    Ptr WebEditor ->                        -- editor : TInterface (Name {namespace = "WebKit2WebExtension", name = "WebEditor"})
    IO (Ptr WebKit2WebExtension.WebPage.WebPage)

-- | Gets the t'GI.WebKit2WebExtension.Objects.WebPage.WebPage' that is associated with the t'GI.WebKit2WebExtension.Objects.WebEditor.WebEditor'.
-- 
-- /Since: 2.10/
webEditorGetPage ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebEditor a) =>
    a
    -- ^ /@editor@/: a t'GI.WebKit2WebExtension.Objects.WebEditor.WebEditor'
    -> m WebKit2WebExtension.WebPage.WebPage
    -- ^ __Returns:__ the associated t'GI.WebKit2WebExtension.Objects.WebPage.WebPage'
webEditorGetPage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWebEditor a) =>
a -> m WebPage
webEditorGetPage a
editor = IO WebPage -> m WebPage
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebPage -> m WebPage) -> IO WebPage -> m WebPage
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebEditor
editor' <- a -> IO (Ptr WebEditor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editor
    Ptr WebPage
result <- Ptr WebEditor -> IO (Ptr WebPage)
webkit_web_editor_get_page Ptr WebEditor
editor'
    Text -> Ptr WebPage -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"webEditorGetPage" Ptr WebPage
result
    WebPage
result' <- ((ManagedPtr WebPage -> WebPage) -> Ptr WebPage -> IO WebPage
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr WebPage -> WebPage
WebKit2WebExtension.WebPage.WebPage) Ptr WebPage
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editor
    WebPage -> IO WebPage
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return WebPage
result'

#if defined(ENABLE_OVERLOADING)
data WebEditorGetPageMethodInfo
instance (signature ~ (m WebKit2WebExtension.WebPage.WebPage), MonadIO m, IsWebEditor a) => O.OverloadedMethod WebEditorGetPageMethodInfo a signature where
    overloadedMethod = webEditorGetPage

instance O.OverloadedMethodInfo WebEditorGetPageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.WebKit2WebExtension.Objects.WebEditor.webEditorGetPage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2webextension-4.0.31/docs/GI-WebKit2WebExtension-Objects-WebEditor.html#v:webEditorGetPage"
        })


#endif