-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Bindings to libnotify library -- -- The package provides a high level interface to libnotify API (see -- Libnotify) -- -- Libnotify.C.Notify and Libnotify.C.NotifyNotification -- modules contain bindings to C-level functions if you're into that @package libnotify @version 0.2 -- | Low level bindings to libnotify -- -- See also -- https://developer.gnome.org/libnotify/0.7/NotifyNotification.html. -- Haddocks here are mostly excerpts from there module Libnotify.C.NotifyNotification -- | An opaque notification token data NotifyNotification -- | Create a new NotifyNotification -- -- Only summary is required notify_notification_new :: String -> String -> String -> IO NotifyNotification -- | Update the notification text and icon notify_notification_update :: NotifyNotification -> String -> String -> String -> IO Bool -- | Display the notification on the screen notify_notification_show :: NotifyNotification -> IO Bool -- | Set the application name for the notification -- -- Used to override an application name for a specific notification. See -- also notify_init and notify_set_app_name notify_notification_set_app_name :: NotifyNotification -> String -> IO () -- | Timeout after which notification is closed data Timeout -- | Default server timeout Default :: Timeout -- | User defined timeout (in milliseconds) Custom :: Int -> Timeout -- | Notification will never expire Infinite :: Timeout -- | Set the timeout of the notification notify_notification_set_timeout :: NotifyNotification -> Timeout -> IO () -- | Set the category of the notification notify_notification_set_category :: NotifyNotification -> String -> IO () -- | The urgency level of the notification data Urgency -- | Low urgency. Used for unimportant notifications Low :: Urgency -- | Normal urgency. Used for most standard notifications Normal :: Urgency -- | Critical urgency. Used for very important notifications Critical :: Urgency -- | Set the urgency level of the notification notify_notification_set_urgency :: NotifyNotification -> Urgency -> IO () -- | Set the icon in the notification from the Pixbuf -- | Deprecated: Use notify_notification_set_image_from_pixbuf -- instead notify_notification_set_icon_from_pixbuf :: NotifyNotification -> Pixbuf -> IO () -- | Set the icon in the notification from the Pixbuf notify_notification_set_image_from_pixbuf :: NotifyNotification -> Pixbuf -> IO () -- | Set a hint with a 32-bit integer value notify_notification_set_hint_int32 :: NotifyNotification -> String -> Int32 -> IO () -- | Set a hint with an unsigned 32-bit integer value notify_notification_set_hint_uint32 :: NotifyNotification -> String -> Word32 -> IO () -- | Set a hint with a double value notify_notification_set_hint_double :: NotifyNotification -> String -> Double -> IO () -- | Set a hint with a string value notify_notification_set_hint_string :: NotifyNotification -> String -> String -> IO () -- | Set a hint with a byte value notify_notification_set_hint_byte :: NotifyNotification -> String -> Word8 -> IO () -- | Set a hint with a byte array value notify_notification_set_hint_byte_array :: NotifyNotification -> String -> ByteString -> IO () -- | Clear all hints notify_notification_clear_hints :: NotifyNotification -> IO () -- | Add an action to a notification. When the action is invoked, the -- specified callback function will be called -- -- For the callback to be *actually* invoked, some kind of magical glib -- mainLoop thing should be running notify_notification_add_action :: NotifyNotification -> String -> String -> (NotifyNotification -> String -> IO ()) -> IO () -- | Clear all actions notify_notification_clear_actions :: NotifyNotification -> IO () -- | Hide the notification from the screen notify_notification_close :: NotifyNotification -> IO Bool -- | Get the closed reason code for the notification notify_notification_get_closed_reason :: NotifyNotification -> IO Int instance GHC.Generics.Generic Libnotify.C.NotifyNotification.Urgency instance Data.Data.Data Libnotify.C.NotifyNotification.Urgency instance GHC.Classes.Ord Libnotify.C.NotifyNotification.Urgency instance GHC.Classes.Eq Libnotify.C.NotifyNotification.Urgency instance GHC.Show.Show Libnotify.C.NotifyNotification.Urgency instance GHC.Generics.Generic Libnotify.C.NotifyNotification.Timeout instance Data.Data.Data Libnotify.C.NotifyNotification.Timeout instance GHC.Classes.Eq Libnotify.C.NotifyNotification.Timeout instance GHC.Show.Show Libnotify.C.NotifyNotification.Timeout instance GHC.Classes.Eq Libnotify.C.NotifyNotification.NotifyNotification instance GHC.Show.Show Libnotify.C.NotifyNotification.NotifyNotification instance System.Glib.Types.GObjectClass Libnotify.C.NotifyNotification.NotifyNotification -- | Low level bindings to libnotify -- -- See also -- https://developer.gnome.org/libnotify/0.7/libnotify-notify.html. -- Haddocks here are mostly excerpts from there module Libnotify.C.Notify -- | Initialize libnotify -- -- This must be called before any other functions notify_init :: String -> IO Bool -- | Uninitialize libnotify notify_uninit :: IO () -- | Get whether libnotify is initialized or not notify_is_initted :: IO Bool -- | Get the application name -- -- Do not forget to call notify_init before calling this! notify_get_app_name :: IO String -- | Set the application name -- -- Do not forget to call notify_init before calling this! notify_set_app_name :: String -> IO () -- | Return server capabilities -- -- Synchronously queries the server for its capabilities -- --
-- >>> notify_get_server_caps -- ["actions","body","body-markup","body-hyperlinks","icon-static","x-canonical-private-icon-only"] --notify_get_server_caps :: IO [String] -- | Server information data ServerInfo ServerInfo :: String -> String -> String -> String -> ServerInfo [serverName] :: ServerInfo -> String [serverVendor] :: ServerInfo -> String [serverVersion] :: ServerInfo -> String [serverSpecVersion] :: ServerInfo -> String -- | Return server information -- -- Synchronously queries the server for its information, specifically, -- the name, vendor, server version, and the version of the notifications -- specification that it is compliant with -- --
-- >>> notify_get_server_info
-- Just (ServerInfo {name = "Xfce Notify Daemon", vendor = "Xfce", version = "0.2.4", specVersion = "0.9"})
--
notify_get_server_info :: IO (Maybe ServerInfo)
instance GHC.Generics.Generic Libnotify.C.Notify.ServerInfo
instance Data.Data.Data Libnotify.C.Notify.ServerInfo
instance GHC.Classes.Eq Libnotify.C.Notify.ServerInfo
instance GHC.Show.Show Libnotify.C.Notify.ServerInfo
-- | High level interface to libnotify API
module Libnotify
-- | Notification object
data Notification
-- | Display notification
--
-- -- >>> token <- display (summary "Greeting" <> body "Hello world!" <> icon "face-smile-big") ---- -- -- You can reuse notification tokens: -- --
-- >>> display_ (reuse token <> body "Hey!") ---- display :: Mod Notification -> IO Notification -- | Display and discard notification token -- --
-- >>> display_ (summary "Greeting" <> body "Hello world!" <> icon "face-smile-big") --display_ :: Mod Notification -> IO () -- | Close notification close :: Notification -> IO () -- | A notification modifier data Mod a -- | Set notification summary -- --
-- >>> display_ (summary "Hello!") ---- summary :: String -> Mod Notification -- | Set notification body -- --
-- >>> display_ (body "Hello world!") ---- body :: String -> Mod Notification -- | Set notification icon -- --
-- >>> display_ (icon "face-smile") ---- -- The argument is either icon name or file name -- icon :: String -> Mod Notification -- | Set notification timeout timeout :: Timeout -> Mod Notification -- | Timeout after which notification is closed data Timeout -- | Default server timeout Default :: Timeout -- | User defined timeout (in milliseconds) Custom :: Int -> Timeout -- | Notification will never expire Infinite :: Timeout -- | Set notification category category :: String -> Mod Notification -- | Set notification urgency urgency :: Urgency -> Mod Notification -- | The urgency level of the notification data Urgency -- | Low urgency. Used for unimportant notifications Low :: Urgency -- | Normal urgency. Used for most standard notifications Normal :: Urgency -- | Critical urgency. Used for very important notifications Critical :: Urgency -- | Set notification image image :: Pixbuf -> Mod Notification -- | Add a hint to notification -- -- It's perfectly OK to add multiple hints to a single notification class Hint v hint :: Hint v => String -> v -> Mod Notification -- | Remove all hints from the notification nohints :: Mod Notification -- | Add an action to notification -- -- It's perfectly OK to add multiple actions to a single notification -- --
-- >>> display_ (action "hello" "Hello world!" (\_ _ -> return ())) ---- action :: String -> String -> (Notification -> String -> IO a) -> Mod Notification -- | Remove all actions from the notification -- --
-- >>> let callback _ _ = return () -- -- >>> display_ (summary "No hello for you!" <> action "hello" "Hello world!" callback <> noactions) ---- noactions :: Mod Notification -- | Set the application name. appName :: String -> Mod Notification -- | Reuse existing notification token, instead of creating a new one -- -- If you try to reuse multiple tokens, the last one wins, e.g. -- --
-- >>> foo <- display (body "foo") -- -- >>> bar <- display (body "bar") -- -- >>> display_ (base foo <> base bar) ---- -- will show only "bar" -- reuse :: Notification -> Mod Notification -- | The class of monoids (types with an associative binary operation that -- has an identity). Instances should satisfy the following laws: -- --
mappend mempty x = x
mappend x mempty = x
mappend x (mappend y z) = mappend (mappend x y) z
mconcat = foldr mappend mempty