Mozdev
mozilla/verbosio/datatypes/nsIDataMatrix.idl
author Alex Vincent@SKYFIREDEMO1
Mon Oct 20 22:25:52 2008 -0700 (15 months ago)
changeset 46 9db1ccb62e4d
parent 313c08ad38a682
permissions -rw-r--r--
Remove more JSLib cruft.
     1 #include "nsISupports.idl"
     2 #include "nsIVariant.idl"
     3 
     4 /*
     5 The 2-D array works like this:  array[row][column] = nsISupports.
     6 
     7 [
     8   [a, b, c],
     9   [d, e, f],
    10   [g, h, i]
    11 ];
    12 
    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]);
    17 
    18 To get row 1 ([d, e, f]), you would call:
    19 var row = array.getRow(1, {});
    20 
    21 To get column 2 ([c, f, i]), you would call:
    22 var col = array.getColumn(2, {});
    23 
    24 To get the item at row 2, column 0 (g), you could call:
    25 var cell = array.getCell(2, 0);
    26 */
    27 
    28 [scriptable, uuid(a4caa627-27d8-46c3-a807-0bdc52642efb)]
    29 interface nsIDataMatrix : nsISupports
    30 {
    31   readonly attribute PRUint32 rowCount;
    32   readonly attribute PRUint32 columnCount;
    33 
    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);
    42 };
    43 
    44 [scriptable, uuid(7bb1f91f-9bf5-4da5-842d-ba01b8fba105)]
    45 interface nsIWritableDataMatrix : nsIDataMatrix
    46 {
    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);
    54 
    55   void insertColumn(in PRUint32 columnNumber,
    56                     in PRUint32 rowCount,
    57                     [array, size_is(rowCount)] in nsISupports rows);
    58   void deleteColumn(in PRUint32 columnNumber);
    59   void replaceColumn(in PRUint32 columnNumber,
    60                      in PRUint32 rowCount,
    61                      [array, size_is(rowCount)] in nsISupports rows);
    62 
    63   void setCell(in PRUint32 rowNumber,
    64                in PRUint32 columnNumber,
    65                in nsISupports cellValue);
    66 
    67   void clear();
    68 };
    69 
    70 // nsIVariant version of nsIDataMatrix
    71 [scriptable, uuid(b4d7fad4-3130-46ca-8d6b-27cf44d2a2a8)]
    72 interface nsIVariantMatrix : nsISupports
    73 {
    74   readonly attribute PRUint32 rowCount;
    75   readonly attribute PRUint32 columnCount;
    76 
    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);  
    85 };
    86 
    87 // nsIVariant version of nsIWritableDataMatrix
    88 [scriptable, uuid(4671b193-9340-41f7-b7bc-3127b0d40b99)]
    89 interface nsIWritableVariantMatrix : nsIVariantMatrix
    90 {
    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);
    98 
    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);
   106 
   107   void setCell(in PRUint32 rowNumber,
   108                in PRUint32 columnNumber,
   109                in nsIVariant cellValue);
   110 
   111   void clear();
   112 };