| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #ifndef IndentOutdentCommand_h | 26 #ifndef IndentOutdentCommand_h |
| 27 #define IndentOutdentCommand_h | 27 #define IndentOutdentCommand_h |
| 28 | 28 |
| 29 #include "core/editing/commands/ApplyBlockElementCommand.h" | 29 #include "core/editing/commands/ApplyBlockElementCommand.h" |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 class CORE_EXPORT IndentOutdentCommand final : public ApplyBlockElementCommand { | 33 class CORE_EXPORT IndentOutdentCommand final : public ApplyBlockElementCommand { |
| 34 public: | 34 public: |
| 35 enum EIndentType { Indent, Outdent }; | 35 enum EIndentType { Indent, Outdent }; |
| 36 static IndentOutdentCommand* create(Document& document, EIndentType type) { | 36 static IndentOutdentCommand* create(Document& document, |
| 37 return new IndentOutdentCommand(document, type); | 37 EditCommandSource source, |
| 38 EIndentType type) { |
| 39 return new IndentOutdentCommand(document, source, type); |
| 38 } | 40 } |
| 39 | 41 |
| 40 bool preservesTypingStyle() const override { return true; } | 42 bool preservesTypingStyle() const override { return true; } |
| 41 | 43 |
| 42 private: | 44 private: |
| 43 IndentOutdentCommand(Document&, EIndentType); | 45 IndentOutdentCommand(Document&, EditCommandSource, EIndentType); |
| 44 | 46 |
| 45 InputEvent::InputType inputType() const override; | 47 InputEvent::InputType inputType() const override; |
| 46 | 48 |
| 47 void outdentRegion(const VisiblePosition&, | 49 void outdentRegion(const VisiblePosition&, |
| 48 const VisiblePosition&, | 50 const VisiblePosition&, |
| 49 EditingState*); | 51 EditingState*); |
| 50 void outdentParagraph(EditingState*); | 52 void outdentParagraph(EditingState*); |
| 51 bool tryIndentingAsListItem(const Position&, const Position&, EditingState*); | 53 bool tryIndentingAsListItem(const Position&, const Position&, EditingState*); |
| 52 void indentIntoBlockquote(const Position&, | 54 void indentIntoBlockquote(const Position&, |
| 53 const Position&, | 55 const Position&, |
| 54 HTMLElement*&, | 56 HTMLElement*&, |
| 55 EditingState*); | 57 EditingState*); |
| 56 | 58 |
| 57 void formatSelection(const VisiblePosition& startOfSelection, | 59 void formatSelection(const VisiblePosition& startOfSelection, |
| 58 const VisiblePosition& endOfSelection, | 60 const VisiblePosition& endOfSelection, |
| 59 EditingState*) override; | 61 EditingState*) override; |
| 60 void formatRange(const Position& start, | 62 void formatRange(const Position& start, |
| 61 const Position& end, | 63 const Position& end, |
| 62 const Position& endOfSelection, | 64 const Position& endOfSelection, |
| 63 HTMLElement*& blockquoteForNextIndent, | 65 HTMLElement*& blockquoteForNextIndent, |
| 64 EditingState*) override; | 66 EditingState*) override; |
| 65 | 67 |
| 66 EIndentType m_typeOfAction; | 68 EIndentType m_typeOfAction; |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 } // namespace blink | 71 } // namespace blink |
| 70 | 72 |
| 71 #endif // IndentOutdentCommand_h | 73 #endif // IndentOutdentCommand_h |
| OLD | NEW |