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 * <pre>void text( String text, SinkEventAttributes attributes );</pre>
030 * the <code>attributes</code> parameter can be used to specify some text styling
031 * options, or other optional parameters.
032 * </p>
033 * <p>
034 * What kind of attributes are supported depends on the event and the sink
035 * implementation. The sink API just specifies a list of suggested attribute
036 * names, that sinks are expected to recognize, and parsers are expected to use
037 * preferably when emitting events.
038 * </p>
039 * <p>
040 * It is recommended that for simple attributes, both keys and values should be
041 * lower-case Strings, but this is not mandatory. One example of an exception is
042 * the {@link #STYLE} attribute, whose value may itself be an AttributeSet again.
043 * </p>
044 * <p>
045 * The <b>base attributes</b> that are supported by almost all events are
046 * {@link #CLASS}, {@link #ID}, {@link #LANG}, {@link #STYLE} and {@link #TITLE}.
047 * </p>
048 *
049 * @author ltheussl
050 * @version $Id: SinkEventAttributes.html 979316 2016-02-02 21:51:43Z hboutemy $
051 * @since 1.1
052 */
053@SuppressWarnings( "checkstyle:interfaceistype" )
054public interface SinkEventAttributes
055    extends MutableAttributeSet
056{
057    // base
058
059    /**
060     * The class of the event element.
061     */
062    String CLASS = "class";
063
064    /**
065     * A unique id for the event element.
066     */
067    String ID = "id";
068
069    /**
070     * The language code for the event element.
071     */
072    String LANG = "lang";
073
074    /**
075     * An inline style definition.
076     *
077     * <p>
078     *   Generally supported values are "italic", "bold", "monospaced" and AttributeSets.
079     * </p>
080     * <p>
081     *   If the value of this Attribute is itself an AttributeSet, it is interpreted as a
082     *   sequence of CSS properties. For instance, the HTML paragraph opening
083     * </p>
084     * <pre>
085     *   &lt;p style="color: red; margin-left: 20px"&gt;
086     * </pre>
087     * <p>
088     *   can be produced by an HTML Sink via the event
089     *   <code>{@link Sink#paragraph(SinkEventAttributes)}</code>, where the value of the
090     *   SinkEventAttribute is an AttributeSet with two Attributes ("<code>color</code>" and
091     *   "<code>margin-left</code>" with values "<code>red</code>" and "<code>20px</code>",
092     *   respectively).
093     * </p>
094     */
095    String STYLE = "style";
096
097    /**
098     * A text to display in a tool tip.
099     */
100    String TITLE = "title";
101
102    // head
103
104    /**
105     * A space separated list of URL's that contains meta data information about the document.
106     */
107    String PROFILE = "profile";
108
109    /**
110     * An electronic mail address.
111     */
112    String EMAIL = "email";
113
114
115    // img
116
117    /**
118     * Specifies the alignment of the event element within its parent element.
119     *
120     * <p>
121     *   Generally supported values are "left", "right", "center", "justify".
122     * </p>
123     */
124    String ALIGN = "align";
125
126    /**
127     * Defines a short description of the event element.
128     */
129    String ALT = "alt";
130
131    /**
132     * Defines a border around an event element.
133     */
134    String BORDER = "border";
135
136    /**
137     * Defines the height of an event element.
138     */
139    String HEIGHT = "height";
140
141    /**
142     * Defines white space on the left and right side of an event element.
143     */
144    String HSPACE = "hspace";
145
146    /**
147     * Defines an image as a server-side image map. Only used by the figureGraphics Sink event.
148     */
149    String ISMAP = "ismap";
150
151    /**
152     * The URL of an external resource, eg an image.
153     */
154    String SRC = "src";
155
156    /**
157     * Defines an image as a client-side image map.
158     */
159    String USEMAP = "usemap";
160
161    /**
162     * Defines white space on the top and bottom of the event element.
163     */
164    String VSPACE = "vspace";
165
166    /**
167     * Sets the width of  an event element.
168     */
169    String WIDTH = "width";
170
171    // hr
172
173    /**
174     * Used to indicate that an element comes with a shadow.
175     */
176    String NOSHADE = "noshade";
177
178    /**
179     * Specifies the size, or thickness, or height of an event element.
180     */
181    String SIZE = "size";
182
183    // anchor
184
185    /**
186     * Specifies the name of an anchor.
187     */
188    String NAME = "name";
189
190    // link
191
192    /**
193     * Specifies the character encoding of text associated with an event element.
194     */
195    String CHARSET = "charset";
196
197    /**
198     * May be used in conjunction with {@link #SHAPE}.
199     *
200     * <p>
201     *   Valid values are the same as for the corresponding HTML attributes.
202     * </p>
203     */
204    String COORDS = "coords";
205
206    /**
207     * The target URL of an event element, eg a link.
208     */
209    String HREF = "href";
210
211    /**
212     * Specifies the base language of the target URL.
213     *
214     * <p>
215     *   Used in conjunction with {@link #HREF}.
216     * </p>
217     */
218    String HREFLANG = "hreflang";
219
220    /**
221     * For references to external resourcs, specifies the relationship between
222     * the current document and the target URL.
223     *
224     * <p>
225     *   Valid values are the same as for the corresponding HTML attribute.
226     * </p>
227     */
228    String REL = "rel";
229
230    /**
231     * For references to external resourcs, specifies the relationship between
232     * the target URL and the current document.
233     *
234     * <p>
235     *   Valid values are the same as for the corresponding HTML attribute.
236     * </p>
237     */
238    String REV = "rev";
239
240    /**
241     * Defines the type of region to be defined for a mapping.
242     *
243     * <p>
244     *   Used with the {@link #COORDS} attribute.
245     * </p>
246     */
247    String SHAPE = "shape";
248
249    /**
250     * Where to open the target URL.
251     *
252     * <p>
253     *   Valid values are the same as for the corresponding HTML attribute.
254     * </p>
255     */
256    String TARGET = "target";
257
258    /**
259     * Specifies the MIME (Multipurpose Internet Mail Extensions) type of an
260     * external resource URL, eg a link.
261     */
262    String TYPE = "type";
263
264    // table
265
266    /**
267     * Specifies the background color of an event element.
268     */
269    String BGCOLOR = "bgcolor";
270
271    /**
272     * Specifies the space between cell walls and contents.
273     */
274    String CELLPADDING = "cellpadding";
275
276    /**
277     * Specifies the space between cells.
278     */
279    String CELLSPACING = "cellspacing";
280
281    /**
282     * Specifies which sides of a border surrounding an element should be visible.
283     *
284     * <p>
285     *   Valid values are the same as for the corresponding HTML attribute.
286     * </p>
287     */
288    String FRAME = "frame";
289
290    /**
291     * Specifies horizontal/vertical divider lines between certain elements, eg table cells.
292     */
293    String RULES = "rules";
294
295    /**
296     * Specifies a summary of an event attribute for speech-synthesizing/non-visual target output.
297     */
298    String SUMMARY = "summary";
299
300    // table cell
301
302    /**
303     * Specifies an abbreviated version of the content in an element.
304     */
305    String ABBRV = "abbrv";
306
307    /**
308     * Defines a name for a cell.
309     */
310    String AXIS = "axis";
311
312    /**
313     * Indicates the number of columns a cell should span. Used in tables.
314     */
315    String COLSPAN = "colspan";
316
317    /**
318     * A space-separated list of cell IDs that supply header information for the cell.
319     */
320    String HEADERS = "headers";
321
322    /**
323     * Whether to disable or enable automatic text wrapping for an element.
324     */
325    String NOWRAP = "nowrap";
326
327    /**
328     * Indicates the number of rows a cell should span. Used in tables.
329     */
330    String ROWSPAN = "rowspan";
331
332    /**
333     * A general scope parameter. In Particular, for table cells this
334     * specifies if the cell provides header information for the rest of the
335     * row that contains it ("row"), or for the rest of the column ("col"),
336     * or for the rest of the row group that contains it ("rowgroup"),
337     * or for the rest of the column group that contains it ("colgroup").
338     */
339    String SCOPE = "scope";
340
341    /**
342     * Specifies the vertical alignment of an element.
343     *
344     * <p>
345     *   Generally accepted values are "top", "baseline", "middle", "bottom", "sup", "sub".
346     * </p>
347     */
348    String VALIGN = "valign";
349
350    // text
351
352    /**
353     * Specifies a decoration for an element.
354     *
355     * <p>
356     *   Generally accepted values are "underline", "overline", "line-through", "boxed".
357     * </p>
358     */
359    String DECORATION = "decoration";
360}