1 /**********************************************
2 * Copyright (C) 2010 Lukas Laag
3 * This file is part of lib-gwt-svg.
4 *
5 * libgwtsvg is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * libgwtsvg is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with libgwtsvg. If not, see http://www.gnu.org/licenses/
17 **********************************************/
18 package org.vectomatic.dom.svg.ui;
19
20 import java.lang.annotation.Documented;
21 import java.lang.annotation.ElementType;
22 import java.lang.annotation.Retention;
23 import java.lang.annotation.RetentionPolicy;
24 import java.lang.annotation.Target;
25
26 import org.vectomatic.dev.svg.impl.gen.SVGResourceGenerator;
27 import org.vectomatic.dom.svg.OMSVGSVGElement;
28
29 import com.google.gwt.resources.client.DataResource;
30 import com.google.gwt.resources.ext.DefaultExtensions;
31 import com.google.gwt.resources.ext.ResourceGeneratorType;
32
33 /**
34 * A resource that contains SVG that should be incorporated into the compiled output.
35 * Note that by default SVG resources are validated against the SVG 1.1 XSD schema.
36 * You can opt out of validation by setting the <code>validated="false"</code>
37 * attribute on the annotation.
38 * @author laaglu
39 */
40 @DefaultExtensions(value = {".svg"})
41 @ResourceGeneratorType(SVGResourceGenerator.class)
42 public interface SVGResource extends DataResource {
43 /**
44 * Specifies additional options to control how an SVG is bundled.
45 */
46 @Documented
47 @Retention(RetentionPolicy.RUNTIME)
48 @Target(ElementType.METHOD)
49 public @interface Validated {
50 /**
51 * If <code>true</code>, the SVG resource will be validated
52 * against SVG 1.1 schema. Use <code>false</code> value if
53 * you need to disable validation
54 */
55 boolean validated() default true;
56 }
57
58 /**
59 * Returns the root element of the SVG resource
60 * @return
61 * the root element of the SVG resource
62 */
63 public OMSVGSVGElement getSvg();
64 }