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 |
121 // | 130 // |
122 // sugary-sweet convenience functions to help create and apply edit commands | 131 // sugary-sweet convenience functions to help create and apply edit commands |
123 // in composite commands | 132 // in composite commands |
124 // | 133 // |
125 void appendNode(Node*, ContainerNode* parent, EditingState*); | 134 void appendNode(Node*, ContainerNode* parent, EditingState*); |
126 void applyCommandToComposite(EditCommand*, EditingState*); | 135 void applyCommandToComposite(EditCommand*, EditingState*); |
127 void applyCommandToComposite(CompositeEditCommand*, | 136 void applyCommandToComposite(CompositeEditCommand*, |
128 const VisibleSelection&, | 137 const VisibleSelection&, |
129 EditingState*); | 138 EditingState*); |
130 void applyStyle(const EditingStyle*, EditingState*); | 139 void applyStyle(const EditingStyle*, EditingState*); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 281 |
273 DEFINE_TYPE_CASTS(CompositeEditCommand, | 282 DEFINE_TYPE_CASTS(CompositeEditCommand, |
274 EditCommand, | 283 EditCommand, |
275 command, | 284 command, |
276 command->isCompositeEditCommand(), | 285 command->isCompositeEditCommand(), |
277 command.isCompositeEditCommand()); | 286 command.isCompositeEditCommand()); |
278 | 287 |
279 } // namespace blink | 288 } // namespace blink |
280 | 289 |
281 #endif // CompositeEditCommand_h | 290 #endif // CompositeEditCommand_h |
OLD | NEW |