OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 bool insertLineBreak(); | 168 bool insertLineBreak(); |
169 bool insertParagraphSeparator(); | 169 bool insertParagraphSeparator(); |
170 | 170 |
171 bool isOverwriteModeEnabled() const { return m_overwriteModeEnabled; } | 171 bool isOverwriteModeEnabled() const { return m_overwriteModeEnabled; } |
172 void toggleOverwriteModeEnabled(); | 172 void toggleOverwriteModeEnabled(); |
173 | 173 |
174 bool canUndo(); | 174 bool canUndo(); |
175 void undo(); | 175 void undo(); |
176 bool canRedo(); | 176 bool canRedo(); |
177 void redo(); | 177 void redo(); |
| 178 void clearUndoStack(); |
178 | 179 |
179 void setBaseWritingDirection(WritingDirection); | 180 void setBaseWritingDirection(WritingDirection); |
180 | 181 |
181 // smartInsertDeleteEnabled and selectTrailingWhitespaceEnabled are | 182 // smartInsertDeleteEnabled and selectTrailingWhitespaceEnabled are |
182 // mutually exclusive, meaning that enabling one will disable the other. | 183 // mutually exclusive, meaning that enabling one will disable the other. |
183 bool smartInsertDeleteEnabled() const; | 184 bool smartInsertDeleteEnabled() const; |
184 bool isSelectTrailingWhitespaceEnabled() const; | 185 bool isSelectTrailingWhitespaceEnabled() const; |
185 | 186 |
186 bool preventRevealSelection() const { return m_preventRevealSelection; } | 187 bool preventRevealSelection() const { return m_preventRevealSelection; } |
187 | 188 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 private: | 247 private: |
247 Member<Editor> m_editor; | 248 Member<Editor> m_editor; |
248 }; | 249 }; |
249 friend class RevealSelectionScope; | 250 friend class RevealSelectionScope; |
250 | 251 |
251 DECLARE_TRACE(); | 252 DECLARE_TRACE(); |
252 | 253 |
253 private: | 254 private: |
254 Member<LocalFrame> m_frame; | 255 Member<LocalFrame> m_frame; |
255 Member<CompositeEditCommand> m_lastEditCommand; | 256 Member<CompositeEditCommand> m_lastEditCommand; |
| 257 const Member<UndoStack> m_undoStack; |
256 int m_preventRevealSelection; | 258 int m_preventRevealSelection; |
257 bool m_shouldStartNewKillRingSequence; | 259 bool m_shouldStartNewKillRingSequence; |
258 bool m_shouldStyleWithCSS; | 260 bool m_shouldStyleWithCSS; |
259 const std::unique_ptr<KillRing> m_killRing; | 261 const std::unique_ptr<KillRing> m_killRing; |
260 VisibleSelection m_mark; | 262 VisibleSelection m_mark; |
261 bool m_areMarkedTextMatchesHighlighted; | 263 bool m_areMarkedTextMatchesHighlighted; |
262 EditorParagraphSeparator m_defaultParagraphSeparator; | 264 EditorParagraphSeparator m_defaultParagraphSeparator; |
263 bool m_overwriteModeEnabled; | 265 bool m_overwriteModeEnabled; |
264 | 266 |
265 explicit Editor(LocalFrame&); | 267 explicit Editor(LocalFrame&); |
266 | 268 |
267 LocalFrame& frame() const | 269 LocalFrame& frame() const |
268 { | 270 { |
269 DCHECK(m_frame); | 271 DCHECK(m_frame); |
270 return *m_frame; | 272 return *m_frame; |
271 } | 273 } |
272 | 274 |
273 bool canDeleteRange(const EphemeralRange&) const; | 275 bool canDeleteRange(const EphemeralRange&) const; |
274 bool shouldDeleteRange(const EphemeralRange&) const; | 276 bool shouldDeleteRange(const EphemeralRange&) const; |
275 | 277 |
276 UndoStack* undoStack() const; | |
277 | |
278 bool tryDHTMLCopy(); | 278 bool tryDHTMLCopy(); |
279 bool tryDHTMLCut(); | 279 bool tryDHTMLCut(); |
280 bool tryDHTMLPaste(PasteMode); | 280 bool tryDHTMLPaste(PasteMode); |
281 | 281 |
282 bool canSmartReplaceWithPasteboard(Pasteboard*); | 282 bool canSmartReplaceWithPasteboard(Pasteboard*); |
283 void pasteAsPlainTextWithPasteboard(Pasteboard*); | 283 void pasteAsPlainTextWithPasteboard(Pasteboard*); |
284 void pasteWithPasteboard(Pasteboard*); | 284 void pasteWithPasteboard(Pasteboard*); |
285 void writeSelectionToPasteboard(); | 285 void writeSelectionToPasteboard(); |
286 bool dispatchCPPEvent(const AtomicString&, DataTransferAccessPolicy, PasteMo
de = AllMimeTypes); | 286 bool dispatchCPPEvent(const AtomicString&, DataTransferAccessPolicy, PasteMo
de = AllMimeTypes); |
287 | 287 |
(...skipping 26 matching lines...) Expand all Loading... |
314 | 314 |
315 inline bool Editor::markedTextMatchesAreHighlighted() const | 315 inline bool Editor::markedTextMatchesAreHighlighted() const |
316 { | 316 { |
317 return m_areMarkedTextMatchesHighlighted; | 317 return m_areMarkedTextMatchesHighlighted; |
318 } | 318 } |
319 | 319 |
320 | 320 |
321 } // namespace blink | 321 } // namespace blink |
322 | 322 |
323 #endif // Editor_h | 323 #endif // Editor_h |
OLD | NEW |