Bumping manifests a=b2g-bump
[gecko.git] / rdf / base / nsIRDFXMLSink.idl
blob8c9d9461c5f5b870bfa47dd5342d70207b9c140e
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/. */
6 /*
8 Interfaces for the RDF/XML sink, which parses RDF/XML into
9 a graph representation.
13 #include "nsISupports.idl"
15 // XXX Until these get scriptable. See nsIRDFXMLSink::AddNameSpace()
16 [ptr] native nsIAtomPtr(nsIAtom);
17 [ref] native nsStringRef(nsString);
18 %{C++
19 class nsIAtom;
20 class nsString;
23 interface nsIRDFXMLSink;
25 /**
26 * An observer that is notified as progress is made on the load
27 * of an RDF/XML document in an <code>nsIRDFXMLSink</code>.
29 [scriptable, uuid(EB1A5D30-AB33-11D2-8EC6-00805F29F370)]
30 interface nsIRDFXMLSinkObserver : nsISupports
32 /**
33 * Called when the load begins.
34 * @param aSink the RDF/XML sink on which the load is beginning.
36 void onBeginLoad(in nsIRDFXMLSink aSink);
38 /**
39 * Called when the load is suspended (e.g., for network quantization).
40 * @param aSink the RDF/XML sink that is being interrupted.
42 void onInterrupt(in nsIRDFXMLSink aSink);
44 /**
45 * Called when a suspended load is resuming.
46 * @param aSink the RDF/XML sink that is resuming.
48 void onResume(in nsIRDFXMLSink aSink);
50 /**
51 * Called when an RDF/XML load completes successfully.
52 * @param aSink the RDF/XML sink that has finished loading.
54 void onEndLoad(in nsIRDFXMLSink aSink);
56 /**
57 * Called when an error occurs during the load
58 * @param aSink the RDF/XML sink in which the error occurred
59 * @param aStatus the networking result code
60 * @param aErrorMsg an error message, if applicable
62 void onError(in nsIRDFXMLSink aSink, in nsresult aStatus, in wstring aErrorMsg);
67 /**
68 * A "sink" that receives and processes RDF/XML. This interface is used
69 * by the RDF/XML parser.
71 [scriptable, uuid(EB1A5D31-AB33-11D2-8EC6-00805F29F370)]
72 interface nsIRDFXMLSink : nsISupports
74 /**
75 * Set to <code>true</code> if the sink is read-only and cannot
76 * be modified
78 attribute boolean readOnly;
80 /**
81 * Initiate the RDF/XML load.
83 void beginLoad();
85 /**
86 * Suspend the RDF/XML load.
88 void interrupt();
90 /**
91 * Resume the RDF/XML load.
93 void resume();
95 /**
96 * Complete the RDF/XML load.
98 void endLoad();
101 * Add namespace information to the RDF/XML sink.
102 * @param aPrefix the namespace prefix
103 * @param aURI the namespace URI
105 [noscript] void addNameSpace(in nsIAtomPtr aPrefix,
106 [const] in nsStringRef aURI);
109 * Add an observer that will be notified as the RDF/XML load
110 * progresses.
111 * <p>
113 * Note that the sink will acquire a strong reference to the
114 * observer, so care should be taken to avoid cyclical references
115 * that cannot be released (i.e., if the observer holds a
116 * reference to the sink, it should be sure that it eventually
117 * clears the reference).
119 * @param aObserver the observer to add to the sink's set of
120 * load observers.
122 void addXMLSinkObserver(in nsIRDFXMLSinkObserver aObserver);
125 * Remove an observer from the sink's set of observers.
126 * @param aObserver the observer to remove.
128 void removeXMLSinkObserver(in nsIRDFXMLSinkObserver aObserver);