Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Holds information about a notification that should be shown to the user.
Since: 2.8
Synopsis
- newtype Notification = Notification (ManagedPtr Notification)
- class (GObject o, IsDescendantOf Notification o) => IsNotification o
- toNotification :: (MonadIO m, IsNotification o) => o -> m Notification
- notificationClicked :: (HasCallStack, MonadIO m, IsNotification a) => a -> m ()
- notificationClose :: (HasCallStack, MonadIO m, IsNotification a) => a -> m ()
- notificationGetBody :: (HasCallStack, MonadIO m, IsNotification a) => a -> m Text
- notificationGetId :: (HasCallStack, MonadIO m, IsNotification a) => a -> m Word64
- notificationGetTag :: (HasCallStack, MonadIO m, IsNotification a) => a -> m (Maybe Text)
- notificationGetTitle :: (HasCallStack, MonadIO m, IsNotification a) => a -> m Text
- getNotificationBody :: (MonadIO m, IsNotification o) => o -> m Text
- getNotificationId :: (MonadIO m, IsNotification o) => o -> m Word64
- getNotificationTag :: (MonadIO m, IsNotification o) => o -> m (Maybe Text)
- getNotificationTitle :: (MonadIO m, IsNotification o) => o -> m Text
- type NotificationClickedCallback = IO ()
- afterNotificationClicked :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClickedCallback) -> m SignalHandlerId
- onNotificationClicked :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClickedCallback) -> m SignalHandlerId
- type NotificationClosedCallback = IO ()
- afterNotificationClosed :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClosedCallback) -> m SignalHandlerId
- onNotificationClosed :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClosedCallback) -> m SignalHandlerId
Exported types
newtype Notification Source #
Memory-managed wrapper type.
Notification (ManagedPtr Notification) |
Instances
Eq Notification Source # | |
Defined in GI.WebKit.Objects.Notification (==) :: Notification -> Notification -> Bool # (/=) :: Notification -> Notification -> Bool # | |
GObject Notification Source # | |
Defined in GI.WebKit.Objects.Notification | |
ManagedPtrNewtype Notification Source # | |
Defined in GI.WebKit.Objects.Notification toManagedPtr :: Notification -> ManagedPtr Notification | |
TypedObject Notification Source # | |
Defined in GI.WebKit.Objects.Notification | |
HasParentTypes Notification Source # | |
Defined in GI.WebKit.Objects.Notification | |
IsGValue (Maybe Notification) Source # | Convert |
Defined in GI.WebKit.Objects.Notification gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Notification -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Notification) | |
type ParentTypes Notification Source # | |
Defined in GI.WebKit.Objects.Notification type ParentTypes Notification = '[Object] |
class (GObject o, IsDescendantOf Notification o) => IsNotification o Source #
Type class for types which can be safely cast to Notification
, for instance with toNotification
.
Instances
(GObject o, IsDescendantOf Notification o) => IsNotification o Source # | |
Defined in GI.WebKit.Objects.Notification |
toNotification :: (MonadIO m, IsNotification o) => o -> m Notification Source #
Cast to Notification
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, clicked, close, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getBody, getData, getId, getProperty, getQdata, getTag, getTitle.
Setters
clicked
:: (HasCallStack, MonadIO m, IsNotification a) | |
=> a |
|
-> m () |
Tells WebKit the notification has been clicked.
This will emit the Notification::clicked signal.
Since: 2.12
close
:: (HasCallStack, MonadIO m, IsNotification a) | |
=> a |
|
-> m () |
Closes the notification.
Since: 2.8
getBody
:: (HasCallStack, MonadIO m, IsNotification a) | |
=> a |
|
-> m Text | Returns: the body for the notification |
Obtains the body for the notification.
Since: 2.8
getId
:: (HasCallStack, MonadIO m, IsNotification a) | |
=> a |
|
-> m Word64 | Returns: the unique id for the notification |
Obtains the unique id for the notification.
Since: 2.8
getTag
:: (HasCallStack, MonadIO m, IsNotification a) | |
=> a |
|
-> m (Maybe Text) | Returns: the tag for the notification |
Obtains the tag identifier for the notification.
Since: 2.16
getTitle
:: (HasCallStack, MonadIO m, IsNotification a) | |
=> a |
|
-> m Text | Returns: the title for the notification |
Obtains the title for the notification.
Since: 2.8
Properties
body
The body for the notification.
Since: 2.8
getNotificationBody :: (MonadIO m, IsNotification o) => o -> m Text Source #
Get the value of the “body
” property.
When overloading is enabled, this is equivalent to
get
notification #body
id
The unique id for the notification.
Since: 2.8
getNotificationId :: (MonadIO m, IsNotification o) => o -> m Word64 Source #
Get the value of the “id
” property.
When overloading is enabled, this is equivalent to
get
notification #id
tag
The tag identifier for the notification.
Since: 2.16
getNotificationTag :: (MonadIO m, IsNotification o) => o -> m (Maybe Text) Source #
Get the value of the “tag
” property.
When overloading is enabled, this is equivalent to
get
notification #tag
title
The title for the notification.
Since: 2.8
getNotificationTitle :: (MonadIO m, IsNotification o) => o -> m Text Source #
Get the value of the “title
” property.
When overloading is enabled, this is equivalent to
get
notification #title
Signals
clicked
type NotificationClickedCallback = IO () Source #
Emitted when a notification has been clicked. See notificationClicked
.
Since: 2.12
afterNotificationClicked :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClickedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the clicked signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
notification #clicked callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onNotificationClicked :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClickedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the clicked signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
notification #clicked callback
closed
type NotificationClosedCallback = IO () Source #
Emitted when a notification has been withdrawn.
The default handler will close the notification using libnotify, if built with support for it.
Since: 2.8
afterNotificationClosed :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClosedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the closed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
notification #closed callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onNotificationClosed :: (IsNotification a, MonadIO m) => a -> ((?self :: a) => NotificationClosedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the closed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
notification #closed callback