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-01-12 10:01:04 +00:00
|
|
|
undo,
|
|
|
|
redo,
|
|
|
|
insertNode,
|
|
|
|
createNode,
|
|
|
|
deleteNode,
|
|
|
|
splitNode,
|
|
|
|
joinNode,
|
|
|
|
|
|
|
|
deleteText = 1003,
|
|
|
|
|
|
|
|
// Text edit commands
|
|
|
|
insertText = 2000,
|
|
|
|
insertIMEText,
|
|
|
|
deleteSelection,
|
|
|
|
setTextProperty,
|
|
|
|
removeTextProperty,
|
|
|
|
outputText,
|
|
|
|
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
|