module GI.WebKit.Objects.DOMXPathResult
(
DOMXPathResult(..) ,
DOMXPathResultK ,
toDOMXPathResult ,
noDOMXPathResult ,
dOMXPathResultGetBooleanValue ,
dOMXPathResultGetInvalidIteratorState ,
dOMXPathResultGetNumberValue ,
dOMXPathResultGetResultType ,
dOMXPathResultGetSingleNodeValue ,
dOMXPathResultGetSnapshotLength ,
dOMXPathResultGetStringValue ,
dOMXPathResultIterateNext ,
dOMXPathResultSnapshotItem ,
DOMXPathResultBooleanValuePropertyInfo ,
getDOMXPathResultBooleanValue ,
DOMXPathResultInvalidIteratorStatePropertyInfo,
getDOMXPathResultInvalidIteratorState ,
DOMXPathResultNumberValuePropertyInfo ,
getDOMXPathResultNumberValue ,
DOMXPathResultResultTypePropertyInfo ,
getDOMXPathResultResultType ,
DOMXPathResultSingleNodeValuePropertyInfo,
getDOMXPathResultSingleNodeValue ,
DOMXPathResultSnapshotLengthPropertyInfo,
getDOMXPathResultSnapshotLength ,
DOMXPathResultStringValuePropertyInfo ,
getDOMXPathResultStringValue ,
) 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.WebKit.Types
import GI.WebKit.Callbacks
import qualified GI.GObject as GObject
newtype DOMXPathResult = DOMXPathResult (ForeignPtr DOMXPathResult)
foreign import ccall "webkit_dom_xpath_result_get_type"
c_webkit_dom_xpath_result_get_type :: IO GType
type instance ParentTypes DOMXPathResult = DOMXPathResultParentTypes
type DOMXPathResultParentTypes = '[DOMObject, GObject.Object]
instance GObject DOMXPathResult where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_dom_xpath_result_get_type
class GObject o => DOMXPathResultK o
instance (GObject o, IsDescendantOf DOMXPathResult o) => DOMXPathResultK o
toDOMXPathResult :: DOMXPathResultK o => o -> IO DOMXPathResult
toDOMXPathResult = unsafeCastTo DOMXPathResult
noDOMXPathResult :: Maybe DOMXPathResult
noDOMXPathResult = Nothing
getDOMXPathResultBooleanValue :: (MonadIO m, DOMXPathResultK o) => o -> m Bool
getDOMXPathResultBooleanValue obj = liftIO $ getObjectPropertyBool obj "boolean-value"
data DOMXPathResultBooleanValuePropertyInfo
instance AttrInfo DOMXPathResultBooleanValuePropertyInfo where
type AttrAllowedOps DOMXPathResultBooleanValuePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMXPathResultBooleanValuePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMXPathResultBooleanValuePropertyInfo = DOMXPathResultK
type AttrGetType DOMXPathResultBooleanValuePropertyInfo = Bool
type AttrLabel DOMXPathResultBooleanValuePropertyInfo = "DOMXPathResult::boolean-value"
attrGet _ = getDOMXPathResultBooleanValue
attrSet _ = undefined
attrConstruct _ = undefined
getDOMXPathResultInvalidIteratorState :: (MonadIO m, DOMXPathResultK o) => o -> m Bool
getDOMXPathResultInvalidIteratorState obj = liftIO $ getObjectPropertyBool obj "invalid-iterator-state"
data DOMXPathResultInvalidIteratorStatePropertyInfo
instance AttrInfo DOMXPathResultInvalidIteratorStatePropertyInfo where
type AttrAllowedOps DOMXPathResultInvalidIteratorStatePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMXPathResultInvalidIteratorStatePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMXPathResultInvalidIteratorStatePropertyInfo = DOMXPathResultK
type AttrGetType DOMXPathResultInvalidIteratorStatePropertyInfo = Bool
type AttrLabel DOMXPathResultInvalidIteratorStatePropertyInfo = "DOMXPathResult::invalid-iterator-state"
attrGet _ = getDOMXPathResultInvalidIteratorState
attrSet _ = undefined
attrConstruct _ = undefined
getDOMXPathResultNumberValue :: (MonadIO m, DOMXPathResultK o) => o -> m Double
getDOMXPathResultNumberValue obj = liftIO $ getObjectPropertyDouble obj "number-value"
data DOMXPathResultNumberValuePropertyInfo
instance AttrInfo DOMXPathResultNumberValuePropertyInfo where
type AttrAllowedOps DOMXPathResultNumberValuePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMXPathResultNumberValuePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMXPathResultNumberValuePropertyInfo = DOMXPathResultK
type AttrGetType DOMXPathResultNumberValuePropertyInfo = Double
type AttrLabel DOMXPathResultNumberValuePropertyInfo = "DOMXPathResult::number-value"
attrGet _ = getDOMXPathResultNumberValue
attrSet _ = undefined
attrConstruct _ = undefined
getDOMXPathResultResultType :: (MonadIO m, DOMXPathResultK o) => o -> m Word32
getDOMXPathResultResultType obj = liftIO $ getObjectPropertyCUInt obj "result-type"
data DOMXPathResultResultTypePropertyInfo
instance AttrInfo DOMXPathResultResultTypePropertyInfo where
type AttrAllowedOps DOMXPathResultResultTypePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMXPathResultResultTypePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMXPathResultResultTypePropertyInfo = DOMXPathResultK
type AttrGetType DOMXPathResultResultTypePropertyInfo = Word32
type AttrLabel DOMXPathResultResultTypePropertyInfo = "DOMXPathResult::result-type"
attrGet _ = getDOMXPathResultResultType
attrSet _ = undefined
attrConstruct _ = undefined
getDOMXPathResultSingleNodeValue :: (MonadIO m, DOMXPathResultK o) => o -> m DOMNode
getDOMXPathResultSingleNodeValue obj = liftIO $ getObjectPropertyObject obj "single-node-value" DOMNode
data DOMXPathResultSingleNodeValuePropertyInfo
instance AttrInfo DOMXPathResultSingleNodeValuePropertyInfo where
type AttrAllowedOps DOMXPathResultSingleNodeValuePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMXPathResultSingleNodeValuePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMXPathResultSingleNodeValuePropertyInfo = DOMXPathResultK
type AttrGetType DOMXPathResultSingleNodeValuePropertyInfo = DOMNode
type AttrLabel DOMXPathResultSingleNodeValuePropertyInfo = "DOMXPathResult::single-node-value"
attrGet _ = getDOMXPathResultSingleNodeValue
attrSet _ = undefined
attrConstruct _ = undefined
getDOMXPathResultSnapshotLength :: (MonadIO m, DOMXPathResultK o) => o -> m Word64
getDOMXPathResultSnapshotLength obj = liftIO $ getObjectPropertyUInt64 obj "snapshot-length"
data DOMXPathResultSnapshotLengthPropertyInfo
instance AttrInfo DOMXPathResultSnapshotLengthPropertyInfo where
type AttrAllowedOps DOMXPathResultSnapshotLengthPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMXPathResultSnapshotLengthPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMXPathResultSnapshotLengthPropertyInfo = DOMXPathResultK
type AttrGetType DOMXPathResultSnapshotLengthPropertyInfo = Word64
type AttrLabel DOMXPathResultSnapshotLengthPropertyInfo = "DOMXPathResult::snapshot-length"
attrGet _ = getDOMXPathResultSnapshotLength
attrSet _ = undefined
attrConstruct _ = undefined
getDOMXPathResultStringValue :: (MonadIO m, DOMXPathResultK o) => o -> m T.Text
getDOMXPathResultStringValue obj = liftIO $ getObjectPropertyString obj "string-value"
data DOMXPathResultStringValuePropertyInfo
instance AttrInfo DOMXPathResultStringValuePropertyInfo where
type AttrAllowedOps DOMXPathResultStringValuePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMXPathResultStringValuePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMXPathResultStringValuePropertyInfo = DOMXPathResultK
type AttrGetType DOMXPathResultStringValuePropertyInfo = T.Text
type AttrLabel DOMXPathResultStringValuePropertyInfo = "DOMXPathResult::string-value"
attrGet _ = getDOMXPathResultStringValue
attrSet _ = undefined
attrConstruct _ = undefined
type instance AttributeList DOMXPathResult = DOMXPathResultAttributeList
type DOMXPathResultAttributeList = ('[ '("boolean-value", DOMXPathResultBooleanValuePropertyInfo), '("core-object", DOMObjectCoreObjectPropertyInfo), '("invalid-iterator-state", DOMXPathResultInvalidIteratorStatePropertyInfo), '("number-value", DOMXPathResultNumberValuePropertyInfo), '("result-type", DOMXPathResultResultTypePropertyInfo), '("single-node-value", DOMXPathResultSingleNodeValuePropertyInfo), '("snapshot-length", DOMXPathResultSnapshotLengthPropertyInfo), '("string-value", DOMXPathResultStringValuePropertyInfo)] :: [(Symbol, *)])
type instance SignalList DOMXPathResult = DOMXPathResultSignalList
type DOMXPathResultSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_dom_xpath_result_get_boolean_value" webkit_dom_xpath_result_get_boolean_value ::
Ptr DOMXPathResult ->
Ptr (Ptr GError) ->
IO CInt
dOMXPathResultGetBooleanValue ::
(MonadIO m, DOMXPathResultK a) =>
a ->
m ()
dOMXPathResultGetBooleanValue _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
onException (do
_ <- propagateGError $ webkit_dom_xpath_result_get_boolean_value _obj'
touchManagedPtr _obj
return ()
) (do
return ()
)
foreign import ccall "webkit_dom_xpath_result_get_invalid_iterator_state" webkit_dom_xpath_result_get_invalid_iterator_state ::
Ptr DOMXPathResult ->
IO CInt
dOMXPathResultGetInvalidIteratorState ::
(MonadIO m, DOMXPathResultK a) =>
a ->
m Bool
dOMXPathResultGetInvalidIteratorState _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_xpath_result_get_invalid_iterator_state _obj'
let result' = (/= 0) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_xpath_result_get_number_value" webkit_dom_xpath_result_get_number_value ::
Ptr DOMXPathResult ->
Ptr (Ptr GError) ->
IO CDouble
dOMXPathResultGetNumberValue ::
(MonadIO m, DOMXPathResultK a) =>
a ->
m Double
dOMXPathResultGetNumberValue _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
onException (do
result <- propagateGError $ webkit_dom_xpath_result_get_number_value _obj'
let result' = realToFrac result
touchManagedPtr _obj
return result'
) (do
return ()
)
foreign import ccall "webkit_dom_xpath_result_get_result_type" webkit_dom_xpath_result_get_result_type ::
Ptr DOMXPathResult ->
IO Word16
dOMXPathResultGetResultType ::
(MonadIO m, DOMXPathResultK a) =>
a ->
m Word16
dOMXPathResultGetResultType _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_xpath_result_get_result_type _obj'
touchManagedPtr _obj
return result
foreign import ccall "webkit_dom_xpath_result_get_single_node_value" webkit_dom_xpath_result_get_single_node_value ::
Ptr DOMXPathResult ->
Ptr (Ptr GError) ->
IO (Ptr DOMNode)
dOMXPathResultGetSingleNodeValue ::
(MonadIO m, DOMXPathResultK a) =>
a ->
m DOMNode
dOMXPathResultGetSingleNodeValue _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
onException (do
result <- propagateGError $ webkit_dom_xpath_result_get_single_node_value _obj'
checkUnexpectedReturnNULL "webkit_dom_xpath_result_get_single_node_value" result
result' <- (newObject DOMNode) result
touchManagedPtr _obj
return result'
) (do
return ()
)
foreign import ccall "webkit_dom_xpath_result_get_snapshot_length" webkit_dom_xpath_result_get_snapshot_length ::
Ptr DOMXPathResult ->
Ptr (Ptr GError) ->
IO Word64
dOMXPathResultGetSnapshotLength ::
(MonadIO m, DOMXPathResultK a) =>
a ->
m Word64
dOMXPathResultGetSnapshotLength _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
onException (do
result <- propagateGError $ webkit_dom_xpath_result_get_snapshot_length _obj'
touchManagedPtr _obj
return result
) (do
return ()
)
foreign import ccall "webkit_dom_xpath_result_get_string_value" webkit_dom_xpath_result_get_string_value ::
Ptr DOMXPathResult ->
Ptr (Ptr GError) ->
IO CString
dOMXPathResultGetStringValue ::
(MonadIO m, DOMXPathResultK a) =>
a ->
m T.Text
dOMXPathResultGetStringValue _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
onException (do
result <- propagateGError $ webkit_dom_xpath_result_get_string_value _obj'
checkUnexpectedReturnNULL "webkit_dom_xpath_result_get_string_value" result
result' <- cstringToText result
freeMem result
touchManagedPtr _obj
return result'
) (do
return ()
)
foreign import ccall "webkit_dom_xpath_result_iterate_next" webkit_dom_xpath_result_iterate_next ::
Ptr DOMXPathResult ->
Ptr (Ptr GError) ->
IO (Ptr DOMNode)
dOMXPathResultIterateNext ::
(MonadIO m, DOMXPathResultK a) =>
a ->
m DOMNode
dOMXPathResultIterateNext _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
onException (do
result <- propagateGError $ webkit_dom_xpath_result_iterate_next _obj'
checkUnexpectedReturnNULL "webkit_dom_xpath_result_iterate_next" result
result' <- (newObject DOMNode) result
touchManagedPtr _obj
return result'
) (do
return ()
)
foreign import ccall "webkit_dom_xpath_result_snapshot_item" webkit_dom_xpath_result_snapshot_item ::
Ptr DOMXPathResult ->
Word64 ->
Ptr (Ptr GError) ->
IO (Ptr DOMNode)
dOMXPathResultSnapshotItem ::
(MonadIO m, DOMXPathResultK a) =>
a ->
Word64 ->
m DOMNode
dOMXPathResultSnapshotItem _obj index = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
onException (do
result <- propagateGError $ webkit_dom_xpath_result_snapshot_item _obj' index
checkUnexpectedReturnNULL "webkit_dom_xpath_result_snapshot_item" result
result' <- (newObject DOMNode) result
touchManagedPtr _obj
return result'
) (do
return ()
)