Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-10 10:23:49

0001 //========================================================================
0002 //
0003 // PDFDocFactory.h
0004 //
0005 // This file is licensed under the GPLv2 or later
0006 //
0007 // Copyright 2010 Hib Eris <hib@hiberis.nl>
0008 // Copyright 2010, 2018, 2021, 2022 Albert Astals Cid <aacid@kde.org>
0009 // Copyright 2019, 2021 Oliver Sander <oliver.sander@tu-dresden.de>
0010 //
0011 //========================================================================
0012 
0013 #ifndef PDFDOCFACTORY_H
0014 #define PDFDOCFACTORY_H
0015 
0016 #include <memory>
0017 
0018 #include "PDFDoc.h"
0019 #include "poppler_private_export.h"
0020 
0021 class GooString;
0022 class PDFDocBuilder;
0023 
0024 //------------------------------------------------------------------------
0025 // PDFDocFactory
0026 //
0027 // PDFDocFactory allows the construction of PDFDocs from different URIs.
0028 //
0029 // By default, it supports local files, 'file://' and 'fd:0' (stdin). When
0030 // compiled with libcurl, it also supports 'http://' and 'https://'.
0031 //
0032 // You can extend the supported URIs by giving a list of PDFDocBuilders to
0033 // the constructor, or by registering a new PDFDocBuilder afterwards.
0034 //------------------------------------------------------------------------
0035 
0036 class POPPLER_PRIVATE_EXPORT PDFDocFactory
0037 {
0038 
0039 public:
0040     explicit PDFDocFactory(std::vector<PDFDocBuilder *> *pdfDocBuilders = nullptr);
0041     ~PDFDocFactory();
0042 
0043     PDFDocFactory(const PDFDocFactory &) = delete;
0044     PDFDocFactory &operator=(const PDFDocFactory &) = delete;
0045 
0046     // Create a PDFDoc. Returns a PDFDoc. You should check this PDFDoc
0047     // with PDFDoc::isOk() for failures.
0048     // The caller is responsible for deleting ownerPassword, userPassWord and guiData.
0049     std::unique_ptr<PDFDoc> createPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr);
0050 
0051     // Extend supported URIs with the ones from the PDFDocBuilder.
0052     void registerPDFDocBuilder(PDFDocBuilder *pdfDocBuilder);
0053 
0054 private:
0055     std::vector<PDFDocBuilder *> *builders;
0056 };
0057 
0058 #endif /* PDFDOCFACTORY_H */