2 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/.
10 dictionary TreeCellInfo {
12 TreeColumn? col = null;
13 DOMString childElt = "";
18 interface XULTreeElement : XULElement
20 [HTMLConstructor] constructor();
25 readonly attribute TreeColumns? columns;
28 * The view that backs the tree and that supplies it with its data.
29 * It is dynamically settable, either using a view attribute on the
30 * tree tag or by setting this attribute to a new value.
32 [SetterThrows, NeedsCallerType]
33 attribute MozTreeView? view;
36 * Whether or not we are currently focused.
38 attribute boolean focused;
41 * Obtain the treebody content node
43 readonly attribute Element? treeBody;
46 * Obtain the height of a row.
48 readonly attribute long rowHeight;
51 * Obtain the width of a row.
53 readonly attribute long rowWidth;
56 * Get the pixel position of the horizontal scrollbar.
58 readonly attribute long horizontalPosition;
61 * Get the index of the first visible row.
63 long getFirstVisibleRow();
66 * Get the index of the last visible row.
68 long getLastVisibleRow();
71 * Gets the number of possible visible rows.
76 * Ensures that a row at a given index is visible.
78 undefined ensureRowIsVisible(long index);
81 * Ensures that a given cell in the tree is visible.
84 undefined ensureCellIsVisible(long row, TreeColumn? col);
87 * Scrolls such that the row at index is at the top of the visible view.
89 undefined scrollToRow(long index);
92 * Scroll the tree up or down by numLines lines. Positive
93 * values move down in the tree. Prevents scrolling off the
96 undefined scrollByLines(long numLines);
99 * Scroll the tree up or down by numPages pages. A page
100 * is considered to be the amount displayed by the tree.
101 * Positive values move down in the tree. Prevents scrolling
102 * off the end of the tree.
104 undefined scrollByPages(long numPages);
107 * Invalidation methods for fine-grained painting control.
109 undefined invalidate();
110 undefined invalidateColumn(TreeColumn? col);
111 undefined invalidateRow(long index);
112 undefined invalidateCell(long row, TreeColumn? col);
113 undefined invalidateRange(long startIndex, long endIndex);
116 * A hit test that can tell you what row the mouse is over.
117 * returns -1 for invalid mouse coordinates.
119 * The coordinate system is the client coordinate system for the
120 * document this tree lives in, and the units are CSS pixels.
122 long getRowAt(long x, long y);
125 * A hit test that can tell you what cell the mouse is over.
126 * TreeCellInfo.row is the row index hit, returns -1 for invalid mouse
127 * coordinates. TreeCellInfo.col is the column hit.
128 * TreeCellInfo.childElt is the pseudoelement hit: this can have values of
129 * "cell", "twisty", "image", and "text".
131 * The coordinate system is the client coordinate system for the
132 * document this tree lives in, and the units are CSS pixels.
135 TreeCellInfo getCellAt(long x, long y);
138 * Find the coordinates of an element within a specific cell.
141 DOMRect? getCoordsForCellItem(long row, TreeColumn col, DOMString element);
144 * Determine if the text of a cell is being cropped or not.
147 boolean isCellCropped(long row, TreeColumn? col);
150 * The view is responsible for calling these notification methods when
151 * rows are added or removed. Index is the position at which the new
152 * rows were added or at which rows were removed. For
153 * non-contiguous additions/removals, this method should be called multiple times.
155 undefined rowCountChanged(long index, long count);
158 * Notify the tree that the view is about to perform a batch
159 * update, that is, add, remove or invalidate several rows at once.
160 * This must be followed by calling endUpdateBatch(), otherwise the tree
161 * will get out of sync.
163 undefined beginUpdateBatch();
166 * Notify the tree that the view has completed a batch update.
168 undefined endUpdateBatch();
171 * Called on a theme switch to flush out the tree's style and image caches.
173 undefined clearStyleAndImageCaches();
176 * Remove an image source from the image cache to allow its invalidation.
179 undefined removeImageCacheEntry(long row, TreeColumn col);