Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sdext / source / pdfimport / filterdet.hxx
blob995ed599169577a40b130973cb5ba99de4065718
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SDEXT_SOURCE_PDFIMPORT_FILTERDET_HXX
21 #define INCLUDED_SDEXT_SOURCE_PDFIMPORT_FILTERDET_HXX
23 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <com/sun/star/io/XStream.hpp>
27 #include <com/sun/star/task/XInteractionHandler.hpp>
29 #include <cppuhelper/compbase.hxx>
30 #include <cppuhelper/basemutex.hxx>
33 namespace pdfi
36 typedef ::cppu::WeakComponentImplHelper<
37 css::document::XExtendedFilterDetection, css::lang::XServiceInfo> PDFDetectorBase;
39 class PDFDetector : private cppu::BaseMutex,
40 public PDFDetectorBase
42 private:
43 css::uno::Reference<
44 css::uno::XComponentContext > m_xContext;
46 public:
47 explicit PDFDetector( const css::uno::Reference<
48 css::uno::XComponentContext >& xContext );
50 // XExtendedFilterDetection
51 virtual OUString SAL_CALL detect( css::uno::Sequence<
52 css::beans::PropertyValue >& io_rDescriptor ) override;
54 OUString SAL_CALL getImplementationName() override;
56 sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
58 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
62 /** Retrieve embedded substream from PDF file
64 Useful e.g. for hybrid PDF
66 @param rPDFFile
67 URI of the pdf file
69 @param o_rOutMimetype
70 Output parameter. Receives the mime type of the
71 substream. Used to distinguish between
72 draw/impress/writer/calc during import
74 @param o_rOutPwd
75 In/Out parameter. If given password is wrong, user is queried
76 for another (if bMayUseUI is true)
78 @param xContext
79 Component context
81 @param rFilterData
82 Basically used to pass on XFilter::filter properties (function
83 uses it to retrieve interaction handler)
85 @param bMayUseUI
86 When false, no dialog is opened to query user for alternate
87 password
89 css::uno::Reference< css::io::XStream >
90 getAdditionalStream( const OUString& rPDFFile,
91 OUString& o_rOutMimetype,
92 OUString& io_rOutPwd,
93 const css::uno::Reference< css::uno::XComponentContext >& xContext,
94 const css::uno::Sequence< css::beans::PropertyValue >& rFilterData,
95 bool bMayUseUI );
98 bool checkDocChecksum( const OUString& rInPDFFileURL,
99 sal_uInt32 nBytes,
100 const OUString& rChkSum );
104 #endif
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */