interfaces/CellML_APISPEC.idl Source File

CellML_APISPEC.idl
Go to the documentation of this file.
1 #ifndef INCLUDED_CELLML_APISPEC
2 #define INCLUDED_CELLML_APISPEC
3 
4 #include "xpcom.idl"
5 #include "DOM_APISPEC.idl"
7 
12 module cellml_api
13 {
14  /* Forward definitions... */
15  interface Model;
16  interface Group;
17  interface MapComponents;
18  interface CellMLComponent;
19  interface ImportComponent;
20  interface ImportUnits;
21  interface Units;
22  interface Unit;
23  interface CellMLImport;
24  interface CellMLVariable;
25  interface ComponentRef;
26  interface RelationshipRef;
27  interface Connection;
28  interface MapVariables;
29  interface Reaction;
30  interface ReactionSet;
31  interface VariableRef;
32  interface Role;
33  interface ExtensionElementList;
34  interface ExtensionAttributeSet;
35  interface MathList;
36  interface ModelSet;
37  interface CellMLElementSet;
38  interface CellMLComponentSet;
39  interface ImportComponentSet;
40  interface CellMLVariableSet;
41  interface UnitsSet;
42  interface CellMLImportSet;
43  interface ImportUnitsSet;
44  interface UnitSet;
45  interface ConnectionSet;
46  interface GroupSet;
47  interface RelationshipRefSet;
48  interface ComponentRefSet;
49  interface MapVariablesSet;
50  interface VariableRefSet;
51  interface RoleSet;
52 
54 
62  typedef wstring CellMLAttributeString;
63 
65 
70  {
76  readonly attribute wstring type;
77  };
78 
83  {
92  attribute dom::Document data;
93  };
94 #pragma terminal-interface
95 
100  {
108  attribute wstring serialisedData;
109  };
110 #pragma terminal-interface
111 
119  {
120  };
121 #ifdef USERDATA_NEEDED
122 #pragma every-module
123 #endif
124 #pragma cross-module-inheritance
125 #pragma user-callback
126 
132  {
138  void loadCompleted(in boolean wasStale);
139  };
140 #pragma terminal-interface
141 
147  exception CellMLException{};
148 
153  interface URI : XPCOM::IObject
154  {
158  attribute wstring asText;
159  };
160 #pragma terminal-interface
161 
166  {
172  readonly attribute CellMLAttributeString cellmlVersion;
173 
177  attribute CellMLAttributeString cmetaId;
178 
185 
193  void insertExtensionElementAfter(in ExtensionElement marker, in ExtensionElement newEl);
194 
199  void appendExtensionElement(in ExtensionElement x);
200 
205  void prependExtensionElement(in ExtensionElement x);
206 
212  void removeExtensionElement(in ExtensionElement x);
213 
220  void replaceExtensionElement(in ExtensionElement x, in ExtensionElement y);
221 
225  void clearExtensionElements();
226 
230  readonly attribute CellMLElementSet childElements;
231 
241  void addElement(in CellMLElement x) raises(CellMLException);
242 
247  void removeElement(in CellMLElement x);
248 
257  void replaceElement(in CellMLElement x, in CellMLElement y)
258  raises(CellMLException);
259 
266  void removeByName(in CellMLAttributeString type,
267  in CellMLAttributeString name);
268 
272  readonly attribute CellMLElement parentElement;
273 
277  readonly attribute Model modelElement;
278 
294  void setUserData(in wstring key, in UserData data);
295 
302  UserData getUserData(in wstring key) raises(CellMLException);
303 
311  UserData getUserDataWithDefault(in wstring key, in UserData defval) raises(CellMLException);
312 
313 
321  CellMLElement clone(in boolean deep);
322 
328  wstring getExtensionAttributeNS(in wstring ns, in wstring localName);
329 
337  void setExtensionAttributeNS(in wstring ns, in wstring qualifiedName, in wstring value);
338 
345  void removeExtensionAttributeNS(in wstring ns, in wstring localName);
346 
352  };
353 
363  {
367  readonly attribute dom::Element domElement;
368 
375  CellMLElement findCellMLElementFromDOMElement(in dom::Element x);
376  };
377 
383  : CellMLElement
384  {
388  attribute CellMLAttributeString name;
389  };
390 
394  interface Model
396  {
408  Model getAlternateVersion(in wstring cellmlVersion) raises(CellMLException);
409 
413  readonly attribute GroupSet groups;
414 
418  readonly attribute CellMLImportSet imports;
419 
427  readonly attribute URI base_uri;
428 
432  readonly attribute UnitsSet localUnits;
433 
439  readonly attribute UnitsSet modelUnits;
440 
459  readonly attribute UnitsSet allUnits;
460 
465 
472 
491  readonly attribute CellMLComponentSet allComponents;
492 
496  readonly attribute ConnectionSet connections;
497 
502  GroupSet findGroupsWithRelationshipRefName(in CellMLAttributeString name);
503 
508  void fullyInstantiateImports();
509 
516  void asyncFullyInstantiateImports(in ImportInstantiationListener listener);
517 
521  CellMLComponent createComponent();
522 
526  ImportComponent createImportComponent();
527 
531  Units createUnits();
532 
536  ImportUnits createImportUnits();
537 
541  Unit createUnit();
542 
546  CellMLImport createCellMLImport();
547 
551  CellMLVariable createCellMLVariable();
552 
556  ComponentRef createComponentRef();
557 
561  RelationshipRef createRelationshipRef();
562 
566  Group createGroup();
567 
571  Connection createConnection();
572 
576  MapVariables createMapVariables();
577 
581  Reaction createReaction();
582 
586  VariableRef createVariableRef();
587 
591  Role createRole();
592 
597  mathml_dom::MathMLMathElement createMathElement();
598 
604  dom::Element createExtensionElement(in dom::DOMString namespaceURI,
605  in dom::DOMString qualifiedName);
606 
610  readonly attribute dom::DOMString serialisedText;
611 
612 
627  RDFRepresentation getRDFRepresentation(in wstring type) raises(CellMLException);
628 
629 
635  Model cloneAcrossImports() raises(CellMLException);
636 
642  readonly attribute URI xmlBase;
643 
647  void clearXMLBase();
648  };
649 #pragma terminal-interface
650 #pragma cross-module-argument
651 
653  {
657  readonly attribute MathList math;
658 
664  void addMath(in MathMLElement x) raises(CellMLException);
665 
674  void removeMath(in MathMLElement x) raises(CellMLException);
675 
684  void replaceMath(in MathMLElement x, in MathMLElement y);
685 
689  void clearMath();
690  };
691 
695  interface CellMLComponent
697  {
701  readonly attribute CellMLVariableSet variables;
702 
706  readonly attribute UnitsSet units;
707 
711  readonly attribute ConnectionSet connections;
712 
724 
729 
734  readonly attribute CellMLComponent containmentParent;
735 
741 
745  readonly attribute ReactionSet reactions;
746 
754  readonly attribute unsigned long importNumber;
755  };
756 
757  interface Units
759  {
763  attribute boolean isBaseUnits;
764 
768  readonly attribute UnitSet unitCollection;
769  };
770 
774  interface Unit
775  : CellMLElement
776  {
782  attribute long prefix;
783 
787  attribute double multiplier;
788 
792  attribute double offset;
793 
797  attribute double exponent;
798 
802  attribute CellMLAttributeString units;
803  };
804 #pragma terminal-interface
805 
809  interface CellMLImport
810  : CellMLElement
811  {
822  readonly attribute URI xlinkHref;
823 
827  readonly attribute ImportComponentSet components;
828 
832  readonly attribute ImportUnitsSet units;
833 
840  readonly attribute ConnectionSet importedConnections;
841 
846  void instantiate();
847 
853  void asyncInstantiate(in ImportInstantiationListener listener);
854 
860  void instantiateFromText(in dom::DOMString xmlText)
861  raises(CellMLException);
862 
871  readonly attribute boolean wasInstantiated;
872 
876  readonly attribute unsigned long uniqueIdentifier;
877 
878 
883  readonly attribute Model importedModel;
884 
889  void uninstantiate();
890  };
891 #pragma terminal-interface
892 
902  interface ImportComponent
904  {
908  attribute CellMLAttributeString componentRef;
909  };
910 #pragma terminal-interface
911 
915  interface ImportUnits
916  : Units
917  {
921  attribute CellMLAttributeString unitsRef;
922  };
923 #pragma terminal-interface
924 
929  {
942  };
943 
947  interface CellMLVariable
949  {
955  attribute CellMLAttributeString initialValue;
956 
962  readonly attribute boolean initialValueFromVariable;
963 
973 
979  attribute double initialValueValue;
980 
985 
990 
995 
1009  readonly attribute CellMLVariable sourceVariable;
1010 
1014  readonly attribute CellMLAttributeString componentName;
1015 
1020  attribute CellMLAttributeString unitsName;
1021 
1027  attribute Units unitsElement;
1028  };
1029 #pragma terminal-interface
1030 #pragma cross-module-argument
1031 
1036  interface ComponentRef
1037  : CellMLElement
1038 
1039  {
1043  attribute CellMLAttributeString componentName;
1044 
1049  readonly attribute ComponentRefSet componentRefs;
1050 
1055  readonly attribute ComponentRef parentComponentRef;
1056 
1060  readonly attribute Group parentGroup;
1061  };
1062 #pragma terminal-interface
1063 
1068  : CellMLElement
1069  {
1074  attribute CellMLAttributeString name;
1075 
1079  readonly attribute CellMLAttributeString relationship;
1080 
1084  readonly attribute CellMLAttributeString relationshipNamespace;
1085 
1092  void setRelationshipName(in CellMLAttributeString namespaceURI,
1093  in CellMLAttributeString name);
1094  };
1095 #pragma terminal-interface
1096 
1100  interface Group : CellMLElement
1101  {
1106 
1110  readonly attribute ComponentRefSet componentRefs;
1111 
1117  readonly attribute boolean isEncapsulation;
1118 
1124  readonly attribute boolean isContainment;
1125  };
1126 #pragma terminal-interface
1127 
1131  interface Connection
1132  : CellMLElement
1133  {
1137  readonly attribute MapComponents componentMapping;
1138 
1142  readonly attribute MapVariablesSet variableMappings;
1143  };
1144 #pragma terminal-interface
1145 
1149  interface MapComponents
1150  : CellMLElement
1151  {
1157  attribute CellMLAttributeString firstComponentName;
1158 
1164  attribute CellMLAttributeString secondComponentName;
1165 
1171 
1177  };
1178 #pragma terminal-interface
1179 
1183  interface MapVariables
1184  : CellMLElement
1185  {
1196  attribute CellMLAttributeString firstVariableName;
1197 
1208  attribute CellMLAttributeString secondVariableName;
1209 
1218 
1227  };
1228 #pragma terminal-interface
1229 
1230  interface VariableRef;
1231  interface Role;
1232 
1236  interface Reaction
1237  : CellMLElement
1238  {
1243 
1248  attribute boolean reversible;
1249 
1260  VariableRef getVariableRef(in wstring varName, in boolean create);
1261 
1268  Role getRoleByDeltaVariable(in wstring varName);
1269  };
1270 #pragma terminal-interface
1271 
1275  interface VariableRef
1276  : CellMLElement
1277  {
1283 
1287  attribute wstring variableName;
1288 
1292  readonly attribute RoleSet roles;
1293  };
1294 #pragma terminal-interface
1295 
1299  interface Role
1301  {
1303  {
1304  REACTANT, PRODUCT, RATE, CATALYST, ACTIVATOR, INHIBITOR, MODIFIER
1305  };
1306 
1308  {
1309  FORWARD, REVERSE, BOTH
1310  };
1311 
1316 
1321 
1325  attribute double stoichiometry;
1326 
1331 
1335  attribute wstring deltaVariableName;
1336  };
1337 #pragma terminal-interface
1338 
1343  {
1349  CellMLElement next();
1350  };
1351 
1356  {
1362  MathMLElement next();
1363  };
1364 
1369  {
1373  readonly attribute unsigned long length;
1374 
1380  boolean contains(in ExtensionElement x);
1381 
1388  long getIndexOf(in ExtensionElement x);
1389 
1394  ExtensionElement getAt(in unsigned long index);
1395  };
1396 #pragma terminal-interface
1397 
1402  {
1406  readonly attribute unsigned long length;
1407 
1413  boolean contains(in MathMLElement x);
1414 
1419  MathMLElementIterator iterate();
1420  };
1421 #pragma terminal-interface
1422 
1427  {
1431  dom::Attr nextAttribute();
1432  };
1433 #pragma terminal-interface
1434 
1439  {
1444  ExtensionAttributeIterator iterate();
1445  };
1446 #pragma terminal-interface
1447 
1448 
1453  {
1457  readonly attribute unsigned long length;
1458 
1464  boolean contains(in CellMLElement x);
1465 
1470  CellMLElementIterator iterate();
1471  };
1472 
1479  {
1485  NamedCellMLElement get(in CellMLAttributeString name);
1486  };
1487 
1492  {
1497  Model nextModel();
1498  };
1499 #pragma terminal-interface
1500 
1504  interface ModelSet
1506  {
1511  ModelIterator iterateModels();
1512 
1518  Model getModel(in CellMLAttributeString name);
1519  };
1520 #pragma terminal-interface
1521 
1526  {
1532  CellMLComponent nextComponent();
1533  };
1534 
1540  {
1545  CellMLComponentIterator iterateComponents();
1546 
1552  CellMLComponent getComponent(in CellMLAttributeString name);
1553  };
1554 
1555 
1560  {
1566  ImportComponent nextImportComponent();
1567  };
1568 #pragma terminal-interface
1569 
1575  {
1580  ImportComponentIterator iterateImportComponents();
1581 
1587  ImportComponent getImportComponent(in CellMLAttributeString name);
1588  };
1589 #pragma terminal-interface
1590 
1595  {
1601  CellMLVariable nextVariable();
1602  };
1603 #pragma terminal-interface
1604 
1610  {
1615  CellMLVariableIterator iterateVariables();
1616 
1622  CellMLVariable getVariable(in CellMLAttributeString name);
1623  };
1624 #pragma terminal-interface
1625 
1630  {
1636  Units nextUnits();
1637  };
1638 
1642  interface UnitsSet
1644  {
1649  UnitsIterator iterateUnits();
1650 
1656  Units getUnits(in CellMLAttributeString name);
1657  };
1658 
1663  {
1669  ImportUnits nextImportUnits();
1670  };
1671 #pragma terminal-interface
1672 
1676  interface ImportUnitsSet
1677  : UnitsSet
1678  {
1683  ImportUnitsIterator iterateImportUnits();
1684 
1691  ImportUnits getImportUnits(in CellMLAttributeString name);
1692  };
1693 #pragma terminal-interface
1694 
1699  {
1704  CellMLImport nextImport();
1705  };
1706 #pragma terminal-interface
1707 
1713  {
1718  CellMLImportIterator iterateImports();
1719  };
1720 #pragma terminal-interface
1721 
1726  {
1732  Unit nextUnit();
1733  };
1734 #pragma terminal-interface
1735 
1739  interface UnitSet
1741  {
1746  UnitIterator iterateUnits();
1747  };
1748 #pragma terminal-interface
1749 
1754  {
1760  Connection nextConnection();
1761  };
1762 #pragma terminal-interface
1763 
1767  interface ConnectionSet
1769  {
1774  ConnectionIterator iterateConnections();
1775  };
1776 #pragma terminal-interface
1777 
1782  {
1788  Group nextGroup();
1789  };
1790 #pragma terminal-interface
1791 
1795  interface GroupSet
1797  {
1802  GroupIterator iterateGroups();
1803 
1810  GroupSet getSubsetInvolvingRelationship(in CellMLAttributeString relName);
1811 
1817 
1823  };
1824 #pragma terminal-interface
1825 
1830  {
1836  RelationshipRef nextRelationshipRef();
1837  };
1838 #pragma terminal-interface
1839 
1845  {
1850  RelationshipRefIterator iterateRelationshipRefs();
1851  };
1852 #pragma terminal-interface
1853 
1858  {
1864  ComponentRef nextComponentRef();
1865  };
1866 #pragma terminal-interface
1867 
1873  {
1878  ComponentRefIterator iterateComponentRefs();
1879  };
1880 #pragma terminal-interface
1881 
1886  {
1894  MapVariables nextMapVariable();
1895 
1901  MapVariables nextMapVariables();
1902  };
1903 #pragma terminal-interface
1904 
1910  {
1915  MapVariablesIterator iterateMapVariables();
1916  };
1917 #pragma terminal-interface
1918 
1924  {
1930  Reaction nextReaction();
1931  };
1932 #pragma terminal-interface
1933 
1937  interface ReactionSet
1939  {
1944  ReactionIterator iterateReactions();
1945  };
1946 #pragma terminal-interface
1947 
1952  {
1958  VariableRef nextVariableRef();
1959  };
1960 #pragma terminal-interface
1961 
1965  interface VariableRefSet
1967  {
1972  VariableRefIterator iterateVariableRefs();
1973  };
1974 #pragma terminal-interface
1975 
1980  {
1986  Role nextRole();
1987  };
1988 #pragma terminal-interface
1989 
1993  interface RoleSet
1995  {
2000  RoleIterator iterateRoles();
2001  };
2002 #pragma terminal-interface
2003 
2009  : XPCOM::IObject
2010  {
2015  void loadCompleted(in Model m);
2016  };
2017 #pragma terminal-interface
2018 
2024  : XPCOM::IObject
2025  {
2030  void loadCompleted(in dom::Document doc);
2031  };
2032 #pragma terminal-interface
2033 
2037  interface ModelLoader
2038  : XPCOM::IObject
2039  {
2049  Model loadFromURL(in dom::DOMString URL)
2050  raises(CellMLException);
2051 
2062  void asyncLoadFromURL(in dom::DOMString URL,
2063  in ModelLoadedListener listener);
2064 
2071  Model createFromText(in dom::DOMString xmlText)
2072  raises(CellMLException);
2073 
2088  readonly attribute dom::DOMString lastErrorMessage;
2089  };
2090 
2094  interface DOMURLLoader
2095  : XPCOM::IObject
2096  {
2105  dom::Document loadDocument(in dom::DOMString URL)
2106  raises(CellMLException);
2107 
2115  dom::Document loadDocumentFromText(in dom::DOMString xmlText)
2116  raises(CellMLException);
2117 
2126  void asyncLoadDocument(in dom::DOMString URL,
2127  in DocumentLoadedListener listener)
2128  raises(CellMLException);
2129 
2147  readonly attribute dom::DOMString lastErrorMessage;
2148  };
2149 #pragma terminal-interface
2150 
2154  interface DOMModelLoader
2155  : ModelLoader
2156  {
2167  Model createFromDOM(in dom::DOMString url, in DOMURLLoader loader)
2168  raises(CellMLException);
2169 
2177  Model createFromDOMDocument(in dom::Document doc)
2178  raises(CellMLException);
2179 
2190  void asyncCreateFromDOM(in dom::DOMString url, in DOMURLLoader loader,
2191  in ModelLoadedListener listener)
2192  raises(CellMLException);
2193  };
2194 #pragma terminal-interface
2195 
2201  : XPCOM::IObject
2202  {
2206  readonly attribute DOMModelLoader modelLoader;
2207 
2213 
2218  readonly attribute DOMURLLoader localURLLoader;
2219 
2225  Model createModel(in wstring version);
2226 
2233  dom::DOMString serialiseNode(in dom::Node node);
2234 
2242  wstring makeURLAbsolute(in wstring relTo, in wstring relURL);
2243  };
2244 #pragma terminal-interface
2245 #pragma cross-module-argument
2246 };
2247 
2248 #endif // INCLUDED_CELLML_APISPEC
2249 
Back to Top