1 package org.apache.maven.doxia.sink; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import javax.swing.text.MutableAttributeSet; 23 24 /** 25 * A set of attributes for a sink event. 26 * <p> 27 * All sink methods that produce some presentation-level output should have at least 28 * one form that allows to pass in a Set of SinkEventAttributes. For instance in 29 * </p> 30 * <pre>void text( String text, SinkEventAttributes attributes );</pre> 31 * <p> 32 * the <code>attributes</code> parameter can be used to specify some text styling 33 * options, or other optional parameters. 34 * </p> 35 * <p> 36 * What kind of attributes are supported depends on the event and the sink 37 * implementation. The sink API just specifies a list of suggested attribute 38 * names, that sinks are expected to recognize, and parsers are expected to use 39 * preferably when emitting events. 40 * </p> 41 * <p> 42 * It is recommended that for simple attributes, both keys and values should be 43 * lower-case Strings, but this is not mandatory. One example of an exception is 44 * the {@link #STYLE} attribute, whose value may itself be an AttributeSet again. 45 * </p> 46 * <p> 47 * The <b>base attributes</b> that are supported by almost all events are 48 * {@link #CLASS}, {@link #ID}, {@link #LANG}, {@link #STYLE} and {@link #TITLE}. 49 * </p> 50 * 51 * @author ltheussl 52 * @since 1.1 53 */ 54 @SuppressWarnings( "checkstyle:interfaceistype" ) 55 public interface SinkEventAttributes 56 extends MutableAttributeSet 57 { 58 // base 59 60 /** 61 * The class of the event element. 62 */ 63 String CLASS = "class"; 64 65 /** 66 * A unique id for the event element. 67 */ 68 String ID = "id"; 69 70 /** 71 * The language code for the event element. 72 */ 73 String LANG = "lang"; 74 75 /** 76 * An inline style definition. 77 * 78 * <p> 79 * Generally supported values are "italic", "bold", "monospaced" and AttributeSets. 80 * </p> 81 * <p> 82 * If the value of this Attribute is itself an AttributeSet, it is interpreted as a 83 * sequence of CSS properties. For instance, the HTML paragraph opening 84 * </p> 85 * <pre> 86 * <p style="color: red; margin-left: 20px"> 87 * </pre> 88 * <p> 89 * can be produced by an HTML Sink via the event 90 * <code>{@link Sink#paragraph(SinkEventAttributes)}</code>, where the value of the 91 * SinkEventAttribute is an AttributeSet with two Attributes ("<code>color</code>" and 92 * "<code>margin-left</code>" with values "<code>red</code>" and "<code>20px</code>", 93 * respectively). 94 * </p> 95 */ 96 String STYLE = "style"; 97 98 /** 99 * 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 }