change comments in these files to be appropriate doc comment format. sr=hyatt.

This commit is contained in:
ben%netscape.com 2001-04-05 05:29:24 +00:00
parent e0e7f1a319
commit adeeacf1cc
6 changed files with 388 additions and 184 deletions

View File

@ -31,65 +31,94 @@ interface nsIOutlinerSelection;
[scriptable, uuid(8398C757-6387-480c-82B2-C914E15CE00D)]
interface nsIOutlinerBoxObject : nsISupports
{
// The view that backs the outliner and that supplies it with its data.
// It is dynamically settable, either using a view attribute on the
// outliner tag or by setting this attribute to a new value.
/**
* The view that backs the outliner and that supplies it with its data.
* It is dynamically settable, either using a view attribute on the
* outliner tag or by setting this attribute to a new value.
*/
attribute nsIOutlinerView view;
// Whether or not we are currently focused.
/**
* Whether or not we are currently focused.
*/
attribute boolean focused;
// Obtain the outlinerbody content node
/**
* Obtain the outlinerbody content node
*/
readonly attribute nsIDOMElement outlinerBody;
// Obtains the selection from the view.
/**
* Obtains the selection from the view.
*/
readonly attribute nsIOutlinerSelection selection;
// Get the index of the first visible row.
/**
* Get the index of the first visible row.
*/
long getFirstVisibleRow();
// Get the index of the last visible row.
/**
* Get the index of the last visible row.
*/
long getLastVisibleRow();
// Gets the number of possible visible rows.
/**
* Gets the number of possible visible rows.
*/
long getPageCount();
// Ensures that a row at a given index is visible.
/**
* Ensures that a row at a given index is visible.
*/
void ensureRowIsVisible(in long index);
// Scrolls such that the row at index is at the top of the visible view.
/**
* Scrolls such that the row at index is at the top of the visible view.
*/
void scrollToRow(in long index);
// Scroll the outliner up or down by numLines lines. Positive
// values move down in the outliner. Prevents scrolling off the
// end of the outliner.
/**
* Scroll the outliner up or down by numLines lines. Positive
* values move down in the outliner. Prevents scrolling off the
* end of the outliner.
*/
void scrollByLines(in long numLines);
// Scroll the outliner up or down by numPages pages. A page
// is considered to be the amount displayed by the outliner.
// Positive values move down in the outliner. Prevents scrolling
// off the end of the outliner.
/**
* Scroll the outliner up or down by numPages pages. A page
* is considered to be the amount displayed by the outliner.
* Positive values move down in the outliner. Prevents scrolling
* off the end of the outliner.
*/
void scrollByPages(in long numPages);
// Invalidation methods for fine-grained painting control.
/**
* Invalidation methods for fine-grained painting control.
*/
void invalidate();
void invalidateRow(in long index);
void invalidateCell(in long row, in wstring colID);
void invalidateRange(in long startIndex, in long endIndex);
void invalidateScrollbar();
// A hit test that can tell you what cell the mouse is over. Row is the row index
// hit. ColID is the column hit. ChildElt is the pseudoelement hit: this can have
// values of "cell", "twisty", "image", and "text".
/**
* A hit test that can tell you what cell the mouse is over. Row is the row index
* hit. ColID is the column hit. ChildElt is the pseudoelement hit: this can have
* values of "cell", "twisty", "image", and "text".
*/
void getCellAt(in long x, in long y, out long row, out wstring colID, out wstring childElt);
// 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.
/**
* 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);
};
%{C++
// Initializer,
%}

View File

@ -29,61 +29,92 @@ interface nsIOutlinerBoxObject;
[scriptable, uuid(F848D7CF-F3D6-4775-8C9F-135546E61E1E)]
interface nsIOutlinerSelection : nsISecurityCheckedComponent
{
// The outliner widget for this selection.
/**
* The outliner widget for this selection.
*/
attribute nsIOutlinerBoxObject outliner;
// Indicates whether or not the row at the specified index is
// part of the selection.
/**
* Indicates whether or not the row at the specified index is
* part of the selection.
*/
boolean isSelected(in long index);
// Deselect all rows and select the row at the specified index.
/**
* Deselect all rows and select the row at the specified index.
*/
void select(in long index);
// Perform a timed select.
/**
* Perform a timed select.
*/
void timedSelect(in long index, in long delay);
// Toggle the selection state of the row at the specified index.
/**
* Toggle the selection state of the row at the specified index.
*/
void toggleSelect(in long index);
// Select the range specified by the indices. If augment is true,
// then we add the range to the selection without clearing out anything
// else. If augment is false, everything is cleared except for the specified range.
/**
* Select the range specified by the indices. If augment is true,
* then we add the range to the selection without clearing out anything
* else. If augment is false, everything is cleared except for the specified range.
*/
void rangedSelect(in long startIndex, in long endIndex, in boolean augment);
// Clears the range.
/**
* Clears the range.
*/
void clearRange(in long startIndex, in long endIndex);
// Clears the selection.
/**
* Clears the selection.
*/
void clearSelection();
// Inverts the selection.
/**
* Inverts the selection.
*/
void invertSelection();
// Selects all rows.
/**
* Selects all rows.
*/
void selectAll();
// Iterate the selection using these methods.
/**
* Iterate the selection using these methods.
*/
long getRangeCount();
void getRangeAt(in long i, out long min, out long max);
// Can be used to invalidate the selection.
/**
* Can be used to invalidate the selection.
*/
void invalidateSelection();
// Called when the row count changes to adjust selection indices.
/**
* Called when the row count changes to adjust selection indices.
*/
void adjustSelection(in long index, in long count);
// This attribute is a boolean indicating whether or not the
// "select" event should fire when the selection is changed using
// one of our methods. A view can use this to temporarily suppress
// the selection while manipulating all of the indices, e.g., on
// a sort.
/**
* This attribute is a boolean indicating whether or not the
* "select" event should fire when the selection is changed using
* one of our methods. A view can use this to temporarily suppress
* the selection while manipulating all of the indices, e.g., on
* a sort.
*/
attribute boolean selectEventsSuppressed;
// The current item (the one that gets a focus rect in addition to being
// selected).
/**
* The current item (the one that gets a focus rect in addition to being
* selected).
*/
attribute long currentIndex;
};
%{C++
// Initializer,
%}

View File

@ -31,91 +31,133 @@ interface nsIOutlinerSelection;
[scriptable, uuid(7660811D-3CB8-441f-8E58-466DE4F3FA9A)]
interface nsIOutlinerView : nsISupports
{
// The total number of rows in the outliner (including the offscreen rows).
/**
* The total number of rows in the outliner (including the offscreen rows).
*/
readonly attribute long rowCount;
// The selection for this view.
/**
* The selection for this view.
*/
attribute nsIOutlinerSelection selection;
// An atomized list of properties for a given row. Each property, x, that
// the view gives back will cause the pseudoclass :moz-outliner-row-x
// to be matched on the pseudoelement ::moz-outliner-row.
//
// The special property "separator" can be returned to supply the outliner
// with the hint that there are no cells in this row and that it should draw
// a separator. It uses the border properties on the separator pseudoclass
// to draw the separator.
/**
* An atomized list of properties for a given row. Each property, x, that
* the view gives back will cause the pseudoclass :moz-outliner-row-x
* to be matched on the pseudoelement ::moz-outliner-row.
*
* The special property "separator" can be returned to supply the outliner
* with the hint that there are no cells in this row and that it should draw
* a separator. It uses the border properties on the separator pseudoclass
* to draw the separator.
*/
void getRowProperties(in long index, in nsISupportsArray properties);
// An atomized list of properties for a given cell. Each property, x, that
// the view gives back will cause the pseudoclass :moz-outliner-cell-x
// to be matched on the ::moz-outliner-cell pseudoelement.
/**
* An atomized list of properties for a given cell. Each property, x, that
* the view gives back will cause the pseudoclass :moz-outliner-cell-x
* to be matched on the ::moz-outliner-cell pseudoelement.
*/
void getCellProperties(in long row, in wstring colID, in nsISupportsArray properties);
// Called to get properties to paint a column background. For shading the sort
// column, etc.
/**
* Called to get properties to paint a column background. For shading the sort
* column, etc.
*/
void getColumnProperties(in wstring colID, in nsIDOMElement colElt, in nsISupportsArray properties);
// Methods that can be used to test whether or not a twisty should be drawn,
// and if so, whether an open or closed twisty should be used.
/**
* Methods that can be used to test whether or not a twisty should be drawn,
* and if so, whether an open or closed twisty should be used.
*/
boolean isContainer(in long index);
boolean isContainerOpen(in long index);
boolean isContainerEmpty(in long index);
// Methods used by the outliner to draw vertical lines in the tree.
// GetParentIndex is used to obtain the index of a parent row.
/**
* Methods used by the outliner to draw vertical lines in the tree.
* GetParentIndex is used to obtain the index of a parent row.
*/
long getParentIndex(in long rowIndex);
// HasNextSibling is used to determine if the row at rowIndex has a nextSibling
// that occurs *after* the index specified by afterIndex. Code that is forced
// to march down the view looking at levels can optimize the march by starting
// at afterIndex+1.
/**
* HasNextSibling is used to determine if the row at rowIndex has a nextSibling
* that occurs *after* the index specified by afterIndex. Code that is forced
* to march down the view looking at levels can optimize the march by starting
* at afterIndex+1.
*/
boolean hasNextSibling(in long rowIndex, in long afterIndex);
// The level is an integer value that represents
// the level of indentation. It is multiplied by the width specified in the
// :moz-outliner-indentation pseudoelement to compute the exact indendation.
/**
* The level is an integer value that represents
* the level of indentation. It is multiplied by the width specified in the
* :moz-outliner-indentation pseudoelement to compute the exact indendation.
*/
long getLevel(in long index);
// The text for a given cell. If a column consists only of an image, then
// the empty string is returned.
/**
* The text for a given cell. If a column consists only of an image, then
* the empty string is returned.
*/
wstring getCellText(in long row, in wstring colID);
// Called during initialization to link the view to the front end box object.
/**
* Called during initialization to link the view to the front end box object.
*/
void setOutliner(in nsIOutlinerBoxObject outliner);
// Called on the view when an item is opened or closed.
/**
* Called on the view when an item is opened or closed.
*/
void toggleOpenState(in long index);
// Called on the view when a header is clicked.
/**
* Called on the view when a header is clicked.
*/
void cycleHeader(in wstring colID, in nsIDOMElement elt);
// Should be called from a XUL onselect handler whenever the selection changes.
// XXX Should this be done automatically?
/**
* Should be called from a XUL onselect handler whenever the selection changes.
* XXX Should this be done automatically?
*/
void selectionChanged();
// Called on the view when a cell in a non-selectable cycling column (e.g., unread/flag/etc.) is clicked.
/**
* Called on the view when a cell in a non-selectable cycling column (e.g., unread/flag/etc.) is clicked.
*/
void cycleCell(in long row, in wstring colID);
// APIs for inline editing. isEditable is called to ask the view if the cell contents are
// editable. A value of true will result in the outliner popping up a text field when the
// user tries to inline edit the cell.
// setCellText is called when the contents of the cell have been edited by the user.
/**
* isEditable is called to ask the view if the cell contents are editable.
* A value of true will result in the outliner popping up a text field when
* the user tries to inline edit the cell.
*/
boolean isEditable(in long row, in wstring colID);
/**
* setCellText is called when the contents of the cell have been edited by the user.
*/
void setCellText(in long row, in wstring colID, in wstring value);
// A command API that can be used to invoke commands on the selection. The outliner
// will automatically invoke this method when certain keys are pressed. For example,
// when the DEL key is pressed, performAction will be called with the "delete" string.
/**
* A command API that can be used to invoke commands on the selection. The outliner
* will automatically invoke this method when certain keys are pressed. For example,
* when the DEL key is pressed, performAction will be called with the "delete" string.
*/
void performAction(in wstring action);
// A command API that can be used to invoke commands on a specific row.
/**
* A command API that can be used to invoke commands on a specific row.
*/
void performActionOnRow(in wstring action, in long row);
// A command API that can be used to invoke commands on a specific cell.
/**
* A command API that can be used to invoke commands on a specific cell.
*/
void performActionOnCell(in wstring action, in long row, in wstring colID);
};
%{C++
// Initializer,
%}

View File

@ -31,65 +31,94 @@ interface nsIOutlinerSelection;
[scriptable, uuid(8398C757-6387-480c-82B2-C914E15CE00D)]
interface nsIOutlinerBoxObject : nsISupports
{
// The view that backs the outliner and that supplies it with its data.
// It is dynamically settable, either using a view attribute on the
// outliner tag or by setting this attribute to a new value.
/**
* The view that backs the outliner and that supplies it with its data.
* It is dynamically settable, either using a view attribute on the
* outliner tag or by setting this attribute to a new value.
*/
attribute nsIOutlinerView view;
// Whether or not we are currently focused.
/**
* Whether or not we are currently focused.
*/
attribute boolean focused;
// Obtain the outlinerbody content node
/**
* Obtain the outlinerbody content node
*/
readonly attribute nsIDOMElement outlinerBody;
// Obtains the selection from the view.
/**
* Obtains the selection from the view.
*/
readonly attribute nsIOutlinerSelection selection;
// Get the index of the first visible row.
/**
* Get the index of the first visible row.
*/
long getFirstVisibleRow();
// Get the index of the last visible row.
/**
* Get the index of the last visible row.
*/
long getLastVisibleRow();
// Gets the number of possible visible rows.
/**
* Gets the number of possible visible rows.
*/
long getPageCount();
// Ensures that a row at a given index is visible.
/**
* Ensures that a row at a given index is visible.
*/
void ensureRowIsVisible(in long index);
// Scrolls such that the row at index is at the top of the visible view.
/**
* Scrolls such that the row at index is at the top of the visible view.
*/
void scrollToRow(in long index);
// Scroll the outliner up or down by numLines lines. Positive
// values move down in the outliner. Prevents scrolling off the
// end of the outliner.
/**
* Scroll the outliner up or down by numLines lines. Positive
* values move down in the outliner. Prevents scrolling off the
* end of the outliner.
*/
void scrollByLines(in long numLines);
// Scroll the outliner up or down by numPages pages. A page
// is considered to be the amount displayed by the outliner.
// Positive values move down in the outliner. Prevents scrolling
// off the end of the outliner.
/**
* Scroll the outliner up or down by numPages pages. A page
* is considered to be the amount displayed by the outliner.
* Positive values move down in the outliner. Prevents scrolling
* off the end of the outliner.
*/
void scrollByPages(in long numPages);
// Invalidation methods for fine-grained painting control.
/**
* Invalidation methods for fine-grained painting control.
*/
void invalidate();
void invalidateRow(in long index);
void invalidateCell(in long row, in wstring colID);
void invalidateRange(in long startIndex, in long endIndex);
void invalidateScrollbar();
// A hit test that can tell you what cell the mouse is over. Row is the row index
// hit. ColID is the column hit. ChildElt is the pseudoelement hit: this can have
// values of "cell", "twisty", "image", and "text".
/**
* A hit test that can tell you what cell the mouse is over. Row is the row index
* hit. ColID is the column hit. ChildElt is the pseudoelement hit: this can have
* values of "cell", "twisty", "image", and "text".
*/
void getCellAt(in long x, in long y, out long row, out wstring colID, out wstring childElt);
// 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.
/**
* 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);
};
%{C++
// Initializer,
%}

View File

@ -29,61 +29,92 @@ interface nsIOutlinerBoxObject;
[scriptable, uuid(F848D7CF-F3D6-4775-8C9F-135546E61E1E)]
interface nsIOutlinerSelection : nsISecurityCheckedComponent
{
// The outliner widget for this selection.
/**
* The outliner widget for this selection.
*/
attribute nsIOutlinerBoxObject outliner;
// Indicates whether or not the row at the specified index is
// part of the selection.
/**
* Indicates whether or not the row at the specified index is
* part of the selection.
*/
boolean isSelected(in long index);
// Deselect all rows and select the row at the specified index.
/**
* Deselect all rows and select the row at the specified index.
*/
void select(in long index);
// Perform a timed select.
/**
* Perform a timed select.
*/
void timedSelect(in long index, in long delay);
// Toggle the selection state of the row at the specified index.
/**
* Toggle the selection state of the row at the specified index.
*/
void toggleSelect(in long index);
// Select the range specified by the indices. If augment is true,
// then we add the range to the selection without clearing out anything
// else. If augment is false, everything is cleared except for the specified range.
/**
* Select the range specified by the indices. If augment is true,
* then we add the range to the selection without clearing out anything
* else. If augment is false, everything is cleared except for the specified range.
*/
void rangedSelect(in long startIndex, in long endIndex, in boolean augment);
// Clears the range.
/**
* Clears the range.
*/
void clearRange(in long startIndex, in long endIndex);
// Clears the selection.
/**
* Clears the selection.
*/
void clearSelection();
// Inverts the selection.
/**
* Inverts the selection.
*/
void invertSelection();
// Selects all rows.
/**
* Selects all rows.
*/
void selectAll();
// Iterate the selection using these methods.
/**
* Iterate the selection using these methods.
*/
long getRangeCount();
void getRangeAt(in long i, out long min, out long max);
// Can be used to invalidate the selection.
/**
* Can be used to invalidate the selection.
*/
void invalidateSelection();
// Called when the row count changes to adjust selection indices.
/**
* Called when the row count changes to adjust selection indices.
*/
void adjustSelection(in long index, in long count);
// This attribute is a boolean indicating whether or not the
// "select" event should fire when the selection is changed using
// one of our methods. A view can use this to temporarily suppress
// the selection while manipulating all of the indices, e.g., on
// a sort.
/**
* This attribute is a boolean indicating whether or not the
* "select" event should fire when the selection is changed using
* one of our methods. A view can use this to temporarily suppress
* the selection while manipulating all of the indices, e.g., on
* a sort.
*/
attribute boolean selectEventsSuppressed;
// The current item (the one that gets a focus rect in addition to being
// selected).
/**
* The current item (the one that gets a focus rect in addition to being
* selected).
*/
attribute long currentIndex;
};
%{C++
// Initializer,
%}

View File

@ -31,91 +31,133 @@ interface nsIOutlinerSelection;
[scriptable, uuid(7660811D-3CB8-441f-8E58-466DE4F3FA9A)]
interface nsIOutlinerView : nsISupports
{
// The total number of rows in the outliner (including the offscreen rows).
/**
* The total number of rows in the outliner (including the offscreen rows).
*/
readonly attribute long rowCount;
// The selection for this view.
/**
* The selection for this view.
*/
attribute nsIOutlinerSelection selection;
// An atomized list of properties for a given row. Each property, x, that
// the view gives back will cause the pseudoclass :moz-outliner-row-x
// to be matched on the pseudoelement ::moz-outliner-row.
//
// The special property "separator" can be returned to supply the outliner
// with the hint that there are no cells in this row and that it should draw
// a separator. It uses the border properties on the separator pseudoclass
// to draw the separator.
/**
* An atomized list of properties for a given row. Each property, x, that
* the view gives back will cause the pseudoclass :moz-outliner-row-x
* to be matched on the pseudoelement ::moz-outliner-row.
*
* The special property "separator" can be returned to supply the outliner
* with the hint that there are no cells in this row and that it should draw
* a separator. It uses the border properties on the separator pseudoclass
* to draw the separator.
*/
void getRowProperties(in long index, in nsISupportsArray properties);
// An atomized list of properties for a given cell. Each property, x, that
// the view gives back will cause the pseudoclass :moz-outliner-cell-x
// to be matched on the ::moz-outliner-cell pseudoelement.
/**
* An atomized list of properties for a given cell. Each property, x, that
* the view gives back will cause the pseudoclass :moz-outliner-cell-x
* to be matched on the ::moz-outliner-cell pseudoelement.
*/
void getCellProperties(in long row, in wstring colID, in nsISupportsArray properties);
// Called to get properties to paint a column background. For shading the sort
// column, etc.
/**
* Called to get properties to paint a column background. For shading the sort
* column, etc.
*/
void getColumnProperties(in wstring colID, in nsIDOMElement colElt, in nsISupportsArray properties);
// Methods that can be used to test whether or not a twisty should be drawn,
// and if so, whether an open or closed twisty should be used.
/**
* Methods that can be used to test whether or not a twisty should be drawn,
* and if so, whether an open or closed twisty should be used.
*/
boolean isContainer(in long index);
boolean isContainerOpen(in long index);
boolean isContainerEmpty(in long index);
// Methods used by the outliner to draw vertical lines in the tree.
// GetParentIndex is used to obtain the index of a parent row.
/**
* Methods used by the outliner to draw vertical lines in the tree.
* GetParentIndex is used to obtain the index of a parent row.
*/
long getParentIndex(in long rowIndex);
// HasNextSibling is used to determine if the row at rowIndex has a nextSibling
// that occurs *after* the index specified by afterIndex. Code that is forced
// to march down the view looking at levels can optimize the march by starting
// at afterIndex+1.
/**
* HasNextSibling is used to determine if the row at rowIndex has a nextSibling
* that occurs *after* the index specified by afterIndex. Code that is forced
* to march down the view looking at levels can optimize the march by starting
* at afterIndex+1.
*/
boolean hasNextSibling(in long rowIndex, in long afterIndex);
// The level is an integer value that represents
// the level of indentation. It is multiplied by the width specified in the
// :moz-outliner-indentation pseudoelement to compute the exact indendation.
/**
* The level is an integer value that represents
* the level of indentation. It is multiplied by the width specified in the
* :moz-outliner-indentation pseudoelement to compute the exact indendation.
*/
long getLevel(in long index);
// The text for a given cell. If a column consists only of an image, then
// the empty string is returned.
/**
* The text for a given cell. If a column consists only of an image, then
* the empty string is returned.
*/
wstring getCellText(in long row, in wstring colID);
// Called during initialization to link the view to the front end box object.
/**
* Called during initialization to link the view to the front end box object.
*/
void setOutliner(in nsIOutlinerBoxObject outliner);
// Called on the view when an item is opened or closed.
/**
* Called on the view when an item is opened or closed.
*/
void toggleOpenState(in long index);
// Called on the view when a header is clicked.
/**
* Called on the view when a header is clicked.
*/
void cycleHeader(in wstring colID, in nsIDOMElement elt);
// Should be called from a XUL onselect handler whenever the selection changes.
// XXX Should this be done automatically?
/**
* Should be called from a XUL onselect handler whenever the selection changes.
* XXX Should this be done automatically?
*/
void selectionChanged();
// Called on the view when a cell in a non-selectable cycling column (e.g., unread/flag/etc.) is clicked.
/**
* Called on the view when a cell in a non-selectable cycling column (e.g., unread/flag/etc.) is clicked.
*/
void cycleCell(in long row, in wstring colID);
// APIs for inline editing. isEditable is called to ask the view if the cell contents are
// editable. A value of true will result in the outliner popping up a text field when the
// user tries to inline edit the cell.
// setCellText is called when the contents of the cell have been edited by the user.
/**
* isEditable is called to ask the view if the cell contents are editable.
* A value of true will result in the outliner popping up a text field when
* the user tries to inline edit the cell.
*/
boolean isEditable(in long row, in wstring colID);
/**
* setCellText is called when the contents of the cell have been edited by the user.
*/
void setCellText(in long row, in wstring colID, in wstring value);
// A command API that can be used to invoke commands on the selection. The outliner
// will automatically invoke this method when certain keys are pressed. For example,
// when the DEL key is pressed, performAction will be called with the "delete" string.
/**
* A command API that can be used to invoke commands on the selection. The outliner
* will automatically invoke this method when certain keys are pressed. For example,
* when the DEL key is pressed, performAction will be called with the "delete" string.
*/
void performAction(in wstring action);
// A command API that can be used to invoke commands on a specific row.
/**
* A command API that can be used to invoke commands on a specific row.
*/
void performActionOnRow(in wstring action, in long row);
// A command API that can be used to invoke commands on a specific cell.
/**
* A command API that can be used to invoke commands on a specific cell.
*/
void performActionOnCell(in wstring action, in long row, in wstring colID);
};
%{C++
// Initializer,
%}