Remove more JSLib cruft.
1 #include "nsISupports.idl"
2 #include "nsIVariant.idl"
5 The 2-D array works like this: array[row][column] = nsISupports.
13 To build this, you would call:
14 array.insertRow(0, 3, [a, b, c]);
15 array.insertRow(1, 3, [d, e, f]);
16 array.insertRow(2, 3, [g, h, i]);
18 To get row 1 ([d, e, f]), you would call:
19 var row = array.getRow(1, {});
21 To get column 2 ([c, f, i]), you would call:
22 var col = array.getColumn(2, {});
24 To get the item at row 2, column 0 (g), you could call:
25 var cell = array.getCell(2, 0);
28 [scriptable, uuid(a4caa627-27d8-46c3-a807-0bdc52642efb)]
29 interface nsIDataMatrix : nsISupports
31 readonly attribute PRUint32 rowCount;
32 readonly attribute PRUint32 columnCount;
34 void getRow(in PRUint32 rowNumber,
35 out PRUint32 columnCount,
36 [array, size_is(columnCount), retval] out nsISupports columns);
37 void getColumn(in PRUint32 columnNumber,
38 out PRUint32 rowCount,
39 [array, size_is(rowCount), retval] out nsISupports rows);
40 nsISupports getCell(in PRUint32 rowNumber,
41 in PRUint32 columnNumber);
44 [scriptable, uuid(7bb1f91f-9bf5-4da5-842d-ba01b8fba105)]
45 interface nsIWritableDataMatrix : nsIDataMatrix
47 void insertRow(in PRUint32 rowNumber,
48 in PRUint32 columnCount,
49 [array, size_is(columnCount)] in nsISupports columns);
50 void deleteRow(in PRUint32 rowNumber);
51 void replaceRow(in PRUint32 rowNumber,
52 in PRUint32 columnCount,
53 [array, size_is(columnCount)] in nsISupports columns);
55 void insertColumn(in PRUint32 columnNumber,
57 [array, size_is(rowCount)] in nsISupports rows);
58 void deleteColumn(in PRUint32 columnNumber);
59 void replaceColumn(in PRUint32 columnNumber,
61 [array, size_is(rowCount)] in nsISupports rows);
63 void setCell(in PRUint32 rowNumber,
64 in PRUint32 columnNumber,
65 in nsISupports cellValue);
70 // nsIVariant version of nsIDataMatrix
71 [scriptable, uuid(b4d7fad4-3130-46ca-8d6b-27cf44d2a2a8)]
72 interface nsIVariantMatrix : nsISupports
74 readonly attribute PRUint32 rowCount;
75 readonly attribute PRUint32 columnCount;
77 void getRow(in PRUint32 rowNumber,
78 out PRUint32 columnCount,
79 [array, size_is(columnCount), retval] out nsIVariant columns);
80 void getColumn(in PRUint32 columnNumber,
81 out PRUint32 rowCount,
82 [array, size_is(rowCount), retval] out nsIVariant rows);
83 nsIVariant getCell(in PRUint32 rowNumber,
84 in PRUint32 columnNumber);
87 // nsIVariant version of nsIWritableDataMatrix
88 [scriptable, uuid(4671b193-9340-41f7-b7bc-3127b0d40b99)]
89 interface nsIWritableVariantMatrix : nsIVariantMatrix
91 void insertRow(in PRUint32 rowNumber,
92 in PRUint32 columnCount,
93 [array, size_is(columnCount)] in nsIVariant columns);
94 void deleteRow(in PRUint32 rowNumber);
95 void replaceRow(in PRUint32 rowNumber,
96 in PRUint32 columnCount,
97 [array, size_is(columnCount)] in nsIVariant columns);
99 void insertColumn(in PRUint32 columnNumber,
100 in PRUint32 rowCount,
101 [array, size_is(rowCount)] in nsIVariant rows);
102 void deleteColumn(in PRUint32 columnNumber);
103 void replaceColumn(in PRUint32 columnNumber,
104 in PRUint32 rowCount,
105 [array, size_is(rowCount)] in nsIVariant rows);
107 void setCell(in PRUint32 rowNumber,
108 in PRUint32 columnNumber,
109 in nsIVariant cellValue);