KParts.SelectorInterface

KDE 4.9 PyKDE API Reference

- KDE's Python API

# SelectorInterface Class Reference

`from PyKDE4.kparts import *`

Namespace: KParts

## Detailed Description

Optional base class for HtmlExtension-derived classes Provides DOM Selector like API: querySelector and querySelectorAll, in order to find specific elements in an HTML document.

Example:

    const QList<SelectorInterface.Element> elements = selectorInterface->querySelectorAll("head > link[rel=\"alternate\"]");

## Enumerations
QueryMethod | { None, EntireContent, SelectedContent }
## Methods
KParts.SelectorInterface.Element | querySelector (self, QString query, KParts.SelectorInterface.QueryMethod method)
[KParts.SelectorInterface.Element] | querySelectorAll (self, QString query, KParts.SelectorInterface.QueryMethod method)
KParts.SelectorInterface.QueryMethods | supportedQueryMethods (self)

## Method Documentation

KParts.SelectorInterface.Element querySelector | ( | self, |
|  | QString | query,
|  | KParts.SelectorInterface.QueryMethod | method
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Returns the first (in document order) element in this fragment matching the given CSS selector query and querying method method.

Note that since the returned item is static snapshot, i.e. not live, it will not be updated when the document changes.

If the quering method specified by method is not supported or cannot be handled, then a null element is returned.

See also:
  supportedQueryMethods

See also:
  QueryMethod

[KParts.SelectorInterface.Element] querySelectorAll | ( | self, |
|  | QString | query,
|  | KParts.SelectorInterface.QueryMethod | method
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Returns all (in document order) elements in this fragment matching the given CSS selector query and querying method method.

Note that since the returned list is static snapshot, i.e. not live, it will not be updated when the document changes.

If the quering method specified by method is not supported or cannot be handled, then an empty list is returned.

See also:
  supportedQueryMethods

See also:
  QueryMethod

KParts.SelectorInterface.QueryMethods supportedQueryMethods | ( |  | self ) |

Returns the supported query methods.

By default this function returns None.

See also:
  QueryMethod

## Enumeration Documentation

QueryMethod

Query methods.

Enumerator:

  None = 0x00 |
  EntireContent = 0x01 |
  SelectedContent = 0x02 |