2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-02-02 11:25:11 +00:00
|
|
|
|
2001-02-12 23:37:37 +00:00
|
|
|
#include "nsISupports.idl"
|
2001-02-02 11:25:11 +00:00
|
|
|
|
2013-09-22 23:24:27 +00:00
|
|
|
interface nsIDOMElement;
|
2002-03-29 02:46:01 +00:00
|
|
|
interface nsITreeView;
|
|
|
|
interface nsITreeSelection;
|
2004-04-17 05:53:38 +00:00
|
|
|
interface nsITreeColumn;
|
|
|
|
interface nsITreeColumns;
|
2008-08-27 12:07:27 +00:00
|
|
|
interface nsIScriptableRegion;
|
2001-02-02 11:25:11 +00:00
|
|
|
|
2008-08-27 12:07:27 +00:00
|
|
|
[scriptable, uuid(64BA5199-C4F4-4498-BBDC-F8E4C369086C)]
|
2002-03-29 02:46:01 +00:00
|
|
|
interface nsITreeBoxObject : nsISupports
|
2001-02-02 11:25:11 +00:00
|
|
|
{
|
2004-04-17 05:53:38 +00:00
|
|
|
/**
|
|
|
|
* Obtain the columns.
|
|
|
|
*/
|
|
|
|
readonly attribute nsITreeColumns columns;
|
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
2002-03-29 02:46:01 +00:00
|
|
|
* The view that backs the tree and that supplies it with its data.
|
2001-04-05 05:29:24 +00:00
|
|
|
* It is dynamically settable, either using a view attribute on the
|
2002-03-29 02:46:01 +00:00
|
|
|
* tree tag or by setting this attribute to a new value.
|
2001-04-05 05:29:24 +00:00
|
|
|
*/
|
2002-03-29 02:46:01 +00:00
|
|
|
attribute nsITreeView view;
|
2001-02-02 11:25:11 +00:00
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
|
|
|
* Whether or not we are currently focused.
|
|
|
|
*/
|
2001-03-08 00:46:58 +00:00
|
|
|
attribute boolean focused;
|
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
2002-03-29 02:46:01 +00:00
|
|
|
* Obtain the treebody content node
|
2001-04-05 05:29:24 +00:00
|
|
|
*/
|
2002-03-29 02:46:01 +00:00
|
|
|
readonly attribute nsIDOMElement treeBody;
|
2001-02-15 09:43:11 +00:00
|
|
|
|
2001-04-30 18:30:18 +00:00
|
|
|
/**
|
|
|
|
* Obtain the height of a row.
|
|
|
|
*/
|
|
|
|
readonly attribute long rowHeight;
|
|
|
|
|
2005-08-30 18:36:15 +00:00
|
|
|
/**
|
|
|
|
* Obtain the width of a row.
|
|
|
|
*/
|
|
|
|
readonly attribute long rowWidth;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the pixel position of the horizontal scrollbar.
|
|
|
|
*/
|
|
|
|
readonly attribute long horizontalPosition;
|
|
|
|
|
2008-08-27 12:07:27 +00:00
|
|
|
/**
|
|
|
|
* Return the region for the visible parts of the selection, in device pixels.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIScriptableRegion selectionRegion;
|
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
|
|
|
* Get the index of the first visible row.
|
|
|
|
*/
|
2001-03-06 02:27:50 +00:00
|
|
|
long getFirstVisibleRow();
|
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
|
|
|
* Get the index of the last visible row.
|
|
|
|
*/
|
2001-03-06 02:27:50 +00:00
|
|
|
long getLastVisibleRow();
|
2001-02-02 11:25:11 +00:00
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
|
|
|
* Gets the number of possible visible rows.
|
|
|
|
*/
|
2004-04-17 05:53:38 +00:00
|
|
|
long getPageLength();
|
2001-02-02 11:25:11 +00:00
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
|
|
|
* Ensures that a row at a given index is visible.
|
|
|
|
*/
|
2001-03-06 02:27:50 +00:00
|
|
|
void ensureRowIsVisible(in long index);
|
|
|
|
|
2005-08-30 18:36:15 +00:00
|
|
|
/**
|
|
|
|
* Ensures that a given cell in the tree is visible.
|
|
|
|
*/
|
2005-09-20 09:30:32 +00:00
|
|
|
void ensureCellIsVisible(in long row, in nsITreeColumn col);
|
2005-08-30 18:36:15 +00:00
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
|
|
|
* Scrolls such that the row at index is at the top of the visible view.
|
|
|
|
*/
|
2001-02-06 02:57:58 +00:00
|
|
|
void scrollToRow(in long index);
|
2001-03-06 02:27:50 +00:00
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
2002-03-29 02:46:01 +00:00
|
|
|
* Scroll the tree up or down by numLines lines. Positive
|
|
|
|
* values move down in the tree. Prevents scrolling off the
|
|
|
|
* end of the tree.
|
2001-04-05 05:29:24 +00:00
|
|
|
*/
|
2001-03-06 02:27:50 +00:00
|
|
|
void scrollByLines(in long numLines);
|
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
2002-03-29 02:46:01 +00:00
|
|
|
* Scroll the tree up or down by numPages pages. A page
|
|
|
|
* is considered to be the amount displayed by the tree.
|
|
|
|
* Positive values move down in the tree. Prevents scrolling
|
|
|
|
* off the end of the tree.
|
2001-04-05 05:29:24 +00:00
|
|
|
*/
|
2001-03-06 02:27:50 +00:00
|
|
|
void scrollByPages(in long numPages);
|
2001-02-06 02:57:58 +00:00
|
|
|
|
2005-08-30 18:36:15 +00:00
|
|
|
/**
|
|
|
|
* Scrolls such that a given cell is visible (if possible)
|
|
|
|
* at the top left corner of the visible view.
|
|
|
|
*/
|
2005-09-20 09:30:32 +00:00
|
|
|
void scrollToCell(in long row, in nsITreeColumn col);
|
2005-08-30 18:36:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Scrolls horizontally so that the specified column is
|
|
|
|
* at the left of the view (if possible).
|
|
|
|
*/
|
2005-09-20 09:30:32 +00:00
|
|
|
void scrollToColumn(in nsITreeColumn col);
|
2005-08-30 18:36:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Scroll to a specific horizontal pixel position.
|
|
|
|
*/
|
|
|
|
void scrollToHorizontalPosition(in long horizontalPosition);
|
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
|
|
|
* Invalidation methods for fine-grained painting control.
|
|
|
|
*/
|
2001-02-02 11:25:11 +00:00
|
|
|
void invalidate();
|
2004-04-17 05:53:38 +00:00
|
|
|
void invalidateColumn(in nsITreeColumn col);
|
2001-02-02 11:25:11 +00:00
|
|
|
void invalidateRow(in long index);
|
2004-04-17 05:53:38 +00:00
|
|
|
void invalidateCell(in long row, in nsITreeColumn col);
|
2001-02-02 22:34:52 +00:00
|
|
|
void invalidateRange(in long startIndex, in long endIndex);
|
2006-06-06 20:05:13 +00:00
|
|
|
void invalidateColumnRange(in long startIndex, in long endIndex,
|
|
|
|
in nsITreeColumn col);
|
2001-02-02 11:25:11 +00:00
|
|
|
|
2002-08-15 05:06:19 +00:00
|
|
|
/**
|
|
|
|
* A hit test that can tell you what row the mouse is over.
|
|
|
|
* returns -1 for invalid mouse coordinates.
|
2005-04-18 05:22:35 +00:00
|
|
|
*
|
|
|
|
* The coordinate system is the client coordinate system for the
|
|
|
|
* document this boxObject lives in, and the units are CSS pixels.
|
2002-08-15 05:06:19 +00:00
|
|
|
*/
|
|
|
|
long getRowAt(in long x, in long y);
|
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
|
|
|
* A hit test that can tell you what cell the mouse is over. Row is the row index
|
2002-01-10 04:47:52 +00:00
|
|
|
* hit, returns -1 for invalid mouse coordinates. ColID is the column hit.
|
|
|
|
* ChildElt is the pseudoelement hit: this can have values of
|
|
|
|
* "cell", "twisty", "image", and "text".
|
2005-04-18 05:22:35 +00:00
|
|
|
*
|
|
|
|
* The coordinate system is the client coordinate system for the
|
|
|
|
* document this boxObject lives in, and the units are CSS pixels.
|
2001-04-05 05:29:24 +00:00
|
|
|
*/
|
2004-04-17 05:53:38 +00:00
|
|
|
void getCellAt(in long x, in long y, out long row, out nsITreeColumn col, out ACString childElt);
|
2001-02-02 11:42:40 +00:00
|
|
|
|
2001-05-11 01:51:04 +00:00
|
|
|
/**
|
|
|
|
* Find the coordinates of an element within a specific cell.
|
|
|
|
*/
|
2004-04-17 05:53:38 +00:00
|
|
|
void getCoordsForCellItem(in long row, in nsITreeColumn col, in ACString element,
|
2001-05-11 01:51:04 +00:00
|
|
|
out long x, out long y, out long width, out long height);
|
|
|
|
|
2001-12-04 22:32:49 +00:00
|
|
|
/**
|
|
|
|
* Determine if the text of a cell is being cropped or not.
|
|
|
|
*/
|
2004-04-17 05:53:38 +00:00
|
|
|
boolean isCellCropped(in long row, in nsITreeColumn col);
|
2001-12-04 22:32:49 +00:00
|
|
|
|
2001-04-05 05:29:24 +00:00
|
|
|
/**
|
|
|
|
* The view is responsible for calling these notification methods when
|
|
|
|
* rows are added or removed. Index is the position at which the new
|
|
|
|
* rows were added or at which rows were removed. For
|
|
|
|
* non-contiguous additions/removals, this method should be called multiple times.
|
|
|
|
*/
|
2001-03-06 02:27:50 +00:00
|
|
|
void rowCountChanged(in long index, in long count);
|
2001-05-11 01:51:04 +00:00
|
|
|
|
2003-05-23 12:03:40 +00:00
|
|
|
/**
|
|
|
|
* Notify the tree that the view is about to perform a batch
|
|
|
|
* update, that is, add, remove or invalidate several rows at once.
|
|
|
|
* This must be followed by calling endUpdateBatch(), otherwise the tree
|
|
|
|
* will get out of sync.
|
|
|
|
*/
|
|
|
|
void beginUpdateBatch();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify the tree that the view has completed a batch update.
|
|
|
|
*/
|
|
|
|
void endUpdateBatch();
|
|
|
|
|
2002-03-27 02:42:59 +00:00
|
|
|
/**
|
2002-03-29 02:46:01 +00:00
|
|
|
* Called on a theme switch to flush out the tree's style and image caches.
|
2002-03-27 02:42:59 +00:00
|
|
|
*/
|
|
|
|
void clearStyleAndImageCaches();
|
2001-02-02 11:25:11 +00:00
|
|
|
};
|