| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 virtual bool isDragAndDropCommand() const; | 111 virtual bool isDragAndDropCommand() const; |
| 112 virtual bool preservesTypingStyle() const; | 112 virtual bool preservesTypingStyle() const; |
| 113 virtual void setShouldRetainAutocorrectionIndicator(bool); | 113 virtual void setShouldRetainAutocorrectionIndicator(bool); |
| 114 virtual bool shouldStopCaretBlinking() const { return false; } | 114 virtual bool shouldStopCaretBlinking() const { return false; } |
| 115 | 115 |
| 116 DECLARE_VIRTUAL_TRACE(); | 116 DECLARE_VIRTUAL_TRACE(); |
| 117 | 117 |
| 118 protected: | 118 protected: |
| 119 explicit CompositeEditCommand(Document&); | 119 explicit CompositeEditCommand(Document&); |
| 120 | 120 |
| 121 // TODO(chongz): Implement "beforeinput" as described below: | |
| 122 // Fires "beforeinput" and will return |false| to cancel applying editing if | |
| 123 // * "beforeinput" was canceled, or | |
| 124 // * |frame| was destroyed by event handlers. | |
| 125 // |willApplyEditing()| should be called from | |
| 126 // * |CompositeEditCommand::apply()|, and | |
| 127 // * |TypingCommand::willAddTypingToOpenCommand()|. | |
| 128 bool willApplyEditing(EditCommandSource); | |
| 129 | |
| 130 // | 121 // |
| 131 // sugary-sweet convenience functions to help create and apply edit commands | 122 // sugary-sweet convenience functions to help create and apply edit commands |
| 132 // in composite commands | 123 // in composite commands |
| 133 // | 124 // |
| 134 void appendNode(Node*, ContainerNode* parent, EditingState*); | 125 void appendNode(Node*, ContainerNode* parent, EditingState*); |
| 135 void applyCommandToComposite(EditCommand*, EditingState*); | 126 void applyCommandToComposite(EditCommand*, EditingState*); |
| 136 void applyCommandToComposite(CompositeEditCommand*, | 127 void applyCommandToComposite(CompositeEditCommand*, |
| 137 const VisibleSelection&, | 128 const VisibleSelection&, |
| 138 EditingState*); | 129 EditingState*); |
| 139 void applyStyle(const EditingStyle*, EditingState*); | 130 void applyStyle(const EditingStyle*, EditingState*); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 272 |
| 282 DEFINE_TYPE_CASTS(CompositeEditCommand, | 273 DEFINE_TYPE_CASTS(CompositeEditCommand, |
| 283 EditCommand, | 274 EditCommand, |
| 284 command, | 275 command, |
| 285 command->isCompositeEditCommand(), | 276 command->isCompositeEditCommand(), |
| 286 command.isCompositeEditCommand()); | 277 command.isCompositeEditCommand()); |
| 287 | 278 |
| 288 } // namespace blink | 279 } // namespace blink |
| 289 | 280 |
| 290 #endif // CompositeEditCommand_h | 281 #endif // CompositeEditCommand_h |
| OLD | NEW |