/* vim: ts=2 sw=2 expandtab
 * BEGIN FLOCK GPL
 *
 * Copyright Flock Inc. 2005-2009
 * http://flock.com
 *
 * This file may be used under the terms of the
 * GNU General Public License Version 2 or later (the "GPL"),
 * http://www.gnu.org/licenses/gpl.html
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * END FLOCK GPL
 */

#include "nsISupports.idl"
#include "nsIRDFDataSource.idl"
#include "nsIRDFNode.idl"
#include "nsIRDFResource.idl"

[scriptable, uuid(4b06085e-d521-4af5-8085-66a288c5220b)]
interface flockIRDFObserver : nsISupports
{
  const PRUint16 TYPE_ASSERT = 1;
  const PRUint16 TYPE_UNASSERT = 2;
  const PRUint16 TYPE_MOVE = 4;
  const PRUint16 TYPE_CHANGE = 8;
  const PRUint16 TYPE_ASSERT_PARENT = 16;
  const PRUint16 TYPE_UNASSERT_PARENT = 32;

  const PRUint16 TYPE_ALL = (TYPE_ASSERT | TYPE_UNASSERT |
                             TYPE_MOVE | TYPE_CHANGE |
                             TYPE_ASSERT_PARENT | TYPE_UNASSERT_PARENT);

  const PRUint16 WATCH_TYPES = (TYPE_ASSERT | TYPE_CHANGE);

  void rdfChanged (in nsIRDFDataSource aDataSource, in PRUint16 aType,
                   in nsIRDFResource aSubject, in nsIRDFResource aPredicate,
                   in nsIRDFNode aNewObject, in nsIRDFNode aOldObject);
};

[scriptable, uuid(93c84f4d-f854-4e84-8fa8-606ff5d904e6)]
interface flockIRDFObservable : nsISupports
{
  void addArcObserver (in PRUint16 aType, in nsIRDFResource aSubject,
                       in nsIRDFResource aPredicate, in nsIRDFNode aObject,
                       in flockIRDFObserver aObserver);
  void removeArcObserver (in PRUint16 aType, in nsIRDFResource aSubject,
                          in nsIRDFResource aPredicate, in nsIRDFNode aObject,
                          in flockIRDFObserver aObserver);
};

