1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
40 Interfaces for the RDF/XML sink, which parses RDF/XML into
41 a graph representation.
45 #include
"nsISupports.idl"
47 // XXX Until these get scriptable. See nsIRDFXMLSink::AddNameSpace()
48 [ptr] native nsIAtomPtr
(nsIAtom
);
49 [ref] native nsStringRef
(nsString
);
55 interface nsIRDFXMLSink
;
58 * An observer that is notified as progress is made on the load
59 * of an RDF/XML document in an <code>nsIRDFXMLSink</code>.
61 [scriptable
, uuid(EB1A5D30
-AB33
-11D2
-8EC6
-00805F29F370
)]
62 interface nsIRDFXMLSinkObserver
: nsISupports
65 * Called when the load begins.
66 * @param aSink the RDF/XML sink on which the load is beginning.
68 void onBeginLoad
(in nsIRDFXMLSink aSink
);
71 * Called when the load is suspended (e.g., for network quantization).
72 * @param aSink the RDF/XML sink that is being interrupted.
74 void onInterrupt
(in nsIRDFXMLSink aSink
);
77 * Called when a suspended load is resuming.
78 * @param aSink the RDF/XML sink that is resuming.
80 void onResume
(in nsIRDFXMLSink aSink
);
83 * Called when an RDF/XML load completes successfully.
84 * @param aSink the RDF/XML sink that has finished loading.
86 void onEndLoad
(in nsIRDFXMLSink aSink
);
89 * Called when an error occurs during the load
90 * @param aSink the RDF/XML sink in which the error occurred
91 * @param aStatus the networking result code
92 * @param aErrorMsg an error message, if applicable
94 void onError
(in nsIRDFXMLSink aSink
, in nsresult aStatus
, in wstring aErrorMsg
);
100 * A "sink" that receives and processes RDF/XML. This interface is used
101 * by the RDF/XML parser.
103 [scriptable
, uuid(EB1A5D31
-AB33
-11D2
-8EC6
-00805F29F370
)]
104 interface nsIRDFXMLSink
: nsISupports
107 * Set to <code>true</code> if the sink is read-only and cannot
110 attribute
boolean readOnly;
113 * Initiate the RDF/XML load.
118 * Suspend the RDF/XML load.
123 * Resume the RDF/XML load.
128 * Complete the RDF/XML load.
133 * Add namespace information to the RDF/XML sink.
134 * @param aPrefix the namespace prefix
135 * @param aURI the namespace URI
137 [noscript
] void addNameSpace
(in nsIAtomPtr aPrefix
,
138 [const] in nsStringRef aURI
);
141 * Add an observer that will be notified as the RDF/XML load
145 * Note that the sink will acquire a strong reference to the
146 * observer, so care should be taken to avoid cyclical references
147 * that cannot be released (i.e., if the observer holds a
148 * reference to the sink, it should be sure that it eventually
149 * clears the reference).
151 * @param aObserver the observer to add to the sink's set of
154 void addXMLSinkObserver
(in nsIRDFXMLSinkObserver aObserver
);
157 * Remove an observer from the sink's set of observers.
158 * @param aObserver the observer to remove.
160 void removeXMLSinkObserver
(in nsIRDFXMLSinkObserver aObserver
);