KParts::SelectorInterface

Search for usage in LXR

KParts::SelectorInterface Class Referenceabstract

#include <KParts/SelectorInterface>

Inheritance diagram for KParts::SelectorInterface:

Public Types

enum  QueryMethod { None = 0x00, EntireContent = 0x01, SelectedContent = 0x02 }
 
typedef QFlags< QueryMethodQueryMethods
 

Public Member Functions

virtual ~SelectorInterface ()
 
virtual Element querySelector (const QString &query, QueryMethod method) const =0
 
virtual QList< Element > querySelectorAll (const QString &query, QueryMethod method) const =0
 
virtual QueryMethods supportedQueryMethods () const
 

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\"]");

Definition at line 35 of file selectorinterface.h.

Member Typedef Documentation

◆ QueryMethods

Stores a combination of QueryMethod values.

Definition at line 53 of file selectorinterface.h.

Member Enumeration Documentation

◆ QueryMethod

Query methods.

See also
QueryMethods
Enumerator
None 

Querying is not possible.

EntireContent 

Query or can query the entire content.

SelectedContent 

Query or can query only the user selected content, if any.

Definition at line 45 of file selectorinterface.h.

Constructor & Destructor Documentation

◆ ~SelectorInterface()

virtual KParts::SelectorInterface::~SelectorInterface ( )
inlinevirtual

Destructor.

Definition at line 58 of file selectorinterface.h.

Member Function Documentation

◆ querySelector()

virtual Element KParts::SelectorInterface::querySelector ( const QString query,
QueryMethod  method 
) const
pure virtual

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 querying method specified by method is not supported or cannot be handled, then a null element is returned.

See also
supportedQueryMethods
QueryMethod

◆ querySelectorAll()

virtual QList<Element> KParts::SelectorInterface::querySelectorAll ( const QString query,
QueryMethod  method 
) const
pure virtual

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 querying method specified by method is not supported or cannot be handled, then an empty list is returned.

See also
supportedQueryMethods
QueryMethod

◆ supportedQueryMethods()

SelectorInterface::QueryMethods SelectorInterface::supportedQueryMethods ( ) const
virtual

Returns the supported query methods.

By default this function returns None.

See also
QueryMethod

Definition at line 14 of file selectorinterface.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:53:51 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.