{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
module Matterhorn.Types.Core
( Name(..)
, ChannelListEntry(..)
, ChannelListEntryType(..)
, ChannelSelectMatch(..)
, LinkTarget(..)
, KeyEvent(..)
, allEvents
, MessageId(..)
, messageIdPostId
, ChannelListGroupLabel(..)
, channelListGroupNames
, MessageSelectState(..)
, HelpScreen(..)
)
where
import Prelude ()
import Matterhorn.Prelude
import qualified Brick
import Brick.Keybindings
import Data.Hashable ( Hashable )
import qualified Data.Text as T
import Data.UUID ( UUID )
import GHC.Generics ( Generic )
import Network.Mattermost.Types
import Matterhorn.Types.RichText ( URL, TeamURLName )
data Name =
MessageInterfaceMessages Name
| MessageInput ChannelId
| MessageInputPrompt Name
| ChannelListViewport TeamId
| HelpViewport
| PostList
| HelpContent HelpScreen
| CompletionList Name
| JoinChannelList TeamId
| UrlList Name
| MessagePreviewViewport Name
| ThemeListSearchInput TeamId
| UserListSearchInput TeamId
| JoinChannelListSearchInput TeamId
| UserListSearchResults TeamId
| ThemeListSearchResults TeamId
| ViewMessageArea TeamId
| ViewMessageReactionsArea TeamId
| TeamId
| ChannelSelectInput TeamId
| AttachmentList ChannelId
| AttachmentFileBrowser ChannelId
| ReactionEmojiList TeamId
| ReactionEmojiListInput TeamId
| TabbedWindowTabBar TeamId
| MuteToggleField TeamId
| ChannelMentionsField TeamId
| DesktopNotificationsField TeamId (WithDefault NotifyOption)
| PushNotificationsField TeamId (WithDefault NotifyOption)
| ChannelTopicEditor TeamId
| ChannelTopicSaveButton TeamId
| ChannelTopicCancelButton TeamId
| ChannelTopicEditorPreview TeamId
| ThreadMessageInput ChannelId
| ThreadEditorAttachmentList ChannelId
| ChannelTopic ChannelId
| TeamList
| ClickableChannelSelectEntry ChannelSelectMatch
| ClickableChannelListEntry ChannelId
| ClickableTeamListEntry TeamId
| ClickableURL (Maybe MessageId) Name Int LinkTarget
| ClickableReaction PostId Name Text (Set UserId)
| ClickableAttachmentInMessage Name FileId
| ClickableUsername (Maybe MessageId) Name Int Text
| ClickableURLListEntry Int LinkTarget
| ClickableChannelListGroupHeading ChannelListGroupLabel
| ClickableReactionEmojiListWindowEntry (Bool, T.Text)
| AttachmentPathEditor Name
| AttachmentPathSaveButton Name
| AttachmentPathCancelButton Name
| RenderedMessage MessageId
| SelectedChannelListEntry TeamId
| VScrollBar Brick.ClickableScrollbarElement Name
deriving (Name -> Name -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Name -> Name -> Bool
$c/= :: Name -> Name -> Bool
== :: Name -> Name -> Bool
$c== :: Name -> Name -> Bool
Eq, Int -> Name -> ShowS
[Name] -> ShowS
Name -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Name] -> ShowS
$cshowList :: [Name] -> ShowS
show :: Name -> String
$cshow :: Name -> String
showsPrec :: Int -> Name -> ShowS
$cshowsPrec :: Int -> Name -> ShowS
Show, Eq Name
Name -> Name -> Bool
Name -> Name -> Ordering
Name -> Name -> Name
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Name -> Name -> Name
$cmin :: Name -> Name -> Name
max :: Name -> Name -> Name
$cmax :: Name -> Name -> Name
>= :: Name -> Name -> Bool
$c>= :: Name -> Name -> Bool
> :: Name -> Name -> Bool
$c> :: Name -> Name -> Bool
<= :: Name -> Name -> Bool
$c<= :: Name -> Name -> Bool
< :: Name -> Name -> Bool
$c< :: Name -> Name -> Bool
compare :: Name -> Name -> Ordering
$ccompare :: Name -> Name -> Ordering
Ord)
data ChannelSelectMatch =
ChannelSelectMatch { ChannelSelectMatch -> Text
nameBefore :: Text
, ChannelSelectMatch -> Text
nameMatched :: Text
, ChannelSelectMatch -> Text
nameAfter :: Text
, ChannelSelectMatch -> Text
matchFull :: Text
, ChannelSelectMatch -> ChannelListEntry
matchEntry :: ChannelListEntry
}
deriving (ChannelSelectMatch -> ChannelSelectMatch -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
$c/= :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
== :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
$c== :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
Eq, Int -> ChannelSelectMatch -> ShowS
[ChannelSelectMatch] -> ShowS
ChannelSelectMatch -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelSelectMatch] -> ShowS
$cshowList :: [ChannelSelectMatch] -> ShowS
show :: ChannelSelectMatch -> String
$cshow :: ChannelSelectMatch -> String
showsPrec :: Int -> ChannelSelectMatch -> ShowS
$cshowsPrec :: Int -> ChannelSelectMatch -> ShowS
Show, Eq ChannelSelectMatch
ChannelSelectMatch -> ChannelSelectMatch -> Bool
ChannelSelectMatch -> ChannelSelectMatch -> Ordering
ChannelSelectMatch -> ChannelSelectMatch -> ChannelSelectMatch
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChannelSelectMatch -> ChannelSelectMatch -> ChannelSelectMatch
$cmin :: ChannelSelectMatch -> ChannelSelectMatch -> ChannelSelectMatch
max :: ChannelSelectMatch -> ChannelSelectMatch -> ChannelSelectMatch
$cmax :: ChannelSelectMatch -> ChannelSelectMatch -> ChannelSelectMatch
>= :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
$c>= :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
> :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
$c> :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
<= :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
$c<= :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
< :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
$c< :: ChannelSelectMatch -> ChannelSelectMatch -> Bool
compare :: ChannelSelectMatch -> ChannelSelectMatch -> Ordering
$ccompare :: ChannelSelectMatch -> ChannelSelectMatch -> Ordering
Ord)
data ChannelListEntry =
ChannelListEntry { ChannelListEntry -> ChannelId
channelListEntryChannelId :: ChannelId
, ChannelListEntry -> ChannelListEntryType
channelListEntryType :: ChannelListEntryType
, ChannelListEntry -> Bool
channelListEntryUnread :: Bool
, ChannelListEntry -> Text
channelListEntrySortValue :: T.Text
, ChannelListEntry -> Bool
channelListEntryFavorite :: Bool
, ChannelListEntry -> Bool
channelListEntryMuted :: Bool
}
deriving (ChannelListEntry -> ChannelListEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelListEntry -> ChannelListEntry -> Bool
$c/= :: ChannelListEntry -> ChannelListEntry -> Bool
== :: ChannelListEntry -> ChannelListEntry -> Bool
$c== :: ChannelListEntry -> ChannelListEntry -> Bool
Eq, Int -> ChannelListEntry -> ShowS
[ChannelListEntry] -> ShowS
ChannelListEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelListEntry] -> ShowS
$cshowList :: [ChannelListEntry] -> ShowS
show :: ChannelListEntry -> String
$cshow :: ChannelListEntry -> String
showsPrec :: Int -> ChannelListEntry -> ShowS
$cshowsPrec :: Int -> ChannelListEntry -> ShowS
Show, Eq ChannelListEntry
ChannelListEntry -> ChannelListEntry -> Bool
ChannelListEntry -> ChannelListEntry -> Ordering
ChannelListEntry -> ChannelListEntry -> ChannelListEntry
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChannelListEntry -> ChannelListEntry -> ChannelListEntry
$cmin :: ChannelListEntry -> ChannelListEntry -> ChannelListEntry
max :: ChannelListEntry -> ChannelListEntry -> ChannelListEntry
$cmax :: ChannelListEntry -> ChannelListEntry -> ChannelListEntry
>= :: ChannelListEntry -> ChannelListEntry -> Bool
$c>= :: ChannelListEntry -> ChannelListEntry -> Bool
> :: ChannelListEntry -> ChannelListEntry -> Bool
$c> :: ChannelListEntry -> ChannelListEntry -> Bool
<= :: ChannelListEntry -> ChannelListEntry -> Bool
$c<= :: ChannelListEntry -> ChannelListEntry -> Bool
< :: ChannelListEntry -> ChannelListEntry -> Bool
$c< :: ChannelListEntry -> ChannelListEntry -> Bool
compare :: ChannelListEntry -> ChannelListEntry -> Ordering
$ccompare :: ChannelListEntry -> ChannelListEntry -> Ordering
Ord)
data ChannelListEntryType =
CLChannel
| CLUserDM UserId
| CLGroupDM
deriving (ChannelListEntryType -> ChannelListEntryType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelListEntryType -> ChannelListEntryType -> Bool
$c/= :: ChannelListEntryType -> ChannelListEntryType -> Bool
== :: ChannelListEntryType -> ChannelListEntryType -> Bool
$c== :: ChannelListEntryType -> ChannelListEntryType -> Bool
Eq, Int -> ChannelListEntryType -> ShowS
[ChannelListEntryType] -> ShowS
ChannelListEntryType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelListEntryType] -> ShowS
$cshowList :: [ChannelListEntryType] -> ShowS
show :: ChannelListEntryType -> String
$cshow :: ChannelListEntryType -> String
showsPrec :: Int -> ChannelListEntryType -> ShowS
$cshowsPrec :: Int -> ChannelListEntryType -> ShowS
Show, Eq ChannelListEntryType
ChannelListEntryType -> ChannelListEntryType -> Bool
ChannelListEntryType -> ChannelListEntryType -> Ordering
ChannelListEntryType
-> ChannelListEntryType -> ChannelListEntryType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChannelListEntryType
-> ChannelListEntryType -> ChannelListEntryType
$cmin :: ChannelListEntryType
-> ChannelListEntryType -> ChannelListEntryType
max :: ChannelListEntryType
-> ChannelListEntryType -> ChannelListEntryType
$cmax :: ChannelListEntryType
-> ChannelListEntryType -> ChannelListEntryType
>= :: ChannelListEntryType -> ChannelListEntryType -> Bool
$c>= :: ChannelListEntryType -> ChannelListEntryType -> Bool
> :: ChannelListEntryType -> ChannelListEntryType -> Bool
$c> :: ChannelListEntryType -> ChannelListEntryType -> Bool
<= :: ChannelListEntryType -> ChannelListEntryType -> Bool
$c<= :: ChannelListEntryType -> ChannelListEntryType -> Bool
< :: ChannelListEntryType -> ChannelListEntryType -> Bool
$c< :: ChannelListEntryType -> ChannelListEntryType -> Bool
compare :: ChannelListEntryType -> ChannelListEntryType -> Ordering
$ccompare :: ChannelListEntryType -> ChannelListEntryType -> Ordering
Ord)
data HelpScreen =
MainHelp
| ScriptHelp
| ThemeHelp
| SyntaxHighlightHelp
| KeybindingHelp
deriving (HelpScreen -> HelpScreen -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HelpScreen -> HelpScreen -> Bool
$c/= :: HelpScreen -> HelpScreen -> Bool
== :: HelpScreen -> HelpScreen -> Bool
$c== :: HelpScreen -> HelpScreen -> Bool
Eq, Int -> HelpScreen -> ShowS
[HelpScreen] -> ShowS
HelpScreen -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HelpScreen] -> ShowS
$cshowList :: [HelpScreen] -> ShowS
show :: HelpScreen -> String
$cshow :: HelpScreen -> String
showsPrec :: Int -> HelpScreen -> ShowS
$cshowsPrec :: Int -> HelpScreen -> ShowS
Show, Eq HelpScreen
HelpScreen -> HelpScreen -> Bool
HelpScreen -> HelpScreen -> Ordering
HelpScreen -> HelpScreen -> HelpScreen
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: HelpScreen -> HelpScreen -> HelpScreen
$cmin :: HelpScreen -> HelpScreen -> HelpScreen
max :: HelpScreen -> HelpScreen -> HelpScreen
$cmax :: HelpScreen -> HelpScreen -> HelpScreen
>= :: HelpScreen -> HelpScreen -> Bool
$c>= :: HelpScreen -> HelpScreen -> Bool
> :: HelpScreen -> HelpScreen -> Bool
$c> :: HelpScreen -> HelpScreen -> Bool
<= :: HelpScreen -> HelpScreen -> Bool
$c<= :: HelpScreen -> HelpScreen -> Bool
< :: HelpScreen -> HelpScreen -> Bool
$c< :: HelpScreen -> HelpScreen -> Bool
compare :: HelpScreen -> HelpScreen -> Ordering
$ccompare :: HelpScreen -> HelpScreen -> Ordering
Ord)
data LinkTarget =
LinkURL URL
| LinkFileId FileId
| LinkPermalink TeamURLName PostId
deriving (LinkTarget -> LinkTarget -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LinkTarget -> LinkTarget -> Bool
$c/= :: LinkTarget -> LinkTarget -> Bool
== :: LinkTarget -> LinkTarget -> Bool
$c== :: LinkTarget -> LinkTarget -> Bool
Eq, Int -> LinkTarget -> ShowS
[LinkTarget] -> ShowS
LinkTarget -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LinkTarget] -> ShowS
$cshowList :: [LinkTarget] -> ShowS
show :: LinkTarget -> String
$cshow :: LinkTarget -> String
showsPrec :: Int -> LinkTarget -> ShowS
$cshowsPrec :: Int -> LinkTarget -> ShowS
Show, Eq LinkTarget
LinkTarget -> LinkTarget -> Bool
LinkTarget -> LinkTarget -> Ordering
LinkTarget -> LinkTarget -> LinkTarget
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: LinkTarget -> LinkTarget -> LinkTarget
$cmin :: LinkTarget -> LinkTarget -> LinkTarget
max :: LinkTarget -> LinkTarget -> LinkTarget
$cmax :: LinkTarget -> LinkTarget -> LinkTarget
>= :: LinkTarget -> LinkTarget -> Bool
$c>= :: LinkTarget -> LinkTarget -> Bool
> :: LinkTarget -> LinkTarget -> Bool
$c> :: LinkTarget -> LinkTarget -> Bool
<= :: LinkTarget -> LinkTarget -> Bool
$c<= :: LinkTarget -> LinkTarget -> Bool
< :: LinkTarget -> LinkTarget -> Bool
$c< :: LinkTarget -> LinkTarget -> Bool
compare :: LinkTarget -> LinkTarget -> Ordering
$ccompare :: LinkTarget -> LinkTarget -> Ordering
Ord)
data MessageId = MessagePostId PostId
| MessageUUID UUID
deriving (MessageId -> MessageId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MessageId -> MessageId -> Bool
$c/= :: MessageId -> MessageId -> Bool
== :: MessageId -> MessageId -> Bool
$c== :: MessageId -> MessageId -> Bool
Eq, ReadPrec [MessageId]
ReadPrec MessageId
Int -> ReadS MessageId
ReadS [MessageId]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MessageId]
$creadListPrec :: ReadPrec [MessageId]
readPrec :: ReadPrec MessageId
$creadPrec :: ReadPrec MessageId
readList :: ReadS [MessageId]
$creadList :: ReadS [MessageId]
readsPrec :: Int -> ReadS MessageId
$creadsPrec :: Int -> ReadS MessageId
Read, Eq MessageId
MessageId -> MessageId -> Bool
MessageId -> MessageId -> Ordering
MessageId -> MessageId -> MessageId
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: MessageId -> MessageId -> MessageId
$cmin :: MessageId -> MessageId -> MessageId
max :: MessageId -> MessageId -> MessageId
$cmax :: MessageId -> MessageId -> MessageId
>= :: MessageId -> MessageId -> Bool
$c>= :: MessageId -> MessageId -> Bool
> :: MessageId -> MessageId -> Bool
$c> :: MessageId -> MessageId -> Bool
<= :: MessageId -> MessageId -> Bool
$c<= :: MessageId -> MessageId -> Bool
< :: MessageId -> MessageId -> Bool
$c< :: MessageId -> MessageId -> Bool
compare :: MessageId -> MessageId -> Ordering
$ccompare :: MessageId -> MessageId -> Ordering
Ord, Int -> MessageId -> ShowS
[MessageId] -> ShowS
MessageId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageId] -> ShowS
$cshowList :: [MessageId] -> ShowS
show :: MessageId -> String
$cshow :: MessageId -> String
showsPrec :: Int -> MessageId -> ShowS
$cshowsPrec :: Int -> MessageId -> ShowS
Show, forall x. Rep MessageId x -> MessageId
forall x. MessageId -> Rep MessageId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MessageId x -> MessageId
$cfrom :: forall x. MessageId -> Rep MessageId x
Generic, Eq MessageId
Int -> MessageId -> Int
MessageId -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: MessageId -> Int
$chash :: MessageId -> Int
hashWithSalt :: Int -> MessageId -> Int
$chashWithSalt :: Int -> MessageId -> Int
Hashable)
messageIdPostId :: MessageId -> Maybe PostId
messageIdPostId :: MessageId -> Maybe PostId
messageIdPostId (MessagePostId PostId
p) = forall a. a -> Maybe a
Just PostId
p
messageIdPostId MessageId
_ = forall a. Maybe a
Nothing
data ChannelListGroupLabel =
ChannelGroupPublicChannels
| ChannelGroupPrivateChannels
| ChannelGroupFavoriteChannels
| ChannelGroupDirectMessages
deriving (ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
$c/= :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
== :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
$c== :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
Eq, Eq ChannelListGroupLabel
ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
ChannelListGroupLabel -> ChannelListGroupLabel -> Ordering
ChannelListGroupLabel
-> ChannelListGroupLabel -> ChannelListGroupLabel
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChannelListGroupLabel
-> ChannelListGroupLabel -> ChannelListGroupLabel
$cmin :: ChannelListGroupLabel
-> ChannelListGroupLabel -> ChannelListGroupLabel
max :: ChannelListGroupLabel
-> ChannelListGroupLabel -> ChannelListGroupLabel
$cmax :: ChannelListGroupLabel
-> ChannelListGroupLabel -> ChannelListGroupLabel
>= :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
$c>= :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
> :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
$c> :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
<= :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
$c<= :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
< :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
$c< :: ChannelListGroupLabel -> ChannelListGroupLabel -> Bool
compare :: ChannelListGroupLabel -> ChannelListGroupLabel -> Ordering
$ccompare :: ChannelListGroupLabel -> ChannelListGroupLabel -> Ordering
Ord, Int -> ChannelListGroupLabel -> ShowS
[ChannelListGroupLabel] -> ShowS
ChannelListGroupLabel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelListGroupLabel] -> ShowS
$cshowList :: [ChannelListGroupLabel] -> ShowS
show :: ChannelListGroupLabel -> String
$cshow :: ChannelListGroupLabel -> String
showsPrec :: Int -> ChannelListGroupLabel -> ShowS
$cshowsPrec :: Int -> ChannelListGroupLabel -> ShowS
Show)
channelListGroupNames :: [(T.Text, ChannelListGroupLabel)]
channelListGroupNames :: [(Text, ChannelListGroupLabel)]
channelListGroupNames =
[ (Text
"public", ChannelListGroupLabel
ChannelGroupPublicChannels)
, (Text
"private", ChannelListGroupLabel
ChannelGroupPrivateChannels)
, (Text
"favorite", ChannelListGroupLabel
ChannelGroupFavoriteChannels)
, (Text
"direct", ChannelListGroupLabel
ChannelGroupDirectMessages)
]
data MessageSelectState =
MessageSelectState { MessageSelectState -> Maybe MessageId
selectMessageId :: Maybe MessageId
}
data KeyEvent
= VtyRefreshEvent
| ShowHelpEvent
| EnterSelectModeEvent
| ReplyRecentEvent
| ToggleMessagePreviewEvent
| InvokeEditorEvent
| EnterFastSelectModeEvent
| QuitEvent
| NextChannelEvent
| PrevChannelEvent
| NextChannelEventAlternate
| PrevChannelEventAlternate
| NextUnreadChannelEvent
| NextUnreadUserOrChannelEvent
| LastChannelEvent
| EnterOpenURLModeEvent
| ClearUnreadEvent
| ToggleMultiLineEvent
| EnterFlaggedPostsEvent
| ToggleChannelListVisibleEvent
| ToggleExpandedChannelTopicsEvent
| ShowAttachmentListEvent
| ChangeMessageEditorFocus
| EditorKillToBolEvent
| EditorKillToEolEvent
| EditorBolEvent
| EditorEolEvent
| EditorTransposeCharsEvent
| EditorDeleteCharacter
| EditorPrevCharEvent
| EditorNextCharEvent
| EditorPrevWordEvent
| EditorNextWordEvent
| EditorDeleteNextWordEvent
| EditorDeletePrevWordEvent
| EditorHomeEvent
| EditorEndEvent
| EditorYankEvent
| CycleChannelListSorting
| SelectNextTabEvent
| SelectPreviousTabEvent
| SaveAttachmentEvent
| CancelEvent
| LoadMoreEvent
| OpenMessageURLEvent
| ScrollUpEvent
| ScrollDownEvent
| ScrollLeftEvent
| ScrollRightEvent
| PageUpEvent
| PageDownEvent
|
| PageLeftEvent
| ScrollTopEvent
| ScrollBottomEvent
| SelectOldestMessageEvent
| ChannelListScrollUpEvent
| ChannelListScrollDownEvent
| SelectUpEvent
| SelectDownEvent
| SearchSelectUpEvent
| SearchSelectDownEvent
| ActivateListItemEvent
| ViewMessageEvent
| FillGapEvent
| CopyPostLinkEvent
| FlagMessageEvent
| OpenThreadEvent
| PinMessageEvent
| YankMessageEvent
| YankWholeMessageEvent
| DeleteMessageEvent
| EditMessageEvent
| ReplyMessageEvent
| ReactToMessageEvent
| AttachmentListAddEvent
| AttachmentListDeleteEvent
| AttachmentOpenEvent
| FileBrowserBeginSearchEvent
| FileBrowserSelectEnterEvent
| FileBrowserSelectCurrentEvent
| FileBrowserListPageUpEvent
| FileBrowserListPageDownEvent
| FileBrowserListHalfPageUpEvent
| FileBrowserListHalfPageDownEvent
| FileBrowserListTopEvent
| FileBrowserListBottomEvent
| FileBrowserListNextEvent
| FileBrowserListPrevEvent
| FormSubmitEvent
| NextTeamEvent
| PrevTeamEvent
| MoveCurrentTeamLeftEvent
| MoveCurrentTeamRightEvent
deriving (KeyEvent -> KeyEvent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KeyEvent -> KeyEvent -> Bool
$c/= :: KeyEvent -> KeyEvent -> Bool
== :: KeyEvent -> KeyEvent -> Bool
$c== :: KeyEvent -> KeyEvent -> Bool
Eq, Int -> KeyEvent -> ShowS
[KeyEvent] -> ShowS
KeyEvent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyEvent] -> ShowS
$cshowList :: [KeyEvent] -> ShowS
show :: KeyEvent -> String
$cshow :: KeyEvent -> String
showsPrec :: Int -> KeyEvent -> ShowS
$cshowsPrec :: Int -> KeyEvent -> ShowS
Show, Eq KeyEvent
KeyEvent -> KeyEvent -> Bool
KeyEvent -> KeyEvent -> Ordering
KeyEvent -> KeyEvent -> KeyEvent
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: KeyEvent -> KeyEvent -> KeyEvent
$cmin :: KeyEvent -> KeyEvent -> KeyEvent
max :: KeyEvent -> KeyEvent -> KeyEvent
$cmax :: KeyEvent -> KeyEvent -> KeyEvent
>= :: KeyEvent -> KeyEvent -> Bool
$c>= :: KeyEvent -> KeyEvent -> Bool
> :: KeyEvent -> KeyEvent -> Bool
$c> :: KeyEvent -> KeyEvent -> Bool
<= :: KeyEvent -> KeyEvent -> Bool
$c<= :: KeyEvent -> KeyEvent -> Bool
< :: KeyEvent -> KeyEvent -> Bool
$c< :: KeyEvent -> KeyEvent -> Bool
compare :: KeyEvent -> KeyEvent -> Ordering
$ccompare :: KeyEvent -> KeyEvent -> Ordering
Ord, Int -> KeyEvent
KeyEvent -> Int
KeyEvent -> [KeyEvent]
KeyEvent -> KeyEvent
KeyEvent -> KeyEvent -> [KeyEvent]
KeyEvent -> KeyEvent -> KeyEvent -> [KeyEvent]
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: KeyEvent -> KeyEvent -> KeyEvent -> [KeyEvent]
$cenumFromThenTo :: KeyEvent -> KeyEvent -> KeyEvent -> [KeyEvent]
enumFromTo :: KeyEvent -> KeyEvent -> [KeyEvent]
$cenumFromTo :: KeyEvent -> KeyEvent -> [KeyEvent]
enumFromThen :: KeyEvent -> KeyEvent -> [KeyEvent]
$cenumFromThen :: KeyEvent -> KeyEvent -> [KeyEvent]
enumFrom :: KeyEvent -> [KeyEvent]
$cenumFrom :: KeyEvent -> [KeyEvent]
fromEnum :: KeyEvent -> Int
$cfromEnum :: KeyEvent -> Int
toEnum :: Int -> KeyEvent
$ctoEnum :: Int -> KeyEvent
pred :: KeyEvent -> KeyEvent
$cpred :: KeyEvent -> KeyEvent
succ :: KeyEvent -> KeyEvent
$csucc :: KeyEvent -> KeyEvent
Enum)
allEvents :: KeyEvents KeyEvent
allEvents :: KeyEvents KeyEvent
allEvents =
forall k. Ord k => [(Text, k)] -> KeyEvents k
keyEvents
[ (Text
"quit", KeyEvent
QuitEvent)
, (Text
"vty-refresh", KeyEvent
VtyRefreshEvent)
, (Text
"clear-unread", KeyEvent
ClearUnreadEvent)
, (Text
"cancel", KeyEvent
CancelEvent)
, (Text
"toggle-message-preview", KeyEvent
ToggleMessagePreviewEvent)
, (Text
"invoke-editor", KeyEvent
InvokeEditorEvent)
, (Text
"toggle-multiline", KeyEvent
ToggleMultiLineEvent)
, (Text
"reply-recent", KeyEvent
ReplyRecentEvent)
, (Text
"enter-fast-select", KeyEvent
EnterFastSelectModeEvent)
, (Text
"focus-next-channel", KeyEvent
NextChannelEvent)
, (Text
"focus-prev-channel", KeyEvent
PrevChannelEvent)
, (Text
"focus-next-channel-alternate", KeyEvent
NextChannelEventAlternate)
, (Text
"focus-prev-channel-alternate", KeyEvent
PrevChannelEventAlternate)
, (Text
"focus-next-unread", KeyEvent
NextUnreadChannelEvent)
, (Text
"focus-next-unread-user-or-channel", KeyEvent
NextUnreadUserOrChannelEvent)
, (Text
"focus-last-channel", KeyEvent
LastChannelEvent)
, (Text
"select-next-tab", KeyEvent
SelectNextTabEvent)
, (Text
"select-previous-tab", KeyEvent
SelectPreviousTabEvent)
, (Text
"save-attachment", KeyEvent
SaveAttachmentEvent)
, (Text
"show-attachment-list", KeyEvent
ShowAttachmentListEvent)
, (Text
"change-message-editor-focus", KeyEvent
ChangeMessageEditorFocus)
, (Text
"editor-kill-to-beginning-of-line", KeyEvent
EditorKillToBolEvent)
, (Text
"editor-kill-to-end-of-line", KeyEvent
EditorKillToEolEvent)
, (Text
"editor-beginning-of-line", KeyEvent
EditorBolEvent)
, (Text
"editor-end-of-line", KeyEvent
EditorEolEvent)
, (Text
"editor-transpose-chars", KeyEvent
EditorTransposeCharsEvent)
, (Text
"editor-delete-char", KeyEvent
EditorDeleteCharacter)
, (Text
"editor-prev-char", KeyEvent
EditorPrevCharEvent)
, (Text
"editor-next-char", KeyEvent
EditorNextCharEvent)
, (Text
"editor-prev-word", KeyEvent
EditorPrevWordEvent)
, (Text
"editor-next-word", KeyEvent
EditorNextWordEvent)
, (Text
"editor-delete-next-word", KeyEvent
EditorDeleteNextWordEvent)
, (Text
"editor-delete-prev-word", KeyEvent
EditorDeletePrevWordEvent)
, (Text
"editor-home", KeyEvent
EditorHomeEvent)
, (Text
"editor-end", KeyEvent
EditorEndEvent)
, (Text
"editor-yank", KeyEvent
EditorYankEvent)
, (Text
"cycle-channel-list-sorting", KeyEvent
CycleChannelListSorting)
, (Text
"next-team", KeyEvent
NextTeamEvent)
, (Text
"prev-team", KeyEvent
PrevTeamEvent)
, (Text
"move-current-team-left", KeyEvent
MoveCurrentTeamLeftEvent)
, (Text
"move-current-team-right", KeyEvent
MoveCurrentTeamRightEvent)
, (Text
"show-flagged-posts", KeyEvent
EnterFlaggedPostsEvent)
, (Text
"toggle-channel-list-visibility", KeyEvent
ToggleChannelListVisibleEvent)
, (Text
"toggle-expanded-channel-topics", KeyEvent
ToggleExpandedChannelTopicsEvent)
, (Text
"show-help", KeyEvent
ShowHelpEvent)
, (Text
"select-mode", KeyEvent
EnterSelectModeEvent)
, (Text
"enter-url-open", KeyEvent
EnterOpenURLModeEvent)
, (Text
"load-more", KeyEvent
LoadMoreEvent)
, (Text
"open-message-url", KeyEvent
OpenMessageURLEvent)
, (Text
"scroll-up", KeyEvent
ScrollUpEvent)
, (Text
"scroll-down", KeyEvent
ScrollDownEvent)
, (Text
"scroll-left", KeyEvent
ScrollLeftEvent)
, (Text
"scroll-right", KeyEvent
ScrollRightEvent)
, (Text
"channel-list-scroll-up", KeyEvent
ChannelListScrollUpEvent)
, (Text
"channel-list-scroll-down", KeyEvent
ChannelListScrollDownEvent)
, (Text
"page-up", KeyEvent
PageUpEvent)
, (Text
"page-down", KeyEvent
PageDownEvent)
, (Text
"page-left", KeyEvent
PageLeftEvent)
, (Text
"page-right", KeyEvent
PageRightEvent)
, (Text
"scroll-top", KeyEvent
ScrollTopEvent)
, (Text
"scroll-bottom", KeyEvent
ScrollBottomEvent)
, (Text
"select-oldest-message", KeyEvent
SelectOldestMessageEvent)
, (Text
"select-up", KeyEvent
SelectUpEvent)
, (Text
"select-down", KeyEvent
SelectDownEvent)
, (Text
"search-select-up", KeyEvent
SearchSelectUpEvent)
, (Text
"search-select-down", KeyEvent
SearchSelectDownEvent)
, (Text
"activate-list-item", KeyEvent
ActivateListItemEvent)
, (Text
"open-thread", KeyEvent
OpenThreadEvent)
, (Text
"flag-message", KeyEvent
FlagMessageEvent)
, (Text
"pin-message", KeyEvent
PinMessageEvent)
, (Text
"view-message", KeyEvent
ViewMessageEvent)
, (Text
"fetch-for-gap", KeyEvent
FillGapEvent)
, (Text
"copy-post-link", KeyEvent
CopyPostLinkEvent)
, (Text
"yank-message", KeyEvent
YankMessageEvent)
, (Text
"yank-whole-message", KeyEvent
YankWholeMessageEvent)
, (Text
"delete-message", KeyEvent
DeleteMessageEvent)
, (Text
"edit-message", KeyEvent
EditMessageEvent)
, (Text
"reply-message", KeyEvent
ReplyMessageEvent)
, (Text
"react-to-message", KeyEvent
ReactToMessageEvent)
, (Text
"add-to-attachment-list", KeyEvent
AttachmentListAddEvent)
, (Text
"delete-from-attachment-list", KeyEvent
AttachmentListDeleteEvent)
, (Text
"open-attachment", KeyEvent
AttachmentOpenEvent)
, (Text
"filebrowser-begin-search", KeyEvent
FileBrowserBeginSearchEvent)
, (Text
"filebrowser-select-file-or-enter-directory", KeyEvent
FileBrowserSelectEnterEvent)
, (Text
"filebrowser-select-current", KeyEvent
FileBrowserSelectCurrentEvent)
, (Text
"filebrowser-list-page-up", KeyEvent
FileBrowserListPageUpEvent)
, (Text
"filebrowser-list-page-down", KeyEvent
FileBrowserListPageDownEvent)
, (Text
"filebrowser-list-half-page-up", KeyEvent
FileBrowserListHalfPageUpEvent)
, (Text
"filebrowser-list-half-page-down", KeyEvent
FileBrowserListHalfPageDownEvent)
, (Text
"filebrowser-list-top", KeyEvent
FileBrowserListTopEvent)
, (Text
"filebrowser-list-bottom", KeyEvent
FileBrowserListBottomEvent)
, (Text
"filebrowser-list-next", KeyEvent
FileBrowserListNextEvent)
, (Text
"filebrowser-list-previous", KeyEvent
FileBrowserListPrevEvent)
, (Text
"submit-form", KeyEvent
FormSubmitEvent)
]