{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.WebKit2.Structs.NavigationAction
(
NavigationAction(..) ,
noNavigationAction ,
#if defined(ENABLE_OVERLOADING)
ResolveNavigationActionMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
NavigationActionCopyMethodInfo ,
#endif
navigationActionCopy ,
#if defined(ENABLE_OVERLOADING)
NavigationActionFreeMethodInfo ,
#endif
navigationActionFree ,
#if defined(ENABLE_OVERLOADING)
NavigationActionGetModifiersMethodInfo ,
#endif
navigationActionGetModifiers ,
#if defined(ENABLE_OVERLOADING)
NavigationActionGetMouseButtonMethodInfo,
#endif
navigationActionGetMouseButton ,
#if defined(ENABLE_OVERLOADING)
NavigationActionGetNavigationTypeMethodInfo,
#endif
navigationActionGetNavigationType ,
#if defined(ENABLE_OVERLOADING)
NavigationActionGetRequestMethodInfo ,
#endif
navigationActionGetRequest ,
#if defined(ENABLE_OVERLOADING)
NavigationActionIsRedirectMethodInfo ,
#endif
navigationActionIsRedirect ,
#if defined(ENABLE_OVERLOADING)
NavigationActionIsUserGestureMethodInfo ,
#endif
navigationActionIsUserGesture ,
) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified 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 GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.WebKit2.Enums as WebKit2.Enums
import {-# SOURCE #-} qualified GI.WebKit2.Objects.URIRequest as WebKit2.URIRequest
newtype NavigationAction = NavigationAction (ManagedPtr NavigationAction)
deriving (NavigationAction -> NavigationAction -> Bool
(NavigationAction -> NavigationAction -> Bool)
-> (NavigationAction -> NavigationAction -> Bool)
-> Eq NavigationAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NavigationAction -> NavigationAction -> Bool
$c/= :: NavigationAction -> NavigationAction -> Bool
== :: NavigationAction -> NavigationAction -> Bool
$c== :: NavigationAction -> NavigationAction -> Bool
Eq)
foreign import ccall "webkit_navigation_action_get_type" c_webkit_navigation_action_get_type ::
IO GType
instance BoxedObject NavigationAction where
boxedType :: NavigationAction -> IO GType
boxedType _ = IO GType
c_webkit_navigation_action_get_type
instance B.GValue.IsGValue NavigationAction where
toGValue :: NavigationAction -> IO GValue
toGValue o :: NavigationAction
o = do
GType
gtype <- IO GType
c_webkit_navigation_action_get_type
NavigationAction
-> (Ptr NavigationAction -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr NavigationAction
o (GType
-> (GValue -> Ptr NavigationAction -> IO ())
-> Ptr NavigationAction
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr NavigationAction -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO NavigationAction
fromGValue gv :: GValue
gv = do
Ptr NavigationAction
ptr <- GValue -> IO (Ptr NavigationAction)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr NavigationAction)
(ManagedPtr NavigationAction -> NavigationAction)
-> Ptr NavigationAction -> IO NavigationAction
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr NavigationAction -> NavigationAction
NavigationAction Ptr NavigationAction
ptr
noNavigationAction :: Maybe NavigationAction
noNavigationAction :: Maybe NavigationAction
noNavigationAction = Maybe NavigationAction
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList NavigationAction
type instance O.AttributeList NavigationAction = NavigationActionAttributeList
type NavigationActionAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_navigation_action_copy" webkit_navigation_action_copy ::
Ptr NavigationAction ->
IO (Ptr NavigationAction)
navigationActionCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
NavigationAction
-> m NavigationAction
navigationActionCopy :: NavigationAction -> m NavigationAction
navigationActionCopy navigation :: NavigationAction
navigation = IO NavigationAction -> m NavigationAction
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO NavigationAction -> m NavigationAction)
-> IO NavigationAction -> m NavigationAction
forall a b. (a -> b) -> a -> b
$ do
Ptr NavigationAction
navigation' <- NavigationAction -> IO (Ptr NavigationAction)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr NavigationAction
navigation
Ptr NavigationAction
result <- Ptr NavigationAction -> IO (Ptr NavigationAction)
webkit_navigation_action_copy Ptr NavigationAction
navigation'
Text -> Ptr NavigationAction -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "navigationActionCopy" Ptr NavigationAction
result
NavigationAction
result' <- ((ManagedPtr NavigationAction -> NavigationAction)
-> Ptr NavigationAction -> IO NavigationAction
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr NavigationAction -> NavigationAction
NavigationAction) Ptr NavigationAction
result
NavigationAction -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr NavigationAction
navigation
NavigationAction -> IO NavigationAction
forall (m :: * -> *) a. Monad m => a -> m a
return NavigationAction
result'
#if defined(ENABLE_OVERLOADING)
data NavigationActionCopyMethodInfo
instance (signature ~ (m NavigationAction), MonadIO m) => O.MethodInfo NavigationActionCopyMethodInfo NavigationAction signature where
overloadedMethod = navigationActionCopy
#endif
foreign import ccall "webkit_navigation_action_free" webkit_navigation_action_free ::
Ptr NavigationAction ->
IO ()
navigationActionFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
NavigationAction
-> m ()
navigationActionFree :: NavigationAction -> m ()
navigationActionFree navigation :: NavigationAction
navigation = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr NavigationAction
navigation' <- NavigationAction -> IO (Ptr NavigationAction)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr NavigationAction
navigation
Ptr NavigationAction -> IO ()
webkit_navigation_action_free Ptr NavigationAction
navigation'
NavigationAction -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr NavigationAction
navigation
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NavigationActionFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo NavigationActionFreeMethodInfo NavigationAction signature where
overloadedMethod = navigationActionFree
#endif
foreign import ccall "webkit_navigation_action_get_modifiers" webkit_navigation_action_get_modifiers ::
Ptr NavigationAction ->
IO Word32
navigationActionGetModifiers ::
(B.CallStack.HasCallStack, MonadIO m) =>
NavigationAction
-> m Word32
navigationActionGetModifiers :: NavigationAction -> m Word32
navigationActionGetModifiers navigation :: NavigationAction
navigation = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr NavigationAction
navigation' <- NavigationAction -> IO (Ptr NavigationAction)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr NavigationAction
navigation
Word32
result <- Ptr NavigationAction -> IO Word32
webkit_navigation_action_get_modifiers Ptr NavigationAction
navigation'
NavigationAction -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr NavigationAction
navigation
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data NavigationActionGetModifiersMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.MethodInfo NavigationActionGetModifiersMethodInfo NavigationAction signature where
overloadedMethod = navigationActionGetModifiers
#endif
foreign import ccall "webkit_navigation_action_get_mouse_button" webkit_navigation_action_get_mouse_button ::
Ptr NavigationAction ->
IO Word32
navigationActionGetMouseButton ::
(B.CallStack.HasCallStack, MonadIO m) =>
NavigationAction
-> m Word32
navigationActionGetMouseButton :: NavigationAction -> m Word32
navigationActionGetMouseButton navigation :: NavigationAction
navigation = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr NavigationAction
navigation' <- NavigationAction -> IO (Ptr NavigationAction)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr NavigationAction
navigation
Word32
result <- Ptr NavigationAction -> IO Word32
webkit_navigation_action_get_mouse_button Ptr NavigationAction
navigation'
NavigationAction -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr NavigationAction
navigation
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data NavigationActionGetMouseButtonMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.MethodInfo NavigationActionGetMouseButtonMethodInfo NavigationAction signature where
overloadedMethod = navigationActionGetMouseButton
#endif
foreign import ccall "webkit_navigation_action_get_navigation_type" webkit_navigation_action_get_navigation_type ::
Ptr NavigationAction ->
IO CUInt
navigationActionGetNavigationType ::
(B.CallStack.HasCallStack, MonadIO m) =>
NavigationAction
-> m WebKit2.Enums.NavigationType
navigationActionGetNavigationType :: NavigationAction -> m NavigationType
navigationActionGetNavigationType navigation :: NavigationAction
navigation = IO NavigationType -> m NavigationType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO NavigationType -> m NavigationType)
-> IO NavigationType -> m NavigationType
forall a b. (a -> b) -> a -> b
$ do
Ptr NavigationAction
navigation' <- NavigationAction -> IO (Ptr NavigationAction)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr NavigationAction
navigation
CUInt
result <- Ptr NavigationAction -> IO CUInt
webkit_navigation_action_get_navigation_type Ptr NavigationAction
navigation'
let result' :: NavigationType
result' = (Int -> NavigationType
forall a. Enum a => Int -> a
toEnum (Int -> NavigationType)
-> (CUInt -> Int) -> CUInt -> NavigationType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
NavigationAction -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr NavigationAction
navigation
NavigationType -> IO NavigationType
forall (m :: * -> *) a. Monad m => a -> m a
return NavigationType
result'
#if defined(ENABLE_OVERLOADING)
data NavigationActionGetNavigationTypeMethodInfo
instance (signature ~ (m WebKit2.Enums.NavigationType), MonadIO m) => O.MethodInfo NavigationActionGetNavigationTypeMethodInfo NavigationAction signature where
overloadedMethod = navigationActionGetNavigationType
#endif
foreign import ccall "webkit_navigation_action_get_request" webkit_navigation_action_get_request ::
Ptr NavigationAction ->
IO (Ptr WebKit2.URIRequest.URIRequest)
navigationActionGetRequest ::
(B.CallStack.HasCallStack, MonadIO m) =>
NavigationAction
-> m WebKit2.URIRequest.URIRequest
navigationActionGetRequest :: NavigationAction -> m URIRequest
navigationActionGetRequest navigation :: NavigationAction
navigation = IO URIRequest -> m URIRequest
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO URIRequest -> m URIRequest) -> IO URIRequest -> m URIRequest
forall a b. (a -> b) -> a -> b
$ do
Ptr NavigationAction
navigation' <- NavigationAction -> IO (Ptr NavigationAction)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr NavigationAction
navigation
Ptr URIRequest
result <- Ptr NavigationAction -> IO (Ptr URIRequest)
webkit_navigation_action_get_request Ptr NavigationAction
navigation'
Text -> Ptr URIRequest -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "navigationActionGetRequest" Ptr URIRequest
result
URIRequest
result' <- ((ManagedPtr URIRequest -> URIRequest)
-> Ptr URIRequest -> IO URIRequest
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr URIRequest -> URIRequest
WebKit2.URIRequest.URIRequest) Ptr URIRequest
result
NavigationAction -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr NavigationAction
navigation
URIRequest -> IO URIRequest
forall (m :: * -> *) a. Monad m => a -> m a
return URIRequest
result'
#if defined(ENABLE_OVERLOADING)
data NavigationActionGetRequestMethodInfo
instance (signature ~ (m WebKit2.URIRequest.URIRequest), MonadIO m) => O.MethodInfo NavigationActionGetRequestMethodInfo NavigationAction signature where
overloadedMethod = navigationActionGetRequest
#endif
foreign import ccall "webkit_navigation_action_is_redirect" webkit_navigation_action_is_redirect ::
Ptr NavigationAction ->
IO CInt
navigationActionIsRedirect ::
(B.CallStack.HasCallStack, MonadIO m) =>
NavigationAction
-> m Bool
navigationActionIsRedirect :: NavigationAction -> m Bool
navigationActionIsRedirect navigation :: NavigationAction
navigation = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr NavigationAction
navigation' <- NavigationAction -> IO (Ptr NavigationAction)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr NavigationAction
navigation
CInt
result <- Ptr NavigationAction -> IO CInt
webkit_navigation_action_is_redirect Ptr NavigationAction
navigation'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
NavigationAction -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr NavigationAction
navigation
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data NavigationActionIsRedirectMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo NavigationActionIsRedirectMethodInfo NavigationAction signature where
overloadedMethod = navigationActionIsRedirect
#endif
foreign import ccall "webkit_navigation_action_is_user_gesture" webkit_navigation_action_is_user_gesture ::
Ptr NavigationAction ->
IO CInt
navigationActionIsUserGesture ::
(B.CallStack.HasCallStack, MonadIO m) =>
NavigationAction
-> m Bool
navigationActionIsUserGesture :: NavigationAction -> m Bool
navigationActionIsUserGesture navigation :: NavigationAction
navigation = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr NavigationAction
navigation' <- NavigationAction -> IO (Ptr NavigationAction)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr NavigationAction
navigation
CInt
result <- Ptr NavigationAction -> IO CInt
webkit_navigation_action_is_user_gesture Ptr NavigationAction
navigation'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
NavigationAction -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr NavigationAction
navigation
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data NavigationActionIsUserGestureMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo NavigationActionIsUserGestureMethodInfo NavigationAction signature where
overloadedMethod = navigationActionIsUserGesture
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveNavigationActionMethod (t :: Symbol) (o :: *) :: * where
ResolveNavigationActionMethod "copy" o = NavigationActionCopyMethodInfo
ResolveNavigationActionMethod "free" o = NavigationActionFreeMethodInfo
ResolveNavigationActionMethod "isRedirect" o = NavigationActionIsRedirectMethodInfo
ResolveNavigationActionMethod "isUserGesture" o = NavigationActionIsUserGestureMethodInfo
ResolveNavigationActionMethod "getModifiers" o = NavigationActionGetModifiersMethodInfo
ResolveNavigationActionMethod "getMouseButton" o = NavigationActionGetMouseButtonMethodInfo
ResolveNavigationActionMethod "getNavigationType" o = NavigationActionGetNavigationTypeMethodInfo
ResolveNavigationActionMethod "getRequest" o = NavigationActionGetRequestMethodInfo
ResolveNavigationActionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveNavigationActionMethod t NavigationAction, O.MethodInfo info NavigationAction p) => OL.IsLabel t (NavigationAction -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif