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: * This interface defines a selector.
018: * <p><b>Remarks</b>: Not all the following selectors are supported (or will be
019: * supported) by CSS.
020: * <p>All examples are CSS2 compliant.
021: *
022: * @version $Revision$
023: * @author Philippe Le Hegaret
024: */
025: public interface Selector {
026:
027: /* simple selectors */
028:
029: /**
030: * This is a conditional selector.
031: * example:
032: * <pre class="example">
033: * simple[role="private"]
034: * .part1
035: * H1#myId
036: * P:lang(fr).p1
037: * </pre>
038: *
039: * @see ConditionalSelector
040: */
041: public static final short SAC_CONDITIONAL_SELECTOR = 0;
042:
043: /**
044: * This selector matches any node.
045: * @see SimpleSelector
046: */
047: public static final short SAC_ANY_NODE_SELECTOR = 1;
048:
049: /**
050: * This selector matches the root node.
051: * @see SimpleSelector
052: */
053: public static final short SAC_ROOT_NODE_SELECTOR = 2;
054:
055: /**
056: * This selector matches only node that are different from a specified one.
057: * @see NegativeSelector
058: */
059: public static final short SAC_NEGATIVE_SELECTOR = 3;
060:
061: /**
062: * This selector matches only element node.
063: * example:
064: * <pre class="example">
065: * H1
066: * animate
067: * </pre>
068: * @see ElementSelector
069: */
070: public static final short SAC_ELEMENT_NODE_SELECTOR = 4;
071:
072: /**
073: * This selector matches only text node.
074: * @see CharacterDataSelector
075: */
076: public static final short SAC_TEXT_NODE_SELECTOR = 5;
077:
078: /**
079: * This selector matches only cdata node.
080: * @see CharacterDataSelector
081: */
082: public static final short SAC_CDATA_SECTION_NODE_SELECTOR = 6;
083:
084: /**
085: * This selector matches only processing instruction node.
086: * @see ProcessingInstructionSelector
087: */
088: public static final short SAC_PROCESSING_INSTRUCTION_NODE_SELECTOR = 7;
089:
090: /**
091: * This selector matches only comment node.
092: * @see CharacterDataSelector
093: */
094: public static final short SAC_COMMENT_NODE_SELECTOR = 8;
095: /**
096: * This selector matches the 'first line' pseudo element.
097: * example:
098: * <pre class="example">
099: * :first-line
100: * </pre>
101: * @see ElementSelector
102: */
103: public static final short SAC_PSEUDO_ELEMENT_SELECTOR = 9;
104:
105: /* combinator selectors */
106:
107: /**
108: * This selector matches an arbitrary descendant of some ancestor element.
109: * example:
110: * <pre class="example">
111: * E F
112: * </pre>
113: * @see DescendantSelector
114: */
115: public static final short SAC_DESCENDANT_SELECTOR = 10;
116:
117: /**
118: * This selector matches a childhood relationship between two elements.
119: * example:
120: * <pre class="example">
121: * E > F
122: * </pre>
123: * @see DescendantSelector
124: */
125: public static final short SAC_CHILD_SELECTOR = 11;
126: /**
127: * This selector matches two selectors who shared the same parent in the
128: * document tree and the element represented by the first sequence
129: * immediately precedes the element represented by the second one.
130: * example:
131: * <pre class="example">
132: * E + F
133: * </pre>
134: * @see SiblingSelector
135: */
136: public static final short SAC_DIRECT_ADJACENT_SELECTOR = 12;
137:
138: /**
139: * An integer indicating the type of <code>Selector</code>
140: */
141: public short getSelectorType();
142:
143: }
|