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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 bool isEnabled(Event* triggeringEvent = 0) const; | 134 bool isEnabled(Event* triggeringEvent = 0) const; |
135 | 135 |
136 TriState state(Event* triggeringEvent = 0) const; | 136 TriState state(Event* triggeringEvent = 0) const; |
137 String value(Event* triggeringEvent = 0) const; | 137 String value(Event* triggeringEvent = 0) const; |
138 | 138 |
139 bool isTextInsertion() const; | 139 bool isTextInsertion() const; |
140 | 140 |
141 // Returns 0 if this Command is not supported. | 141 // Returns 0 if this Command is not supported. |
142 int idForHistogram() const; | 142 int idForHistogram() const; |
143 private: | 143 private: |
144 LocalFrame& frame() const { return *m_frame; } | 144 LocalFrame& frame() const |
| 145 { |
| 146 ASSERT(m_frame); |
| 147 return *m_frame; |
| 148 } |
145 | 149 |
146 const EditorInternalCommand* m_command; | 150 const EditorInternalCommand* m_command; |
147 EditorCommandSource m_source; | 151 EditorCommandSource m_source; |
148 RefPtrWillBeMember<LocalFrame> m_frame; | 152 RefPtrWillBeMember<LocalFrame> m_frame; |
149 }; | 153 }; |
150 Command command(const String& commandName); // Command source is CommandFrom
MenuOrKeyBinding. | 154 Command command(const String& commandName); // Command source is CommandFrom
MenuOrKeyBinding. |
151 Command command(const String& commandName, EditorCommandSource); | 155 Command command(const String& commandName, EditorCommandSource); |
152 | 156 |
153 // |Editor::executeCommand| is implementation of |WebFrame::executeCommand| | 157 // |Editor::executeCommand| is implementation of |WebFrame::executeCommand| |
154 // rather than |Document::execCommand|. | 158 // rather than |Document::execCommand|. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 bool m_shouldStartNewKillRingSequence; | 243 bool m_shouldStartNewKillRingSequence; |
240 bool m_shouldStyleWithCSS; | 244 bool m_shouldStyleWithCSS; |
241 const OwnPtr<KillRing> m_killRing; | 245 const OwnPtr<KillRing> m_killRing; |
242 VisibleSelection m_mark; | 246 VisibleSelection m_mark; |
243 bool m_areMarkedTextMatchesHighlighted; | 247 bool m_areMarkedTextMatchesHighlighted; |
244 EditorParagraphSeparator m_defaultParagraphSeparator; | 248 EditorParagraphSeparator m_defaultParagraphSeparator; |
245 bool m_overwriteModeEnabled; | 249 bool m_overwriteModeEnabled; |
246 | 250 |
247 explicit Editor(LocalFrame&); | 251 explicit Editor(LocalFrame&); |
248 | 252 |
249 LocalFrame& frame() const { return *m_frame; } | 253 LocalFrame& frame() const |
| 254 { |
| 255 ASSERT(m_frame); |
| 256 return *m_frame; |
| 257 } |
250 | 258 |
251 bool canDeleteRange(Range*) const; | 259 bool canDeleteRange(Range*) const; |
252 | 260 |
253 UndoStack* undoStack() const; | 261 UndoStack* undoStack() const; |
254 | 262 |
255 bool tryDHTMLCopy(); | 263 bool tryDHTMLCopy(); |
256 bool tryDHTMLCut(); | 264 bool tryDHTMLCut(); |
257 bool tryDHTMLPaste(PasteMode); | 265 bool tryDHTMLPaste(PasteMode); |
258 | 266 |
259 bool canSmartReplaceWithPasteboard(Pasteboard*); | 267 bool canSmartReplaceWithPasteboard(Pasteboard*); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 300 |
293 inline bool Editor::markedTextMatchesAreHighlighted() const | 301 inline bool Editor::markedTextMatchesAreHighlighted() const |
294 { | 302 { |
295 return m_areMarkedTextMatchesHighlighted; | 303 return m_areMarkedTextMatchesHighlighted; |
296 } | 304 } |
297 | 305 |
298 | 306 |
299 } // namespace blink | 307 } // namespace blink |
300 | 308 |
301 #endif // Editor_h | 309 #endif // Editor_h |
OLD | NEW |