1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
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/
9 *
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
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is Robert Sayre.
18 *
19 * Portions created by the Initial Developer are Copyright (C) 2005
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * 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.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38 #include "nsISupports.idl"
39 #include "nsISAXAttributes.idl"
40
41 /**
42 * This interface extends the nsISAXAttributes interface with
43 * manipulators so that the list can be modified or reused.
44 */
45 [scriptable, uuid(8b1de83d-cebb-49fa-8245-c0fe319eb7b6)]
46 interface nsISAXMutableAttributes : nsISAXAttributes {
47
48 /**
49 * Add an attribute to the end of the list.
50 *
51 * For the sake of speed, this method does no checking
52 * to see if the attribute is already in the list: that is
53 * the responsibility of the application.
54 *
55 * @param uri The Namespace URI, or the empty string if
56 * none is available or Namespace processing is not
57 * being performed.
58 * @param localName The local name, or the empty string if
59 * Namespace processing is not being performed.
60 * @param qName The qualified (prefixed) name, or the empty string
61 * if qualified names are not available.
62 * @param type The attribute type as a string.
63 * @param value The attribute value.
64 */
65 void addAttribute(in AString uri,
66 in AString localName,
67 in AString qName,
68 in AString type,
69 in AString value);
70
71 /**
72 * Clear the attribute list for reuse.
73 */
74 void clear();
75
76 /**
77 * Remove an attribute from the list.
78 *
79 * @param index The index of the attribute (zero-based).
80 */
81 void removeAttribute(in unsigned long index);
82
83 /**
84 * Set the attributes list. This method will clear any attributes in
85 * the list before adding the attributes from the argument.
86 *
87 * @param attributes The attributes object to replace populate the
88 * list with.
89 */
90 void setAttributes(in nsISAXAttributes attributes);
91
92 /**
93 * Set an attribute in the list.
94 *
95 * For the sake of speed, this method does no checking for name
96 * conflicts or well-formedness: such checks are the responsibility
97 * of the application.
98 *
99 * @param index The index of the attribute (zero-based).
100 * @param uri The Namespace URI, or the empty string if
101 * none is available or Namespace processing is not
102 * being performed.
103 * @param localName The local name, or the empty string if
104 * Namespace processing is not being performed.
105 * @param qName The qualified name, or the empty string
106 * if qualified names are not available.
107 * @param type The attribute type as a string.
108 * @param value The attribute value.
109 */
110 void setAttribute(in unsigned long index,
111 in AString uri,
112 in AString localName,
113 in AString qName,
114 in AString type,
115 in AString value);
116
117 /**
118 * Set the local name of a specific attribute.
119 *
120 * @param index The index of the attribute (zero-based).
121 * @param localName The attribute's local name, or the empty
122 * string for none.
123 */
124 void setLocalName(in unsigned long index, in AString localName);
125
126 /**
127 * Set the qualified name of a specific attribute.
128 *
129 * @param index The index of the attribute (zero-based).
130 * @param qName The attribute's qualified name, or the empty
131 * string for none.
132 */
133 void setQName(in unsigned long index, in AString qName);
134
135 /**
136 * Set the type of a specific attribute.
137 *
138 * @param index The index of the attribute (zero-based).
139 * @param type The attribute's type.
140 */
141 void setType(in unsigned long index, in AString type);
142
143 /**
144 * Set the Namespace URI of a specific attribute.
145 *
146 * @param index The index of the attribute (zero-based).
147 * @param uri The attribute's Namespace URI, or the empty
148 * string for none.
149 */
150 void setURI(in unsigned long index, in AString uri);
151
152 /**
153 * Set the value of a specific attribute.
154 *
155 * @param index The index of the attribute (zero-based).
156 * @param value The attribute's value.
157 */
158 void setValue(in unsigned long index, in AString value);
159 };