2018-01-12 10:01:04 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_EditAction_h
|
|
|
|
#define mozilla_EditAction_h
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
// This is int32_t instead of int16_t because nsIInlineSpellChecker.idl's
|
|
|
|
// spellCheckAfterEditorChange is defined to take it as a long.
|
|
|
|
// TODO: Make each name eFoo and investigate whether the numeric values
|
|
|
|
// still have some meaning.
|
Bug 1463985 - part 1: Rename EditAction to EditSubAction and related stuff r=m_kato
When we implement InputEvent.inputType, we need to set a stack class to record
which edit action is currently handled. However, currently, we call smaller
jobs as edit action. For example, when user types a character at selecting
some characters, then, EditAction::deleteSelection is performed first, then,
EditAction::insertText is performed. However, for the InputEvent.inputType,
we need inserText information. So, for making new enum EditAction, we need
to rename current EditAction to EditSubAction.
And also this renames related stuff:
EditorBase::mIsInEditAction -> EditorBase::mIsInEditSubAction
EditorBase::IsInEditAction() -> EditorBase::IsInEditSubAction()
EditorBase::mAction -> EditorBase::mTopLevelEditSubAction
TextEditRules::mTheAction -> TextEditRules::mTopLevelEditSubAction
EditorBase::StartOperation() ->
EditorBase::OnStartToHandleTopLevelEditSubAction()
EditorBase::EndOperation() ->
EditorBase::OnEndHandlingTopLevelEditSubAction()
AutoRules -> AutoTopLevelEditSubActionNotifier
RulesInfo -> EditSubActionInfo
MozReview-Commit-ID: cvSkPUjFm1
--HG--
extra : rebase_source : baf527a3e353b7a8ebe9a46be2243b059c500234
2018-05-28 11:12:34 +00:00
|
|
|
enum class EditSubAction : int32_t
|
2018-01-12 10:01:04 +00:00
|
|
|
{
|
|
|
|
ignore = -1,
|
|
|
|
|
2018-05-28 11:29:34 +00:00
|
|
|
// eNone indicates not edit sub-action is being handled. This is useful
|
|
|
|
// of initial value of member variables.
|
|
|
|
eNone = 0,
|
2018-05-28 11:36:06 +00:00
|
|
|
|
|
|
|
// eUndo and eRedo indicate entire actions of undo/redo operation.
|
|
|
|
eUndo,
|
|
|
|
eRedo,
|
|
|
|
|
2018-05-28 12:16:44 +00:00
|
|
|
// eInsertNode indicates to insert a new node into the DOM tree.
|
|
|
|
eInsertNode,
|
|
|
|
|
|
|
|
// eCreateNode indicates to create a new node and insert it into the DOM tree.
|
|
|
|
eCreateNode,
|
|
|
|
|
2018-05-28 12:19:34 +00:00
|
|
|
// eDeleteNode indicates to remove a node from the DOM tree.
|
|
|
|
eDeleteNode,
|
|
|
|
|
2018-05-28 12:25:20 +00:00
|
|
|
// eSplitNode indicates to split a node to 2 nodes.
|
|
|
|
eSplitNode,
|
|
|
|
|
|
|
|
// eJoinNodes indicates to join 2 nodes.
|
|
|
|
eJoinNodes,
|
2018-01-12 10:01:04 +00:00
|
|
|
|
2018-05-28 12:29:14 +00:00
|
|
|
// eDeleteText indicates to delete some characters form a text node.
|
|
|
|
eDeleteText,
|
2018-01-12 10:01:04 +00:00
|
|
|
|
2018-05-28 12:36:47 +00:00
|
|
|
// eInsertText indicates to insert some characters.
|
|
|
|
eInsertText,
|
|
|
|
|
2018-05-28 12:44:39 +00:00
|
|
|
// eInsertTextComingFromIME indicates to insert or update composition string
|
|
|
|
// with new text which is new composition string or commit string.
|
|
|
|
eInsertTextComingFromIME,
|
|
|
|
|
2018-05-28 12:49:56 +00:00
|
|
|
// eDeleteSelectedContent indicates to remove selected content.
|
|
|
|
eDeleteSelectedContent,
|
|
|
|
|
2018-05-28 13:05:10 +00:00
|
|
|
// eSetTextProperty indicates to set a style from text.
|
|
|
|
eSetTextProperty,
|
|
|
|
|
|
|
|
// eRemoveTextProperty indicates to remove a style from text.
|
|
|
|
eRemoveTextProperty,
|
|
|
|
|
2018-05-28 13:09:55 +00:00
|
|
|
// eComputeTextToOutput indicates to compute the editor value as plain text
|
|
|
|
// or something requested format.
|
|
|
|
eComputeTextToOutput,
|
|
|
|
|
2018-01-12 10:01:04 +00:00
|
|
|
setText,
|
|
|
|
|
|
|
|
// HTML editor only actions
|
|
|
|
insertBreak = 3000,
|
|
|
|
makeList,
|
|
|
|
indent,
|
|
|
|
outdent,
|
|
|
|
align,
|
|
|
|
makeBasicBlock,
|
|
|
|
removeList,
|
|
|
|
makeDefListItem,
|
|
|
|
insertElement,
|
|
|
|
insertQuotation,
|
|
|
|
|
|
|
|
htmlPaste = 3012,
|
|
|
|
loadHTML,
|
|
|
|
resetTextProperties,
|
|
|
|
setAbsolutePosition,
|
|
|
|
removeAbsolutePosition,
|
|
|
|
decreaseZIndex,
|
|
|
|
increaseZIndex,
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
Bug 1463985 - part 1: Rename EditAction to EditSubAction and related stuff r=m_kato
When we implement InputEvent.inputType, we need to set a stack class to record
which edit action is currently handled. However, currently, we call smaller
jobs as edit action. For example, when user types a character at selecting
some characters, then, EditAction::deleteSelection is performed first, then,
EditAction::insertText is performed. However, for the InputEvent.inputType,
we need inserText information. So, for making new enum EditAction, we need
to rename current EditAction to EditSubAction.
And also this renames related stuff:
EditorBase::mIsInEditAction -> EditorBase::mIsInEditSubAction
EditorBase::IsInEditAction() -> EditorBase::IsInEditSubAction()
EditorBase::mAction -> EditorBase::mTopLevelEditSubAction
TextEditRules::mTheAction -> TextEditRules::mTopLevelEditSubAction
EditorBase::StartOperation() ->
EditorBase::OnStartToHandleTopLevelEditSubAction()
EditorBase::EndOperation() ->
EditorBase::OnEndHandlingTopLevelEditSubAction()
AutoRules -> AutoTopLevelEditSubActionNotifier
RulesInfo -> EditSubActionInfo
MozReview-Commit-ID: cvSkPUjFm1
--HG--
extra : rebase_source : baf527a3e353b7a8ebe9a46be2243b059c500234
2018-05-28 11:12:34 +00:00
|
|
|
inline bool operator!(const mozilla::EditSubAction& aEditSubAction)
|
2018-01-12 10:01:04 +00:00
|
|
|
{
|
2018-05-28 11:29:34 +00:00
|
|
|
return aEditSubAction == mozilla::EditSubAction::eNone;
|
2018-01-12 10:01:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // #ifdef mozilla_EditAction_h
|