Copyright | (c) Eric Mertens 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Client.State.Window
Description
This module defines types and operations used to store messages for display in the client's buffers.
Synopsis
- data Window = Window {
- _winName' :: !Char
- _winMessages :: !WindowLines
- _winMarker :: !(Maybe Int)
- _winUnread :: !Int
- _winTotal :: !Int
- _winMention :: !WindowLineImportance
- _winHideMeta :: !Bool
- _winHidden :: !Bool
- _winActivityFilter :: !ActivityFilter
- winName :: Lens' Window (Maybe Char)
- 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
- winHidden :: Lens' Window Bool
- winActivityFilter :: Lens' Window ActivityFilter
- data WindowLines
- = !WindowLine :- WindowLines
- | Nil
- 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 ActivityFilter
- data WindowLineImportance
- activityFilterStrings :: [String]
- applyActivityFilter :: ActivityFilter -> WindowLineImportance -> WindowLineImportance
- readActivityFilter :: String -> Maybe ActivityFilter
- emptyWindow :: Window
- addToWindow :: WindowLine -> Window -> (Window, Bool)
- windowSeen :: Window -> Window
- windowActivate :: Window -> Window
- windowDeactivate :: Window -> Window
- windowClear :: 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.
Constructors
Window | |
Fields
|
Window lines
data WindowLines Source #
Constructors
!WindowLine :- WindowLines | |
Nil |
Instances
Each WindowLines WindowLines WindowLine WindowLine Source # | |
Defined in Client.State.Window Methods each :: Traversal WindowLines WindowLines WindowLine WindowLine # |
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.
Constructors
WindowLine | |
Fields
|
Instances
Each WindowLines WindowLines WindowLine WindowLine Source # | |
Defined in Client.State.Window Methods each :: Traversal WindowLines WindowLines WindowLine WindowLine # |
Window line importance
data ActivityFilter Source #
Instances
data WindowLineImportance Source #
Flag for the important of a message being added to a window
Constructors
WLBoring | Don't update unread count |
WLNormal | Increment unread count |
WLImportant | Increment unread count and set important flag |
Instances
Window operations
emptyWindow :: Window Source #
A window with no messages
addToWindow :: WindowLine -> Window -> (Window, Bool) Source #
Adds a given line to a window as the newest message. Window's unread count will be updated according to the given importance. Additionally returns True if this window becomes important as a result of this line.
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.
windowClear :: Window -> Window Source #
Packed time
data PackedTime Source #
packZonedTime :: ZonedTime -> PackedTime Source #
unpackUTCTime :: PackedTime -> UTCTime Source #