rdf/base/idl/nsIRDFObserver.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial