1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/rdf/base/idl/nsIRDFObserver.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,94 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 +#include "nsIRDFResource.idl" 1.11 +#include "nsIRDFNode.idl" 1.12 + 1.13 +interface nsIRDFDataSource; 1.14 + 1.15 +// An nsIRDFObserver object is an observer that will be notified 1.16 +// when assertions are made or removed from a datasource 1.17 +[scriptable, uuid(3CC75360-484A-11D2-BC16-00805F912FE7)] 1.18 +interface nsIRDFObserver : nsISupports { 1.19 + /** 1.20 + * This method is called whenever a new assertion is made 1.21 + * in the data source 1.22 + * @param aDataSource the datasource that is issuing 1.23 + * the notification. 1.24 + * @param aSource the subject of the assertion 1.25 + * @param aProperty the predicate of the assertion 1.26 + * @param aTarget the object of the assertion 1.27 + */ 1.28 + void onAssert(in nsIRDFDataSource aDataSource, 1.29 + in nsIRDFResource aSource, 1.30 + in nsIRDFResource aProperty, 1.31 + in nsIRDFNode aTarget); 1.32 + 1.33 + /** 1.34 + * This method is called whenever an assertion is removed 1.35 + * from the data source 1.36 + * @param aDataSource the datasource that is issuing 1.37 + * the notification. 1.38 + * @param aSource the subject of the assertion 1.39 + * @param aProperty the predicate of the assertion 1.40 + * @param aTarget the object of the assertion 1.41 + */ 1.42 + void onUnassert(in nsIRDFDataSource aDataSource, 1.43 + in nsIRDFResource aSource, 1.44 + in nsIRDFResource aProperty, 1.45 + in nsIRDFNode aTarget); 1.46 + 1.47 + /** 1.48 + * This method is called when the object of an assertion 1.49 + * changes from one value to another. 1.50 + * @param aDataSource the datasource that is issuing 1.51 + * the notification. 1.52 + * @param aSource the subject of the assertion 1.53 + * @param aProperty the predicate of the assertion 1.54 + * @param aOldTarget the old object of the assertion 1.55 + * @param aNewTarget the new object of the assertion 1.56 + */ 1.57 + void onChange(in nsIRDFDataSource aDataSource, 1.58 + in nsIRDFResource aSource, 1.59 + in nsIRDFResource aProperty, 1.60 + in nsIRDFNode aOldTarget, 1.61 + in nsIRDFNode aNewTarget); 1.62 + 1.63 + /** 1.64 + * This method is called when the subject of an assertion 1.65 + * changes from one value to another. 1.66 + * @param aDataSource the datasource that is issuing 1.67 + * the notification. 1.68 + * @param aOldSource the old subject of the assertion 1.69 + * @param aNewSource the new subject of the assertion 1.70 + * @param aProperty the predicate of the assertion 1.71 + * @param aTarget the object of the assertion 1.72 + */ 1.73 + void onMove(in nsIRDFDataSource aDataSource, 1.74 + in nsIRDFResource aOldSource, 1.75 + in nsIRDFResource aNewSource, 1.76 + in nsIRDFResource aProperty, 1.77 + in nsIRDFNode aTarget); 1.78 + 1.79 + /** 1.80 + * This method is called when a datasource is about to 1.81 + * send several notifications at once. The observer can 1.82 + * use this as a cue to optimize its behavior. The observer 1.83 + * can expect the datasource to call endUpdateBatch() when 1.84 + * the group of notifications has completed. 1.85 + * @param aDataSource the datasource that is going to 1.86 + * be issuing the notifications. 1.87 + */ 1.88 + void onBeginUpdateBatch(in nsIRDFDataSource aDataSource); 1.89 + 1.90 + /** 1.91 + * This method is called when a datasource has completed 1.92 + * issuing a notification group. 1.93 + * @param aDataSource the datasource that has finished 1.94 + * issuing a group of notifications 1.95 + */ 1.96 + void onEndUpdateBatch(in nsIRDFDataSource aDataSource); 1.97 +};