123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- #region Copyright and License
- //
- // Fizzler - CSS Selector Engine for Microsoft .NET Framework
- // Copyright (c) 2009 Atif Aziz, Colin Ramsay. All rights reserved.
- //
- // This library is free software; you can redistribute it and/or modify it under
- // the terms of the GNU Lesser General Public License as published by the Free
- // Software Foundation; either version 3 of the License, or (at your option)
- // any later version.
- //
- // This library is distributed in the hope that it will be useful, but WITHOUT
- // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- // details.
- //
- // You should have received a copy of the GNU Lesser General Public License
- // along with this library; if not, write to the Free Software Foundation, Inc.,
- // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- //
- #endregion
- #pragma warning disable
- namespace Fizzler
- {
- /// <summary>
- /// Represents a selectors implementation for an arbitrary document/node system.
- /// </summary>
- public interface IElementOps<TElement>
- {
- //
- // Selectors
- //
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#type-selectors">type selector</a>,
- /// which represents an instance of the element type in the document tree.
- /// </summary>
- Selector<TElement> Type(NamespacePrefix prefix, string name);
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#universal-selector">universal selector</a>,
- /// any single element in the document tree in any namespace
- /// (including those without a namespace) if no default namespace
- /// has been specified for selectors.
- /// </summary>
- Selector<TElement> Universal(NamespacePrefix prefix);
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#Id-selectors">ID selector</a>,
- /// which represents an element instance that has an identifier that
- /// matches the identifier in the ID selector.
- /// </summary>
- Selector<TElement> Id(string id);
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#class-html">class selector</a>,
- /// which is an alternative <see cref="AttributeIncludes"/> when
- /// representing the <c>class</c> attribute.
- /// </summary>
- Selector<TElement> Class(string clazz);
- //
- // Attribute selectors
- //
- /// <summary>
- /// Generates an <a href="http://www.w3.org/TR/css3-selectors/#attribute-selectors">attribute selector</a>
- /// that represents an element with the given attribute <paramref name="name"/>
- /// whatever the values of the attribute.
- /// </summary>
- Selector<TElement> AttributeExists(NamespacePrefix prefix, string name);
- /// <summary>
- /// Generates an <a href="http://www.w3.org/TR/css3-selectors/#attribute-selectors">attribute selector</a>
- /// that represents an element with the given attribute <paramref name="name"/>
- /// and whose value is exactly <paramref name="value"/>.
- /// </summary>
- Selector<TElement> AttributeExact(NamespacePrefix prefix, string name, string value);
- /// <summary>
- /// Generates an <a href="http://www.w3.org/TR/css3-selectors/#attribute-selectors">attribute selector</a>
- /// that represents an element with the given attribute <paramref name="name"/>
- /// and whose value is a whitespace-separated list of words, one of
- /// which is exactly <paramref name="value"/>.
- /// </summary>
- Selector<TElement> AttributeIncludes(NamespacePrefix prefix, string name, string value);
- /// <summary>
- /// Generates an <a href="http://www.w3.org/TR/css3-selectors/#attribute-selectors">attribute selector</a>
- /// that represents an element with the given attribute <paramref name="name"/>,
- /// its value either being exactly <paramref name="value"/> or beginning
- /// with <paramref name="value"/> immediately followed by "-" (U+002D).
- /// </summary>
- Selector<TElement> AttributeDashMatch(NamespacePrefix prefix, string name, string value);
- /// <summary>
- /// Generates an <a href="http://www.w3.org/TR/css3-selectors/#attribute-selectors">attribute selector</a>
- /// that represents an element with the attribute <paramref name="name"/>
- /// whose value begins with the prefix <paramref name="value"/>.
- /// </summary>
- Selector<TElement> AttributePrefixMatch(NamespacePrefix prefix, string name, string value);
- /// <summary>
- /// Generates an <a href="http://www.w3.org/TR/css3-selectors/#attribute-selectors">attribute selector</a>
- /// that represents an element with the attribute <paramref name="name"/>
- /// whose value ends with the suffix <paramref name="value"/>.
- /// </summary>
- Selector<TElement> AttributeSuffixMatch(NamespacePrefix prefix, string name, string value);
- /// <summary>
- /// Generates an <a href="http://www.w3.org/TR/css3-selectors/#attribute-selectors">attribute selector</a>
- /// that represents an element with the attribute <paramref name="name"/>
- /// whose value contains at least one instance of the substring <paramref name="value"/>.
- /// </summary>
- Selector<TElement> AttributeSubstring(NamespacePrefix prefix, string name, string value);
- //
- // Pseudo-class selectors
- //
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#pseudo-classes">pseudo-class selector</a>,
- /// which represents an element that is the first child of some other element.
- /// </summary>
- Selector<TElement> FirstChild();
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#pseudo-classes">pseudo-class selector</a>,
- /// which represents an element that is the last child of some other element.
- /// </summary>
- Selector<TElement> LastChild();
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#pseudo-classes">pseudo-class selector</a>,
- /// which represents an element that is the N-th child of some other element.
- /// </summary>
- Selector<TElement> NthChild(int a, int b);
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#pseudo-classes">pseudo-class selector</a>,
- /// which represents an element that has a parent element and whose parent
- /// element has no other element children.
- /// </summary>
- Selector<TElement> OnlyChild();
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#pseudo-classes">pseudo-class selector</a>,
- /// which represents an element that has no children at all.
- /// </summary>
- Selector<TElement> Empty();
- //
- // Combinators
- //
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#combinators">combinator</a>,
- /// which represents a childhood relationship between two elements.
- /// </summary>
- Selector<TElement> Child();
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#combinators">combinator</a>,
- /// which represents a relationship between two elements where one element is an
- /// arbitrary descendant of some ancestor element.
- /// </summary>
- Selector<TElement> Descendant();
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#combinators">combinator</a>,
- /// which represents elements that share the same parent in the document tree and
- /// where the first element immediately precedes the second element.
- /// </summary>
- Selector<TElement> Adjacent();
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#combinators">combinator</a>,
- /// which separates two sequences of simple selectors. The elements represented
- /// by the two sequences share the same parent in the document tree and the
- /// element represented by the first sequence precedes (not necessarily
- /// immediately) the element represented by the second one.
- /// </summary>
- Selector<TElement> GeneralSibling();
- /// <summary>
- /// Generates a <a href="http://www.w3.org/TR/css3-selectors/#pseudo-classes">pseudo-class selector</a>,
- /// which represents an element that is the N-th child from bottom up of some other element.
- /// </summary>
- Selector<TElement> NthLastChild(int a, int b);
- }
- }
- #pragma warning restore
|