KItinerary

pdfdocumentprocessor.h
1/*
2 SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <KItinerary/ExtractorDocumentProcessor>
10#include <KItinerary/PdfImage>
11
12#include <unordered_set>
13
14namespace KItinerary {
15
16/** PDF document processor. */
18{
19public:
22
23 bool canHandleData(const QByteArray &encodedData, QStringView fileName) const override;
24 ExtractorDocumentNode createNodeFromData(const QByteArray &encodedData) const override;
25 ExtractorDocumentNode createNodeFromContent(const QVariant &decodedData) const override;
26 void expandNode(ExtractorDocumentNode &node, const ExtractorEngine *engine) const override;
27 void postExtract(ExtractorDocumentNode &node, const ExtractorEngine *engine) const override;
28 QJSValue contentToScriptValue(const ExtractorDocumentNode &node, QJSEngine *engine) const override;
29 void destroyNode(ExtractorDocumentNode &node) const override;
30
31private:
32 mutable std::unordered_set<PdfImageRef> m_imageIds;
33};
34
35}
36
A node in the extracted document object tree.
Abstract base class of a document type processor.
Semantic data extraction engine.
void postExtract(ExtractorDocumentNode &node, const ExtractorEngine *engine) const override
Called after extractors have been applied to node.
bool canHandleData(const QByteArray &encodedData, QStringView fileName) const override
Fast check whether the given encoded data can possibly be processed by this instance.
QJSValue contentToScriptValue(const ExtractorDocumentNode &node, QJSEngine *engine) const override
Create a QJSValue for the node content.
void destroyNode(ExtractorDocumentNode &node) const override
Destroys type-specific data in node.
void expandNode(ExtractorDocumentNode &node, const ExtractorEngine *engine) const override
Create child nodes for node, as far as that's necessary for this document type.
ExtractorDocumentNode createNodeFromData(const QByteArray &encodedData) const override
Create a document node from raw data.
ExtractorDocumentNode createNodeFromContent(const QVariant &decodedData) const override
Create a document node from an already decoded data type.
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.