/
InputType.purs
156 lines (150 loc) · 5.39 KB
/
InputType.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
module Web.UIEvent.InputEvent.InputType where
import Prelude
data InputType
= InsertText
| InsertReplacementText
| InsertLineBreak
| InsertParagraph
| InsertOrderedList
| InsertUnorderedList
| InsertHorizontalRule
| InsertFromYank
| InsertFromDrop
| InsertFromPaste
| InsertFromPasteAsQuotation
| InsertTranspose
| InsertCompositionText
| InsertLink
| DeleteWordBackward
| DeleteWordForward
| DeleteSoftLineBackward
| DeleteSoftLineForward
| DeleteEntireSoftLine
| DeleteHardLineBackward
| DeleteHardLineForward
| DeleteByDrag
| DeleteByCut
| DeleteContent
| DeleteContentBackward
| DeleteContentForward
| HistoryUndo
| HistoryRedo
| FormatBold
| FormatItalic
| FormatUnderline
| FormatStrikeThrough
| FormatSuperscript
| FormatSubscript
| FormatJustifyFull
| FormatJustifyCenter
| FormatJustifyRight
| FormatJustifyLeft
| FormatIndent
| FormatOutdent
| FormatRemove
| FormatSetBlockTextDirection
| FormatSetInlineTextDirection
| FormatBackColor
| FormatFontColor
| FormatFontName
| Other String
derive instance eqInputType :: Eq InputType
derive instance ordInputType :: Ord InputType
instance showInputType :: Show InputType where
show = print
parse :: String -> InputType
parse "insertText" = InsertText
parse "insertReplacementText" = InsertReplacementText
parse "insertLineBreak" = InsertLineBreak
parse "insertParagraph" = InsertParagraph
parse "insertOrderedList" = InsertOrderedList
parse "insertUnorderedList" = InsertUnorderedList
parse "insertHorizontalRule" = InsertHorizontalRule
parse "insertFromYank" = InsertFromYank
parse "insertFromDrop" = InsertFromDrop
parse "insertFromPaste" = InsertFromPaste
parse "insertFromPasteAsQuotation" = InsertFromPasteAsQuotation
parse "insertTranspose" = InsertTranspose
parse "insertCompositionText" = InsertCompositionText
parse "insertLink" = InsertLink
parse "deleteWordBackward" = DeleteWordBackward
parse "deleteWordForward" = DeleteWordForward
parse "deleteSoftLineBackward" = DeleteSoftLineBackward
parse "deleteSoftLineForward" = DeleteSoftLineForward
parse "deleteEntireSoftLine" = DeleteEntireSoftLine
parse "deleteHardLineBackward" = DeleteHardLineBackward
parse "deleteHardLineForward" = DeleteHardLineForward
parse "deleteByDrag" = DeleteByDrag
parse "deleteByCut" = DeleteByCut
parse "deleteContent" = DeleteContent
parse "deleteContentBackward" = DeleteContentBackward
parse "deleteContentForward" = DeleteContentForward
parse "historyUndo" = HistoryUndo
parse "historyRedo" = HistoryRedo
parse "formatBold" = FormatBold
parse "formatItalic" = FormatItalic
parse "formatUnderline" = FormatUnderline
parse "formatStrikeThrough" = FormatStrikeThrough
parse "formatSuperscript" = FormatSuperscript
parse "formatSubscript" = FormatSubscript
parse "formatJustifyFull" = FormatJustifyFull
parse "formatJustifyCenter" = FormatJustifyCenter
parse "formatJustifyRight" = FormatJustifyRight
parse "formatJustifyLeft" = FormatJustifyLeft
parse "formatIndent" = FormatIndent
parse "formatOutdent" = FormatOutdent
parse "formatRemove" = FormatRemove
parse "formatSetBlockTextDirection" = FormatSetBlockTextDirection
parse "formatSetInlineTextDirection" = FormatSetInlineTextDirection
parse "formatBackColor" = FormatBackColor
parse "formatFontColor" = FormatFontColor
parse "formatFontName" = FormatFontName
parse s = Other s
print :: InputType -> String
print InsertText = "insertText"
print InsertReplacementText = "insertReplacementText"
print InsertLineBreak = "insertLineBreak"
print InsertParagraph = "insertParagraph"
print InsertOrderedList = "insertOrderedList"
print InsertUnorderedList = "insertUnorderedList"
print InsertHorizontalRule = "insertHorizontalRule"
print InsertFromYank = "insertFromYank"
print InsertFromDrop = "insertFromDrop"
print InsertFromPaste = "insertFromPaste"
print InsertFromPasteAsQuotation = "insertFromPasteAsQuotation"
print InsertTranspose = "insertTranspose"
print InsertCompositionText = "insertCompositionText"
print InsertLink = "insertLink"
print DeleteWordBackward = "deleteWordBackward"
print DeleteWordForward = "deleteWordForward"
print DeleteSoftLineBackward = "deleteSoftLineBackward"
print DeleteSoftLineForward = "deleteSoftLineForward"
print DeleteEntireSoftLine = "deleteEntireSoftLine"
print DeleteHardLineBackward = "deleteHardLineBackward"
print DeleteHardLineForward = "deleteHardLineForward"
print DeleteByDrag = "deleteByDrag"
print DeleteByCut = "deleteByCut"
print DeleteContent = "deleteContent"
print DeleteContentBackward = "deleteContentBackward"
print DeleteContentForward = "deleteContentForward"
print HistoryUndo = "historyUndo"
print HistoryRedo = "historyRedo"
print FormatBold = "formatBold"
print FormatItalic = "formatItalic"
print FormatUnderline = "formatUnderline"
print FormatStrikeThrough = "formatStrikeThrough"
print FormatSuperscript = "formatSuperscript"
print FormatSubscript = "formatSubscript"
print FormatJustifyFull = "formatJustifyFull"
print FormatJustifyCenter = "formatJustifyCenter"
print FormatJustifyRight = "formatJustifyRight"
print FormatJustifyLeft = "formatJustifyLeft"
print FormatIndent = "formatIndent"
print FormatOutdent = "formatOutdent"
print FormatRemove = "formatRemove"
print FormatSetBlockTextDirection = "formatSetBlockTextDirection"
print FormatSetInlineTextDirection = "formatSetInlineTextDirection"
print FormatBackColor = "formatBackColor"
print FormatFontColor = "formatFontColor"
print FormatFontName = "formatFontName"
print (Other s) = s