-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell binding for Libnotify -- -- Usable binding to libnotify library. @package libnotify @version 0.0.2.1 -- | System.Libnotify.Types module is a collection of types is used in -- other modules. This is reexported with System.Libnotify module. -- Perhaps it'll never be needed to import explicitly. module System.Libnotify.Types -- | Timeout in seconds after which notification is closed. Although -- timeout does not work with notify-osd. data Timeout -- | Default server timeout. Default :: Timeout -- | User defined timeout (in milliseconds). Custom :: Int -> Timeout -- | Notification will not expire until user pays attention to it. Infinite :: Timeout -- | Urgency can be used by the notification server to prioritize -- notifications. Although urgency does not work with notify-osd. data Urgency -- | Low priority notification. Low :: Urgency -- | Default notification urgency. Normal :: Urgency -- | Critical notification that requires immediate attention. Critical :: Urgency -- | Category can be used by the notification server to filter or display -- the data in a certain way. type Category = String -- | Type synonim for notification title. type Title = String -- | Type synonim for notification body. type Body = String -- | Type synonim for notification icon. type Icon = String -- | Server information. data ServerInfo ServerInfo :: String -> String -> String -> String -> ServerInfo serverName :: ServerInfo -> String serverVendor :: ServerInfo -> String serverVersion :: ServerInfo -> String serverSpecVersion :: ServerInfo -> String -- | Hint is some setting (server-dependent) which comes with notification. data Hint HintInt :: String -> Int32 -> Hint HintDouble :: String -> Double -> Hint HintString :: String -> String -> Hint HintByte :: String -> Word8 -> Hint HintArray :: String -> ByteString -> Hint instance Show ServerInfo -- | System.Libnotify.Server module deals with notification server info -- processing and initialized applications managing. module System.Libnotify.Server -- | Returns registered application name. getAppName :: IO String -- | Updates registered application name. setAppName :: String -> IO () -- | Returns server capability strings. getServerCaps :: IO [String] -- | Returns server information. getServerInfo :: IO ServerInfo -- | System.Libnotify module deals with notification session processing. module System.Libnotify -- | Notification monad. Saves notification context. data Notify a -- | Notification state. Contains next rendered notification data. data NotifyState -- | Libnotify errors. data NotifyError -- | notify_init() has failed. NotifyInitHasFailed :: NotifyError -- | new has called before notify_init(). NewCalledBeforeInit :: NotifyError -- | Function for one-time notification with hints perhaps. Should be -- enough for a vast majority of applications. oneShot :: Title -> Body -> Icon -> Maybe [Hint] -> IO (Either NotifyError ()) -- | Initializes and uninitializes libnotify API. Any notifications API -- calls should be wrapped into withNotifications, i.e. -- --
--   main = withNotifications (Just "api-name") $ do { ... here are notification API calls ... }
--   
withNotifications :: Maybe String -> IO a -> IO (Either NotifyError ()) -- | Creates new notification session. Inside new call one can -- manage current notification via update or render calls. -- Returns notification pointer. This could be useful if one wants to -- update or close the same notification after some time -- (see continue). new :: Title -> Body -> Icon -> Notify t -> IO (Either NotifyError (Notification, NotifyState)) -- | Continues old notification session. continue :: (Notification, NotifyState) -> Notify a -> IO NotifyState -- | Updates notification Title, Body and Icon. User -- can update notification partially, passing Nothing to arguments that -- should not changed. update :: Maybe Title -> Maybe Body -> Maybe Icon -> Notify Bool -- | Shows notification to user. render :: Notify Bool -- | Closes notification. close :: Notify Bool -- | Sets notification Timeout. setTimeout :: Timeout -> Notify () -- | Sets notification Category. setCategory :: Category -> Notify () -- | Sets notification Urgency. setUrgency :: Urgency -> Notify () -- | Adds Hint to notification. addHint :: Hint -> Notify () -- | Removes hints from notification. removeHints :: Notify () -- | Adds action to notification. addAction :: String -> String -> (Notification -> String -> IO ()) -> Notify () -- | Removes actions from notification. removeActions :: Notify () -- | Sets notification icon from pixbuf setIconFromPixbuf :: Pixbuf -> Notify () -- | Sets notification image from pixbuf setImageFromPixbuf :: Pixbuf -> Notify () instance Show NotifyError instance Functor Notify instance Monad Notify instance MonadIO Notify