matterhorn-50200.17.0: Terminal client for the Mattermost chat system
Safe HaskellNone
LanguageHaskell2010

Matterhorn.State.ListWindow

Synopsis

Documentation

listWindowActivateCurrent :: TeamId -> Lens' ChatState (ListWindowState a b) -> MH () Source #

Activate the specified list window's selected item by invoking the window's configured enter keypress handler function.

listWindowActivate :: TeamId -> Lens' ChatState (ListWindowState a b) -> a -> MH () Source #

Activate the specified list window's selected item by invoking the window's configured enter keypress handler function.

listWindowSearchString :: Lens' ChatState (ListWindowState a b) -> MH Text Source #

Get the current search string for the specified window.

listWindowMove Source #

Arguments

:: Lens' ChatState (ListWindowState a b)

Which window

-> (List Name a -> List Name a)

How to transform the list in the window

-> MH () 

Move the list cursor in the specified window.

exitListWindow Source #

Arguments

:: TeamId 
-> Lens' ChatState (ListWindowState a b)

Which window to reset

-> MH () 

Clear the state of the specified list window and return to the Main mode.

enterListWindowMode Source #

Arguments

:: TeamId 
-> Lens' ChatState (ListWindowState a b)

Which window to initialize

-> Mode

The mode to change to

-> b

The window's initial search scope

-> (a -> MH Bool)

The window's enter keypress handler

-> (b -> Session -> Text -> IO (Vector a))

The window's results fetcher function

-> MH () 

Initialize a list window with the specified arguments and switch to the specified mode.

resetListWindowSearch :: Lens' ChatState (ListWindowState a b) -> MH () Source #

Reset the window's search by initiating a new search request for the string that is currently in the window's editor. This does nothing if a search for this window is already in progress.

onEventListWindow Source #

Arguments

:: Lens' ChatState (ListWindowState a b)

Which window to dispatch to?

-> (KeyConfig -> KeyHandlerMap)

The keybinding builder

-> Event

The event

-> MH Bool 

Generically handle an event for the list window state targeted by the specified lens. Automatically dispatches new searches in the window's editor if the editor contents change.