{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.WebKit2.Objects.Notification
(
Notification(..) ,
IsNotification ,
toNotification ,
#if defined(ENABLE_OVERLOADING)
ResolveNotificationMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
NotificationClickedMethodInfo ,
#endif
notificationClicked ,
#if defined(ENABLE_OVERLOADING)
NotificationCloseMethodInfo ,
#endif
notificationClose ,
#if defined(ENABLE_OVERLOADING)
NotificationGetBodyMethodInfo ,
#endif
notificationGetBody ,
#if defined(ENABLE_OVERLOADING)
NotificationGetIdMethodInfo ,
#endif
notificationGetId ,
#if defined(ENABLE_OVERLOADING)
NotificationGetTagMethodInfo ,
#endif
notificationGetTag ,
#if defined(ENABLE_OVERLOADING)
NotificationGetTitleMethodInfo ,
#endif
notificationGetTitle ,
#if defined(ENABLE_OVERLOADING)
NotificationBodyPropertyInfo ,
#endif
getNotificationBody ,
#if defined(ENABLE_OVERLOADING)
notificationBody ,
#endif
#if defined(ENABLE_OVERLOADING)
NotificationIdPropertyInfo ,
#endif
getNotificationId ,
#if defined(ENABLE_OVERLOADING)
notificationId ,
#endif
#if defined(ENABLE_OVERLOADING)
NotificationTagPropertyInfo ,
#endif
getNotificationTag ,
#if defined(ENABLE_OVERLOADING)
notificationTag ,
#endif
#if defined(ENABLE_OVERLOADING)
NotificationTitlePropertyInfo ,
#endif
getNotificationTitle ,
#if defined(ENABLE_OVERLOADING)
notificationTitle ,
#endif
NotificationClickedCallback ,
#if defined(ENABLE_OVERLOADING)
NotificationClickedSignalInfo ,
#endif
afterNotificationClicked ,
onNotificationClicked ,
NotificationClosedCallback ,
#if defined(ENABLE_OVERLOADING)
NotificationClosedSignalInfo ,
#endif
afterNotificationClosed ,
onNotificationClosed ,
) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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 Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
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 qualified GHC.Records as R
import qualified GI.GObject.Objects.Object as GObject.Object
newtype Notification = Notification (SP.ManagedPtr Notification)
deriving (Notification -> Notification -> Bool
(Notification -> Notification -> Bool)
-> (Notification -> Notification -> Bool) -> Eq Notification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Notification -> Notification -> Bool
== :: Notification -> Notification -> Bool
$c/= :: Notification -> Notification -> Bool
/= :: Notification -> Notification -> Bool
Eq)
instance SP.ManagedPtrNewtype Notification where
toManagedPtr :: Notification -> ManagedPtr Notification
toManagedPtr (Notification ManagedPtr Notification
p) = ManagedPtr Notification
p
foreign import ccall "webkit_notification_get_type"
c_webkit_notification_get_type :: IO B.Types.GType
instance B.Types.TypedObject Notification where
glibType :: IO GType
glibType = IO GType
c_webkit_notification_get_type
instance B.Types.GObject Notification
class (SP.GObject o, O.IsDescendantOf Notification o) => IsNotification o
instance (SP.GObject o, O.IsDescendantOf Notification o) => IsNotification o
instance O.HasParentTypes Notification
type instance O.ParentTypes Notification = '[GObject.Object.Object]
toNotification :: (MIO.MonadIO m, IsNotification o) => o -> m Notification
toNotification :: forall (m :: * -> *) o.
(MonadIO m, IsNotification o) =>
o -> m Notification
toNotification = IO Notification -> m Notification
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Notification -> m Notification)
-> (o -> IO Notification) -> o -> m Notification
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Notification -> Notification) -> o -> IO Notification
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Notification -> Notification
Notification
instance B.GValue.IsGValue (Maybe Notification) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_webkit_notification_get_type
gvalueSet_ :: Ptr GValue -> Maybe Notification -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Notification
P.Nothing = Ptr GValue -> Ptr Notification -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Notification
forall a. Ptr a
FP.nullPtr :: FP.Ptr Notification)
gvalueSet_ Ptr GValue
gv (P.Just Notification
obj) = Notification -> (Ptr Notification -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Notification
obj (Ptr GValue -> Ptr Notification -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Notification)
gvalueGet_ Ptr GValue
gv = do
Ptr Notification
ptr <- Ptr GValue -> IO (Ptr Notification)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Notification)
if Ptr Notification
ptr Ptr Notification -> Ptr Notification -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Notification
forall a. Ptr a
FP.nullPtr
then Notification -> Maybe Notification
forall a. a -> Maybe a
P.Just (Notification -> Maybe Notification)
-> IO Notification -> IO (Maybe Notification)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Notification -> Notification)
-> Ptr Notification -> IO Notification
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Notification -> Notification
Notification Ptr Notification
ptr
else Maybe Notification -> IO (Maybe Notification)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Notification
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveNotificationMethod (t :: Symbol) (o :: *) :: * where
ResolveNotificationMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveNotificationMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveNotificationMethod "clicked" o = NotificationClickedMethodInfo
ResolveNotificationMethod "close" o = NotificationCloseMethodInfo
ResolveNotificationMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveNotificationMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveNotificationMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveNotificationMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveNotificationMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveNotificationMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveNotificationMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveNotificationMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveNotificationMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveNotificationMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveNotificationMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveNotificationMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveNotificationMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveNotificationMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveNotificationMethod "getBody" o = NotificationGetBodyMethodInfo
ResolveNotificationMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveNotificationMethod "getId" o = NotificationGetIdMethodInfo
ResolveNotificationMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveNotificationMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveNotificationMethod "getTag" o = NotificationGetTagMethodInfo
ResolveNotificationMethod "getTitle" o = NotificationGetTitleMethodInfo
ResolveNotificationMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveNotificationMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveNotificationMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveNotificationMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveNotificationMethod t Notification, O.OverloadedMethod info Notification p) => OL.IsLabel t (Notification -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveNotificationMethod t Notification, O.OverloadedMethod info Notification p, R.HasField t Notification p) => R.HasField t Notification p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveNotificationMethod t Notification, O.OverloadedMethodInfo info Notification) => OL.IsLabel t (O.MethodProxy info Notification) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type NotificationClickedCallback =
IO ()
type C_NotificationClickedCallback =
Ptr Notification ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_NotificationClickedCallback :: C_NotificationClickedCallback -> IO (FunPtr C_NotificationClickedCallback)
wrap_NotificationClickedCallback ::
GObject a => (a -> NotificationClickedCallback) ->
C_NotificationClickedCallback
wrap_NotificationClickedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_NotificationClickedCallback
wrap_NotificationClickedCallback a -> IO ()
gi'cb Ptr Notification
gi'selfPtr Ptr ()
_ = do
Ptr Notification -> (Notification -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Notification
gi'selfPtr ((Notification -> IO ()) -> IO ())
-> (Notification -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Notification
gi'self -> a -> IO ()
gi'cb (Notification -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Notification
gi'self)
onNotificationClicked :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClickedCallback) -> m SignalHandlerId
onNotificationClicked :: forall a (m :: * -> *).
(IsNotification a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onNotificationClicked a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_NotificationClickedCallback
wrapped' = (a -> IO ()) -> C_NotificationClickedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_NotificationClickedCallback
wrap_NotificationClickedCallback a -> IO ()
wrapped
FunPtr C_NotificationClickedCallback
wrapped'' <- C_NotificationClickedCallback
-> IO (FunPtr C_NotificationClickedCallback)
mk_NotificationClickedCallback C_NotificationClickedCallback
wrapped'
a
-> Text
-> FunPtr C_NotificationClickedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"clicked" FunPtr C_NotificationClickedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterNotificationClicked :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClickedCallback) -> m SignalHandlerId
afterNotificationClicked :: forall a (m :: * -> *).
(IsNotification a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterNotificationClicked a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_NotificationClickedCallback
wrapped' = (a -> IO ()) -> C_NotificationClickedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_NotificationClickedCallback
wrap_NotificationClickedCallback a -> IO ()
wrapped
FunPtr C_NotificationClickedCallback
wrapped'' <- C_NotificationClickedCallback
-> IO (FunPtr C_NotificationClickedCallback)
mk_NotificationClickedCallback C_NotificationClickedCallback
wrapped'
a
-> Text
-> FunPtr C_NotificationClickedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"clicked" FunPtr C_NotificationClickedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data NotificationClickedSignalInfo
instance SignalInfo NotificationClickedSignalInfo where
type HaskellCallbackType NotificationClickedSignalInfo = NotificationClickedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_NotificationClickedCallback cb
cb'' <- mk_NotificationClickedCallback cb'
connectSignalFunPtr obj "clicked" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification::clicked"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#g:signal:clicked"})
#endif
type NotificationClosedCallback =
IO ()
type C_NotificationClosedCallback =
Ptr Notification ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_NotificationClosedCallback :: C_NotificationClosedCallback -> IO (FunPtr C_NotificationClosedCallback)
wrap_NotificationClosedCallback ::
GObject a => (a -> NotificationClosedCallback) ->
C_NotificationClosedCallback
wrap_NotificationClosedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_NotificationClickedCallback
wrap_NotificationClosedCallback a -> IO ()
gi'cb Ptr Notification
gi'selfPtr Ptr ()
_ = do
Ptr Notification -> (Notification -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Notification
gi'selfPtr ((Notification -> IO ()) -> IO ())
-> (Notification -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Notification
gi'self -> a -> IO ()
gi'cb (Notification -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Notification
gi'self)
onNotificationClosed :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClosedCallback) -> m SignalHandlerId
onNotificationClosed :: forall a (m :: * -> *).
(IsNotification a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onNotificationClosed a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_NotificationClickedCallback
wrapped' = (a -> IO ()) -> C_NotificationClickedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_NotificationClickedCallback
wrap_NotificationClosedCallback a -> IO ()
wrapped
FunPtr C_NotificationClickedCallback
wrapped'' <- C_NotificationClickedCallback
-> IO (FunPtr C_NotificationClickedCallback)
mk_NotificationClosedCallback C_NotificationClickedCallback
wrapped'
a
-> Text
-> FunPtr C_NotificationClickedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"closed" FunPtr C_NotificationClickedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterNotificationClosed :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClosedCallback) -> m SignalHandlerId
afterNotificationClosed :: forall a (m :: * -> *).
(IsNotification a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterNotificationClosed a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_NotificationClickedCallback
wrapped' = (a -> IO ()) -> C_NotificationClickedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_NotificationClickedCallback
wrap_NotificationClosedCallback a -> IO ()
wrapped
FunPtr C_NotificationClickedCallback
wrapped'' <- C_NotificationClickedCallback
-> IO (FunPtr C_NotificationClickedCallback)
mk_NotificationClosedCallback C_NotificationClickedCallback
wrapped'
a
-> Text
-> FunPtr C_NotificationClickedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"closed" FunPtr C_NotificationClickedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data NotificationClosedSignalInfo
instance SignalInfo NotificationClosedSignalInfo where
type HaskellCallbackType NotificationClosedSignalInfo = NotificationClosedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_NotificationClosedCallback cb
cb'' <- mk_NotificationClosedCallback cb'
connectSignalFunPtr obj "closed" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification::closed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#g:signal:closed"})
#endif
getNotificationBody :: (MonadIO m, IsNotification o) => o -> m T.Text
getNotificationBody :: forall (m :: * -> *) o.
(MonadIO m, IsNotification o) =>
o -> m Text
getNotificationBody o
obj = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getNotificationBody" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"body"
#if defined(ENABLE_OVERLOADING)
data NotificationBodyPropertyInfo
instance AttrInfo NotificationBodyPropertyInfo where
type AttrAllowedOps NotificationBodyPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint NotificationBodyPropertyInfo = IsNotification
type AttrSetTypeConstraint NotificationBodyPropertyInfo = (~) ()
type AttrTransferTypeConstraint NotificationBodyPropertyInfo = (~) ()
type AttrTransferType NotificationBodyPropertyInfo = ()
type AttrGetType NotificationBodyPropertyInfo = T.Text
type AttrLabel NotificationBodyPropertyInfo = "body"
type AttrOrigin NotificationBodyPropertyInfo = Notification
attrGet = getNotificationBody
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification.body"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#g:attr:body"
})
#endif
getNotificationId :: (MonadIO m, IsNotification o) => o -> m Word64
getNotificationId :: forall (m :: * -> *) o.
(MonadIO m, IsNotification o) =>
o -> m Word64
getNotificationId o
obj = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word64
forall a. GObject a => a -> String -> IO Word64
B.Properties.getObjectPropertyUInt64 o
obj String
"id"
#if defined(ENABLE_OVERLOADING)
data NotificationIdPropertyInfo
instance AttrInfo NotificationIdPropertyInfo where
type AttrAllowedOps NotificationIdPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint NotificationIdPropertyInfo = IsNotification
type AttrSetTypeConstraint NotificationIdPropertyInfo = (~) ()
type AttrTransferTypeConstraint NotificationIdPropertyInfo = (~) ()
type AttrTransferType NotificationIdPropertyInfo = ()
type AttrGetType NotificationIdPropertyInfo = Word64
type AttrLabel NotificationIdPropertyInfo = "id"
type AttrOrigin NotificationIdPropertyInfo = Notification
attrGet = getNotificationId
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification.id"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#g:attr:id"
})
#endif
getNotificationTag :: (MonadIO m, IsNotification o) => o -> m (Maybe T.Text)
getNotificationTag :: forall (m :: * -> *) o.
(MonadIO m, IsNotification o) =>
o -> m (Maybe Text)
getNotificationTag o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"tag"
#if defined(ENABLE_OVERLOADING)
data NotificationTagPropertyInfo
instance AttrInfo NotificationTagPropertyInfo where
type AttrAllowedOps NotificationTagPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint NotificationTagPropertyInfo = IsNotification
type AttrSetTypeConstraint NotificationTagPropertyInfo = (~) ()
type AttrTransferTypeConstraint NotificationTagPropertyInfo = (~) ()
type AttrTransferType NotificationTagPropertyInfo = ()
type AttrGetType NotificationTagPropertyInfo = (Maybe T.Text)
type AttrLabel NotificationTagPropertyInfo = "tag"
type AttrOrigin NotificationTagPropertyInfo = Notification
attrGet = getNotificationTag
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification.tag"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#g:attr:tag"
})
#endif
getNotificationTitle :: (MonadIO m, IsNotification o) => o -> m T.Text
getNotificationTitle :: forall (m :: * -> *) o.
(MonadIO m, IsNotification o) =>
o -> m Text
getNotificationTitle o
obj = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getNotificationTitle" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"title"
#if defined(ENABLE_OVERLOADING)
data NotificationTitlePropertyInfo
instance AttrInfo NotificationTitlePropertyInfo where
type AttrAllowedOps NotificationTitlePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint NotificationTitlePropertyInfo = IsNotification
type AttrSetTypeConstraint NotificationTitlePropertyInfo = (~) ()
type AttrTransferTypeConstraint NotificationTitlePropertyInfo = (~) ()
type AttrTransferType NotificationTitlePropertyInfo = ()
type AttrGetType NotificationTitlePropertyInfo = T.Text
type AttrLabel NotificationTitlePropertyInfo = "title"
type AttrOrigin NotificationTitlePropertyInfo = Notification
attrGet = getNotificationTitle
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification.title"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#g:attr:title"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Notification
type instance O.AttributeList Notification = NotificationAttributeList
type NotificationAttributeList = ('[ '("body", NotificationBodyPropertyInfo), '("id", NotificationIdPropertyInfo), '("tag", NotificationTagPropertyInfo), '("title", NotificationTitlePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
notificationBody :: AttrLabelProxy "body"
notificationBody = AttrLabelProxy
notificationId :: AttrLabelProxy "id"
notificationId = AttrLabelProxy
notificationTag :: AttrLabelProxy "tag"
notificationTag = AttrLabelProxy
notificationTitle :: AttrLabelProxy "title"
notificationTitle = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Notification = NotificationSignalList
type NotificationSignalList = ('[ '("clicked", NotificationClickedSignalInfo), '("closed", NotificationClosedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_notification_clicked" webkit_notification_clicked ::
Ptr Notification ->
IO ()
notificationClicked ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m ()
notificationClicked :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> m ()
notificationClicked a
notification = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
Ptr Notification -> IO ()
webkit_notification_clicked Ptr Notification
notification'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationClickedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationClickedMethodInfo a signature where
overloadedMethod = notificationClicked
instance O.OverloadedMethodInfo NotificationClickedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification.notificationClicked",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#v:notificationClicked"
})
#endif
foreign import ccall "webkit_notification_close" webkit_notification_close ::
Ptr Notification ->
IO ()
notificationClose ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m ()
notificationClose :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> m ()
notificationClose a
notification = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
Ptr Notification -> IO ()
webkit_notification_close Ptr Notification
notification'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationCloseMethodInfo
instance (signature ~ (m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationCloseMethodInfo a signature where
overloadedMethod = notificationClose
instance O.OverloadedMethodInfo NotificationCloseMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification.notificationClose",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#v:notificationClose"
})
#endif
foreign import ccall "webkit_notification_get_body" webkit_notification_get_body ::
Ptr Notification ->
IO CString
notificationGetBody ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m T.Text
notificationGetBody :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> m Text
notificationGetBody a
notification = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
result <- Ptr Notification -> IO CString
webkit_notification_get_body Ptr Notification
notification'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"notificationGetBody" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data NotificationGetBodyMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationGetBodyMethodInfo a signature where
overloadedMethod = notificationGetBody
instance O.OverloadedMethodInfo NotificationGetBodyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification.notificationGetBody",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#v:notificationGetBody"
})
#endif
foreign import ccall "webkit_notification_get_id" webkit_notification_get_id ::
Ptr Notification ->
IO Word64
notificationGetId ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m Word64
notificationGetId :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> m Word64
notificationGetId a
notification = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
Word64
result <- Ptr Notification -> IO Word64
webkit_notification_get_id Ptr Notification
notification'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
Word64 -> IO Word64
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data NotificationGetIdMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationGetIdMethodInfo a signature where
overloadedMethod = notificationGetId
instance O.OverloadedMethodInfo NotificationGetIdMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification.notificationGetId",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#v:notificationGetId"
})
#endif
foreign import ccall "webkit_notification_get_tag" webkit_notification_get_tag ::
Ptr Notification ->
IO CString
notificationGetTag ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m (Maybe T.Text)
notificationGetTag :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> m (Maybe Text)
notificationGetTag a
notification = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
result <- Ptr Notification -> IO CString
webkit_notification_get_tag Ptr Notification
notification'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data NotificationGetTagMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationGetTagMethodInfo a signature where
overloadedMethod = notificationGetTag
instance O.OverloadedMethodInfo NotificationGetTagMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification.notificationGetTag",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#v:notificationGetTag"
})
#endif
foreign import ccall "webkit_notification_get_title" webkit_notification_get_title ::
Ptr Notification ->
IO CString
notificationGetTitle ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> m T.Text
notificationGetTitle :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> m Text
notificationGetTitle a
notification = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Notification
notification' <- a -> IO (Ptr Notification)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
notification
CString
result <- Ptr Notification -> IO CString
webkit_notification_get_title Ptr Notification
notification'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"notificationGetTitle" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data NotificationGetTitleMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationGetTitleMethodInfo a signature where
overloadedMethod = notificationGetTitle
instance O.OverloadedMethodInfo NotificationGetTitleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.Notification.notificationGetTitle",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.29/docs/GI-WebKit2-Objects-Notification.html#v:notificationGetTitle"
})
#endif