1//========================================================================
2//
3// PDFDocBuilder.h
4//
5// This file is licensed under the GPLv2 or later
6//
7// Copyright 2010 Hib Eris <hib@hiberis.nl>
8// Copyright 2010, 2018, 2020, 2022 Albert Astals Cid <aacid@kde.org>
9// Copyright 2021 Oliver Sander <oliver.sander@tu-dresden.de>
10//
11//========================================================================
12
13#ifndef PDFDOCBUILDER_H
14#define PDFDOCBUILDER_H
15
16#include <memory>
17
18#include "PDFDoc.h"
19class GooString;
20
21//------------------------------------------------------------------------
22// PDFDocBuilder
23//
24// PDFDocBuilder is an abstract class that specifies the interface for
25// constructing PDFDocs.
26//------------------------------------------------------------------------
27
28class PDFDocBuilder
29{
30
31public:
32 PDFDocBuilder() = default;
33 virtual ~PDFDocBuilder();
34
35 PDFDocBuilder(const PDFDocBuilder &) = delete;
36 PDFDocBuilder &operator=(const PDFDocBuilder &) = delete;
37
38 // Builds a new PDFDoc. Returns a PDFDoc. You should check this PDFDoc
39 // with PDFDoc::isOk() for failures.
40 // The caller is responsible for deleting ownerPassword, userPassWord and guiData.
41 virtual std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) = 0;
42
43 // Returns true if the builder supports building a PDFDoc from the URI.
44 virtual bool supports(const GooString &uri) = 0;
45};
46
47#endif /* PDFDOCBUILDER_H */
48

source code of poppler/poppler/PDFDocBuilder.h