Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/EditAction.h
Line
Count
Source (jump to first uncovered line)
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/. */
5
6
#ifndef mozilla_EditAction_h
7
#define mozilla_EditAction_h
8
9
namespace mozilla {
10
11
// This is int32_t instead of int16_t because nsIInlineSpellChecker.idl's
12
// spellCheckAfterEditorChange is defined to take it as a long.
13
// TODO: Make each name eFoo and investigate whether the numeric values
14
//       still have some meaning.
15
enum class EditSubAction : int32_t
16
{
17
  // eNone indicates not edit sub-action is being handled.  This is useful
18
  // of initial value of member variables.
19
  eNone,
20
21
  // eUndo and eRedo indicate entire actions of undo/redo operation.
22
  eUndo,
23
  eRedo,
24
25
  // eInsertNode indicates to insert a new node into the DOM tree.
26
  eInsertNode,
27
28
  // eCreateNode indicates to create a new node and insert it into the DOM tree.
29
  eCreateNode,
30
31
  // eDeleteNode indicates to remove a node from the DOM tree.
32
  eDeleteNode,
33
34
  // eSplitNode indicates to split a node to 2 nodes.
35
  eSplitNode,
36
37
  // eJoinNodes indicates to join 2 nodes.
38
  eJoinNodes,
39
40
  // eDeleteText indicates to delete some characters form a text node.
41
  eDeleteText,
42
43
  // eInsertText indicates to insert some characters.
44
  eInsertText,
45
46
  // eInsertTextComingFromIME indicates to insert or update composition string
47
  // with new text which is new composition string or commit string.
48
  eInsertTextComingFromIME,
49
50
  // eDeleteSelectedContent indicates to remove selected content.
51
  eDeleteSelectedContent,
52
53
  // eSetTextProperty indicates to set a style from text.
54
  eSetTextProperty,
55
56
  // eRemoveTextProperty indicates to remove a style from text.
57
  eRemoveTextProperty,
58
59
  // eRemoveAllTextProperties indicate to remove all styles from text.
60
  eRemoveAllTextProperties,
61
62
  // eComputeTextToOutput indicates to compute the editor value as plain text
63
  // or something requested format.
64
  eComputeTextToOutput,
65
66
  // eSetText indicates to set editor value to new value.
67
  eSetText,
68
69
  // eInsertParagraphSeparator indicates to insert paragraph separator, <br> or
70
  // \n at least to break current line.
71
  eInsertParagraphSeparator,
72
73
  // eCreateOrChangeList indicates to create new list or change existing list
74
  // type.
75
  eCreateOrChangeList,
76
77
  // eIndent and eOutdent indicates to indent or outdent the target with
78
  // using <blockquote>, <ul>, <ol> or just margin of start edge.
79
  eIndent,
80
  eOutdent,
81
82
  // eSetOrClearAlignment aligns content or clears alignment with align
83
  // attribute or text-align.
84
  eSetOrClearAlignment,
85
86
  // eCreateOrRemoveBlock creates new block or removes existing block and
87
  // move its descendants to where the block was.
88
  eCreateOrRemoveBlock,
89
90
  // eRemoveList removes specific type of list but keep its content.
91
  eRemoveList,
92
93
  // eCreateOrChangeDefinitionList indicates to create new definition list or
94
  // change existing list to a definition list.
95
  eCreateOrChangeDefinitionList,
96
97
  // eInsertElement indicates to insert an element.
98
  eInsertElement,
99
100
  // eInsertQuotation indicates to insert an element and make it "quoted text".
101
  eInsertQuotation,
102
103
  // ePasteHTMLContent indicates to paste HTML content in clipboard.
104
  ePasteHTMLContent,
105
106
  // eInsertHTMLSource indicates to create a document fragment from given HTML
107
  // source and insert into the DOM tree.  So, this is similar to innerHTML.
108
  eInsertHTMLSource,
109
110
  // eReplaceHeadWithHTMLSource indicates to create a document fragment from
111
  // given HTML source and replace content of <head> with it.
112
  eReplaceHeadWithHTMLSource,
113
114
  // eSetPositionToAbsolute and eSetPositionToStatic indicates to set position
115
  // property to absolute or static.
116
  eSetPositionToAbsolute,
117
  eSetPositionToStatic,
118
119
  // eDecreaseZIndex and eIncreaseZIndex indicate to decrease and increase
120
  // z-index value.
121
  eDecreaseZIndex,
122
  eIncreaseZIndex,
123
124
  // eCreateBogusNode indicates to create a bogus <br> node.
125
  eCreateBogusNode,
126
};
127
128
} // namespace mozilla
129
130
inline bool operator!(const mozilla::EditSubAction& aEditSubAction)
131
0
{
132
0
  return aEditSubAction == mozilla::EditSubAction::eNone;
133
0
}
134
135
#endif // #ifdef mozilla_EditAction_h