OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 void insertTextRunWithoutNewlines(const String &text, bool selectInsertedTex
t); | 71 void insertTextRunWithoutNewlines(const String &text, bool selectInsertedTex
t); |
72 void insertLineBreak(); | 72 void insertLineBreak(); |
73 void insertParagraphSeparatorInQuotedContent(); | 73 void insertParagraphSeparatorInQuotedContent(); |
74 void insertParagraphSeparator(); | 74 void insertParagraphSeparator(); |
75 void deleteKeyPressed(TextGranularity, bool killRing); | 75 void deleteKeyPressed(TextGranularity, bool killRing); |
76 void forwardDeleteKeyPressed(TextGranularity, bool killRing); | 76 void forwardDeleteKeyPressed(TextGranularity, bool killRing); |
77 void deleteSelection(bool smartDelete); | 77 void deleteSelection(bool smartDelete); |
78 void setCompositionType(TextCompositionType type) { m_compositionType = type
; } | 78 void setCompositionType(TextCompositionType type) { m_compositionType = type
; } |
79 | 79 |
80 private: | 80 private: |
81 static PassRefPtr<TypingCommand> create(Document& document, ETypingCommand c
ommand, const String& text = "", Options options = 0, TextGranularity granularit
y = CharacterGranularity) | 81 static PassRefPtrWillBeRawPtr<TypingCommand> create(Document& document, ETyp
ingCommand command, const String& text = "", Options options = 0, TextGranularit
y granularity = CharacterGranularity) |
82 { | 82 { |
83 return adoptRef(new TypingCommand(document, command, text, options, gran
ularity, TextCompositionNone)); | 83 return adoptRefWillBeNoop(new TypingCommand(document, command, text, opt
ions, granularity, TextCompositionNone)); |
84 } | 84 } |
85 | 85 |
86 static PassRefPtr<TypingCommand> create(Document& document, ETypingCommand c
ommand, const String& text, Options options, TextCompositionType compositionType
) | 86 static PassRefPtrWillBeRawPtr<TypingCommand> create(Document& document, ETyp
ingCommand command, const String& text, Options options, TextCompositionType com
positionType) |
87 { | 87 { |
88 return adoptRef(new TypingCommand(document, command, text, options, Char
acterGranularity, compositionType)); | 88 return adoptRefWillBeNoop(new TypingCommand(document, command, text, opt
ions, CharacterGranularity, compositionType)); |
89 } | 89 } |
90 | 90 |
91 TypingCommand(Document&, ETypingCommand, const String& text, Options, TextGr
anularity, TextCompositionType); | 91 TypingCommand(Document&, ETypingCommand, const String& text, Options, TextGr
anularity, TextCompositionType); |
92 | 92 |
93 void setSmartDelete(bool smartDelete) { m_smartDelete = smartDelete; } | 93 void setSmartDelete(bool smartDelete) { m_smartDelete = smartDelete; } |
94 bool isOpenForMoreTyping() const { return m_openForMoreTyping; } | 94 bool isOpenForMoreTyping() const { return m_openForMoreTyping; } |
95 void closeTyping() { m_openForMoreTyping = false; } | 95 void closeTyping() { m_openForMoreTyping = false; } |
96 | 96 |
97 static PassRefPtr<TypingCommand> lastTypingCommandIfStillOpenForTyping(Local
Frame*); | 97 static PassRefPtrWillBeRawPtr<TypingCommand> lastTypingCommandIfStillOpenFor
Typing(LocalFrame*); |
98 | 98 |
99 virtual void doApply() OVERRIDE; | 99 virtual void doApply() OVERRIDE; |
100 virtual EditAction editingAction() const OVERRIDE; | 100 virtual EditAction editingAction() const OVERRIDE; |
101 virtual bool isTypingCommand() const OVERRIDE; | 101 virtual bool isTypingCommand() const OVERRIDE; |
102 virtual bool preservesTypingStyle() const OVERRIDE { return m_preservesTypin
gStyle; } | 102 virtual bool preservesTypingStyle() const OVERRIDE { return m_preservesTypin
gStyle; } |
103 virtual void setShouldRetainAutocorrectionIndicator(bool retain) OVERRIDE {
m_shouldRetainAutocorrectionIndicator = retain; } | 103 virtual void setShouldRetainAutocorrectionIndicator(bool retain) OVERRIDE {
m_shouldRetainAutocorrectionIndicator = retain; } |
104 virtual bool shouldStopCaretBlinking() const OVERRIDE { return true; } | 104 virtual bool shouldStopCaretBlinking() const OVERRIDE { return true; } |
105 void setShouldPreventSpellChecking(bool prevent) { m_shouldPreventSpellCheck
ing = prevent; } | 105 void setShouldPreventSpellChecking(bool prevent) { m_shouldPreventSpellCheck
ing = prevent; } |
106 | 106 |
107 static void updateSelectionIfDifferentFromCurrentSelection(TypingCommand*, L
ocalFrame*); | 107 static void updateSelectionIfDifferentFromCurrentSelection(TypingCommand*, L
ocalFrame*); |
(...skipping 21 matching lines...) Expand all Loading... |
129 // was opened with a backward delete. | 129 // was opened with a backward delete. |
130 bool m_openedByBackwardDelete; | 130 bool m_openedByBackwardDelete; |
131 | 131 |
132 bool m_shouldRetainAutocorrectionIndicator; | 132 bool m_shouldRetainAutocorrectionIndicator; |
133 bool m_shouldPreventSpellChecking; | 133 bool m_shouldPreventSpellChecking; |
134 }; | 134 }; |
135 | 135 |
136 } // namespace WebCore | 136 } // namespace WebCore |
137 | 137 |
138 #endif // TypingCommand_h | 138 #endif // TypingCommand_h |
OLD | NEW |