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
117 * @param {boolean} disabled
118 * @param {boolean} conditional
120 addBreakpoint: function(lineNumber, disabled, conditional) { },
123 * @param {number} lineNumber
125 removeBreakpoint: function(lineNumber) { },
128 * @param {number} lineNumber
130 setExecutionLine: function(lineNumber) { },
132 clearExecutionLine: function() { },
135 * @param {number} lineNumber
136 * @param {string} className
137 * @param {boolean} toggled
139 toggleLineClass: function(lineNumber, className, toggled) { },
142 * @param {number} lineNumber
143 * @param {!Element} element
145 addDecoration: function(lineNumber, element) { },
148 * @param {number} lineNumber
149 * @param {!Element} element
151 removeDecoration: function(lineNumber, element) { },
154 * @param {!RegExp} regex
155 * @param {?WebInspector.TextRange} range
157 highlightSearchResults: function(regex, range) { },
160 * @param {number} lineNumber
161 * @param {number=} columnNumber
162 * @param {boolean=} shouldHighlight
164 revealPosition: function(lineNumber, columnNumber, shouldHighlight) { },
166 clearPositionHighlight: function() { },
169 * @return {!Array.<!Element>}
171 elementsToRestoreScrollPositionsFor: function() { },
174 * @param {!WebInspector.TextEditor} textEditor
176 inheritScrollPositions: function(textEditor) { },
178 beginUpdates: function() { },
180 endUpdates: function() { },
182 onResize: function() { },
185 * @param {!WebInspector.TextRange} range
186 * @param {string} text
187 * @return {!WebInspector.TextRange}
189 editRange: function(range, text) { },
192 * @param {number} lineNumber
194 scrollToLine: function(lineNumber) { },
199 firstVisibleLine: function() { },
204 lastVisibleLine: function() { },
207 * @return {!WebInspector.TextRange}
209 selection: function() { },
212 * @return {!Array.<!WebInspector.TextRange>}
214 selections: function() { },
217 * @return {?WebInspector.TextRange}
219 lastSelection: function() { },
222 * @param {!WebInspector.TextRange} textRange
224 setSelection: function(textRange) { },
227 * @param {!WebInspector.TextRange} range
230 copyRange: function(range) { },
233 * @param {string} text
235 setText: function(text) { },
240 text: function() { },
243 * @return {!WebInspector.TextRange}
245 range: function() { },
248 * @param {number} lineNumber
251 line: function(lineNumber) { },
256 get linesCount() { },
259 * @param {number} line
260 * @param {string} name
261 * @param {?Object} value
263 setAttribute: function(line, name, value) { },
266 * @param {number} line
267 * @param {string} name
268 * @return {?Object} value
270 getAttribute: function(line, name) { },
273 * @param {number} line
274 * @param {string} name
276 removeAttribute: function(line, name) { },
278 wasShown: function() { },
280 willHide: function() { },
283 * @param {?WebInspector.CompletionDictionary} dictionary
285 setCompletionDictionary: function(dictionary) { },
288 * @param {number} lineNumber
289 * @param {number} columnNumber
290 * @return {?WebInspector.TextEditorPositionHandle}
292 textEditorPositionHandle: function(lineNumber, columnNumber) { },
294 dispose: function() { }
300 WebInspector.TextEditorPositionHandle = function()
304 WebInspector.TextEditorPositionHandle.prototype = {
306 * @return {?{lineNumber: number, columnNumber: number}}
308 resolve: function() { },
311 * @param {!WebInspector.TextEditorPositionHandle} positionHandle
314 equal: function(positionHandle) { }
320 WebInspector.TextEditorDelegate = function()
324 WebInspector.TextEditorDelegate.prototype = {
326 * @param {!WebInspector.TextRange} oldRange
327 * @param {!WebInspector.TextRange} newRange
329 onTextChanged: function(oldRange, newRange) { },
332 * @param {!WebInspector.TextRange} textRange
334 selectionChanged: function(textRange) { },
337 * @param {number} lineNumber
339 scrollChanged: function(lineNumber) { },
341 editorFocused: function() { },
344 * @param {!WebInspector.ContextMenu} contextMenu
345 * @param {number} lineNumber
347 populateLineGutterContextMenu: function(contextMenu, lineNumber) { },
350 * @param {!WebInspector.ContextMenu} contextMenu
351 * @param {number} lineNumber
353 populateTextAreaContextMenu: function(contextMenu, lineNumber) { },
356 * @param {?WebInspector.TextRange} from
357 * @param {?WebInspector.TextRange} to
359 onJumpToPosition: function(from, to) { }
365 WebInspector.TokenizerFactory = function() { }
367 WebInspector.TokenizerFactory.prototype = {
369 * @param {string} mimeType
370 * @return {function(string, function(string, ?string, number, number))}
372 createTokenizer: function(mimeType) { }