module GI.WebKit2.Objects.FindController
(
FindController(..) ,
FindControllerK ,
toFindController ,
noFindController ,
findControllerCountMatches ,
findControllerGetMaxMatchCount ,
findControllerGetOptions ,
findControllerGetSearchText ,
findControllerGetWebView ,
findControllerSearch ,
findControllerSearchFinish ,
findControllerSearchNext ,
findControllerSearchPrevious ,
FindControllerMaxMatchCountPropertyInfo ,
getFindControllerMaxMatchCount ,
FindControllerOptionsPropertyInfo ,
getFindControllerOptions ,
FindControllerTextPropertyInfo ,
getFindControllerText ,
FindControllerWebViewPropertyInfo ,
constructFindControllerWebView ,
getFindControllerWebView ,
FindControllerCountedMatchesCallback ,
FindControllerCountedMatchesCallbackC ,
FindControllerCountedMatchesSignalInfo ,
afterFindControllerCountedMatches ,
findControllerCountedMatchesCallbackWrapper,
findControllerCountedMatchesClosure ,
mkFindControllerCountedMatchesCallback ,
noFindControllerCountedMatchesCallback ,
onFindControllerCountedMatches ,
FindControllerFailedToFindTextCallback ,
FindControllerFailedToFindTextCallbackC ,
FindControllerFailedToFindTextSignalInfo,
afterFindControllerFailedToFindText ,
findControllerFailedToFindTextCallbackWrapper,
findControllerFailedToFindTextClosure ,
mkFindControllerFailedToFindTextCallback,
noFindControllerFailedToFindTextCallback,
onFindControllerFailedToFindText ,
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
type FindControllerCountedMatchesCallback =
Word32 ->
IO ()
noFindControllerCountedMatchesCallback :: Maybe FindControllerCountedMatchesCallback
noFindControllerCountedMatchesCallback = Nothing
type FindControllerCountedMatchesCallbackC =
Ptr () ->
Word32 ->
Ptr () ->
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
type FindControllerFailedToFindTextCallback =
IO ()
noFindControllerFailedToFindTextCallback :: Maybe FindControllerFailedToFindTextCallback
noFindControllerFailedToFindTextCallback = Nothing
type FindControllerFailedToFindTextCallbackC =
Ptr () ->
Ptr () ->
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
type FindControllerFoundTextCallback =
Word32 ->
IO ()
noFindControllerFoundTextCallback :: Maybe FindControllerFoundTextCallback
noFindControllerFoundTextCallback = Nothing
type FindControllerFoundTextCallbackC =
Ptr () ->
Word32 ->
Ptr () ->
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
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
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
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
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, *)])
foreign import ccall "webkit_find_controller_count_matches" webkit_find_controller_count_matches ::
Ptr FindController ->
CString ->
Word32 ->
Word32 ->
IO ()
findControllerCountMatches ::
(MonadIO m, FindControllerK a) =>
a ->
T.Text ->
Word32 ->
Word32 ->
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 ()
foreign import ccall "webkit_find_controller_get_max_match_count" webkit_find_controller_get_max_match_count ::
Ptr FindController ->
IO Word32
findControllerGetMaxMatchCount ::
(MonadIO m, FindControllerK a) =>
a ->
m Word32
findControllerGetMaxMatchCount _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_find_controller_get_max_match_count _obj'
touchManagedPtr _obj
return result
foreign import ccall "webkit_find_controller_get_options" webkit_find_controller_get_options ::
Ptr FindController ->
IO Word32
findControllerGetOptions ::
(MonadIO m, FindControllerK a) =>
a ->
m Word32
findControllerGetOptions _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_find_controller_get_options _obj'
touchManagedPtr _obj
return result
foreign import ccall "webkit_find_controller_get_search_text" webkit_find_controller_get_search_text ::
Ptr FindController ->
IO CString
findControllerGetSearchText ::
(MonadIO m, FindControllerK a) =>
a ->
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'
foreign import ccall "webkit_find_controller_get_web_view" webkit_find_controller_get_web_view ::
Ptr FindController ->
IO (Ptr WebView)
findControllerGetWebView ::
(MonadIO m, FindControllerK a) =>
a ->
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'
foreign import ccall "webkit_find_controller_search" webkit_find_controller_search ::
Ptr FindController ->
CString ->
Word32 ->
Word32 ->
IO ()
findControllerSearch ::
(MonadIO m, FindControllerK a) =>
a ->
T.Text ->
Word32 ->
Word32 ->
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 ()
foreign import ccall "webkit_find_controller_search_finish" webkit_find_controller_search_finish ::
Ptr FindController ->
IO ()
findControllerSearchFinish ::
(MonadIO m, FindControllerK a) =>
a ->
m ()
findControllerSearchFinish _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
webkit_find_controller_search_finish _obj'
touchManagedPtr _obj
return ()
foreign import ccall "webkit_find_controller_search_next" webkit_find_controller_search_next ::
Ptr FindController ->
IO ()
findControllerSearchNext ::
(MonadIO m, FindControllerK a) =>
a ->
m ()
findControllerSearchNext _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
webkit_find_controller_search_next _obj'
touchManagedPtr _obj
return ()
foreign import ccall "webkit_find_controller_search_previous" webkit_find_controller_search_previous ::
Ptr FindController ->
IO ()
findControllerSearchPrevious ::
(MonadIO m, FindControllerK a) =>
a ->
m ()
findControllerSearchPrevious _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
webkit_find_controller_search_previous _obj'
touchManagedPtr _obj
return ()