Copyright | (c) Eric Mertens 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
This module defines types and operations used to store messages for display in the client's buffers.
Synopsis
- data Window = Window {
- _winMessages :: !WindowLines
- _winMarker :: !(Maybe Int)
- _winUnread :: !Int
- _winTotal :: !Int
- _winMention :: !WindowLineImportance
- _winHideMeta :: !Bool
- winMessages :: Lens' Window WindowLines
- winUnread :: Lens' Window Int
- winTotal :: Lens' Window Int
- winMention :: Lens' Window WindowLineImportance
- winMarker :: Lens' Window (Maybe Int)
- winHideMeta :: Lens' Window Bool
- data WindowLine = WindowLine {}
- wlSummary :: Lens' WindowLine IrcSummary
- wlText :: Getter WindowLine Text
- wlPrefix :: Lens' WindowLine Image'
- wlImage :: Lens' WindowLine Image'
- wlFullImage :: Lens' WindowLine Image'
- wlImportance :: Lens' WindowLine WindowLineImportance
- wlTimestamp :: Lens' WindowLine PackedTime
- data WindowLineImportance
- emptyWindow :: Window
- addToWindow :: WindowLine -> Window -> Window
- windowSeen :: Window -> Window
- windowActivate :: Window -> Window
- windowDeactivate :: Window -> Window
- data PackedTime
- packZonedTime :: ZonedTime -> PackedTime
- unpackUTCTime :: PackedTime -> UTCTime
- unpackTimeOfDay :: PackedTime -> TimeOfDay
Windows
A Window
tracks all of the messages and metadata for a particular
message buffer.
Window | |
|
winMessages :: Lens' Window WindowLines Source #
Window lines
data WindowLine Source #
A single message to be displayed in a window. The normal message line consists of the image prefix and the image. This allows line wrapping to be applied separately to the image and prefix so that wrapped messages can fall to the right side of the prefix.
WindowLine | |
|
Window line importance
data WindowLineImportance Source #
Flag for the important of a message being added to a window
WLBoring | Don't update unread count |
WLNormal | Increment unread count |
WLImportant | Increment unread count and set important flag |
Instances
Eq WindowLineImportance Source # | |
Defined in Client.State.Window (==) :: WindowLineImportance -> WindowLineImportance -> Bool # (/=) :: WindowLineImportance -> WindowLineImportance -> Bool # | |
Ord WindowLineImportance Source # | |
Defined in Client.State.Window compare :: WindowLineImportance -> WindowLineImportance -> Ordering # (<) :: WindowLineImportance -> WindowLineImportance -> Bool # (<=) :: WindowLineImportance -> WindowLineImportance -> Bool # (>) :: WindowLineImportance -> WindowLineImportance -> Bool # (>=) :: WindowLineImportance -> WindowLineImportance -> Bool # max :: WindowLineImportance -> WindowLineImportance -> WindowLineImportance # min :: WindowLineImportance -> WindowLineImportance -> WindowLineImportance # | |
Read WindowLineImportance Source # | |
Defined in Client.State.Window | |
Show WindowLineImportance Source # | |
Defined in Client.State.Window showsPrec :: Int -> WindowLineImportance -> ShowS # show :: WindowLineImportance -> String # showList :: [WindowLineImportance] -> ShowS # |
Window operations
emptyWindow :: Window Source #
A window with no messages
addToWindow :: WindowLine -> Window -> Window Source #
Adds a given line to a window as the newest message. Window's unread count will be updated according to the given importance.
windowSeen :: Window -> Window Source #
Update the window clearing the unread count and important flag.
windowActivate :: Window -> Window Source #
Update the window when it first becomes active. If only boring messages have been added since last time the marker will be hidden.
windowDeactivate :: Window -> Window Source #
Update the window when it becomes inactive. This resets the activity marker to the bottom of the window.
Packed time
data PackedTime Source #
packZonedTime :: ZonedTime -> PackedTime Source #
unpackUTCTime :: PackedTime -> UTCTime Source #