2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Apple Inc. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
15 * * Neither the name of Google Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 WebInspector.TextEditor = function() { };
37 WebInspector.TextEditor.Events = {
38 GutterClick: "gutterClick"
41 /** @typedef {{lineNumber: number, event: !Event}} */
42 WebInspector.TextEditor.GutterClickEventData;
44 WebInspector.TextEditor.prototype = {
53 isClean: function() { },
55 markClean: function() { },
60 indent: function() { },
63 * @param {number} lineNumber
64 * @param {number} column
65 * @return {?{x: number, y: number, height: number}}
67 cursorPositionToCoordinates: function(lineNumber, column) { return null; },
72 * @return {?WebInspector.TextRange}
74 coordinatesToCursorPosition: function(x, y) { return null; },
77 * @param {number} lineNumber
78 * @param {number} column
79 * @return {?{startColumn: number, endColumn: number, type: string}}
81 tokenAtTextPosition: function(lineNumber, column) { return null; },
84 * @param {string} mimeType
86 setMimeType: function(mimeType) { },
89 * @param {boolean} readOnly
91 setReadOnly: function(readOnly) { },
96 readOnly: function() { },
101 defaultFocusedElement: function() { },
104 * @param {!WebInspector.TextRange} range
105 * @param {string} cssClass
108 highlightRange: function(range, cssClass) { },
111 * @param {!Object} highlightDescriptor
113 removeHighlight: function(highlightDescriptor) { },
116 * @param {number} lineNumber
118 revealLine: function(lineNumber) { },
121 * @param {number} lineNumber
122 * @param {boolean} disabled
123 * @param {boolean} conditional
125 addBreakpoint: function(lineNumber, disabled, conditional) { },
128 * @param {number} lineNumber
130 removeBreakpoint: function(lineNumber) { },
133 * @param {number} lineNumber
135 setExecutionLine: function(lineNumber) { },
137 clearExecutionLine: function() { },
140 * @param {number} lineNumber
141 * @param {!Element} element
143 addDecoration: function(lineNumber, element) { },
146 * @param {number} lineNumber
147 * @param {!Element} element
149 removeDecoration: function(lineNumber, element) { },
152 * @param {!RegExp} regex
153 * @param {?WebInspector.TextRange} range
155 highlightSearchResults: function(regex, range) { },
158 * @param {number} lineNumber
159 * @param {number=} columnNumber
161 highlightPosition: function(lineNumber, columnNumber) { },
163 clearPositionHighlight: function() { },
166 * @return {!Array.<!Element>}
168 elementsToRestoreScrollPositionsFor: function() { },
171 * @param {!WebInspector.TextEditor} textEditor
173 inheritScrollPositions: function(textEditor) { },
175 beginUpdates: function() { },
177 endUpdates: function() { },
179 onResize: function() { },
182 * @param {!WebInspector.TextRange} range
183 * @param {string} text
184 * @return {!WebInspector.TextRange}
186 editRange: function(range, text) { },
189 * @param {number} lineNumber
191 scrollToLine: function(lineNumber) { },
196 firstVisibleLine: function() { },
201 lastVisibleLine: function() { },
204 * @return {!WebInspector.TextRange}
206 selection: function() { },
209 * @return {?WebInspector.TextRange}
211 lastSelection: function() { },
214 * @param {!WebInspector.TextRange} textRange
216 setSelection: function(textRange) { },
219 * @param {!WebInspector.TextRange} range
222 copyRange: function(range) { },
225 * @param {string} text
227 setText: function(text) { },
232 text: function() { },
235 * @return {!WebInspector.TextRange}
237 range: function() { },
240 * @param {number} lineNumber
243 line: function(lineNumber) { },
248 get linesCount() { },
251 * @param {number} line
252 * @param {string} name
253 * @param {?Object} value
255 setAttribute: function(line, name, value) { },
258 * @param {number} line
259 * @param {string} name
260 * @return {?Object} value
262 getAttribute: function(line, name) { },
265 * @param {number} line
266 * @param {string} name
268 removeAttribute: function(line, name) { },
270 wasShown: function() { },
272 willHide: function() { },
275 * @param {?WebInspector.CompletionDictionary} dictionary
277 setCompletionDictionary: function(dictionary) { },
280 * @param {number} lineNumber
281 * @param {number} columnNumber
282 * @return {?WebInspector.TextEditorPositionHandle}
284 textEditorPositionHandle: function(lineNumber, columnNumber) { }
290 WebInspector.TextEditorPositionHandle = function()
294 WebInspector.TextEditorPositionHandle.prototype = {
296 * @return {?{lineNumber: number, columnNumber: number}}
298 resolve: function() { },
301 * @param {!WebInspector.TextEditorPositionHandle} positionHandle
304 equal: function(positionHandle) { }
310 WebInspector.TextEditorDelegate = function()
314 WebInspector.TextEditorDelegate.prototype = {
316 * @param {!WebInspector.TextRange} oldRange
317 * @param {!WebInspector.TextRange} newRange
319 onTextChanged: function(oldRange, newRange) { },
322 * @param {!WebInspector.TextRange} textRange
324 selectionChanged: function(textRange) { },
327 * @param {number} lineNumber
329 scrollChanged: function(lineNumber) { },
331 editorFocused: function() { },
334 * @param {!WebInspector.ContextMenu} contextMenu
335 * @param {number} lineNumber
337 populateLineGutterContextMenu: function(contextMenu, lineNumber) { },
340 * @param {!WebInspector.ContextMenu} contextMenu
341 * @param {number} lineNumber
343 populateTextAreaContextMenu: function(contextMenu, lineNumber) { },
346 * @param {string} hrefValue
347 * @param {boolean} isExternal
350 createLink: function(hrefValue, isExternal) { },
353 * @param {?WebInspector.TextRange} from
354 * @param {?WebInspector.TextRange} to
356 onJumpToPosition: function(from, to) { }
362 WebInspector.TokenizerFactory = function() { }
364 WebInspector.TokenizerFactory.prototype = {
366 * @param {string} mimeType
367 * @return {function(string, function(string, ?string, number, number))}
369 createTokenizer: function(mimeType) { }