michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "nsIRDFResource.idl" michael@0: #include "nsIRDFNode.idl" michael@0: michael@0: interface nsIRDFDataSource; michael@0: michael@0: // An nsIRDFObserver object is an observer that will be notified michael@0: // when assertions are made or removed from a datasource michael@0: [scriptable, uuid(3CC75360-484A-11D2-BC16-00805F912FE7)] michael@0: interface nsIRDFObserver : nsISupports { michael@0: /** michael@0: * This method is called whenever a new assertion is made michael@0: * in the data source michael@0: * @param aDataSource the datasource that is issuing michael@0: * the notification. michael@0: * @param aSource the subject of the assertion michael@0: * @param aProperty the predicate of the assertion michael@0: * @param aTarget the object of the assertion michael@0: */ michael@0: void onAssert(in nsIRDFDataSource aDataSource, michael@0: in nsIRDFResource aSource, michael@0: in nsIRDFResource aProperty, michael@0: in nsIRDFNode aTarget); michael@0: michael@0: /** michael@0: * This method is called whenever an assertion is removed michael@0: * from the data source michael@0: * @param aDataSource the datasource that is issuing michael@0: * the notification. michael@0: * @param aSource the subject of the assertion michael@0: * @param aProperty the predicate of the assertion michael@0: * @param aTarget the object of the assertion michael@0: */ michael@0: void onUnassert(in nsIRDFDataSource aDataSource, michael@0: in nsIRDFResource aSource, michael@0: in nsIRDFResource aProperty, michael@0: in nsIRDFNode aTarget); michael@0: michael@0: /** michael@0: * This method is called when the object of an assertion michael@0: * changes from one value to another. michael@0: * @param aDataSource the datasource that is issuing michael@0: * the notification. michael@0: * @param aSource the subject of the assertion michael@0: * @param aProperty the predicate of the assertion michael@0: * @param aOldTarget the old object of the assertion michael@0: * @param aNewTarget the new object of the assertion michael@0: */ michael@0: void onChange(in nsIRDFDataSource aDataSource, michael@0: in nsIRDFResource aSource, michael@0: in nsIRDFResource aProperty, michael@0: in nsIRDFNode aOldTarget, michael@0: in nsIRDFNode aNewTarget); michael@0: michael@0: /** michael@0: * This method is called when the subject of an assertion michael@0: * changes from one value to another. michael@0: * @param aDataSource the datasource that is issuing michael@0: * the notification. michael@0: * @param aOldSource the old subject of the assertion michael@0: * @param aNewSource the new subject of the assertion michael@0: * @param aProperty the predicate of the assertion michael@0: * @param aTarget the object of the assertion michael@0: */ michael@0: void onMove(in nsIRDFDataSource aDataSource, michael@0: in nsIRDFResource aOldSource, michael@0: in nsIRDFResource aNewSource, michael@0: in nsIRDFResource aProperty, michael@0: in nsIRDFNode aTarget); michael@0: michael@0: /** michael@0: * This method is called when a datasource is about to michael@0: * send several notifications at once. The observer can michael@0: * use this as a cue to optimize its behavior. The observer michael@0: * can expect the datasource to call endUpdateBatch() when michael@0: * the group of notifications has completed. michael@0: * @param aDataSource the datasource that is going to michael@0: * be issuing the notifications. michael@0: */ michael@0: void onBeginUpdateBatch(in nsIRDFDataSource aDataSource); michael@0: michael@0: /** michael@0: * This method is called when a datasource has completed michael@0: * issuing a notification group. michael@0: * @param aDataSource the datasource that has finished michael@0: * issuing a group of notifications michael@0: */ michael@0: void onEndUpdateBatch(in nsIRDFDataSource aDataSource); michael@0: };