LibreOffice Module sdext (master) 1
pdfiadaptor.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_SDEXT_SOURCE_PDFIMPORT_PDFIADAPTOR_HXX
21#define INCLUDED_SDEXT_SOURCE_PDFIMPORT_PDFIADAPTOR_HXX
22
23#include <xmlemitter.hxx>
25
26#include <com/sun/star/lang/XServiceInfo.hpp>
27#include <com/sun/star/xml/XImportFilter.hpp>
28#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
29#include <com/sun/star/uno/XComponentContext.hpp>
30#include <com/sun/star/task/XStatusIndicator.hpp>
31#include <com/sun/star/document/XFilter.hpp>
32#include <com/sun/star/io/XInputStream.hpp>
33#include <com/sun/star/io/XOutputStream.hpp>
34#include <com/sun/star/document/XImporter.hpp>
35#include <com/sun/star/frame/XModel.hpp>
36
38
39
40namespace pdfi
41{
43 css::document::XFilter,
44 css::document::XImporter,
45 css::lang::XServiceInfo> PDFIHybridAdaptorBase;
46
48 {
49 private:
50 css::uno::Reference<
51 css::uno::XComponentContext > m_xContext;
52 css::uno::Reference<
53 css::frame::XModel > m_xModel;
54
55 public:
56 explicit PDFIHybridAdaptor( const css::uno::Reference<
57 css::uno::XComponentContext >& xContext );
58
59 // XFilter
60 virtual sal_Bool SAL_CALL filter( const css::uno::Sequence<css::beans::PropertyValue>& rFilterData ) override;
61 virtual void SAL_CALL cancel() override;
62
63 // XImporter
64 virtual void SAL_CALL setTargetDocument( const css::uno::Reference< css::lang::XComponent >& xDocument ) override;
65
66 OUString SAL_CALL getImplementationName() override;
67
68 sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
69
70 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
71 };
72
74 css::xml::XImportFilter,
75 css::document::XImporter,
76 css::lang::XServiceInfo> PDFIAdaptorBase;
77
81 {
82 private:
83 OUString const m_implementationName;
84 css::uno::Reference<
85 css::uno::XComponentContext > m_xContext;
86 css::uno::Reference<
87 css::frame::XModel > m_xModel;
89
90 bool parse( const css::uno::Reference<css::io::XInputStream>& xInput,
91 const css::uno::Reference<css::task::XInteractionHandler>& xIHdl,
92 const OUString& rPwd,
93 const css::uno::Reference<css::task::XStatusIndicator>& xStatus,
94 const XmlEmitterSharedPtr& rEmitter,
95 const OUString& rURL,
96 const OUString& rFilterOptions);
97
98 public:
99 explicit PDFIRawAdaptor( OUString const & implementationName,
100 const css::uno::Reference<
101 css::uno::XComponentContext >& xContext );
102
108 void setTreeVisitorFactory(const TreeVisitorFactorySharedPtr& rVisitorFactory);
109
118 bool odfConvert( const OUString& rURL,
119 const css::uno::Reference<css::io::XOutputStream>& xOutput,
120 const css::uno::Reference<css::task::XStatusIndicator>& xStatus );
121
122 // XImportFilter
123 virtual sal_Bool SAL_CALL importer( const css::uno::Sequence< css::beans::PropertyValue >& rSourceData,
124 const css::uno::Reference< css::xml::sax::XDocumentHandler >& rHdl,
125 const css::uno::Sequence< OUString >& rUserData ) override;
126
127 // XImporter
128 virtual void SAL_CALL setTargetDocument( const css::uno::Reference< css::lang::XComponent >& xDocument ) override;
129
130 OUString SAL_CALL getImplementationName() override;
131
132 sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
133
134 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
135 };
136}
137
138#endif
139
140/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL cancel() override
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL filter(const css::uno::Sequence< css::beans::PropertyValue > &rFilterData) override
Definition: pdfiadaptor.cxx:52
virtual void SAL_CALL setTargetDocument(const css::uno::Reference< css::lang::XComponent > &xDocument) override
OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: pdfiadaptor.hxx:51
PDFIHybridAdaptor(const css::uno::Reference< css::uno::XComponentContext > &xContext)
Definition: pdfiadaptor.cxx:46
css::uno::Reference< css::frame::XModel > m_xModel
Definition: pdfiadaptor.hxx:53
Adapts raw pdf import to XImportFilter interface.
Definition: pdfiadaptor.hxx:81
bool parse(const css::uno::Reference< css::io::XInputStream > &xInput, const css::uno::Reference< css::task::XInteractionHandler > &xIHdl, const OUString &rPwd, const css::uno::Reference< css::task::XStatusIndicator > &xStatus, const XmlEmitterSharedPtr &rEmitter, const OUString &rURL, const OUString &rFilterOptions)
bool odfConvert(const OUString &rURL, const css::uno::Reference< css::io::XOutputStream > &xOutput, const css::uno::Reference< css::task::XStatusIndicator > &xStatus)
Export pdf document to ODG.
css::uno::Reference< css::frame::XModel > m_xModel
Definition: pdfiadaptor.hxx:87
virtual void SAL_CALL setTargetDocument(const css::uno::Reference< css::lang::XComponent > &xDocument) override
TreeVisitorFactorySharedPtr m_pVisitorFactory
Definition: pdfiadaptor.hxx:88
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void setTreeVisitorFactory(const TreeVisitorFactorySharedPtr &rVisitorFactory)
Set factory object used to create the tree visitors.
PDFIRawAdaptor(OUString const &implementationName, const css::uno::Reference< css::uno::XComponentContext > &xContext)
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: pdfiadaptor.hxx:85
OUString SAL_CALL getImplementationName() override
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
OUString const m_implementationName
Definition: pdfiadaptor.hxx:83
virtual sal_Bool SAL_CALL importer(const css::uno::Sequence< css::beans::PropertyValue > &rSourceData, const css::uno::Reference< css::xml::sax::XDocumentHandler > &rHdl, const css::uno::Sequence< OUString > &rUserData) override
::comphelper::WeakComponentImplHelper< css::xml::XImportFilter, css::document::XImporter, css::lang::XServiceInfo > PDFIAdaptorBase
Definition: pdfiadaptor.hxx:76
std::shared_ptr< TreeVisitorFactory > TreeVisitorFactorySharedPtr
::comphelper::WeakComponentImplHelper< css::document::XFilter, css::document::XImporter, css::lang::XServiceInfo > PDFIHybridAdaptorBase
Definition: pdfiadaptor.hxx:45
std::shared_ptr< XmlEmitter > XmlEmitterSharedPtr
Definition: xmlemitter.hxx:48
unsigned char sal_Bool