gecko-dev/layout/xul/tree/nsITreeBoxObject.idl

124 lines
3.5 KiB
Plaintext

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "nsISupports.idl"
interface nsITreeView;
webidl Element;
webidl TreeColumn;
webidl TreeColumns;
/**
* This interface cannot become builtinclass until bug 1438525 is fixed.
*/
[scriptable, uuid(f3da0c5e-51f5-45f0-b2cd-6be3ab6847ae)]
interface nsITreeBoxObject : nsISupports
{
/**
* Obtain the columns.
*/
readonly attribute TreeColumns columns;
/**
* The view that backs the tree and that supplies it with its data.
* It is dynamically settable, either using a view attribute on the
* tree tag or by setting this attribute to a new value.
*/
attribute nsITreeView view;
/**
* Whether or not we are currently focused.
*/
attribute boolean focused;
/**
* Obtain the treebody content node
*/
readonly attribute Element treeBody;
/**
* Obtain the height of a row.
*/
readonly attribute long rowHeight;
/**
* Obtain the width of a row.
*/
readonly attribute long rowWidth;
/**
* Get the index of the first visible row.
*/
long getFirstVisibleRow();
/**
* Get the index of the last visible row.
*/
long getLastVisibleRow();
/**
* Ensures that a row at a given index is visible.
*/
void ensureRowIsVisible(in long index);
/**
* Invalidation methods for fine-grained painting control.
*/
void invalidate();
void invalidateColumn(in TreeColumn col);
void invalidateRow(in long index);
void invalidateCell(in long row, in TreeColumn col);
void invalidateRange(in long startIndex, in long endIndex);
/**
* A hit test that can tell you what cell the mouse is over. Row is the row index
* 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".
*
* The coordinate system is the client coordinate system for the
* document this boxObject lives in, and the units are CSS pixels.
*/
void getCellAt(in long x, in long y, out long row, out TreeColumn col, out AString childElt);
/**
* Find the coordinates of an element within a specific cell.
*/
void getCoordsForCellItem(in long row, in TreeColumn col, in AString element,
out long x, out long y, out long width, out long height);
/**
* Determine if the text of a cell is being cropped or not.
*/
boolean isCellCropped(in long row, in TreeColumn col);
/**
* 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.
*/
void rowCountChanged(in long index, in long count);
/**
* 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();
/**
* Called on a theme switch to flush out the tree's style and image caches.
*/
void clearStyleAndImageCaches();
};