001package org.apache.maven.doxia.sink;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *   http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import javax.swing.text.MutableAttributeSet;
023
024/**
025 * A set of attributes for a sink event.
026 * <p>
027 * All sink methods that produce some presentation-level output should have at least
028 * one form that allows to pass in a Set of SinkEventAttributes. For instance in
029 * </p>
030 * <pre>void text( String text, SinkEventAttributes attributes );</pre>
031 * <p>
032 * the <code>attributes</code> parameter can be used to specify some text styling
033 * options, or other optional parameters.
034 * </p>
035 * <p>
036 * What kind of attributes are supported depends on the event and the sink
037 * implementation. The sink API just specifies a list of suggested attribute
038 * names, that sinks are expected to recognize, and parsers are expected to use
039 * preferably when emitting events.
040 * </p>
041 * <p>
042 * It is recommended that for simple attributes, both keys and values should be
043 * lower-case Strings, but this is not mandatory. One example of an exception is
044 * the {@link #STYLE} attribute, whose value may itself be an AttributeSet again.
045 * </p>
046 * <p>
047 * The <b>base attributes</b> that are supported by almost all events are
048 * {@link #CLASS}, {@link #ID}, {@link #LANG}, {@link #STYLE} and {@link #TITLE}.
049 * </p>
050 *
051 * @author ltheussl
052 * @since 1.1
053 */
054@SuppressWarnings( "checkstyle:interfaceistype" )
055public interface SinkEventAttributes
056    extends MutableAttributeSet
057{
058    // base
059
060    /**
061     * The class of the event element.
062     */
063    String CLASS = "class";
064
065    /**
066     * A unique id for the event element.
067     */
068    String ID = "id";
069
070    /**
071     * The language code for the event element.
072     */
073    String LANG = "lang";
074
075    /**
076     * An inline style definition.
077     *
078     * <p>
079     *   Generally supported values are "italic", "bold", "monospaced" and AttributeSets.
080     * </p>
081     * <p>
082     *   If the value of this Attribute is itself an AttributeSet, it is interpreted as a
083     *   sequence of CSS properties. For instance, the HTML paragraph opening
084     * </p>
085     * <pre>
086     *   &lt;p style="color: red; margin-left: 20px"&gt;
087     * </pre>
088     * <p>
089     *   can be produced by an HTML Sink via the event
090     *   <code>{@link Sink#paragraph(SinkEventAttributes)}</code>, where the value of the
091     *   SinkEventAttribute is an AttributeSet with two Attributes ("<code>color</code>" and
092     *   "<code>margin-left</code>" with values "<code>red</code>" and "<code>20px</code>",
093     *   respectively).
094     * </p>
095     */
096    String STYLE = "style";
097
098    /**
099     * A text to display in a tool tip.
100     */
101    String TITLE = "title";
102
103    // head
104
105    /**
106     * A space separated list of URL's that contains meta data information about the document.
107     */
108    String PROFILE = "profile";
109
110    /**
111     * An electronic mail address.
112     */
113    String EMAIL = "email";
114
115
116    // img
117
118    /**
119     * Specifies the alignment of the event element within its parent element.
120     *
121     * <p>
122     *   Generally supported values are "left", "right", "center", "justify".
123     * </p>
124     */
125    String ALIGN = "align";
126
127    /**
128     * Defines a short description of the event element.
129     */
130    String ALT = "alt";
131
132    /**
133     * Defines a border around an event element.
134     */
135    String BORDER = "border";
136
137    /**
138     * Defines the height of an event element.
139     */
140    String HEIGHT = "height";
141
142    /**
143     * Defines white space on the left and right side of an event element.
144     */
145    String HSPACE = "hspace";
146
147    /**
148     * Defines an image as a server-side image map. Only used by the figureGraphics Sink event.
149     */
150    String ISMAP = "ismap";
151
152    /**
153     * The URL of an external resource, eg an image.
154     */
155    String SRC = "src";
156
157    /**
158     * Defines an image as a client-side image map.
159     */
160    String USEMAP = "usemap";
161
162    /**
163     * Defines white space on the top and bottom of the event element.
164     */
165    String VSPACE = "vspace";
166
167    /**
168     * Sets the width of  an event element.
169     */
170    String WIDTH = "width";
171
172    // hr
173
174    /**
175     * Used to indicate that an element comes with a shadow.
176     */
177    String NOSHADE = "noshade";
178
179    /**
180     * Specifies the size, or thickness, or height of an event element.
181     */
182    String SIZE = "size";
183
184    // anchor
185
186    /**
187     * Specifies the name of an anchor.
188     */
189    String NAME = "name";
190
191    // link
192
193    /**
194     * Specifies the character encoding of text associated with an event element.
195     */
196    String CHARSET = "charset";
197
198    /**
199     * May be used in conjunction with {@link #SHAPE}.
200     *
201     * <p>
202     *   Valid values are the same as for the corresponding HTML attributes.
203     * </p>
204     */
205    String COORDS = "coords";
206
207    /**
208     * The target URL of an event element, eg a link.
209     */
210    String HREF = "href";
211
212    /**
213     * Specifies the base language of the target URL.
214     *
215     * <p>
216     *   Used in conjunction with {@link #HREF}.
217     * </p>
218     */
219    String HREFLANG = "hreflang";
220
221    /**
222     * For references to external resourcs, specifies the relationship between
223     * the current document and the target URL.
224     *
225     * <p>
226     *   Valid values are the same as for the corresponding HTML attribute.
227     * </p>
228     */
229    String REL = "rel";
230
231    /**
232     * For references to external resourcs, specifies the relationship between
233     * the target URL and the current document.
234     *
235     * <p>
236     *   Valid values are the same as for the corresponding HTML attribute.
237     * </p>
238     */
239    String REV = "rev";
240
241    /**
242     * Defines the type of region to be defined for a mapping.
243     *
244     * <p>
245     *   Used with the {@link #COORDS} attribute.
246     * </p>
247     */
248    String SHAPE = "shape";
249
250    /**
251     * Where to open the target URL.
252     *
253     * <p>
254     *   Valid values are the same as for the corresponding HTML attribute.
255     * </p>
256     */
257    String TARGET = "target";
258
259    /**
260     * Specifies the MIME (Multipurpose Internet Mail Extensions) type of an
261     * external resource URL, eg a link.
262     */
263    String TYPE = "type";
264
265    // table
266
267    /**
268     * Specifies the background color of an event element.
269     */
270    String BGCOLOR = "bgcolor";
271
272    /**
273     * Specifies the space between cell walls and contents.
274     */
275    String CELLPADDING = "cellpadding";
276
277    /**
278     * Specifies the space between cells.
279     */
280    String CELLSPACING = "cellspacing";
281
282    /**
283     * Specifies which sides of a border surrounding an element should be visible.
284     *
285     * <p>
286     *   Valid values are the same as for the corresponding HTML attribute.
287     * </p>
288     */
289    String FRAME = "frame";
290
291    /**
292     * Specifies horizontal/vertical divider lines between certain elements, eg table cells.
293     */
294    String RULES = "rules";
295
296    /**
297     * Specifies a summary of an event attribute for speech-synthesizing/non-visual target output.
298     */
299    String SUMMARY = "summary";
300
301    // table cell
302
303    /**
304     * Specifies an abbreviated version of the content in an element.
305     */
306    String ABBRV = "abbrv";
307
308    /**
309     * Defines a name for a cell.
310     */
311    String AXIS = "axis";
312
313    /**
314     * Indicates the number of columns a cell should span. Used in tables.
315     */
316    String COLSPAN = "colspan";
317
318    /**
319     * A space-separated list of cell IDs that supply header information for the cell.
320     */
321    String HEADERS = "headers";
322
323    /**
324     * Whether to disable or enable automatic text wrapping for an element.
325     */
326    String NOWRAP = "nowrap";
327
328    /**
329     * Indicates the number of rows a cell should span. Used in tables.
330     */
331    String ROWSPAN = "rowspan";
332
333    /**
334     * A general scope parameter. In Particular, for table cells this
335     * specifies if the cell provides header information for the rest of the
336     * row that contains it ("row"), or for the rest of the column ("col"),
337     * or for the rest of the row group that contains it ("rowgroup"),
338     * or for the rest of the column group that contains it ("colgroup").
339     */
340    String SCOPE = "scope";
341
342    /**
343     * Specifies the vertical alignment of an element.
344     *
345     * <p>
346     *   Generally accepted values are "top", "baseline", "middle", "bottom", "sup", "sub".
347     * </p>
348     */
349    String VALIGN = "valign";
350
351    // text
352
353    /**
354     * Specifies a decoration for an element.
355     *
356     * <p>
357     *   Generally accepted values are "underline", "overline", "line-through", "boxed".
358     * </p>
359     */
360    String DECORATION = "decoration";
361
362    /**
363     * Specifies the semantics of an element.
364     *
365     * <p>
366     *   Generally accepted values are "emphasis", "strong",
367     *   "small", "line-through", "citation", "quote", "definition", "abbreviation",
368     *   "italic", "bold", "monospaced", "code, "variable", "sample", "keyboard",
369     *   "superscript", "subscript", "annotation", "highlight", "ruby", "rubyBase",
370     *   "rubyText", "rubyTextContainer", "rubyParentheses", "bidirectionalIsolation",
371     *   "bidirectionalOverride", "phrase", "insert", "delete".
372     * </p>
373     */
374    String SEMANTICS = "semantics";
375
376    /**
377     * Specifies the semantics of an element.
378     *
379     * <p>
380     *   Generally accepted values are "article", "section",
381     *   "navigation", "sidebar".
382     * </p>
383     */
384    String SECTIONS = "sections";
385
386    /**
387     * Specifies a value for the data element.
388     */
389    String VALUE = "value";
390
391    /**
392     * Specifies a machine readable date/time for the time element.
393     */
394    String DATETIME = "datetime";
395
396}