libnotify-0.0.2.1: Haskell binding for Libnotify

Safe HaskellNone

System.Libnotify

Description

System.Libnotify module deals with notification session processing.

Synopsis

Documentation

data Notify a

Notification monad. Saves notification context.

data NotifyState

Notification state. Contains next rendered notification data.

data NotifyError

Libnotify errors.

Constructors

NotifyInitHasFailed

notify_init() has failed.

NewCalledBeforeInit

new has called before notify_init().

Instances

oneShot :: Title -> Body -> Icon -> Maybe [Hint] -> IO (Either NotifyError ())

Function for one-time notification with hints perhaps. Should be enough for a vast majority of applications.

withNotifications :: Maybe String -> IO a -> 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 ... }

new :: Title -> Body -> Icon -> Notify t -> IO (Either NotifyError (Notification, NotifyState))

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).

continue :: (Notification, NotifyState) -> Notify a -> IO NotifyState

Continues old notification session.

update :: Maybe Title -> Maybe Body -> Maybe Icon -> Notify Bool

Updates notification Title, Body and Icon. User can update notification partially, passing Nothing to arguments that should not changed.

render :: Notify Bool

Shows notification to user.

close :: Notify Bool

Closes notification.

setTimeout :: Timeout -> Notify ()

Sets notification Timeout.

setCategory :: Category -> Notify ()

Sets notification Category.

setUrgency :: Urgency -> Notify ()

Sets notification Urgency.

addHint :: Hint -> Notify ()

Adds Hint to notification.

removeHints :: Notify ()

Removes hints from notification.

addAction :: String -> String -> (Notification -> String -> IO ()) -> Notify ()

Adds action to notification.

removeActions :: Notify ()

Removes actions from notification.

setIconFromPixbuf :: Pixbuf -> Notify ()

Sets notification icon from pixbuf

setImageFromPixbuf :: Pixbuf -> Notify ()

Sets notification image from pixbuf