From 95057fc657daf8e2046349e5eef10e2efeae2901 Mon Sep 17 00:00:00 2001 From: "jay.yan%sun.com" Date: Wed, 17 Apr 2002 09:44:40 +0000 Subject: [PATCH] bug 127893 check in additional IDL files contributed by Sun r=jgaunt sr=jst this part is only the new idl files, I will checkin makefile for 3 platforms soon. git-svn-id: svn://10.0.0.236/trunk@119217 18797224-902f-48f8-a5cc-f745e15eee43 --- .../accessible/public/nsIAccessibleAction.idl | 51 ++++++ .../public/nsIAccessibleEditableText.idl | 53 +++++++ .../public/nsIAccessibleHyperLink.idl | 60 +++++++ .../public/nsIAccessibleHyperText.idl | 38 +++++ .../public/nsIAccessibleSelection.idl | 72 +++++++++ .../accessible/public/nsIAccessibleTable.idl | 66 ++++++++ .../accessible/public/nsIAccessibleText.idl | 149 ++++++++++++++++++ .../accessible/public/nsIAccessibleValue.idl | 60 +++++++ 8 files changed, 549 insertions(+) create mode 100644 mozilla/accessible/public/nsIAccessibleAction.idl create mode 100644 mozilla/accessible/public/nsIAccessibleEditableText.idl create mode 100644 mozilla/accessible/public/nsIAccessibleHyperLink.idl create mode 100644 mozilla/accessible/public/nsIAccessibleHyperText.idl create mode 100644 mozilla/accessible/public/nsIAccessibleSelection.idl create mode 100644 mozilla/accessible/public/nsIAccessibleTable.idl create mode 100644 mozilla/accessible/public/nsIAccessibleText.idl create mode 100644 mozilla/accessible/public/nsIAccessibleValue.idl diff --git a/mozilla/accessible/public/nsIAccessibleAction.idl b/mozilla/accessible/public/nsIAccessibleAction.idl new file mode 100644 index 00000000000..725bc0312b1 --- /dev/null +++ b/mozilla/accessible/public/nsIAccessibleAction.idl @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Mozilla browser. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Marc Mulcahy (marc.mulcahy@sun.com) + * + * Contributor(s): Paul Sandoz (paul.sandoz@sun.com) + * Bill Haneman (bill.haneman@sun.com) + * John Gaunt (jgaunt@netscape.com) + */ + +#include "nsISupports.idl" + +[scriptable, uuid(829B36D4-125A-4279-ABC4-87D834664F82)] +interface nsIAccessibleAction : nsISupports +{ + readonly attribute long actions; + + boolean doAction (in long index); + + wstring getDescription (in long index); + void getDescriptionConst (in long index, + [shared, retval] out string description); + + wstring getKeyBinding (in long index); + void getKeyBindingConst (in long index, + [shared, retval] out string keyBinding); +}; + +/* + Assumptions: + + string is a UTF-8 or most likely ASCII + encoding. + +*/ diff --git a/mozilla/accessible/public/nsIAccessibleEditableText.idl b/mozilla/accessible/public/nsIAccessibleEditableText.idl new file mode 100644 index 00000000000..531f54e60a7 --- /dev/null +++ b/mozilla/accessible/public/nsIAccessibleEditableText.idl @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Mozilla browser. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Marc Mulcahy (marc.mulcahy@sun.com) + * + * Contributor(s): Paul Sandoz (paul.sandoz@sun.com) + * Bill Haneman (bill.haneman@sun.com) + * John Gaunt (jgaunt@netscape.com) + */ + +#include "nsISupports.idl" + +[scriptable, uuid(91F0A56C-11BE-47C7-8D02-7C15E00C05F5)] +interface nsIAccessibleEditableText : nsISupports +{ + /** + * Set font styles, such as italic, bold... + */ + void setAttributes (in long startPos, in long endPos, + in nsISupports attributes); + boolean setTextContents (in wstring text); + void insertText (in wstring text, in long length, inout long position); + void copyText (in long startPos, in long endPos); + void cutText (in long startPos, in long endPos); + void deleteText (in long startPos, in long endPos); + void pasteText (in long position); +}; + +/* + Assumptions: + + selectAttributes method takes an nsISupports parameter. + 'set' methods throw exception on failure. + 'wstring' inputs are potentially multibyte (UTF-16 for + instance); 'string' and UTF-8 may be a better choice. + +*/ diff --git a/mozilla/accessible/public/nsIAccessibleHyperLink.idl b/mozilla/accessible/public/nsIAccessibleHyperLink.idl new file mode 100644 index 00000000000..0b07f230828 --- /dev/null +++ b/mozilla/accessible/public/nsIAccessibleHyperLink.idl @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Mozilla browser. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Marc Mulcahy (marc.mulcahy@sun.com) + * + * Contributor(s): Bill Haneman (bill.haneman@sun.com) + * John Gaunt (jgaunt@netscape.com) + */ + +#include "nsISupports.idl" +#include "nsIAccessible.idl" + +interface nsIURI; + +[scriptable, uuid(a492c7d6-1dd1-11b2-9bc0-80614884799a)] +interface nsIAccessibleHyperLink : nsISupports +{ + readonly attribute long links; + readonly attribute long getStartIndex; + readonly attribute long getEndIndex; + + nsIURI getURI (in long i); + + nsIAccessible getObject (in long i); + + boolean isValid (); +}; + +/* + Assumptions: + + The object associated with object or anchor index + is an nsIAccessible. + A URI can be represented by the nsIURI interface + (or nsIURL interface). + + Note that an object which supports nsIAccessibleHyperlink + does *not* generally implement nsIAccessible, unlike the + case of the other nsiAccessible* interfaces in this directory. + + Aaron: would the nsISupports return from + getObject be queryable for nsIURI and nsIURL directly? + +*/ diff --git a/mozilla/accessible/public/nsIAccessibleHyperText.idl b/mozilla/accessible/public/nsIAccessibleHyperText.idl new file mode 100644 index 00000000000..6b5338e464a --- /dev/null +++ b/mozilla/accessible/public/nsIAccessibleHyperText.idl @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Mozilla browser. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Marc Mulcahy (marc.mulcahy@sun.com) + * + * Contributor(s): Bill Haneman (bill.haneman@sun.com) + * Paul Sandoz (paul.sandoz@sun.com) + * John Gaunt (jgaunt@netscape.com) + */ + +#include "nsISupports.idl" +#include "nsIAccessibleHyperLink.idl" + +[scriptable, uuid(8f18d922-1dd2-11b2-82ea-829b78a44413)] +interface nsIAccessibleHyperText : nsISupports +{ + readonly attribute long links; + + nsIAccessibleHyperLink getLink (in long index); + + long getLinkIndex (in long charIndex); +}; diff --git a/mozilla/accessible/public/nsIAccessibleSelection.idl b/mozilla/accessible/public/nsIAccessibleSelection.idl new file mode 100644 index 00000000000..c3beb4cd3b1 --- /dev/null +++ b/mozilla/accessible/public/nsIAccessibleSelection.idl @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Mozilla browser. + + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Marc Mulcahy (marc.mulcahy@sun.com) + * + * Contributor(s): Paul Sandoz (paul.sandoz@sun.com) + * Bill Haneman (bill.haneman@sun.com) + * John Gaunt (jgaunt@netscape.com) + */ + + +#include "nsISupports.idl" +#include "nsIAccessible.idl" + +[scriptable, uuid(94A1C5C2-25C2-46B3-BD0C-525D1D3E3346)] +interface nsIAccessibleSelection : nsISupports +{ + /** + * Returns the number of accessible children currently selected. + */ + readonly attribute long selectionCount; + + /** + * Adds the specified accessible child of the object to the + * object's selection. + */ + void addSelection (in long index); + + /** + * Removes the specified child of the object from the object's selection. + */ + void removeSelection (in long index); + + /** + * Clears the selection in the object so that no children in the object + * are selected. + */ + void clearSelection (); + + /** + * Returns a reference to the accessible object representing the specified + * selected child of the object. + */ + nsIAccessible refSelection (in long index); + + /** + * Determines if the current child of this object is selected + */ + boolean isChildSelected (in long index); + + /** + * If the object does not accept multiple selection, return false. + */ + boolean selectAllSelection (); +}; diff --git a/mozilla/accessible/public/nsIAccessibleTable.idl b/mozilla/accessible/public/nsIAccessibleTable.idl new file mode 100644 index 00000000000..d3b3a7ad983 --- /dev/null +++ b/mozilla/accessible/public/nsIAccessibleTable.idl @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Mozilla browser. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Marc Mulcahy (marc.mulcahy@sun.com) + * + * Contributor(s): Paul Sandoz (paul.sandoz@sun.com) + * Bill Haneman (bill.haneman@sun.com) + * John Gaunt (jgaunt@netscape.com) + */ + +#include "nsISupports.idl" +#include "nsIAccessible.idl" + +[scriptable, uuid(0A7E98A9-CA7D-42F0-BFE1-2CFC35256038)] +interface nsIAccessibleTable : nsISupports +{ + attribute nsIAccessible caption; + attribute nsIAccessible summary; + readonly attribute long columns; + readonly attribute nsIAccessibleTable columnHeader; + readonly attribute long rows; + readonly attribute nsIAccessibleTable rowHeader; + + void getSelectedColumns (out unsigned long columnsSize, + [retval, array, size_is(columnsSize)] out long columns); + + void getSelectedRows (out unsigned long rowsSize, + [retval, array, size_is(rowsSize)] out long rows); + + /** + * gets a cell + */ + nsIAccessible cellRefAt (in long row, in long column); + + /** + * get an index + */ + long getIndexAt (in long row, in long column); + long getColumnAtIndex (in long index); + long getRowAtIndex (in long index); + long getColumnExtentAt (in long row, in long column); + long getRowExtentAt (in long row, in long column); + + wstring getColumnDescription (in long column); + wstring getRowDescription (in long row); + + boolean isColumnSelected (in long column); + boolean isRowSelected (in long row); + boolean isCellSelected (in long row, in long column); +}; diff --git a/mozilla/accessible/public/nsIAccessibleText.idl b/mozilla/accessible/public/nsIAccessibleText.idl new file mode 100644 index 00000000000..7728b535388 --- /dev/null +++ b/mozilla/accessible/public/nsIAccessibleText.idl @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Mozilla browser. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Marc Mulcahy (marc.mulcahy@sun.com) + * + * Contributor(s): Paul Sandoz (paul.sandoz@sun.com) + * Bill Haneman (bill.haneman@sun.com) + * John Gaunt (jgaunt@netscape.com) + */ + +#include "nsISupports.idl" + +typedef long nsAccessibleTextBoundary; +typedef long nsAccessibleCoordType; + +[scriptable, uuid(E44D3FA6-9CB2-432A-8BDB-69D72B6ADA00)] +interface nsIAccessibleText : nsISupports +{ + const nsAccessibleTextBoundary BOUNDARY_CHAR = 0; + const nsAccessibleTextBoundary BOUNDARY_WORD_START = 1; + const nsAccessibleTextBoundary BOUNDARY_WORD_END = 2; + const nsAccessibleTextBoundary BOUNDARY_SENTENCE_START = 3; + const nsAccessibleTextBoundary BOUNDARY_SENTENCE_END = 4; + const nsAccessibleTextBoundary BOUNDARY_LINE_START = 5; + const nsAccessibleTextBoundary BOUNDARY_LINE_END = 6; + const nsAccessibleTextBoundary BOUNDARY_ATTRIBUTE_RANGE = 7; + + const nsAccessibleCoordType COORD_TYPE_SCREEN = 0; + const nsAccessibleCoordType COORD_TYPE_WINDOW = 1; + + readonly attribute long caretOffset; + /** + * This needs a return value for success/failure + * Not all text fields may support this + */ + boolean setCaretOffset (in long offset); + + readonly attribute long characterCount; + + /** + * String methods may need to return multibyte-encoded strings, + * since some locales can't be encoded using 16-bit chars. + * So the methods below might return UTF-16 strings, or they could + * return "string" values which are UTF-8. + */ + wstring getText (in long startOffset, in long endOffset); + + wstring getTextAfterOffset (in long offset, + in nsAccessibleTextBoundary boundaryType, + out long startOffset, + out long endOffset); + + wstring getTextAtOffset (in long offset, + in nsAccessibleTextBoundary boundaryType, + out long startOffset, + out long endOffset); + + /** + * It would be better to return an unsigned long here, + * to allow unicode chars > 16 bits + */ + wchar getCharacterAtOffset (in long offset); + + nsISupports getAttributeRange (in long offset, + out long rangeStartOffset, + out long rangeEndOffset); + + wstring getTextBeforeOffset (in long offset, + in nsAccessibleTextBoundary boundaryType, + out long startOffset, + out long endOffset); + + void getCharacterExtents (in long offset, + out long x, + out long y, + out long length, + out long width, + in nsAccessibleCoordType coordType); + + long getOffsetAtPoint (in long x, in long y, + in nsAccessibleCoordType coordType); + + void getSelectionBounds (in long selectionNum, + out long startOffset, + out long endOffset); + + /** + * This needs a return value for success/failure + * Not all text fields may support this + */ + boolean setSelectionBounds (in long selectionNum, + in long startOffset, + in long endOffset); + + /** + * This needs a return value for success/failure + * Not all text fields may support this + */ + boolean addSelection (in long selectionNum, + in long startOffset, + in long endOffset); + + /** + * This needs a return value for success/failure + * Not all text fields may support this + */ + boolean removeSelection (in long selectionNum); +}; + +/* + Assumptions: + + Using wstring (UCS2) instead of string encoded in UTF-8. + Multibyte encodings (or at least potentially multi-byte + encodings) would be preferred for the reasons cited above. + + The following methods will throw an exception + on failure (since not every text component will allow + every operation): + setSelectionBounds, addSelection, removeSelection, + setCaretOffset. + + getRangeAttributes defined to return an nsISupports + interface instead of a pango specific data structure. + It may be that some other return type is more appropriate + for mozilla text attributes. + + we assume that all text components support the idea of + a caret offset, whether visible or "virtual". If this + isn't the case, caretOffset can be made readonly and + a setCaretOffset method provided which throws an exception + on failure (as with *selection methods above). +*/ diff --git a/mozilla/accessible/public/nsIAccessibleValue.idl b/mozilla/accessible/public/nsIAccessibleValue.idl new file mode 100644 index 00000000000..60d9b8dc6b2 --- /dev/null +++ b/mozilla/accessible/public/nsIAccessibleValue.idl @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Mozilla browser. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Marc Mulcahy (marc.mulcahy@sun.com) + * + * Contributor(s): + * John Gaunt (jgaunt@netscape.com) + */ + +#include "nsISupports.idl" + +[scriptable, uuid(F4ABBC2F-0F28-47DC-A9E9-F7A1719AB2BE)] +interface nsIAccessibleValue : nsISupports +{ + readonly attribute double maximumValue; + readonly attribute double minimumValue; + readonly attribute double currentValue; + + /** + * We want to be able to return a success condition of the value + * getting set. ie if the value is not within the interval of + * minimumValue-maximumValue + */ + boolean setCurrentValue (in double value); +}; + +/* + Assumptions: + + The attribute currentValue will throw an exception + if it cannot be set i.e. if the value is not a + member of the interval. + This may not be the 'desired' behaviour given gObject + equivalent. Thus it could be changed to be: + + readonly attribute double currentValue; + boolean setCurrentValue (double long value); + + GValue can represent many basic types. + Since this interface is designed to represent + an interval and a member of double should + cover the cases of char int and float. + +*/