-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Desktop Notifications client
--   
--   A library for issuing notifications using FreeDesktop.org's Desktop
--   Notifications protcol. This protocol is supported by services such as
--   Ubuntu's NotifyOSD.
@package fdo-notify
@version 0.3.1


-- | A library for issuing notifications using FreeDesktop.org Desktop
--   Notifications protocol. This protocol is used to communicate with
--   services such as Ubuntu's NotifyOSD.
--   
--   This library does not yet support receiving events relating to
--   notifications, or images in notifications: if you need that
--   functionality please contact the maintainer.
module DBus.Notify

-- | Display a notification. Return a handle which can be used to replace
--   the notification.
notify :: Client -> Note -> IO Notification

-- | Replace an existing notification. If the notification has already been
--   closed, a new one will be created.
replace :: Client -> Notification -> Note -> IO Notification

-- | A handle on a displayed notification The notification may not have
--   reached the screen yet, and may already have been closed.
data Notification

-- | <i>Deprecated: Use DBus.Client.connectSession</i>
mkSessionClient :: IO Client

-- | Connect to the bus specified in the environment variable
--   <tt>DBUS_SESSION_BUS_ADDRESS</tt>, which must be set.
--   
--   Throws a <a>ClientError</a> if <tt>DBUS_SESSION_BUS_ADDRESS</tt> is
--   unset, contains an invalid address, or if connecting to the bus
--   failed.
connectSession :: IO Client

-- | An active client session to a message bus. Clients may send or receive
--   method calls, and listen for or emit signals.
data Client :: *

-- | A <a>Note</a> with default values. All fields are blank except for
--   <a>expiry</a>, which is <a>Dependent</a>.
blankNote :: Note

-- | Contents of a notification
data Note
Note :: String -> Maybe Icon -> String -> Maybe Body -> [(Action, String)] -> [Hint] -> Timeout -> Note
[appName] :: Note -> String
[appImage] :: Note -> Maybe Icon
[summary] :: Note -> String
[body] :: Note -> Maybe Body
[actions] :: Note -> [(Action, String)]
[hints] :: Note -> [Hint]
[expiry] :: Note -> Timeout

-- | Message bodies may contain simple markup. NotifyOSD doesn't support
--   any markup.
data Body
Text :: String -> Body
Bold :: Body -> Body
Italic :: Body -> Body
Underline :: Body -> Body
Hyperlink :: URL -> Body -> Body
Img :: URL -> String -> Body
Concat :: Body -> Body -> Body
type URL = String

-- | Length of time to display notifications. NotifyOSD seems to ignore
--   these.
data Timeout

-- | Wait to be dismissed by user
Never :: Timeout

-- | Let the notification service decide
Dependent :: Timeout

-- | Show notification for a fixed duration (must be positive)
Milliseconds :: Int32 -> Timeout
newtype Action
Action :: String -> Action
[actionName] :: Action -> String

-- | Images are not yet supported
data Image

-- | An Icon is either a path to an image, or a name in an icon theme
data Icon
File :: FilePath -> Icon
Icon :: String -> Icon

-- | Categorisation of (some) notifications
data Category
Device :: Category
DeviceAdded :: Category
DeviceError :: Category
DeviceRemoved :: Category
Email :: Category
EmailArrived :: Category
EmailBounced :: Category
Im :: Category
ImError :: Category
ImReceived :: Category
Network :: Category
NetworkConnected :: Category
NetworkDisconnected :: Category
NetworkError :: Category
Presence :: Category
PresenceOffline :: Category
PresenceOnline :: Category
Transfer :: Category
TransferComplete :: Category
TransferError :: Category

-- | Urgency of the notification. Notifications may be prioritised by
--   urgency.
data UrgencyLevel
Low :: UrgencyLevel
Normal :: UrgencyLevel

-- | Critical notifications require user attention
Critical :: UrgencyLevel

-- | Various hints about how the notification should be displayed
data Hint
Urgency :: UrgencyLevel -> Hint
Category :: Category -> Hint
ImageData :: Image -> Hint
ImagePath :: Icon -> Hint
SoundFile :: FilePath -> Hint
SuppressSound :: Bool -> Hint
X :: Int32 -> Hint
Y :: Int32 -> Hint

-- | Determine the server's capabilities
getCapabilities :: Client -> IO [Capability]
data Capability
ActionsCap :: Capability
BodyCap :: Capability
BodyHyperlinksCap :: Capability
BodyImagesCap :: Capability
BodyMarkupCap :: Capability
IconMultiCap :: Capability
IconStaticCap :: Capability
SoundCap :: Capability
UnknownCap :: String -> Capability
instance GHC.Show.Show DBus.Notify.Capability
instance GHC.Read.Read DBus.Notify.Capability
instance GHC.Classes.Eq DBus.Notify.Capability
instance GHC.Show.Show DBus.Notify.Note
instance GHC.Classes.Eq DBus.Notify.Note
instance GHC.Show.Show DBus.Notify.Hint
instance GHC.Classes.Eq DBus.Notify.Hint
instance GHC.Show.Show DBus.Notify.Category
instance GHC.Classes.Eq DBus.Notify.Category
instance GHC.Show.Show DBus.Notify.UrgencyLevel
instance GHC.Enum.Enum DBus.Notify.UrgencyLevel
instance GHC.Classes.Ord DBus.Notify.UrgencyLevel
instance GHC.Classes.Eq DBus.Notify.UrgencyLevel
instance GHC.Show.Show DBus.Notify.Icon
instance GHC.Classes.Eq DBus.Notify.Icon
instance GHC.Show.Show DBus.Notify.Image
instance GHC.Classes.Eq DBus.Notify.Image
instance GHC.Show.Show DBus.Notify.Action
instance GHC.Classes.Eq DBus.Notify.Action
instance GHC.Show.Show DBus.Notify.Timeout
instance GHC.Classes.Eq DBus.Notify.Timeout
instance GHC.Show.Show DBus.Notify.Body
instance GHC.Classes.Eq DBus.Notify.Body
