{- |
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(..)                      ,
    FindControllerK                         ,
    toFindController                        ,
    noFindController                        ,


 -- * Methods
-- ** findControllerCountMatches
    findControllerCountMatches              ,


-- ** findControllerGetMaxMatchCount
    findControllerGetMaxMatchCount          ,


-- ** findControllerGetOptions
    findControllerGetOptions                ,


-- ** findControllerGetSearchText
    findControllerGetSearchText             ,


-- ** findControllerGetWebView
    findControllerGetWebView                ,


-- ** findControllerSearch
    findControllerSearch                    ,


-- ** findControllerSearchFinish
    findControllerSearchFinish              ,


-- ** findControllerSearchNext
    findControllerSearchNext                ,


-- ** findControllerSearchPrevious
    findControllerSearchPrevious            ,




 -- * Properties
-- ** MaxMatchCount
    FindControllerMaxMatchCountPropertyInfo ,
    getFindControllerMaxMatchCount          ,


-- ** Options
    FindControllerOptionsPropertyInfo       ,
    getFindControllerOptions                ,


-- ** Text
    FindControllerTextPropertyInfo          ,
    getFindControllerText                   ,


-- ** WebView
    FindControllerWebViewPropertyInfo       ,
    constructFindControllerWebView          ,
    getFindControllerWebView                ,




 -- * Signals
-- ** CountedMatches
    FindControllerCountedMatchesCallback    ,
    FindControllerCountedMatchesCallbackC   ,
    FindControllerCountedMatchesSignalInfo  ,
    afterFindControllerCountedMatches       ,
    findControllerCountedMatchesCallbackWrapper,
    findControllerCountedMatchesClosure     ,
    mkFindControllerCountedMatchesCallback  ,
    noFindControllerCountedMatchesCallback  ,
    onFindControllerCountedMatches          ,


-- ** FailedToFindText
    FindControllerFailedToFindTextCallback  ,
    FindControllerFailedToFindTextCallbackC ,
    FindControllerFailedToFindTextSignalInfo,
    afterFindControllerFailedToFindText     ,
    findControllerFailedToFindTextCallbackWrapper,
    findControllerFailedToFindTextClosure   ,
    mkFindControllerFailedToFindTextCallback,
    noFindControllerFailedToFindTextCallback,
    onFindControllerFailedToFindText        ,


-- ** FoundText
    FindControllerFoundTextCallback         ,
    FindControllerFoundTextCallbackC        ,
    FindControllerFoundTextSignalInfo       ,
    afterFindControllerFoundText            ,
    findControllerFoundTextCallbackWrapper  ,
    findControllerFoundTextClosure          ,
    mkFindControllerFoundTextCallback       ,
    noFindControllerFoundTextCallback       ,
    onFindControllerFoundText               ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.WebKit2.Types
import GI.WebKit2.Callbacks
import qualified GI.GObject as GObject

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

type instance ParentTypes FindController = FindControllerParentTypes
type FindControllerParentTypes = '[GObject.Object]

instance GObject FindController where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_webkit_find_controller_get_type
    

class GObject o => FindControllerK o
instance (GObject o, IsDescendantOf FindController o) => FindControllerK o

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

noFindController :: Maybe FindController
noFindController = Nothing

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

noFindControllerCountedMatchesCallback :: Maybe FindControllerCountedMatchesCallback
noFindControllerCountedMatchesCallback = Nothing

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

foreign import ccall "wrapper"
    mkFindControllerCountedMatchesCallback :: FindControllerCountedMatchesCallbackC -> IO (FunPtr FindControllerCountedMatchesCallbackC)

findControllerCountedMatchesClosure :: FindControllerCountedMatchesCallback -> IO Closure
findControllerCountedMatchesClosure cb = newCClosure =<< mkFindControllerCountedMatchesCallback wrapped
    where wrapped = findControllerCountedMatchesCallbackWrapper cb

findControllerCountedMatchesCallbackWrapper ::
    FindControllerCountedMatchesCallback ->
    Ptr () ->
    Word32 ->
    Ptr () ->
    IO ()
findControllerCountedMatchesCallbackWrapper _cb _ match_count _ = do
    _cb  match_count

onFindControllerCountedMatches :: (GObject a, MonadIO m) => a -> FindControllerCountedMatchesCallback -> m SignalHandlerId
onFindControllerCountedMatches obj cb = liftIO $ connectFindControllerCountedMatches obj cb SignalConnectBefore
afterFindControllerCountedMatches :: (GObject a, MonadIO m) => a -> FindControllerCountedMatchesCallback -> m SignalHandlerId
afterFindControllerCountedMatches obj cb = connectFindControllerCountedMatches obj cb SignalConnectAfter

connectFindControllerCountedMatches :: (GObject a, MonadIO m) =>
                                       a -> FindControllerCountedMatchesCallback -> SignalConnectMode -> m SignalHandlerId
connectFindControllerCountedMatches obj cb after = liftIO $ do
    cb' <- mkFindControllerCountedMatchesCallback (findControllerCountedMatchesCallbackWrapper cb)
    connectSignalFunPtr obj "counted-matches" cb' after

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

noFindControllerFailedToFindTextCallback :: Maybe FindControllerFailedToFindTextCallback
noFindControllerFailedToFindTextCallback = Nothing

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

foreign import ccall "wrapper"
    mkFindControllerFailedToFindTextCallback :: FindControllerFailedToFindTextCallbackC -> IO (FunPtr FindControllerFailedToFindTextCallbackC)

findControllerFailedToFindTextClosure :: FindControllerFailedToFindTextCallback -> IO Closure
findControllerFailedToFindTextClosure cb = newCClosure =<< mkFindControllerFailedToFindTextCallback wrapped
    where wrapped = findControllerFailedToFindTextCallbackWrapper cb

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

onFindControllerFailedToFindText :: (GObject a, MonadIO m) => a -> FindControllerFailedToFindTextCallback -> m SignalHandlerId
onFindControllerFailedToFindText obj cb = liftIO $ connectFindControllerFailedToFindText obj cb SignalConnectBefore
afterFindControllerFailedToFindText :: (GObject a, MonadIO m) => a -> FindControllerFailedToFindTextCallback -> m SignalHandlerId
afterFindControllerFailedToFindText obj cb = connectFindControllerFailedToFindText obj cb SignalConnectAfter

connectFindControllerFailedToFindText :: (GObject a, MonadIO m) =>
                                         a -> FindControllerFailedToFindTextCallback -> SignalConnectMode -> m SignalHandlerId
connectFindControllerFailedToFindText obj cb after = liftIO $ do
    cb' <- mkFindControllerFailedToFindTextCallback (findControllerFailedToFindTextCallbackWrapper cb)
    connectSignalFunPtr obj "failed-to-find-text" cb' after

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

noFindControllerFoundTextCallback :: Maybe FindControllerFoundTextCallback
noFindControllerFoundTextCallback = Nothing

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

foreign import ccall "wrapper"
    mkFindControllerFoundTextCallback :: FindControllerFoundTextCallbackC -> IO (FunPtr FindControllerFoundTextCallbackC)

findControllerFoundTextClosure :: FindControllerFoundTextCallback -> IO Closure
findControllerFoundTextClosure cb = newCClosure =<< mkFindControllerFoundTextCallback wrapped
    where wrapped = findControllerFoundTextCallbackWrapper cb

findControllerFoundTextCallbackWrapper ::
    FindControllerFoundTextCallback ->
    Ptr () ->
    Word32 ->
    Ptr () ->
    IO ()
findControllerFoundTextCallbackWrapper _cb _ match_count _ = do
    _cb  match_count

onFindControllerFoundText :: (GObject a, MonadIO m) => a -> FindControllerFoundTextCallback -> m SignalHandlerId
onFindControllerFoundText obj cb = liftIO $ connectFindControllerFoundText obj cb SignalConnectBefore
afterFindControllerFoundText :: (GObject a, MonadIO m) => a -> FindControllerFoundTextCallback -> m SignalHandlerId
afterFindControllerFoundText obj cb = connectFindControllerFoundText obj cb SignalConnectAfter

connectFindControllerFoundText :: (GObject a, MonadIO m) =>
                                  a -> FindControllerFoundTextCallback -> SignalConnectMode -> m SignalHandlerId
connectFindControllerFoundText obj cb after = liftIO $ do
    cb' <- mkFindControllerFoundTextCallback (findControllerFoundTextCallbackWrapper cb)
    connectSignalFunPtr obj "found-text" cb' after

-- VVV Prop "max-match-count"
   -- Type: TBasicType TUInt32
   -- Flags: [PropertyReadable]

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

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

-- VVV Prop "options"
   -- Type: TInterface "WebKit2" "FindOptions"
   -- Flags: [PropertyReadable]

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

data FindControllerOptionsPropertyInfo
instance AttrInfo FindControllerOptionsPropertyInfo where
    type AttrAllowedOps FindControllerOptionsPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint FindControllerOptionsPropertyInfo = (~) ()
    type AttrBaseTypeConstraint FindControllerOptionsPropertyInfo = FindControllerK
    type AttrGetType FindControllerOptionsPropertyInfo = [FindOptions]
    type AttrLabel FindControllerOptionsPropertyInfo = "FindController::options"
    attrGet _ = getFindControllerOptions
    attrSet _ = undefined
    attrConstruct _ = undefined

-- VVV Prop "text"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]

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

data FindControllerTextPropertyInfo
instance AttrInfo FindControllerTextPropertyInfo where
    type AttrAllowedOps FindControllerTextPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint FindControllerTextPropertyInfo = (~) ()
    type AttrBaseTypeConstraint FindControllerTextPropertyInfo = FindControllerK
    type AttrGetType FindControllerTextPropertyInfo = T.Text
    type AttrLabel FindControllerTextPropertyInfo = "FindController::text"
    attrGet _ = getFindControllerText
    attrSet _ = undefined
    attrConstruct _ = undefined

-- VVV Prop "web-view"
   -- Type: TInterface "WebKit2" "WebView"
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]

getFindControllerWebView :: (MonadIO m, FindControllerK o) => o -> m WebView
getFindControllerWebView obj = liftIO $ getObjectPropertyObject obj "web-view" WebView

constructFindControllerWebView :: (WebViewK a) => a -> IO ([Char], GValue)
constructFindControllerWebView val = constructObjectPropertyObject "web-view" val

data FindControllerWebViewPropertyInfo
instance AttrInfo FindControllerWebViewPropertyInfo where
    type AttrAllowedOps FindControllerWebViewPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FindControllerWebViewPropertyInfo = WebViewK
    type AttrBaseTypeConstraint FindControllerWebViewPropertyInfo = FindControllerK
    type AttrGetType FindControllerWebViewPropertyInfo = WebView
    type AttrLabel FindControllerWebViewPropertyInfo = "FindController::web-view"
    attrGet _ = getFindControllerWebView
    attrSet _ = undefined
    attrConstruct _ = constructFindControllerWebView

type instance AttributeList FindController = FindControllerAttributeList
type FindControllerAttributeList = ('[ '("max-match-count", FindControllerMaxMatchCountPropertyInfo), '("options", FindControllerOptionsPropertyInfo), '("text", FindControllerTextPropertyInfo), '("web-view", FindControllerWebViewPropertyInfo)] :: [(Symbol, *)])

data FindControllerCountedMatchesSignalInfo
instance SignalInfo FindControllerCountedMatchesSignalInfo where
    type HaskellCallbackType FindControllerCountedMatchesSignalInfo = FindControllerCountedMatchesCallback
    connectSignal _ = connectFindControllerCountedMatches

data FindControllerFailedToFindTextSignalInfo
instance SignalInfo FindControllerFailedToFindTextSignalInfo where
    type HaskellCallbackType FindControllerFailedToFindTextSignalInfo = FindControllerFailedToFindTextCallback
    connectSignal _ = connectFindControllerFailedToFindText

data FindControllerFoundTextSignalInfo
instance SignalInfo FindControllerFoundTextSignalInfo where
    type HaskellCallbackType FindControllerFoundTextSignalInfo = FindControllerFoundTextCallback
    connectSignal _ = connectFindControllerFoundText

type instance SignalList FindController = FindControllerSignalList
type FindControllerSignalList = ('[ '("counted-matches", FindControllerCountedMatchesSignalInfo), '("failed-to-find-text", FindControllerFailedToFindTextSignalInfo), '("found-text", FindControllerFoundTextSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method FindController::count_matches
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "search_text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "find_options", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "max_match_count", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "search_text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "find_options", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "max_match_count", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_count_matches" webkit_find_controller_count_matches :: 
    Ptr FindController ->                   -- _obj : TInterface "WebKit2" "FindController"
    CString ->                              -- search_text : TBasicType TUTF8
    Word32 ->                               -- find_options : TBasicType TUInt32
    Word32 ->                               -- max_match_count : TBasicType TUInt32
    IO ()


findControllerCountMatches ::
    (MonadIO m, FindControllerK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- search_text
    Word32 ->                               -- find_options
    Word32 ->                               -- max_match_count
    m ()
findControllerCountMatches _obj search_text find_options max_match_count = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    search_text' <- textToCString search_text
    webkit_find_controller_count_matches _obj' search_text' find_options max_match_count
    touchManagedPtr _obj
    freeMem search_text'
    return ()

-- method FindController::get_max_match_count
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUInt32
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_get_max_match_count" webkit_find_controller_get_max_match_count :: 
    Ptr FindController ->                   -- _obj : TInterface "WebKit2" "FindController"
    IO Word32


findControllerGetMaxMatchCount ::
    (MonadIO m, FindControllerK a) =>
    a ->                                    -- _obj
    m Word32
findControllerGetMaxMatchCount _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_find_controller_get_max_match_count _obj'
    touchManagedPtr _obj
    return result

-- method FindController::get_options
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUInt32
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_get_options" webkit_find_controller_get_options :: 
    Ptr FindController ->                   -- _obj : TInterface "WebKit2" "FindController"
    IO Word32


findControllerGetOptions ::
    (MonadIO m, FindControllerK a) =>
    a ->                                    -- _obj
    m Word32
findControllerGetOptions _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_find_controller_get_options _obj'
    touchManagedPtr _obj
    return result

-- method FindController::get_search_text
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_get_search_text" webkit_find_controller_get_search_text :: 
    Ptr FindController ->                   -- _obj : TInterface "WebKit2" "FindController"
    IO CString


findControllerGetSearchText ::
    (MonadIO m, FindControllerK a) =>
    a ->                                    -- _obj
    m T.Text
findControllerGetSearchText _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_find_controller_get_search_text _obj'
    checkUnexpectedReturnNULL "webkit_find_controller_get_search_text" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

-- method FindController::get_web_view
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "WebKit2" "WebView"
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_get_web_view" webkit_find_controller_get_web_view :: 
    Ptr FindController ->                   -- _obj : TInterface "WebKit2" "FindController"
    IO (Ptr WebView)


findControllerGetWebView ::
    (MonadIO m, FindControllerK a) =>
    a ->                                    -- _obj
    m WebView
findControllerGetWebView _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_find_controller_get_web_view _obj'
    checkUnexpectedReturnNULL "webkit_find_controller_get_web_view" result
    result' <- (newObject WebView) result
    touchManagedPtr _obj
    return result'

-- method FindController::search
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "search_text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "find_options", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "max_match_count", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "search_text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "find_options", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "max_match_count", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_search" webkit_find_controller_search :: 
    Ptr FindController ->                   -- _obj : TInterface "WebKit2" "FindController"
    CString ->                              -- search_text : TBasicType TUTF8
    Word32 ->                               -- find_options : TBasicType TUInt32
    Word32 ->                               -- max_match_count : TBasicType TUInt32
    IO ()


findControllerSearch ::
    (MonadIO m, FindControllerK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- search_text
    Word32 ->                               -- find_options
    Word32 ->                               -- max_match_count
    m ()
findControllerSearch _obj search_text find_options max_match_count = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    search_text' <- textToCString search_text
    webkit_find_controller_search _obj' search_text' find_options max_match_count
    touchManagedPtr _obj
    freeMem search_text'
    return ()

-- method FindController::search_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_search_finish" webkit_find_controller_search_finish :: 
    Ptr FindController ->                   -- _obj : TInterface "WebKit2" "FindController"
    IO ()


findControllerSearchFinish ::
    (MonadIO m, FindControllerK a) =>
    a ->                                    -- _obj
    m ()
findControllerSearchFinish _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    webkit_find_controller_search_finish _obj'
    touchManagedPtr _obj
    return ()

-- method FindController::search_next
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_search_next" webkit_find_controller_search_next :: 
    Ptr FindController ->                   -- _obj : TInterface "WebKit2" "FindController"
    IO ()


findControllerSearchNext ::
    (MonadIO m, FindControllerK a) =>
    a ->                                    -- _obj
    m ()
findControllerSearchNext _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    webkit_find_controller_search_next _obj'
    touchManagedPtr _obj
    return ()

-- method FindController::search_previous
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit2" "FindController", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "webkit_find_controller_search_previous" webkit_find_controller_search_previous :: 
    Ptr FindController ->                   -- _obj : TInterface "WebKit2" "FindController"
    IO ()


findControllerSearchPrevious ::
    (MonadIO m, FindControllerK a) =>
    a ->                                    -- _obj
    m ()
findControllerSearchPrevious _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    webkit_find_controller_search_previous _obj'
    touchManagedPtr _obj
    return ()