update dev300-m58
[ooovba.git] / sdext / source / pdfimport / filterdet.hxx
blobd7997dcec83e3f0052fde70c150510a8ddf23f06
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filterdet.hxx,v $
11 * $Revision: 1.2 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef INCLUDED_PDFI_FILTERDET_HXX
33 #define INCLUDED_PDFI_FILTERDET_HXX
35 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/uno/XComponentContext.hpp>
38 #include <com/sun/star/io/XStream.hpp>
39 #include <com/sun/star/task/XInteractionHandler.hpp>
41 #include <cppuhelper/compbase1.hxx>
42 #include <cppuhelper/basemutex.hxx>
45 namespace pdfi
48 typedef ::cppu::WeakComponentImplHelper1<
49 com::sun::star::document::XExtendedFilterDetection > PDFDetectorBase;
51 class PDFDetector : private cppu::BaseMutex,
52 public PDFDetectorBase
54 private:
55 com::sun::star::uno::Reference<
56 com::sun::star::uno::XComponentContext > m_xContext;
58 public:
59 explicit PDFDetector( const ::com::sun::star::uno::Reference<
60 ::com::sun::star::uno::XComponentContext >& xContext );
62 // XExtendedFilterDetection
63 virtual rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence<
64 com::sun::star::beans::PropertyValue >& io_rDescriptor )
65 throw (com::sun::star::uno::RuntimeException);
69 /** Retrieve embedded substream from PDF file
71 Useful e.g. for hybrid PDF
73 @param rPDFFile
74 URI of the pdf file
76 @param o_rOutMimetype
77 Output parameter. Receives the mime type of the
78 substream. Used to distinguish between
79 draw/impress/writer/calc during import
81 @param o_rOutPwd
82 In/Out parameter. If given password is wrong, user is queried
83 for another (if bMayUseUI is true)
85 @param xContext
86 Component context
88 @param rFilterData
89 Basically used to pass on XFilter::filter properties (function
90 uses it to retrieve interaction handler)
92 @param bMayUseUI
93 When false, no dialog is opened to query user for alternate
94 password
96 com::sun::star::uno::Reference< com::sun::star::io::XStream >
97 getAdditionalStream( const rtl::OUString& rPDFFile,
98 rtl::OUString& o_rOutMimetype,
99 rtl::OUString& io_rOutPwd,
100 const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext,
101 const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rFilterData,
102 bool bMayUseUI );
105 bool checkDocChecksum( const rtl::OUString& rInPDFFileURL,
106 sal_uInt32 nBytes,
107 const rtl::OUString& rChkSum );
109 bool getPassword( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >& xHandler,
110 rtl::OUString& o_rPwd,
111 bool bFirstTry );
115 #endif