Bug 1855385 [wpt PR 42195] - [text-spacing-trim] Remove redundant copying of variants...
[gecko.git] / editor / libeditor / JoinSplitNodeDirection.h
blobfd5075916866f2f8260401516082df9abf67caa9
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 #ifndef JoinSplitNodeDirection_h
7 #define JoinSplitNodeDirection_h
9 #include <iostream>
11 namespace mozilla {
13 // JoinNodesDirection is also affected to which one is new node at splitting
14 // a node because a couple of undo/redo.
15 enum class JoinNodesDirection {
16 LeftNodeIntoRightNode,
17 RightNodeIntoLeftNode,
20 static inline std::ostream& operator<<(std::ostream& aStream,
21 JoinNodesDirection aJoinNodesDirection) {
22 if (aJoinNodesDirection == JoinNodesDirection::LeftNodeIntoRightNode) {
23 return aStream << "JoinNodesDirection::LeftNodeIntoRightNode";
25 if (aJoinNodesDirection == JoinNodesDirection::RightNodeIntoLeftNode) {
26 return aStream << "JoinNodesDirection::RightNodeIntoLeftNode";
28 return aStream << "Invalid value";
31 // SplitNodeDirection is also affected to which one is removed at joining a
32 // node because a couple of undo/redo.
33 enum class SplitNodeDirection {
34 LeftNodeIsNewOne,
35 RightNodeIsNewOne,
38 static inline std::ostream& operator<<(std::ostream& aStream,
39 SplitNodeDirection aSplitNodeDirection) {
40 if (aSplitNodeDirection == SplitNodeDirection::LeftNodeIsNewOne) {
41 return aStream << "SplitNodeDirection::LeftNodeIsNewOne";
43 if (aSplitNodeDirection == SplitNodeDirection::RightNodeIsNewOne) {
44 return aStream << "SplitNodeDirection::RightNodeIsNewOne";
46 return aStream << "Invalid value";
49 } // namespace mozilla
51 #endif // JoinSplitNodeDirection_h