001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.visualweb.api.designer.cssengine;
043:
044: import java.awt.Color;
045: import org.netbeans.modules.visualweb.designer.html.HtmlTag;
046: import org.w3c.dom.Element;
047:
048: /**
049: * Provides CSS value service.
050: *
051: * @author Peter Zavadsky
052: */
053: public interface CssValueService {
054:
055: public Color getColorForElement(Element element, int styleIndex);
056:
057: public boolean isColorTransparentForElement(Element element,
058: int styleIndex);
059:
060: public float getFontSizeForElement(Element element, int defaultSize);
061:
062: public int getFontStyleForElement(Element element, int defaultStyle);
063:
064: /** @return not-empty array of font family names */
065: public String[] getFontFamilyNamesForElement(Element element);
066:
067: // /** XXX Replace with values returned, and manage the fonts out of desinger/cssengine.
068: // * @return always non-empy <code>Font</code> array */
069: // public Font[] getFontsForElement(Element element, int defaultSize, int defaultType);
070: // /** XXX Replace with values returned, and manage the fonts out of desinger/cssengine. */
071: // public FontMetrics[] getFontsMetricsForElement(Element element);
072:
073: public CssListValue getComputedCssListValue(CssValue cssValue);
074:
075: public String[] getCssLengthUnits();
076:
077: public boolean isAbsoluteValue(CssValue cssValue);
078:
079: public boolean isAutoValue(CssValue cssValue);
080:
081: public boolean isBaseLineValue(CssValue cssValue);
082:
083: public boolean isBlockValue(CssValue cssValue);
084:
085: public boolean isBothValue(CssValue cssValue);
086:
087: public boolean isBottomValue(CssValue cssValue);
088:
089: public boolean isCapitalizeValue(CssValue cssValue);
090:
091: public boolean isCenterValue(CssValue cssValue);
092:
093: public boolean isCircleValue(CssValue cssValue);
094:
095: public boolean isCollapseValue(CssValue cssValue);
096:
097: public boolean isDashedValue(CssValue cssValue);
098:
099: public boolean isDecimalValue(CssValue cssValue);
100:
101: public boolean isDiscValue(CssValue cssValue);
102:
103: public boolean isDottedValue(CssValue cssValue);
104:
105: public boolean isDoubleValue(CssValue cssValue);
106:
107: public boolean isFixedValue(CssValue cssValue);
108:
109: /** XXX Rave only, TODO get rid of this. */
110: public boolean isGridValue(CssValue cssValue);
111:
112: public boolean isGrooveValue(CssValue cssValue);
113:
114: public boolean isHiddenValue(CssValue cssValue);
115:
116: public boolean isInlineBlockValue(CssValue cssValue);
117:
118: public boolean isInlineValue(CssValue cssValue);
119:
120: public boolean isInsetValue(CssValue cssValue);
121:
122: public boolean isJustifyValue(CssValue cssValue);
123:
124: public boolean isLeftValue(CssValue cssValue);
125:
126: public boolean isListItemValue(CssValue cssValue);
127:
128: public boolean isLowerAlphaValue(CssValue cssValue);
129:
130: public boolean isLowerCaseValue(CssValue cssValue);
131:
132: public boolean isLowerLatinValue(CssValue cssValue);
133:
134: public boolean isLowerRomanValue(CssValue cssValue);
135:
136: public boolean isMiddleValue(CssValue cssValue);
137:
138: public boolean isNoneValue(CssValue cssValue);
139:
140: public boolean isNormalValue(CssValue cssValue);
141:
142: public boolean isNoRepeatValue(CssValue cssValue);
143:
144: public boolean isNoWrapValue(CssValue cssValue);
145:
146: public boolean isOutsetValue(CssValue cssValue);
147:
148: public boolean isPreValue(CssValue cssValue);
149:
150: public boolean isPreWrapValue(CssValue cssValue);
151:
152: public boolean isRaveCenterValue(CssValue cssValue);
153:
154: public boolean isRelativeValue(CssValue cssValue);
155:
156: public boolean isRepeatValue(CssValue cssValue);
157:
158: public boolean isRepeatXValue(CssValue cssValue);
159:
160: public boolean isRepeatYValue(CssValue cssValue);
161:
162: public boolean isRidgeValue(CssValue cssValue);
163:
164: public boolean isRightValue(CssValue cssValue);
165:
166: public boolean isSmallCapsValue(CssValue cssValue);
167:
168: public boolean isSolidValue(CssValue cssValue);
169:
170: public boolean isSquareValue(CssValue cssValue);
171:
172: public boolean isStaticValue(CssValue cssValue);
173:
174: public boolean isSubValue(CssValue cssValue);
175:
176: public boolean isSuperValue(CssValue cssValue);
177:
178: public boolean isTableValue(CssValue cssValue);
179:
180: public boolean isTableCaptionValue(CssValue cssValue);
181:
182: public boolean isTableCellValue(CssValue cssValue);
183:
184: public boolean isTableColumnValue(CssValue cssValue);
185:
186: public boolean isTableColumnGroupValue(CssValue cssValue);
187:
188: public boolean isTableFooterGroupValue(CssValue cssValue);
189:
190: public boolean isTableHeaderGroupValue(CssValue cssValue);
191:
192: public boolean isTableRowGroupValue(CssValue cssValue);
193:
194: public boolean isTableRowValue(CssValue cssValue);
195:
196: public boolean isTextBottomValue(CssValue cssValue);
197:
198: public boolean isTextTopValue(CssValue cssValue);
199:
200: public boolean isTopValue(CssValue cssValue);
201:
202: public boolean isUpperAlphaValue(CssValue cssValue);
203:
204: public boolean isUpperCaseValue(CssValue cssValue);
205:
206: public boolean isUpperLatinValue(CssValue cssValue);
207:
208: public boolean isUpperRomanValue(CssValue cssValue);
209:
210: public boolean isVisibleValue(CssValue cssValue);
211:
212: public boolean isOfPrimitivePercentageType(CssValue cssValue);
213:
214: public boolean isOfPrimitiveEmsType(CssValue cssValue);
215:
216: public CssValue getBothCssValueConstant();
217:
218: public CssValue getCollapseCssValueConstant();
219:
220: public CssValue getDecimalCssValueConstant();
221:
222: public CssValue getDiscCssValueConstant();
223:
224: public CssValue getTableFooterGroupValueConstant();
225:
226: public CssValue getTableHeaderGroupValueConstant();
227:
228: public CssValue getTableRowGroupValueConstant();
229:
230: public CssValue getTableRowValueConstant();
231:
232: public boolean isPositionProperty(String property);
233:
234: public boolean isTextProperty(String property);
235:
236: public boolean isAutoValue(String value);
237:
238: public String getAbsoluteValue();
239:
240: public String getGridValue();
241:
242: public String getHeightProperty();
243:
244: public String getWidthProperty();
245:
246: public boolean hasNoUnits(String value);
247:
248: // XXX Get rid of the HtmlTag parameter.
249: public boolean isInlineTag(CssValue cssDisplay, Element element,
250: HtmlTag tag);
251:
252: /** XXX Computes css length, provides the auto value as <code>CssValue.AUTO</code>, revise that, it looks very dangerous.
253: * XXX Hack, this engine impl is incorrect, it shouldn't be up to the engine to compute the final value. */
254: public int getCssLength(Element element, int property);
255:
256: }
|