{- |
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.WebKit2.Objects.FindController
    ( 

-- * Exported types
    FindController(..)                      ,
    IsFindController                        ,
    toFindController                        ,
    noFindController                        ,


 -- * Methods
-- ** countMatches #method:countMatches#
    FindControllerCountMatchesMethodInfo    ,
    findControllerCountMatches              ,


-- ** getMaxMatchCount #method:getMaxMatchCount#
    FindControllerGetMaxMatchCountMethodInfo,
    findControllerGetMaxMatchCount          ,


-- ** getOptions #method:getOptions#
    FindControllerGetOptionsMethodInfo      ,
    findControllerGetOptions                ,


-- ** getSearchText #method:getSearchText#
    FindControllerGetSearchTextMethodInfo   ,
    findControllerGetSearchText             ,


-- ** getWebView #method:getWebView#
    FindControllerGetWebViewMethodInfo      ,
    findControllerGetWebView                ,


-- ** search #method:search#
    FindControllerSearchMethodInfo          ,
    findControllerSearch                    ,


-- ** searchFinish #method:searchFinish#
    FindControllerSearchFinishMethodInfo    ,
    findControllerSearchFinish              ,


-- ** searchNext #method:searchNext#
    FindControllerSearchNextMethodInfo      ,
    findControllerSearchNext                ,


-- ** searchPrevious #method:searchPrevious#
    FindControllerSearchPreviousMethodInfo  ,
    findControllerSearchPrevious            ,




 -- * Properties
-- ** maxMatchCount #attr:maxMatchCount#
    FindControllerMaxMatchCountPropertyInfo ,
    findControllerMaxMatchCount             ,
    getFindControllerMaxMatchCount          ,


-- ** options #attr:options#
    FindControllerOptionsPropertyInfo       ,
    findControllerOptions                   ,
    getFindControllerOptions                ,


-- ** text #attr:text#
    FindControllerTextPropertyInfo          ,
    findControllerText                      ,
    getFindControllerText                   ,


-- ** webView #attr:webView#
    FindControllerWebViewPropertyInfo       ,
    constructFindControllerWebView          ,
    findControllerWebView                   ,
    getFindControllerWebView                ,




 -- * Signals
-- ** countedMatches #signal:countedMatches#
    C_FindControllerCountedMatchesCallback  ,
    FindControllerCountedMatchesCallback    ,
    FindControllerCountedMatchesSignalInfo  ,
    afterFindControllerCountedMatches       ,
    genClosure_FindControllerCountedMatches ,
    mk_FindControllerCountedMatchesCallback ,
    noFindControllerCountedMatchesCallback  ,
    onFindControllerCountedMatches          ,
    wrap_FindControllerCountedMatchesCallback,


-- ** failedToFindText #signal:failedToFindText#
    C_FindControllerFailedToFindTextCallback,
    FindControllerFailedToFindTextCallback  ,
    FindControllerFailedToFindTextSignalInfo,
    afterFindControllerFailedToFindText     ,
    genClosure_FindControllerFailedToFindText,
    mk_FindControllerFailedToFindTextCallback,
    noFindControllerFailedToFindTextCallback,
    onFindControllerFailedToFindText        ,
    wrap_FindControllerFailedToFindTextCallback,


-- ** foundText #signal:foundText#
    C_FindControllerFoundTextCallback       ,
    FindControllerFoundTextCallback         ,
    FindControllerFoundTextSignalInfo       ,
    afterFindControllerFoundText            ,
    genClosure_FindControllerFoundText      ,
    mk_FindControllerFoundTextCallback      ,
    noFindControllerFoundTextCallback       ,
    onFindControllerFoundText               ,
    wrap_FindControllerFoundTextCallback    ,




    ) 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.WebKit2.Flags as WebKit2.Flags
import {-# SOURCE #-} qualified GI.WebKit2.Objects.WebView as WebKit2.WebView

newtype FindController = FindController (ManagedPtr FindController)
foreign import ccall "webkit_find_controller_get_type"
    c_webkit_find_controller_get_type :: IO GType

instance GObject FindController where
    gobjectType _ = c_webkit_find_controller_get_type
    

class GObject o => IsFindController o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError FindController a) =>
    IsFindController a
#endif
instance IsFindController FindController
instance GObject.Object.IsObject FindController

toFindController :: IsFindController o => o -> IO FindController
toFindController = unsafeCastTo FindController

noFindController :: Maybe FindController
noFindController = Nothing

type family ResolveFindControllerMethod (t :: Symbol) (o :: *) :: * where
    ResolveFindControllerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveFindControllerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveFindControllerMethod "countMatches" o = FindControllerCountMatchesMethodInfo
    ResolveFindControllerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveFindControllerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveFindControllerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveFindControllerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveFindControllerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveFindControllerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveFindControllerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveFindControllerMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveFindControllerMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveFindControllerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveFindControllerMethod "search" o = FindControllerSearchMethodInfo
    ResolveFindControllerMethod "searchFinish" o = FindControllerSearchFinishMethodInfo
    ResolveFindControllerMethod "searchNext" o = FindControllerSearchNextMethodInfo
    ResolveFindControllerMethod "searchPrevious" o = FindControllerSearchPreviousMethodInfo
    ResolveFindControllerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveFindControllerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveFindControllerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveFindControllerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveFindControllerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveFindControllerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveFindControllerMethod "getMaxMatchCount" o = FindControllerGetMaxMatchCountMethodInfo
    ResolveFindControllerMethod "getOptions" o = FindControllerGetOptionsMethodInfo
    ResolveFindControllerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveFindControllerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveFindControllerMethod "getSearchText" o = FindControllerGetSearchTextMethodInfo
    ResolveFindControllerMethod "getWebView" o = FindControllerGetWebViewMethodInfo
    ResolveFindControllerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveFindControllerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveFindControllerMethod l o = O.MethodResolutionFailed l o

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

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

-- signal FindController::counted-matches
type FindControllerCountedMatchesCallback =
    Word32 ->
    IO ()

noFindControllerCountedMatchesCallback :: Maybe FindControllerCountedMatchesCallback
noFindControllerCountedMatchesCallback = Nothing

type C_FindControllerCountedMatchesCallback =
    Ptr () ->                               -- object
    Word32 ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_FindControllerCountedMatchesCallback :: C_FindControllerCountedMatchesCallback -> IO (FunPtr C_FindControllerCountedMatchesCallback)

genClosure_FindControllerCountedMatches :: FindControllerCountedMatchesCallback -> IO Closure
genClosure_FindControllerCountedMatches cb = do
    let cb' = wrap_FindControllerCountedMatchesCallback cb
    mk_FindControllerCountedMatchesCallback cb' >>= newCClosure


wrap_FindControllerCountedMatchesCallback ::
    FindControllerCountedMatchesCallback ->
    Ptr () ->
    Word32 ->
    Ptr () ->
    IO ()
wrap_FindControllerCountedMatchesCallback _cb _ matchCount _ = do
    _cb  matchCount


onFindControllerCountedMatches :: (IsFindController a, MonadIO m) => a -> FindControllerCountedMatchesCallback -> m SignalHandlerId
onFindControllerCountedMatches obj cb = liftIO $ do
    let cb' = wrap_FindControllerCountedMatchesCallback cb
    cb'' <- mk_FindControllerCountedMatchesCallback cb'
    connectSignalFunPtr obj "counted-matches" cb'' SignalConnectBefore

afterFindControllerCountedMatches :: (IsFindController a, MonadIO m) => a -> FindControllerCountedMatchesCallback -> m SignalHandlerId
afterFindControllerCountedMatches obj cb = liftIO $ do
    let cb' = wrap_FindControllerCountedMatchesCallback cb
    cb'' <- mk_FindControllerCountedMatchesCallback cb'
    connectSignalFunPtr obj "counted-matches" cb'' SignalConnectAfter


-- signal FindController::failed-to-find-text
type FindControllerFailedToFindTextCallback =
    IO ()

noFindControllerFailedToFindTextCallback :: Maybe FindControllerFailedToFindTextCallback
noFindControllerFailedToFindTextCallback = Nothing

type C_FindControllerFailedToFindTextCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_FindControllerFailedToFindTextCallback :: C_FindControllerFailedToFindTextCallback -> IO (FunPtr C_FindControllerFailedToFindTextCallback)

genClosure_FindControllerFailedToFindText :: FindControllerFailedToFindTextCallback -> IO Closure
genClosure_FindControllerFailedToFindText cb = do
    let cb' = wrap_FindControllerFailedToFindTextCallback cb
    mk_FindControllerFailedToFindTextCallback cb' >>= newCClosure


wrap_FindControllerFailedToFindTextCallback ::
    FindControllerFailedToFindTextCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_FindControllerFailedToFindTextCallback _cb _ _ = do
    _cb 


onFindControllerFailedToFindText :: (IsFindController a, MonadIO m) => a -> FindControllerFailedToFindTextCallback -> m SignalHandlerId
onFindControllerFailedToFindText obj cb = liftIO $ do
    let cb' = wrap_FindControllerFailedToFindTextCallback cb
    cb'' <- mk_FindControllerFailedToFindTextCallback cb'
    connectSignalFunPtr obj "failed-to-find-text" cb'' SignalConnectBefore

afterFindControllerFailedToFindText :: (IsFindController a, MonadIO m) => a -> FindControllerFailedToFindTextCallback -> m SignalHandlerId
afterFindControllerFailedToFindText obj cb = liftIO $ do
    let cb' = wrap_FindControllerFailedToFindTextCallback cb
    cb'' <- mk_FindControllerFailedToFindTextCallback cb'
    connectSignalFunPtr obj "failed-to-find-text" cb'' SignalConnectAfter


-- signal FindController::found-text
type FindControllerFoundTextCallback =
    Word32 ->
    IO ()

noFindControllerFoundTextCallback :: Maybe FindControllerFoundTextCallback
noFindControllerFoundTextCallback = Nothing

type C_FindControllerFoundTextCallback =
    Ptr () ->                               -- object
    Word32 ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_FindControllerFoundTextCallback :: C_FindControllerFoundTextCallback -> IO (FunPtr C_FindControllerFoundTextCallback)

genClosure_FindControllerFoundText :: FindControllerFoundTextCallback -> IO Closure
genClosure_FindControllerFoundText cb = do
    let cb' = wrap_FindControllerFoundTextCallback cb
    mk_FindControllerFoundTextCallback cb' >>= newCClosure


wrap_FindControllerFoundTextCallback ::
    FindControllerFoundTextCallback ->
    Ptr () ->
    Word32 ->
    Ptr () ->
    IO ()
wrap_FindControllerFoundTextCallback _cb _ matchCount _ = do
    _cb  matchCount


onFindControllerFoundText :: (IsFindController a, MonadIO m) => a -> FindControllerFoundTextCallback -> m SignalHandlerId
onFindControllerFoundText obj cb = liftIO $ do
    let cb' = wrap_FindControllerFoundTextCallback cb
    cb'' <- mk_FindControllerFoundTextCallback cb'
    connectSignalFunPtr obj "found-text" cb'' SignalConnectBefore

afterFindControllerFoundText :: (IsFindController a, MonadIO m) => a -> FindControllerFoundTextCallback -> m SignalHandlerId
afterFindControllerFoundText obj cb = liftIO $ do
    let cb' = wrap_FindControllerFoundTextCallback cb
    cb'' <- mk_FindControllerFoundTextCallback cb'
    connectSignalFunPtr obj "found-text" cb'' SignalConnectAfter


-- VVV Prop "max-match-count"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getFindControllerMaxMatchCount :: (MonadIO m, IsFindController o) => o -> m Word32
getFindControllerMaxMatchCount obj = liftIO $ getObjectPropertyUInt32 obj "max-match-count"

data FindControllerMaxMatchCountPropertyInfo
instance AttrInfo FindControllerMaxMatchCountPropertyInfo where
    type AttrAllowedOps FindControllerMaxMatchCountPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint FindControllerMaxMatchCountPropertyInfo = (~) ()
    type AttrBaseTypeConstraint FindControllerMaxMatchCountPropertyInfo = IsFindController
    type AttrGetType FindControllerMaxMatchCountPropertyInfo = Word32
    type AttrLabel FindControllerMaxMatchCountPropertyInfo = "max-match-count"
    type AttrOrigin FindControllerMaxMatchCountPropertyInfo = FindController
    attrGet _ = getFindControllerMaxMatchCount
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "options"
   -- Type: TInterface (Name {namespace = "WebKit2", name = "FindOptions"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getFindControllerOptions :: (MonadIO m, IsFindController o) => o -> m [WebKit2.Flags.FindOptions]
getFindControllerOptions obj = liftIO $ getObjectPropertyFlags obj "options"

data FindControllerOptionsPropertyInfo
instance AttrInfo FindControllerOptionsPropertyInfo where
    type AttrAllowedOps FindControllerOptionsPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint FindControllerOptionsPropertyInfo = (~) ()
    type AttrBaseTypeConstraint FindControllerOptionsPropertyInfo = IsFindController
    type AttrGetType FindControllerOptionsPropertyInfo = [WebKit2.Flags.FindOptions]
    type AttrLabel FindControllerOptionsPropertyInfo = "options"
    type AttrOrigin FindControllerOptionsPropertyInfo = FindController
    attrGet _ = getFindControllerOptions
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "text"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getFindControllerText :: (MonadIO m, IsFindController o) => o -> m (Maybe T.Text)
getFindControllerText obj = liftIO $ getObjectPropertyString obj "text"

data FindControllerTextPropertyInfo
instance AttrInfo FindControllerTextPropertyInfo where
    type AttrAllowedOps FindControllerTextPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint FindControllerTextPropertyInfo = (~) ()
    type AttrBaseTypeConstraint FindControllerTextPropertyInfo = IsFindController
    type AttrGetType FindControllerTextPropertyInfo = (Maybe T.Text)
    type AttrLabel FindControllerTextPropertyInfo = "text"
    type AttrOrigin FindControllerTextPropertyInfo = FindController
    attrGet _ = getFindControllerText
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "web-view"
   -- Type: TInterface (Name {namespace = "WebKit2", name = "WebView"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getFindControllerWebView :: (MonadIO m, IsFindController o) => o -> m WebKit2.WebView.WebView
getFindControllerWebView obj = liftIO $ checkUnexpectedNothing "getFindControllerWebView" $ getObjectPropertyObject obj "web-view" WebKit2.WebView.WebView

constructFindControllerWebView :: (IsFindController o, WebKit2.WebView.IsWebView a) => a -> IO (GValueConstruct o)
constructFindControllerWebView val = constructObjectPropertyObject "web-view" (Just val)

data FindControllerWebViewPropertyInfo
instance AttrInfo FindControllerWebViewPropertyInfo where
    type AttrAllowedOps FindControllerWebViewPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint FindControllerWebViewPropertyInfo = WebKit2.WebView.IsWebView
    type AttrBaseTypeConstraint FindControllerWebViewPropertyInfo = IsFindController
    type AttrGetType FindControllerWebViewPropertyInfo = WebKit2.WebView.WebView
    type AttrLabel FindControllerWebViewPropertyInfo = "web-view"
    type AttrOrigin FindControllerWebViewPropertyInfo = FindController
    attrGet _ = getFindControllerWebView
    attrSet _ = undefined
    attrConstruct _ = constructFindControllerWebView
    attrClear _ = undefined

instance O.HasAttributeList FindController
type instance O.AttributeList FindController = FindControllerAttributeList
type FindControllerAttributeList = ('[ '("maxMatchCount", FindControllerMaxMatchCountPropertyInfo), '("options", FindControllerOptionsPropertyInfo), '("text", FindControllerTextPropertyInfo), '("webView", FindControllerWebViewPropertyInfo)] :: [(Symbol, *)])

findControllerMaxMatchCount :: AttrLabelProxy "maxMatchCount"
findControllerMaxMatchCount = AttrLabelProxy

findControllerOptions :: AttrLabelProxy "options"
findControllerOptions = AttrLabelProxy

findControllerText :: AttrLabelProxy "text"
findControllerText = AttrLabelProxy

findControllerWebView :: AttrLabelProxy "webView"
findControllerWebView = AttrLabelProxy

data FindControllerCountedMatchesSignalInfo
instance SignalInfo FindControllerCountedMatchesSignalInfo where
    type HaskellCallbackType FindControllerCountedMatchesSignalInfo = FindControllerCountedMatchesCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_FindControllerCountedMatchesCallback cb
        cb'' <- mk_FindControllerCountedMatchesCallback cb'
        connectSignalFunPtr obj "counted-matches" cb'' connectMode

data FindControllerFailedToFindTextSignalInfo
instance SignalInfo FindControllerFailedToFindTextSignalInfo where
    type HaskellCallbackType FindControllerFailedToFindTextSignalInfo = FindControllerFailedToFindTextCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_FindControllerFailedToFindTextCallback cb
        cb'' <- mk_FindControllerFailedToFindTextCallback cb'
        connectSignalFunPtr obj "failed-to-find-text" cb'' connectMode

data FindControllerFoundTextSignalInfo
instance SignalInfo FindControllerFoundTextSignalInfo where
    type HaskellCallbackType FindControllerFoundTextSignalInfo = FindControllerFoundTextCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_FindControllerFoundTextCallback cb
        cb'' <- mk_FindControllerFoundTextCallback cb'
        connectSignalFunPtr obj "found-text" cb'' connectMode

type instance O.SignalList FindController = FindControllerSignalList
type FindControllerSignalList = ('[ '("countedMatches", FindControllerCountedMatchesSignalInfo), '("failedToFindText", FindControllerFailedToFindTextSignalInfo), '("foundText", FindControllerFoundTextSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method FindController::count_matches
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "find_controller", argType = TInterface (Name {namespace = "WebKit2", name = "FindController"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitFindController", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "search_text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the text to look for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "find_options", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a bitmask with the #WebKitFindOptions used in the search", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "max_match_count", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the maximum number of matches allowed in the search", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_count_matches" webkit_find_controller_count_matches :: 
    Ptr FindController ->                   -- find_controller : TInterface (Name {namespace = "WebKit2", name = "FindController"})
    CString ->                              -- search_text : TBasicType TUTF8
    Word32 ->                               -- find_options : TBasicType TUInt32
    Word32 ->                               -- max_match_count : TBasicType TUInt
    IO ()

{- |
Counts the number of matches for /@searchText@/ found in the
'GI.WebKit2.Objects.WebView.WebView' with the provided /@findOptions@/. The number of
matches will be provided by the
'GI.WebKit2.Objects.FindController.FindController'::@/counted-matches/@ signal.
-}
findControllerCountMatches ::
    (B.CallStack.HasCallStack, MonadIO m, IsFindController a) =>
    a
    {- ^ /@findController@/: the 'GI.WebKit2.Objects.FindController.FindController' -}
    -> T.Text
    {- ^ /@searchText@/: the text to look for -}
    -> Word32
    {- ^ /@findOptions@/: a bitmask with the 'GI.WebKit2.Flags.FindOptions' used in the search -}
    -> Word32
    {- ^ /@maxMatchCount@/: the maximum number of matches allowed in the search -}
    -> m ()
findControllerCountMatches findController searchText findOptions maxMatchCount = liftIO $ do
    findController' <- unsafeManagedPtrCastPtr findController
    searchText' <- textToCString searchText
    webkit_find_controller_count_matches findController' searchText' findOptions maxMatchCount
    touchManagedPtr findController
    freeMem searchText'
    return ()

data FindControllerCountMatchesMethodInfo
instance (signature ~ (T.Text -> Word32 -> Word32 -> m ()), MonadIO m, IsFindController a) => O.MethodInfo FindControllerCountMatchesMethodInfo a signature where
    overloadedMethod _ = findControllerCountMatches

-- method FindController::get_max_match_count
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "find_controller", argType = TInterface (Name {namespace = "WebKit2", name = "FindController"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitFindController", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_get_max_match_count" webkit_find_controller_get_max_match_count :: 
    Ptr FindController ->                   -- find_controller : TInterface (Name {namespace = "WebKit2", name = "FindController"})
    IO Word32

{- |
Gets the maximum number of matches to report during a text
lookup. This number is passed as the last argument of
'GI.WebKit2.Objects.FindController.findControllerSearch' or
'GI.WebKit2.Objects.FindController.findControllerCountMatches'.
-}
findControllerGetMaxMatchCount ::
    (B.CallStack.HasCallStack, MonadIO m, IsFindController a) =>
    a
    {- ^ /@findController@/: the 'GI.WebKit2.Objects.FindController.FindController' -}
    -> m Word32
    {- ^ __Returns:__ the maximum number of matches to report. -}
findControllerGetMaxMatchCount findController = liftIO $ do
    findController' <- unsafeManagedPtrCastPtr findController
    result <- webkit_find_controller_get_max_match_count findController'
    touchManagedPtr findController
    return result

data FindControllerGetMaxMatchCountMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsFindController a) => O.MethodInfo FindControllerGetMaxMatchCountMethodInfo a signature where
    overloadedMethod _ = findControllerGetMaxMatchCount

-- method FindController::get_options
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "find_controller", argType = TInterface (Name {namespace = "WebKit2", name = "FindController"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitFindController", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_get_options" webkit_find_controller_get_options :: 
    Ptr FindController ->                   -- find_controller : TInterface (Name {namespace = "WebKit2", name = "FindController"})
    IO Word32

{- |
Gets a bitmask containing the 'GI.WebKit2.Flags.FindOptions' associated with
the current search.
-}
findControllerGetOptions ::
    (B.CallStack.HasCallStack, MonadIO m, IsFindController a) =>
    a
    {- ^ /@findController@/: the 'GI.WebKit2.Objects.FindController.FindController' -}
    -> m Word32
    {- ^ __Returns:__ a bitmask containing the 'GI.WebKit2.Flags.FindOptions' associated
with the current search. -}
findControllerGetOptions findController = liftIO $ do
    findController' <- unsafeManagedPtrCastPtr findController
    result <- webkit_find_controller_get_options findController'
    touchManagedPtr findController
    return result

data FindControllerGetOptionsMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsFindController a) => O.MethodInfo FindControllerGetOptionsMethodInfo a signature where
    overloadedMethod _ = findControllerGetOptions

-- method FindController::get_search_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "find_controller", argType = TInterface (Name {namespace = "WebKit2", name = "FindController"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitFindController", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_get_search_text" webkit_find_controller_get_search_text :: 
    Ptr FindController ->                   -- find_controller : TInterface (Name {namespace = "WebKit2", name = "FindController"})
    IO CString

{- |
Gets the text that /@findController@/ is currently searching
for. This text is passed to either
'GI.WebKit2.Objects.FindController.findControllerSearch' or
'GI.WebKit2.Objects.FindController.findControllerCountMatches'.
-}
findControllerGetSearchText ::
    (B.CallStack.HasCallStack, MonadIO m, IsFindController a) =>
    a
    {- ^ /@findController@/: the 'GI.WebKit2.Objects.FindController.FindController' -}
    -> m T.Text
    {- ^ __Returns:__ the text to look for in the 'GI.WebKit2.Objects.WebView.WebView'. -}
findControllerGetSearchText findController = liftIO $ do
    findController' <- unsafeManagedPtrCastPtr findController
    result <- webkit_find_controller_get_search_text findController'
    checkUnexpectedReturnNULL "findControllerGetSearchText" result
    result' <- cstringToText result
    touchManagedPtr findController
    return result'

data FindControllerGetSearchTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFindController a) => O.MethodInfo FindControllerGetSearchTextMethodInfo a signature where
    overloadedMethod _ = findControllerGetSearchText

-- method FindController::get_web_view
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "find_controller", argType = TInterface (Name {namespace = "WebKit2", name = "FindController"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitFindController", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "WebView"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_get_web_view" webkit_find_controller_get_web_view :: 
    Ptr FindController ->                   -- find_controller : TInterface (Name {namespace = "WebKit2", name = "FindController"})
    IO (Ptr WebKit2.WebView.WebView)

{- |
Gets the 'GI.WebKit2.Objects.WebView.WebView' this find controller is associated to. Do
not unref the returned instance as it belongs to the
'GI.WebKit2.Objects.FindController.FindController'.
-}
findControllerGetWebView ::
    (B.CallStack.HasCallStack, MonadIO m, IsFindController a) =>
    a
    {- ^ /@findController@/: the 'GI.WebKit2.Objects.FindController.FindController' -}
    -> m WebKit2.WebView.WebView
    {- ^ __Returns:__ the 'GI.WebKit2.Objects.WebView.WebView'. -}
findControllerGetWebView findController = liftIO $ do
    findController' <- unsafeManagedPtrCastPtr findController
    result <- webkit_find_controller_get_web_view findController'
    checkUnexpectedReturnNULL "findControllerGetWebView" result
    result' <- (newObject WebKit2.WebView.WebView) result
    touchManagedPtr findController
    return result'

data FindControllerGetWebViewMethodInfo
instance (signature ~ (m WebKit2.WebView.WebView), MonadIO m, IsFindController a) => O.MethodInfo FindControllerGetWebViewMethodInfo a signature where
    overloadedMethod _ = findControllerGetWebView

-- method FindController::search
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "find_controller", argType = TInterface (Name {namespace = "WebKit2", name = "FindController"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitFindController", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "search_text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the text to look for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "find_options", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a bitmask with the #WebKitFindOptions used in the search", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "max_match_count", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the maximum number of matches allowed in the search", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_search" webkit_find_controller_search :: 
    Ptr FindController ->                   -- find_controller : TInterface (Name {namespace = "WebKit2", name = "FindController"})
    CString ->                              -- search_text : TBasicType TUTF8
    Word32 ->                               -- find_options : TBasicType TUInt32
    Word32 ->                               -- max_match_count : TBasicType TUInt
    IO ()

{- |
Looks for /@searchText@/ in the 'GI.WebKit2.Objects.WebView.WebView' associated with
/@findController@/ since the beginning of the document highlighting
up to /@maxMatchCount@/ matches. The outcome of the search will be
asynchronously provided by the 'GI.WebKit2.Objects.FindController.FindController'::@/found-text/@
and 'GI.WebKit2.Objects.FindController.FindController'::@/failed-to-find-text/@ signals.

To look for the next or previous occurrences of the same text
with the same find options use 'GI.WebKit2.Objects.FindController.findControllerSearchNext'
and\/or 'GI.WebKit2.Objects.FindController.findControllerSearchPrevious'. The
'GI.WebKit2.Objects.FindController.FindController' will use the same text and options for the
following searches unless they are modified by another call to this
method.

Note that if the number of matches is higher than /@maxMatchCount@/
then 'GI.WebKit2.Objects.FindController.FindController'::@/found-text/@ will report @/G_MAXUINT/@ matches
instead of the actual number.

Callers should call 'GI.WebKit2.Objects.FindController.findControllerSearchFinish' to
finish the current search operation.
-}
findControllerSearch ::
    (B.CallStack.HasCallStack, MonadIO m, IsFindController a) =>
    a
    {- ^ /@findController@/: the 'GI.WebKit2.Objects.FindController.FindController' -}
    -> T.Text
    {- ^ /@searchText@/: the text to look for -}
    -> Word32
    {- ^ /@findOptions@/: a bitmask with the 'GI.WebKit2.Flags.FindOptions' used in the search -}
    -> Word32
    {- ^ /@maxMatchCount@/: the maximum number of matches allowed in the search -}
    -> m ()
findControllerSearch findController searchText findOptions maxMatchCount = liftIO $ do
    findController' <- unsafeManagedPtrCastPtr findController
    searchText' <- textToCString searchText
    webkit_find_controller_search findController' searchText' findOptions maxMatchCount
    touchManagedPtr findController
    freeMem searchText'
    return ()

data FindControllerSearchMethodInfo
instance (signature ~ (T.Text -> Word32 -> Word32 -> m ()), MonadIO m, IsFindController a) => O.MethodInfo FindControllerSearchMethodInfo a signature where
    overloadedMethod _ = findControllerSearch

-- method FindController::search_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "find_controller", argType = TInterface (Name {namespace = "WebKit2", name = "FindController"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitFindController", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_search_finish" webkit_find_controller_search_finish :: 
    Ptr FindController ->                   -- find_controller : TInterface (Name {namespace = "WebKit2", name = "FindController"})
    IO ()

{- |
Finishes a find operation started by
'GI.WebKit2.Objects.FindController.findControllerSearch'. It will basically unhighlight
every text match found.

This method will be typically called when the search UI is
closed\/hidden by the client application.
-}
findControllerSearchFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsFindController a) =>
    a
    {- ^ /@findController@/: a 'GI.WebKit2.Objects.FindController.FindController' -}
    -> m ()
findControllerSearchFinish findController = liftIO $ do
    findController' <- unsafeManagedPtrCastPtr findController
    webkit_find_controller_search_finish findController'
    touchManagedPtr findController
    return ()

data FindControllerSearchFinishMethodInfo
instance (signature ~ (m ()), MonadIO m, IsFindController a) => O.MethodInfo FindControllerSearchFinishMethodInfo a signature where
    overloadedMethod _ = findControllerSearchFinish

-- method FindController::search_next
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "find_controller", argType = TInterface (Name {namespace = "WebKit2", name = "FindController"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitFindController", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_search_next" webkit_find_controller_search_next :: 
    Ptr FindController ->                   -- find_controller : TInterface (Name {namespace = "WebKit2", name = "FindController"})
    IO ()

{- |
Looks for the next occurrence of the search text.

Calling this method before 'GI.WebKit2.Objects.FindController.findControllerSearch' or
'GI.WebKit2.Objects.FindController.findControllerCountMatches' is a programming error.
-}
findControllerSearchNext ::
    (B.CallStack.HasCallStack, MonadIO m, IsFindController a) =>
    a
    {- ^ /@findController@/: the 'GI.WebKit2.Objects.FindController.FindController' -}
    -> m ()
findControllerSearchNext findController = liftIO $ do
    findController' <- unsafeManagedPtrCastPtr findController
    webkit_find_controller_search_next findController'
    touchManagedPtr findController
    return ()

data FindControllerSearchNextMethodInfo
instance (signature ~ (m ()), MonadIO m, IsFindController a) => O.MethodInfo FindControllerSearchNextMethodInfo a signature where
    overloadedMethod _ = findControllerSearchNext

-- method FindController::search_previous
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "find_controller", argType = TInterface (Name {namespace = "WebKit2", name = "FindController"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitFindController", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_search_previous" webkit_find_controller_search_previous :: 
    Ptr FindController ->                   -- find_controller : TInterface (Name {namespace = "WebKit2", name = "FindController"})
    IO ()

{- |
Looks for the previous occurrence of the search text.

Calling this method before 'GI.WebKit2.Objects.FindController.findControllerSearch' or
'GI.WebKit2.Objects.FindController.findControllerCountMatches' is a programming error.
-}
findControllerSearchPrevious ::
    (B.CallStack.HasCallStack, MonadIO m, IsFindController a) =>
    a
    {- ^ /@findController@/: the 'GI.WebKit2.Objects.FindController.FindController' -}
    -> m ()
findControllerSearchPrevious findController = liftIO $ do
    findController' <- unsafeManagedPtrCastPtr findController
    webkit_find_controller_search_previous findController'
    touchManagedPtr findController
    return ()

data FindControllerSearchPreviousMethodInfo
instance (signature ~ (m ()), MonadIO m, IsFindController a) => O.MethodInfo FindControllerSearchPreviousMethodInfo a signature where
    overloadedMethod _ = findControllerSearchPrevious