{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.Notification
(
Notification(..) ,
IsNotification ,
toNotification ,
#if defined(ENABLE_OVERLOADING)
ResolveNotificationMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
NotificationAddButtonMethodInfo ,
#endif
notificationAddButton ,
#if defined(ENABLE_OVERLOADING)
NotificationAddButtonWithTargetMethodInfo,
#endif
notificationAddButtonWithTarget ,
notificationNew ,
#if defined(ENABLE_OVERLOADING)
NotificationSetBodyMethodInfo ,
#endif
notificationSetBody ,
#if defined(ENABLE_OVERLOADING)
NotificationSetCategoryMethodInfo ,
#endif
notificationSetCategory ,
#if defined(ENABLE_OVERLOADING)
NotificationSetDefaultActionMethodInfo ,
#endif
notificationSetDefaultAction ,
#if defined(ENABLE_OVERLOADING)
NotificationSetDefaultActionAndTargetMethodInfo,
#endif
notificationSetDefaultActionAndTarget ,
#if defined(ENABLE_OVERLOADING)
NotificationSetIconMethodInfo ,
#endif
notificationSetIcon ,
#if defined(ENABLE_OVERLOADING)
NotificationSetPriorityMethodInfo ,
#endif
notificationSetPriority ,
#if defined(ENABLE_OVERLOADING)
NotificationSetTitleMethodInfo ,
#endif
notificationSetTitle ,
#if defined(ENABLE_OVERLOADING)
NotificationSetUrgentMethodInfo ,
#endif
notificationSetUrgent ,
) 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.Kind as DK
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
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Icon as Gio.Icon
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 "g_notification_get_type"
c_g_notification_get_type :: IO B.Types.GType
instance B.Types.TypedObject Notification where
glibType :: IO GType
glibType = IO GType
c_g_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_g_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 :: DK.Type) :: DK.Type where
ResolveNotificationMethod "addButton" o = NotificationAddButtonMethodInfo
ResolveNotificationMethod "addButtonWithTarget" o = NotificationAddButtonWithTargetMethodInfo
ResolveNotificationMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveNotificationMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
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 "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveNotificationMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveNotificationMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveNotificationMethod "setBody" o = NotificationSetBodyMethodInfo
ResolveNotificationMethod "setCategory" o = NotificationSetCategoryMethodInfo
ResolveNotificationMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveNotificationMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveNotificationMethod "setDefaultAction" o = NotificationSetDefaultActionMethodInfo
ResolveNotificationMethod "setDefaultActionAndTarget" o = NotificationSetDefaultActionAndTargetMethodInfo
ResolveNotificationMethod "setIcon" o = NotificationSetIconMethodInfo
ResolveNotificationMethod "setPriority" o = NotificationSetPriorityMethodInfo
ResolveNotificationMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveNotificationMethod "setTitle" o = NotificationSetTitleMethodInfo
ResolveNotificationMethod "setUrgent" o = NotificationSetUrgentMethodInfo
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
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Notification
type instance O.AttributeList Notification = NotificationAttributeList
type NotificationAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Notification = NotificationSignalList
type NotificationSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_notification_new" g_notification_new ::
CString ->
IO (Ptr Notification)
notificationNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m Notification
notificationNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m Notification
notificationNew Text
title = IO Notification -> m Notification
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Notification -> m Notification)
-> IO Notification -> m Notification
forall a b. (a -> b) -> a -> b
$ do
CString
title' <- Text -> IO CString
textToCString Text
title
Ptr Notification
result <- CString -> IO (Ptr Notification)
g_notification_new CString
title'
Text -> Ptr Notification -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"notificationNew" Ptr Notification
result
Notification
result' <- ((ManagedPtr Notification -> Notification)
-> Ptr Notification -> IO Notification
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Notification -> Notification
Notification) Ptr Notification
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
title'
Notification -> IO Notification
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Notification
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_notification_add_button" g_notification_add_button ::
Ptr Notification ->
CString ->
CString ->
IO ()
notificationAddButton ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> T.Text
-> m ()
notificationAddButton :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> Text -> Text -> m ()
notificationAddButton a
notification Text
label Text
detailedAction = 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
CString
label' <- Text -> IO CString
textToCString Text
label
CString
detailedAction' <- Text -> IO CString
textToCString Text
detailedAction
Ptr Notification -> CString -> CString -> IO ()
g_notification_add_button Ptr Notification
notification' CString
label' CString
detailedAction'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
label'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
detailedAction'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationAddButtonMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationAddButtonMethodInfo a signature where
overloadedMethod = notificationAddButton
instance O.OverloadedMethodInfo NotificationAddButtonMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Notification.notificationAddButton",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.32/docs/GI-Gio-Objects-Notification.html#v:notificationAddButton"
})
#endif
foreign import ccall "g_notification_add_button_with_target_value" g_notification_add_button_with_target_value ::
Ptr Notification ->
CString ->
CString ->
Ptr GVariant ->
IO ()
notificationAddButtonWithTarget ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> T.Text
-> Maybe (GVariant)
-> m ()
notificationAddButtonWithTarget :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> Text -> Text -> Maybe GVariant -> m ()
notificationAddButtonWithTarget a
notification Text
label Text
action Maybe GVariant
target = 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
CString
label' <- Text -> IO CString
textToCString Text
label
CString
action' <- Text -> IO CString
textToCString Text
action
Ptr GVariant
maybeTarget <- case Maybe GVariant
target of
Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just GVariant
jTarget -> do
Ptr GVariant
jTarget' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jTarget
Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jTarget'
Ptr Notification -> CString -> CString -> Ptr GVariant -> IO ()
g_notification_add_button_with_target_value Ptr Notification
notification' CString
label' CString
action' Ptr GVariant
maybeTarget
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
target GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
label'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
action'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationAddButtonWithTargetMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (GVariant) -> m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationAddButtonWithTargetMethodInfo a signature where
overloadedMethod = notificationAddButtonWithTarget
instance O.OverloadedMethodInfo NotificationAddButtonWithTargetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Notification.notificationAddButtonWithTarget",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.32/docs/GI-Gio-Objects-Notification.html#v:notificationAddButtonWithTarget"
})
#endif
foreign import ccall "g_notification_set_body" g_notification_set_body ::
Ptr Notification ->
CString ->
IO ()
notificationSetBody ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> Maybe (T.Text)
-> m ()
notificationSetBody :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> Maybe Text -> m ()
notificationSetBody a
notification Maybe Text
body = 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
CString
maybeBody <- case Maybe Text
body of
Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just Text
jBody -> do
CString
jBody' <- Text -> IO CString
textToCString Text
jBody
CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jBody'
Ptr Notification -> CString -> IO ()
g_notification_set_body Ptr Notification
notification' CString
maybeBody
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeBody
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetBodyMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationSetBodyMethodInfo a signature where
overloadedMethod = notificationSetBody
instance O.OverloadedMethodInfo NotificationSetBodyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Notification.notificationSetBody",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.32/docs/GI-Gio-Objects-Notification.html#v:notificationSetBody"
})
#endif
foreign import ccall "g_notification_set_category" g_notification_set_category ::
Ptr Notification ->
CString ->
IO ()
notificationSetCategory ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> Maybe (T.Text)
-> m ()
notificationSetCategory :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> Maybe Text -> m ()
notificationSetCategory a
notification Maybe Text
category = 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
CString
maybeCategory <- case Maybe Text
category of
Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just Text
jCategory -> do
CString
jCategory' <- Text -> IO CString
textToCString Text
jCategory
CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jCategory'
Ptr Notification -> CString -> IO ()
g_notification_set_category Ptr Notification
notification' CString
maybeCategory
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeCategory
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetCategoryMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationSetCategoryMethodInfo a signature where
overloadedMethod = notificationSetCategory
instance O.OverloadedMethodInfo NotificationSetCategoryMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Notification.notificationSetCategory",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.32/docs/GI-Gio-Objects-Notification.html#v:notificationSetCategory"
})
#endif
foreign import ccall "g_notification_set_default_action" g_notification_set_default_action ::
Ptr Notification ->
CString ->
IO ()
notificationSetDefaultAction ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> m ()
notificationSetDefaultAction :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> Text -> m ()
notificationSetDefaultAction a
notification Text
detailedAction = 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
CString
detailedAction' <- Text -> IO CString
textToCString Text
detailedAction
Ptr Notification -> CString -> IO ()
g_notification_set_default_action Ptr Notification
notification' CString
detailedAction'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
detailedAction'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetDefaultActionMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationSetDefaultActionMethodInfo a signature where
overloadedMethod = notificationSetDefaultAction
instance O.OverloadedMethodInfo NotificationSetDefaultActionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Notification.notificationSetDefaultAction",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.32/docs/GI-Gio-Objects-Notification.html#v:notificationSetDefaultAction"
})
#endif
foreign import ccall "g_notification_set_default_action_and_target_value" g_notification_set_default_action_and_target_value ::
Ptr Notification ->
CString ->
Ptr GVariant ->
IO ()
notificationSetDefaultActionAndTarget ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> Maybe (GVariant)
-> m ()
notificationSetDefaultActionAndTarget :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> Text -> Maybe GVariant -> m ()
notificationSetDefaultActionAndTarget a
notification Text
action Maybe GVariant
target = 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
CString
action' <- Text -> IO CString
textToCString Text
action
Ptr GVariant
maybeTarget <- case Maybe GVariant
target of
Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just GVariant
jTarget -> do
Ptr GVariant
jTarget' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jTarget
Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jTarget'
Ptr Notification -> CString -> Ptr GVariant -> IO ()
g_notification_set_default_action_and_target_value Ptr Notification
notification' CString
action' Ptr GVariant
maybeTarget
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
target GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
action'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetDefaultActionAndTargetMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationSetDefaultActionAndTargetMethodInfo a signature where
overloadedMethod = notificationSetDefaultActionAndTarget
instance O.OverloadedMethodInfo NotificationSetDefaultActionAndTargetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Notification.notificationSetDefaultActionAndTarget",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.32/docs/GI-Gio-Objects-Notification.html#v:notificationSetDefaultActionAndTarget"
})
#endif
foreign import ccall "g_notification_set_icon" g_notification_set_icon ::
Ptr Notification ->
Ptr Gio.Icon.Icon ->
IO ()
notificationSetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a, Gio.Icon.IsIcon b) =>
a
-> b
-> m ()
notificationSetIcon :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsNotification a, IsIcon b) =>
a -> b -> m ()
notificationSetIcon a
notification b
icon = 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 Icon
icon' <- b -> IO (Ptr Icon)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
icon
Ptr Notification -> Ptr Icon -> IO ()
g_notification_set_icon Ptr Notification
notification' Ptr Icon
icon'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
icon
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetIconMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsNotification a, Gio.Icon.IsIcon b) => O.OverloadedMethod NotificationSetIconMethodInfo a signature where
overloadedMethod = notificationSetIcon
instance O.OverloadedMethodInfo NotificationSetIconMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Notification.notificationSetIcon",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.32/docs/GI-Gio-Objects-Notification.html#v:notificationSetIcon"
})
#endif
foreign import ccall "g_notification_set_priority" g_notification_set_priority ::
Ptr Notification ->
CUInt ->
IO ()
notificationSetPriority ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> Gio.Enums.NotificationPriority
-> m ()
notificationSetPriority :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> NotificationPriority -> m ()
notificationSetPriority a
notification NotificationPriority
priority = 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
let priority' :: CUInt
priority' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (NotificationPriority -> Int) -> NotificationPriority -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NotificationPriority -> Int
forall a. Enum a => a -> Int
fromEnum) NotificationPriority
priority
Ptr Notification -> CUInt -> IO ()
g_notification_set_priority Ptr Notification
notification' CUInt
priority'
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 NotificationSetPriorityMethodInfo
instance (signature ~ (Gio.Enums.NotificationPriority -> m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationSetPriorityMethodInfo a signature where
overloadedMethod = notificationSetPriority
instance O.OverloadedMethodInfo NotificationSetPriorityMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Notification.notificationSetPriority",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.32/docs/GI-Gio-Objects-Notification.html#v:notificationSetPriority"
})
#endif
foreign import ccall "g_notification_set_title" g_notification_set_title ::
Ptr Notification ->
CString ->
IO ()
notificationSetTitle ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> T.Text
-> m ()
notificationSetTitle :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> Text -> m ()
notificationSetTitle a
notification Text
title = 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
CString
title' <- Text -> IO CString
textToCString Text
title
Ptr Notification -> CString -> IO ()
g_notification_set_title Ptr Notification
notification' CString
title'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
notification
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
title'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NotificationSetTitleMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationSetTitleMethodInfo a signature where
overloadedMethod = notificationSetTitle
instance O.OverloadedMethodInfo NotificationSetTitleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Notification.notificationSetTitle",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.32/docs/GI-Gio-Objects-Notification.html#v:notificationSetTitle"
})
#endif
foreign import ccall "g_notification_set_urgent" g_notification_set_urgent ::
Ptr Notification ->
CInt ->
IO ()
{-# DEPRECATED notificationSetUrgent ["(Since version 2.42)","Since 2.42, this has been deprecated in favour of"," 'GI.Gio.Objects.Notification.notificationSetPriority'."] #-}
notificationSetUrgent ::
(B.CallStack.HasCallStack, MonadIO m, IsNotification a) =>
a
-> Bool
-> m ()
notificationSetUrgent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsNotification a) =>
a -> Bool -> m ()
notificationSetUrgent a
notification Bool
urgent = 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
let urgent' :: CInt
urgent' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
urgent
Ptr Notification -> CInt -> IO ()
g_notification_set_urgent Ptr Notification
notification' CInt
urgent'
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 NotificationSetUrgentMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsNotification a) => O.OverloadedMethod NotificationSetUrgentMethodInfo a signature where
overloadedMethod = notificationSetUrgent
instance O.OverloadedMethodInfo NotificationSetUrgentMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Notification.notificationSetUrgent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.32/docs/GI-Gio-Objects-Notification.html#v:notificationSetUrgent"
})
#endif