KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > css > engine > CSSContext


1 /*
2
3    Copyright 2002-2004 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.css.engine;
19
20 import org.apache.batik.css.engine.value.Value;
21 import org.apache.batik.util.ParsedURL;
22 import org.w3c.dom.Element JavaDoc;
23
24 /**
25  * This interface allows the user of a CSSEngine to provide contextual
26  * informations.
27  *
28  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
29  * @version $Id: CSSContext.java,v 1.11 2005/03/27 08:58:31 cam Exp $
30  */

31 public interface CSSContext {
32     
33     /**
34      * Returns the Value corresponding to the given system color.
35      */

36     Value getSystemColor(String JavaDoc ident);
37
38     /**
39      * Returns the value corresponding to the default font-family.
40      */

41     Value getDefaultFontFamily();
42
43     /**
44      * Returns a lighter font-weight.
45      */

46     float getLighterFontWeight(float f);
47
48     /**
49      * Returns a bolder font-weight.
50      */

51     float getBolderFontWeight(float f);
52
53     /**
54      * Returns the size of a px CSS unit in millimeters.
55      */

56     float getPixelUnitToMillimeter();
57
58     /**
59      * Returns the size of a px CSS unit in millimeters.
60      * This will be removed after next release.
61      * @see #getPixelUnitToMillimeter()
62      */

63     float getPixelToMillimeter();
64
65     /**
66      * Returns the medium font size.
67      */

68     float getMediumFontSize();
69
70     /**
71      * Returns the width of the block which directly contains the
72      * given element.
73      */

74     float getBlockWidth(Element JavaDoc elt);
75
76     /**
77      * Returns the height of the block which directly contains the
78      * given element.
79      */

80     float getBlockHeight(Element JavaDoc elt);
81
82     /**
83      * This method should throw a SecurityException if the resource
84      * found at url and referenced from docURL should not be loaded.
85      *
86      * @param resourceURL url for the resource, as defined in
87      * the resource's xlink:href attribute. If that
88      * attribute was empty, then this parameter should
89      * be null
90      * @param docURL url for the document into which the
91      * resource was found.
92      */

93     public void
94         checkLoadExternalResource(ParsedURL resourceURL,
95                                   ParsedURL docURL) throws SecurityException JavaDoc;
96
97     /**
98      * Returns true if the document is dynamic, false otherwise.
99      */

100     public boolean isDynamic();
101
102     /**
103      * Returns true if the document is interactive, false otherwise.
104      */

105     public boolean isInteractive();
106
107     /**
108      * Returns the CSS engine associated with given element.
109      */

110     public CSSEngine getCSSEngineForElement(Element JavaDoc e);
111 }
112
Popular Tags