KItinerary::ExtractorDocumentProcessor

Search for usage in LXR

#include <extractordocumentprocessor.h>

Inheritance diagram for KItinerary::ExtractorDocumentProcessor:

Public Member Functions

virtual bool canHandleData (const QByteArray &encodedData, QStringView fileName) const
 
virtual QJSValue contentToScriptValue (const ExtractorDocumentNode &node, QJSEngine *engine) const
 
virtual ExtractorDocumentNode createNodeFromContent (const QVariant &decodedData) const
 
virtual ExtractorDocumentNode createNodeFromData (const QByteArray &encodedData) const
 
virtual void destroyNode (ExtractorDocumentNode &node) const
 
virtual void expandNode (ExtractorDocumentNode &node, const ExtractorEngine *engine) const
 
virtual bool matches (const ExtractorFilter &filter, const ExtractorDocumentNode &node) const
 
virtual void postExtract (ExtractorDocumentNode &node, const ExtractorEngine *engine) const
 
virtual void preExtract (ExtractorDocumentNode &node, const ExtractorEngine *engine) const
 
virtual void reduceNode (ExtractorDocumentNode &node) const
 

Protected Member Functions

template<typename T >
void destroyIfOwned (ExtractorDocumentNode &node) const
 

Static Protected Member Functions

static bool matchesGadget (const ExtractorFilter &filter, const QMetaObject *mo, const void *obj)
 
template<typename T >
static bool matchesGadget (const ExtractorFilter &filter, const T *obj)
 

Detailed Description

Abstract base class of a document type processor.

Definition at line 23 of file extractordocumentprocessor.h.

Member Function Documentation

◆ canHandleData()

◆ contentToScriptValue()

QJSValue ExtractorDocumentProcessor::contentToScriptValue ( const ExtractorDocumentNode & node,
QJSEngine * engine ) const
virtual

Create a QJSValue for the node content.

The default implementation is sufficient if the content is a QObject pointer, QGadget value, or any built-in type.

Reimplemented in KItinerary::BinaryDocumentProcessor, KItinerary::HtmlDocumentProcessor, KItinerary::IcalEventProcessor, KItinerary::PdfDocumentProcessor, and KItinerary::PkPassDocumentProcessor.

Definition at line 107 of file extractordocumentprocessor.cpp.

◆ createNodeFromContent()

ExtractorDocumentNode ExtractorDocumentProcessor::createNodeFromContent ( const QVariant & decodedData) const
virtual

Create a document node from an already decoded data type.

The default implementation just sets decodedData on the resulting node.

Reimplemented in KItinerary::HtmlDocumentProcessor, KItinerary::MimeDocumentProcessor, KItinerary::PdfDocumentProcessor, and KItinerary::PkPassDocumentProcessor.

Definition at line 30 of file extractordocumentprocessor.cpp.

◆ createNodeFromData()

◆ destroyIfOwned()

template<typename T >
void KItinerary::ExtractorDocumentProcessor::destroyIfOwned ( ExtractorDocumentNode & node) const
inlineprotected

Definition at line 80 of file extractordocumentprocessor.h.

◆ destroyNode()

void ExtractorDocumentProcessor::destroyNode ( ExtractorDocumentNode & node) const
virtual

Destroys type-specific data in node.

The default implementation does nothing.

Reimplemented in KItinerary::HtmlDocumentProcessor, KItinerary::MimeDocumentProcessor, KItinerary::PdfDocumentProcessor, and KItinerary::PkPassDocumentProcessor.

Definition at line 112 of file extractordocumentprocessor.cpp.

◆ expandNode()

◆ matches()

bool ExtractorDocumentProcessor::matches ( const ExtractorFilter & filter,
const ExtractorDocumentNode & node ) const
virtual

Checks whether the given filter matches node.

The default implementation can handle QObject and Q_GADGET types via Qt's property system.

Reimplemented in KItinerary::BinaryDocumentProcessor, KItinerary::IataBcbpDocumentProcessor, KItinerary::IcalEventProcessor, KItinerary::MimeDocumentProcessor, and KItinerary::TextDocumentProcessor.

Definition at line 55 of file extractordocumentprocessor.cpp.

◆ matchesGadget() [1/2]

bool ExtractorDocumentProcessor::matchesGadget ( const ExtractorFilter & filter,
const QMetaObject * mo,
const void * obj )
staticprotected

Definition at line 98 of file extractordocumentprocessor.cpp.

◆ matchesGadget() [2/2]

template<typename T >
static bool KItinerary::ExtractorDocumentProcessor::matchesGadget ( const ExtractorFilter & filter,
const T * obj )
inlinestaticprotected

Definition at line 87 of file extractordocumentprocessor.h.

◆ postExtract()

void ExtractorDocumentProcessor::postExtract ( ExtractorDocumentNode & node,
const ExtractorEngine * engine ) const
virtual

Called after extractors have been applied to node.

This can be used for applying document type specific data to the extracted result. The default implementation does nothing.

Reimplemented in KItinerary::HtmlDocumentProcessor, KItinerary::IcalEventProcessor, KItinerary::PdfDocumentProcessor, KItinerary::PkPassDocumentProcessor, and KItinerary::TextDocumentProcessor.

Definition at line 103 of file extractordocumentprocessor.cpp.

◆ preExtract()

void ExtractorDocumentProcessor::preExtract ( ExtractorDocumentNode & node,
const ExtractorEngine * engine ) const
virtual

Called before extractors are applied to node.

This can be used for performing document type specific extraction steps. The default implementation does nothing.

Reimplemented in KItinerary::ExternalProcessor, KItinerary::HtmlDocumentProcessor, KItinerary::IataBcbpDocumentProcessor, KItinerary::IcalEventProcessor, KItinerary::JsonLdDocumentProcessor, KItinerary::PkPassDocumentProcessor, KItinerary::SsbDocumentProcessor, KItinerary::Uic9183DocumentProcessor, and KItinerary::VdvDocumentProcessor.

Definition at line 51 of file extractordocumentprocessor.cpp.

◆ reduceNode()

void ExtractorDocumentProcessor::reduceNode ( ExtractorDocumentNode & node) const
virtual

Propagate results from child nodes up to node.

The default implementation just appends results.

Definition at line 41 of file extractordocumentprocessor.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:28:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.