Update git submodules
[LibreOffice.git] / writerperfect / source / draw / PageMakerImportFilter.cxx
blobb7d207c0e73137230fadb0124b5eddf325d0dcfa
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* PageMakerImportFilter: Sets up the filter, and calls OdgExporter
3 * to do the actual filtering
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 */
10 #include <libpagemaker/libpagemaker.h>
12 #include <cppuhelper/supportsservice.hxx>
14 #include "PageMakerImportFilter.hxx"
16 bool PageMakerImportFilter::doImportDocument(weld::Window*, librevenge::RVNGInputStream& rInput,
17 OdgGenerator& rGenerator, utl::MediaDescriptor&)
19 return libpagemaker::PMDocument::parse(&rInput, &rGenerator);
22 bool PageMakerImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName)
24 if (libpagemaker::PMDocument::isSupported(&rInput))
26 rTypeName = "draw_PageMaker_Document";
27 return true;
30 return false;
33 // XServiceInfo
34 OUString SAL_CALL PageMakerImportFilter::getImplementationName()
36 return u"org.libreoffice.comp.Draw.PageMakerImportFilter"_ustr;
39 sal_Bool SAL_CALL PageMakerImportFilter::supportsService(const OUString& rServiceName)
41 return cppu::supportsService(this, rServiceName);
44 css::uno::Sequence<OUString> SAL_CALL PageMakerImportFilter::getSupportedServiceNames()
46 return { u"com.sun.star.document.ImportFilter"_ustr,
47 u"com.sun.star.document.ExtendedTypeDetection"_ustr };
50 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
51 org_libreoffice_comp_Draw_PageMakerImportFilter_get_implementation(
52 css::uno::XComponentContext* const context, const css::uno::Sequence<css::uno::Any>&)
54 return cppu::acquire(new PageMakerImportFilter(context));
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */