OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "core/dom/DocumentMarkerController.h" | 40 #include "core/dom/DocumentMarkerController.h" |
41 #include "core/dom/NodeList.h" | 41 #include "core/dom/NodeList.h" |
42 #include "core/dom/NodeTraversal.h" | 42 #include "core/dom/NodeTraversal.h" |
43 #include "core/dom/ParserContentPolicy.h" | 43 #include "core/dom/ParserContentPolicy.h" |
44 #include "core/dom/Text.h" | 44 #include "core/dom/Text.h" |
45 #include "core/editing/ApplyStyleCommand.h" | 45 #include "core/editing/ApplyStyleCommand.h" |
46 #include "core/editing/DeleteSelectionCommand.h" | 46 #include "core/editing/DeleteSelectionCommand.h" |
47 #include "core/editing/IndentOutdentCommand.h" | 47 #include "core/editing/IndentOutdentCommand.h" |
48 #include "core/editing/InputMethodController.h" | 48 #include "core/editing/InputMethodController.h" |
49 #include "core/editing/InsertListCommand.h" | 49 #include "core/editing/InsertListCommand.h" |
50 #include "core/editing/ModifySelectionListLevel.h" | |
51 #include "core/editing/RemoveFormatCommand.h" | 50 #include "core/editing/RemoveFormatCommand.h" |
52 #include "core/editing/RenderedPosition.h" | 51 #include "core/editing/RenderedPosition.h" |
53 #include "core/editing/ReplaceSelectionCommand.h" | 52 #include "core/editing/ReplaceSelectionCommand.h" |
54 #include "core/editing/SimplifyMarkupCommand.h" | 53 #include "core/editing/SimplifyMarkupCommand.h" |
55 #include "core/editing/SpellChecker.h" | 54 #include "core/editing/SpellChecker.h" |
56 #include "core/editing/TypingCommand.h" | 55 #include "core/editing/TypingCommand.h" |
57 #include "core/editing/UndoStack.h" | 56 #include "core/editing/UndoStack.h" |
58 #include "core/editing/VisibleUnits.h" | 57 #include "core/editing/VisibleUnits.h" |
59 #include "core/editing/htmlediting.h" | 58 #include "core/editing/htmlediting.h" |
60 #include "core/editing/markup.h" | 59 #include "core/editing/markup.h" |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 { | 587 { |
589 if (!canEditRichly()) | 588 if (!canEditRichly()) |
590 return 0; | 589 return 0; |
591 | 590 |
592 ASSERT(m_frame.document()); | 591 ASSERT(m_frame.document()); |
593 RefPtr<Node> newList = InsertListCommand::insertList(*m_frame.document(), In
sertListCommand::UnorderedList); | 592 RefPtr<Node> newList = InsertListCommand::insertList(*m_frame.document(), In
sertListCommand::UnorderedList); |
594 revealSelectionAfterEditingOperation(); | 593 revealSelectionAfterEditingOperation(); |
595 return newList; | 594 return newList; |
596 } | 595 } |
597 | 596 |
598 bool Editor::canIncreaseSelectionListLevel() | |
599 { | |
600 ASSERT(m_frame.document()); | |
601 return canEditRichly() && IncreaseSelectionListLevelCommand::canIncreaseSele
ctionListLevel(*m_frame.document()); | |
602 } | |
603 | |
604 bool Editor::canDecreaseSelectionListLevel() | |
605 { | |
606 ASSERT(m_frame.document()); | |
607 return canEditRichly() && DecreaseSelectionListLevelCommand::canDecreaseSele
ctionListLevel(*m_frame.document()); | |
608 } | |
609 | |
610 PassRefPtr<Node> Editor::increaseSelectionListLevel() | |
611 { | |
612 if (!canEditRichly() || m_frame.selection().isNone()) | |
613 return 0; | |
614 | |
615 ASSERT(m_frame.document()); | |
616 RefPtr<Node> newList = IncreaseSelectionListLevelCommand::increaseSelectionL
istLevel(*m_frame.document()); | |
617 revealSelectionAfterEditingOperation(); | |
618 return newList; | |
619 } | |
620 | |
621 PassRefPtr<Node> Editor::increaseSelectionListLevelOrdered() | |
622 { | |
623 if (!canEditRichly() || m_frame.selection().isNone()) | |
624 return 0; | |
625 | |
626 ASSERT(m_frame.document()); | |
627 RefPtr<Node> newList = IncreaseSelectionListLevelCommand::increaseSelectionL
istLevelOrdered(*m_frame.document()); | |
628 revealSelectionAfterEditingOperation(); | |
629 return newList.release(); | |
630 } | |
631 | |
632 PassRefPtr<Node> Editor::increaseSelectionListLevelUnordered() | |
633 { | |
634 if (!canEditRichly() || m_frame.selection().isNone()) | |
635 return 0; | |
636 | |
637 ASSERT(m_frame.document()); | |
638 RefPtr<Node> newList = IncreaseSelectionListLevelCommand::increaseSelectionL
istLevelUnordered(*m_frame.document()); | |
639 revealSelectionAfterEditingOperation(); | |
640 return newList.release(); | |
641 } | |
642 | |
643 void Editor::decreaseSelectionListLevel() | |
644 { | |
645 if (!canEditRichly() || m_frame.selection().isNone()) | |
646 return; | |
647 | |
648 ASSERT(m_frame.document()); | |
649 DecreaseSelectionListLevelCommand::decreaseSelectionListLevel(*m_frame.docum
ent()); | |
650 revealSelectionAfterEditingOperation(); | |
651 } | |
652 | |
653 void Editor::removeFormattingAndStyle() | 597 void Editor::removeFormattingAndStyle() |
654 { | 598 { |
655 ASSERT(m_frame.document()); | 599 ASSERT(m_frame.document()); |
656 RemoveFormatCommand::create(*m_frame.document())->apply(); | 600 RemoveFormatCommand::create(*m_frame.document())->apply(); |
657 } | 601 } |
658 | 602 |
659 void Editor::clearLastEditCommand() | 603 void Editor::clearLastEditCommand() |
660 { | 604 { |
661 m_lastEditCommand.clear(); | 605 m_lastEditCommand.clear(); |
662 } | 606 } |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 return m_frame.spellChecker(); | 1253 return m_frame.spellChecker(); |
1310 } | 1254 } |
1311 | 1255 |
1312 void Editor::toggleOverwriteModeEnabled() | 1256 void Editor::toggleOverwriteModeEnabled() |
1313 { | 1257 { |
1314 m_overwriteModeEnabled = !m_overwriteModeEnabled; | 1258 m_overwriteModeEnabled = !m_overwriteModeEnabled; |
1315 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); | 1259 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); |
1316 } | 1260 } |
1317 | 1261 |
1318 } // namespace WebCore | 1262 } // namespace WebCore |
OLD | NEW |