Bug 1613552 [wpt PR 21618] - Fix timeout vs. task-queue race conditions in promise...
[gecko.git] / widget / CommandList.h
blob77de35eed778d94066a8bc3ca3f9b3d8cabea35d
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /**
7 * Define NS_DEFINE_COMMAND(aName, aCommandStr) before including this.
8 * @param aName The name useful in C++ of the command.
9 * @param aCommandStr The command string in JS.
11 * Define NS_DEFINE_COMMAND_WITH_PARAM(aName, aCommandStr, aParam) before
12 * including this.
13 * @param aName The name useful in C++ of the command.
14 * @param aCommandStr The command string in JS, but this may be shared with
15 * other aName values. I.e., cannot map aName and
16 * aCommandStr 1:1.
17 * @param aParam Additional param value. When aCommandStr is executed,
18 * this value is also specified. I.e., aName becomes
19 * unique when you look for with both aCommandStr and
20 * aParam.
22 * Define NS_DEFINE_COMMAND_NO_EXEC_COMMAND(aName) before including this.
23 * @param aName The name useful in C++ of the command.
26 // Mapped from commands of some platforms
27 NS_DEFINE_COMMAND(BeginLine, cmd_beginLine)
28 NS_DEFINE_COMMAND(CharNext, cmd_charNext)
29 NS_DEFINE_COMMAND(CharPrevious, cmd_charPrevious)
30 NS_DEFINE_COMMAND(Copy, cmd_copy)
31 NS_DEFINE_COMMAND(Cut, cmd_cut)
32 NS_DEFINE_COMMAND(Delete, cmd_delete)
33 NS_DEFINE_COMMAND(DeleteCharBackward, cmd_deleteCharBackward)
34 NS_DEFINE_COMMAND(DeleteCharForward, cmd_deleteCharForward)
35 NS_DEFINE_COMMAND(DeleteToBeginningOfLine, cmd_deleteToBeginningOfLine)
36 NS_DEFINE_COMMAND(DeleteToEndOfLine, cmd_deleteToEndOfLine)
37 NS_DEFINE_COMMAND(DeleteWordBackward, cmd_deleteWordBackward)
38 NS_DEFINE_COMMAND(DeleteWordForward, cmd_deleteWordForward)
39 NS_DEFINE_COMMAND(EndLine, cmd_endLine)
40 NS_DEFINE_COMMAND(InsertParagraph, cmd_insertParagraph)
41 NS_DEFINE_COMMAND(InsertLineBreak, cmd_insertLineBreak)
42 NS_DEFINE_COMMAND(LineNext, cmd_lineNext)
43 NS_DEFINE_COMMAND(LinePrevious, cmd_linePrevious)
44 NS_DEFINE_COMMAND(MoveBottom, cmd_moveBottom)
45 NS_DEFINE_COMMAND(MovePageDown, cmd_movePageDown)
46 NS_DEFINE_COMMAND(MovePageUp, cmd_movePageUp)
47 NS_DEFINE_COMMAND(MoveTop, cmd_moveTop)
48 NS_DEFINE_COMMAND(Paste, cmd_paste)
49 NS_DEFINE_COMMAND(ScrollBottom, cmd_scrollBottom)
50 NS_DEFINE_COMMAND(ScrollLineDown, cmd_scrollLineDown)
51 NS_DEFINE_COMMAND(ScrollLineUp, cmd_scrollLineUp)
52 NS_DEFINE_COMMAND(ScrollPageDown, cmd_scrollPageDown)
53 NS_DEFINE_COMMAND(ScrollPageUp, cmd_scrollPageUp)
54 NS_DEFINE_COMMAND(ScrollTop, cmd_scrollTop)
55 NS_DEFINE_COMMAND(SelectAll, cmd_selectAll)
56 NS_DEFINE_COMMAND(SelectBeginLine, cmd_selectBeginLine)
57 NS_DEFINE_COMMAND(SelectBottom, cmd_selectBottom)
58 NS_DEFINE_COMMAND(SelectCharNext, cmd_selectCharNext)
59 NS_DEFINE_COMMAND(SelectCharPrevious, cmd_selectCharPrevious)
60 NS_DEFINE_COMMAND(SelectEndLine, cmd_selectEndLine)
61 NS_DEFINE_COMMAND(SelectLineNext, cmd_selectLineNext)
62 NS_DEFINE_COMMAND(SelectLinePrevious, cmd_selectLinePrevious)
63 NS_DEFINE_COMMAND(SelectPageDown, cmd_selectPageDown)
64 NS_DEFINE_COMMAND(SelectPageUp, cmd_selectPageUp)
65 NS_DEFINE_COMMAND(SelectTop, cmd_selectTop)
66 NS_DEFINE_COMMAND(SelectWordNext, cmd_selectWordNext)
67 NS_DEFINE_COMMAND(SelectWordPrevious, cmd_selectWordPrevious)
68 NS_DEFINE_COMMAND(WordNext, cmd_wordNext)
69 NS_DEFINE_COMMAND(WordPrevious, cmd_wordPrevious)
71 // We don't have corresponding commands for them, but some platforms have them.
72 NS_DEFINE_COMMAND_NO_EXEC_COMMAND(CancelOperation)
73 NS_DEFINE_COMMAND_NO_EXEC_COMMAND(Complete)
74 NS_DEFINE_COMMAND_NO_EXEC_COMMAND(InsertBacktab)
75 NS_DEFINE_COMMAND_NO_EXEC_COMMAND(InsertTab)
77 // Commands mapped from HTMLDocument.execCommand()
78 NS_DEFINE_COMMAND(FormatBold, cmd_bold)
79 NS_DEFINE_COMMAND(FormatItalic, cmd_italic)
80 NS_DEFINE_COMMAND(FormatUnderline, cmd_underline)
81 NS_DEFINE_COMMAND(FormatStrikeThrough, cmd_strikethrough)
82 NS_DEFINE_COMMAND(FormatSubscript, cmd_subscript)
83 NS_DEFINE_COMMAND(FormatSuperscript, cmd_superscript)
84 NS_DEFINE_COMMAND(HistoryUndo, cmd_undo)
85 NS_DEFINE_COMMAND(HistoryRedo, cmd_redo)
86 NS_DEFINE_COMMAND(FormatBlock, cmd_paragraphState)
87 NS_DEFINE_COMMAND(FormatIndent, cmd_indent)
88 NS_DEFINE_COMMAND(FormatOutdent, cmd_outdent)
89 NS_DEFINE_COMMAND_WITH_PARAM(FormatJustifyLeft, cmd_align, left)
90 NS_DEFINE_COMMAND_WITH_PARAM(FormatJustifyRight, cmd_align, right)
91 NS_DEFINE_COMMAND_WITH_PARAM(FormatJustifyCenter, cmd_align, center)
92 NS_DEFINE_COMMAND_WITH_PARAM(FormatJustifyFull, cmd_align, justify)
93 NS_DEFINE_COMMAND(FormatBackColor, cmd_highlight)
94 NS_DEFINE_COMMAND(FormatFontColor, cmd_fontColor)
95 NS_DEFINE_COMMAND(FormatFontName, cmd_fontFace)
96 NS_DEFINE_COMMAND(FormatFontSize, cmd_fontSize)
97 NS_DEFINE_COMMAND(FormatIncreaseFontSize, cmd_increaseFont)
98 NS_DEFINE_COMMAND(FormatDecreaseFontSize, cmd_decreaseFont)
99 NS_DEFINE_COMMAND(InsertHorizontalRule, cmd_insertHR)
100 NS_DEFINE_COMMAND(InsertLink, cmd_insertLinkNoUI)
101 NS_DEFINE_COMMAND(InsertImage, cmd_insertImageNoUI)
102 NS_DEFINE_COMMAND(InsertHTML, cmd_insertHTML)
103 NS_DEFINE_COMMAND(InsertText, cmd_insertText)
104 NS_DEFINE_COMMAND(InsertOrderedList, cmd_ol)
105 NS_DEFINE_COMMAND(InsertUnorderedList, cmd_ul)
106 NS_DEFINE_COMMAND(GetHTML, cmd_getContents)
107 NS_DEFINE_COMMAND(FormatRemove, cmd_removeStyles)
108 NS_DEFINE_COMMAND(FormatRemoveLink, cmd_removeLinks)
109 NS_DEFINE_COMMAND(SetDocumentUseCSS, cmd_setDocumentUseCSS)
110 NS_DEFINE_COMMAND(SetDocumentReadOnly, cmd_setDocumentReadOnly)
111 NS_DEFINE_COMMAND(SetDocumentInsertBROnEnterKeyPress, cmd_insertBrOnReturn)
112 NS_DEFINE_COMMAND(SetDocumentDefaultParagraphSeparator,
113 cmd_defaultParagraphSeparator)
114 NS_DEFINE_COMMAND(ToggleObjectResizers, cmd_enableObjectResizing)
115 NS_DEFINE_COMMAND(ToggleInlineTableEditor, cmd_enableInlineTableEditing)
116 NS_DEFINE_COMMAND(ToggleAbsolutePositionEditor,
117 cmd_enableAbsolutePositionEditing)
119 // Commands not mapped from HTMLDocument.execCommand() but available with
120 // command dispatcher and handled in editor.
121 NS_DEFINE_COMMAND(CutOrDelete, cmd_cutOrDelete)
122 NS_DEFINE_COMMAND(CopyOrDelete, cmd_copyOrDelete)
123 NS_DEFINE_COMMAND(EditorObserverDocumentCreated, obs_documentCreated)
124 NS_DEFINE_COMMAND(EditorObserverDocumentLocationChanged,
125 obs_documentLocationChanged)
126 NS_DEFINE_COMMAND(EditorObserverDocumentWillBeDestroyed,
127 obs_documentWillBeDestroyed)
128 NS_DEFINE_COMMAND(FormatAbbreviation, cmd_abbr)
129 NS_DEFINE_COMMAND(FormatAbsolutePosition, cmd_absPos)
130 NS_DEFINE_COMMAND(FormatAcronym, cmd_acronym)
131 NS_DEFINE_COMMAND(FormatCitation, cmd_cite)
132 NS_DEFINE_COMMAND(FormatCode, cmd_code)
133 NS_DEFINE_COMMAND(FormatDecreaseZIndex, cmd_decreaseZIndex)
134 NS_DEFINE_COMMAND(FormatDocumentBackgroundColor, cmd_backgroundColor)
135 NS_DEFINE_COMMAND(FormatEmphasis, cmd_em)
136 NS_DEFINE_COMMAND(FormatIncreaseZIndex, cmd_increaseZIndex)
137 NS_DEFINE_COMMAND(FormatJustify, cmd_align) // Only for getting enabled/state
138 NS_DEFINE_COMMAND(FormatJustifyNone, cmd_align) // with empty string or params
139 NS_DEFINE_COMMAND(FormatNoBreak, cmd_nobreak)
140 NS_DEFINE_COMMAND(FormatRemoveList, cmd_removeList)
141 NS_DEFINE_COMMAND(FormatSample, cmd_samp)
142 NS_DEFINE_COMMAND(FormatSetBlockTextDirection, cmd_switchTextDirection)
143 NS_DEFINE_COMMAND(FormatStrong, cmd_strong)
144 NS_DEFINE_COMMAND(FormatTeletypeText, cmd_tt)
145 NS_DEFINE_COMMAND(FormatVariable, cmd_var)
146 NS_DEFINE_COMMAND(InsertDefinitionDetails, cmd_dd)
147 NS_DEFINE_COMMAND(InsertDefinitionTerm, cmd_dt)
148 NS_DEFINE_COMMAND(MoveDown, cmd_moveDown)
149 NS_DEFINE_COMMAND(MoveDown2, cmd_moveDown2)
150 NS_DEFINE_COMMAND(MoveLeft, cmd_moveLeft)
151 NS_DEFINE_COMMAND(MoveLeft2, cmd_moveLeft2)
152 NS_DEFINE_COMMAND(MoveRight, cmd_moveRight)
153 NS_DEFINE_COMMAND(MoveRight2, cmd_moveRight2)
154 NS_DEFINE_COMMAND(MoveUp, cmd_moveUp)
155 NS_DEFINE_COMMAND(MoveUp2, cmd_moveUp2)
156 NS_DEFINE_COMMAND(PasteAsQuotation, cmd_pasteQuote)
157 NS_DEFINE_COMMAND(PasteTransferable, cmd_pasteTransferable)
158 NS_DEFINE_COMMAND(PasteWithoutFormat, cmd_pasteNoFormatting)
159 NS_DEFINE_COMMAND(SelectDown, cmd_selectDown)
160 NS_DEFINE_COMMAND(SelectDown2, cmd_selectDown2)
161 NS_DEFINE_COMMAND(SelectLeft, cmd_selectLeft)
162 NS_DEFINE_COMMAND(SelectLeft2, cmd_selectLeft2)
163 NS_DEFINE_COMMAND(SelectRight, cmd_selectRight)
164 NS_DEFINE_COMMAND(SelectRight2, cmd_selectRight2)
165 NS_DEFINE_COMMAND(SelectUp, cmd_selectUp)
166 NS_DEFINE_COMMAND(SelectUp2, cmd_selectUp2)
167 NS_DEFINE_COMMAND(SetDocumentModified, cmd_setDocumentModified)