nsIRDFObserver.idl 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsISupports.idl"
  6. #include "nsIRDFResource.idl"
  7. #include "nsIRDFNode.idl"
  8. interface nsIRDFDataSource;
  9. // An nsIRDFObserver object is an observer that will be notified
  10. // when assertions are made or removed from a datasource
  11. [scriptable, uuid(3CC75360-484A-11D2-BC16-00805F912FE7)]
  12. interface nsIRDFObserver : nsISupports {
  13. /**
  14. * This method is called whenever a new assertion is made
  15. * in the data source
  16. * @param aDataSource the datasource that is issuing
  17. * the notification.
  18. * @param aSource the subject of the assertion
  19. * @param aProperty the predicate of the assertion
  20. * @param aTarget the object of the assertion
  21. */
  22. void onAssert(in nsIRDFDataSource aDataSource,
  23. in nsIRDFResource aSource,
  24. in nsIRDFResource aProperty,
  25. in nsIRDFNode aTarget);
  26. /**
  27. * This method is called whenever an assertion is removed
  28. * from the data source
  29. * @param aDataSource the datasource that is issuing
  30. * the notification.
  31. * @param aSource the subject of the assertion
  32. * @param aProperty the predicate of the assertion
  33. * @param aTarget the object of the assertion
  34. */
  35. void onUnassert(in nsIRDFDataSource aDataSource,
  36. in nsIRDFResource aSource,
  37. in nsIRDFResource aProperty,
  38. in nsIRDFNode aTarget);
  39. /**
  40. * This method is called when the object of an assertion
  41. * changes from one value to another.
  42. * @param aDataSource the datasource that is issuing
  43. * the notification.
  44. * @param aSource the subject of the assertion
  45. * @param aProperty the predicate of the assertion
  46. * @param aOldTarget the old object of the assertion
  47. * @param aNewTarget the new object of the assertion
  48. */
  49. void onChange(in nsIRDFDataSource aDataSource,
  50. in nsIRDFResource aSource,
  51. in nsIRDFResource aProperty,
  52. in nsIRDFNode aOldTarget,
  53. in nsIRDFNode aNewTarget);
  54. /**
  55. * This method is called when the subject of an assertion
  56. * changes from one value to another.
  57. * @param aDataSource the datasource that is issuing
  58. * the notification.
  59. * @param aOldSource the old subject of the assertion
  60. * @param aNewSource the new subject of the assertion
  61. * @param aProperty the predicate of the assertion
  62. * @param aTarget the object of the assertion
  63. */
  64. void onMove(in nsIRDFDataSource aDataSource,
  65. in nsIRDFResource aOldSource,
  66. in nsIRDFResource aNewSource,
  67. in nsIRDFResource aProperty,
  68. in nsIRDFNode aTarget);
  69. /**
  70. * This method is called when a datasource is about to
  71. * send several notifications at once. The observer can
  72. * use this as a cue to optimize its behavior. The observer
  73. * can expect the datasource to call endUpdateBatch() when
  74. * the group of notifications has completed.
  75. * @param aDataSource the datasource that is going to
  76. * be issuing the notifications.
  77. */
  78. void onBeginUpdateBatch(in nsIRDFDataSource aDataSource);
  79. /**
  80. * This method is called when a datasource has completed
  81. * issuing a notification group.
  82. * @param aDataSource the datasource that has finished
  83. * issuing a group of notifications
  84. */
  85. void onEndUpdateBatch(in nsIRDFDataSource aDataSource);
  86. };