001: /*
002:
003: Licensed to the Apache Software Foundation (ASF) under one or more
004: contributor license agreements. See the NOTICE file distributed with
005: this work for additional information regarding copyright ownership.
006: The ASF licenses this file to You under the Apache License, Version 2.0
007: (the "License"); you may not use this file except in compliance with
008: the License. You may obtain a copy of the License at
009:
010: http://www.apache.org/licenses/LICENSE-2.0
011:
012: Unless required by applicable law or agreed to in writing, software
013: distributed under the License is distributed on an "AS IS" BASIS,
014: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: See the License for the specific language governing permissions and
016: limitations under the License.
017:
018: */
019: package org.apache.batik.css.engine.value;
020:
021: import org.w3c.dom.DOMException;
022:
023: /**
024: * This interface represents a property value.
025: *
026: * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
027: * @version $Id: Value.java 475477 2006-11-15 22:44:28Z cam $
028: */
029: public interface Value {
030:
031: /**
032: * A string representation of the current value.
033: */
034: String getCssText();
035:
036: /**
037: * A code defining the type of the value.
038: */
039: short getCssValueType();
040:
041: /**
042: * The type of the value.
043: */
044: short getPrimitiveType();
045:
046: /**
047: * This method is used to get the float value.
048: * @exception DOMException
049: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a float
050: * value.
051: */
052: float getFloatValue() throws DOMException;
053:
054: /**
055: * This method is used to get the string value.
056: * @exception DOMException
057: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a string
058: * value.
059: */
060: String getStringValue() throws DOMException;
061:
062: /**
063: * The red value of the RGB color.
064: * @exception DOMException
065: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a RGB
066: * color value.
067: */
068: Value getRed() throws DOMException;
069:
070: /**
071: * The green value of the RGB color.
072: * @exception DOMException
073: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a RGB
074: * color value.
075: */
076: Value getGreen() throws DOMException;
077:
078: /**
079: * The blue value of the RGB color.
080: * @exception DOMException
081: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a RGB
082: * color value.
083: */
084: Value getBlue() throws DOMException;
085:
086: /**
087: * The number of <code>CSSValues</code> in the list. The range of valid
088: * values of the indices is <code>0</code> to <code>length-1</code>
089: * inclusive.
090: * @exception DOMException
091: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a list
092: * value.
093: */
094: int getLength() throws DOMException;
095:
096: /**
097: * Used to retrieve a rule by ordinal index.
098: * @return The style rule at the <code>index</code> position in the
099: * list, or <code>null</code> if that is not a valid index.
100: * @exception DOMException
101: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a list
102: * value.
103: */
104: Value item(int index) throws DOMException;
105:
106: /**
107: * The top value of the rect.
108: * @exception DOMException
109: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Rect
110: * value.
111: */
112: Value getTop() throws DOMException;
113:
114: /**
115: * The right value of the rect.
116: * @exception DOMException
117: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Rect
118: * value.
119: */
120: Value getRight() throws DOMException;
121:
122: /**
123: * The bottom value of the rect.
124: * @exception DOMException
125: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Rect
126: * value.
127: */
128: Value getBottom() throws DOMException;
129:
130: /**
131: * The left value of the rect.
132: * @exception DOMException
133: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Rect
134: * value.
135: */
136: Value getLeft() throws DOMException;
137:
138: /**
139: * The identifier value of the counter.
140: * @exception DOMException
141: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Counter
142: * value.
143: */
144: String getIdentifier() throws DOMException;
145:
146: /**
147: * The listStyle value of the counter.
148: * @exception DOMException
149: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Counter
150: * value.
151: */
152: String getListStyle() throws DOMException;
153:
154: /**
155: * The separator value of the counter.
156: * @exception DOMException
157: * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Counter
158: * value.
159: */
160: String getSeparator() throws DOMException;
161: }
|