001: /*
002: * Copyright (c) 1999 World Wide Web Consortium,
003: * (Massachusetts Institute of Technology, Institut National de
004: * Recherche en Informatique et en Automatique, Keio University). All
005: * Rights Reserved. This program is distributed under the W3C's Software
006: * Intellectual Property License. This program is distributed in the
007: * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009: * PURPOSE.
010: * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011: *
012: * $Id$
013: */
014: package org.w3c.css.sac;
015:
016: /**
017: * @version $Revision$
018: * @author Philippe Le Hegaret
019: */
020: public interface Condition {
021:
022: /**
023: * This condition checks exactly two conditions.
024: * example:
025: * <pre class="example">
026: * .part1:lang(fr)
027: * </pre>
028: * @see CombinatorCondition
029: */
030: public static final short SAC_AND_CONDITION = 0;
031:
032: /**
033: * This condition checks one of two conditions.
034: * @see CombinatorCondition
035: */
036: public static final short SAC_OR_CONDITION = 1;
037:
038: /**
039: * This condition checks that a condition can't be applied to a node.
040: * @see NegativeCondition
041: */
042: public static final short SAC_NEGATIVE_CONDITION = 2;
043:
044: /**
045: * This condition checks a specified position.
046: * example:
047: * <pre class="example">
048: * :first-child
049: * </pre>
050: * @see PositionalCondition
051: */
052: public static final short SAC_POSITIONAL_CONDITION = 3;
053:
054: /**
055: * This condition checks an attribute.
056: * example:
057: * <pre class="example">
058: * [simple]
059: * [restart="never"]
060: * </pre>
061: * @see AttributeCondition
062: */
063: public static final short SAC_ATTRIBUTE_CONDITION = 4;
064: /**
065: * This condition checks an id attribute.
066: * example:
067: * <pre class="example">
068: * #myId
069: * </pre>
070: * @see AttributeCondition
071: */
072: public static final short SAC_ID_CONDITION = 5;
073: /**
074: * This condition checks the language of the node.
075: * example:
076: * <pre class="example">
077: * :lang(fr)
078: * </pre>
079: * @see LangCondition
080: */
081: public static final short SAC_LANG_CONDITION = 6;
082: /**
083: * This condition checks for a value in a space-separated values in a
084: * specified attribute
085: * example:
086: * <pre class="example">
087: * [values~="10"]
088: * </pre>
089: * @see AttributeCondition
090: */
091: public static final short SAC_ONE_OF_ATTRIBUTE_CONDITION = 7;
092: /**
093: * This condition checks if the value is in a hypen-separated list of values
094: * in a specified attribute.
095: * example:
096: * <pre class="example">
097: * [languages|="fr"]
098: * </pre>
099: * @see AttributeCondition
100: */
101: public static final short SAC_BEGIN_HYPHEN_ATTRIBUTE_CONDITION = 8;
102: /**
103: * This condition checks for a specified class.
104: * example:
105: * <pre class="example">
106: * .example
107: * </pre>
108: * @see AttributeCondition
109: */
110: public static final short SAC_CLASS_CONDITION = 9;
111: /**
112: * This condition checks for the link pseudo class.
113: * example:
114: * <pre class="example">
115: * :link
116: * :visited
117: * :hover
118: * </pre>
119: * @see AttributeCondition
120: */
121: public static final short SAC_PSEUDO_CLASS_CONDITION = 10;
122: /**
123: * This condition checks if a node is the only one in the node list.
124: */
125: public static final short SAC_ONLY_CHILD_CONDITION = 11;
126: /**
127: * This condition checks if a node is the only one of his type.
128: */
129: public static final short SAC_ONLY_TYPE_CONDITION = 12;
130: /**
131: * This condition checks the content of a node.
132: * @see ContentCondition
133: */
134: public static final short SAC_CONTENT_CONDITION = 13;
135:
136: /**
137: * An integer indicating the type of <code>Condition</code>.
138: */
139: public short getConditionType();
140: }
|