LibreOffice Module writerperfect (master) 1
PageMakerImportFilter.cxx
Go to the documentation of this file.
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
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
10#include <libpagemaker/libpagemaker.h>
11
13
15
16bool PageMakerImportFilter::doImportDocument(weld::Window*, librevenge::RVNGInputStream& rInput,
17 OdgGenerator& rGenerator, utl::MediaDescriptor&)
18{
19 return libpagemaker::PMDocument::parse(&rInput, &rGenerator);
20}
21
22bool PageMakerImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName)
23{
24 if (libpagemaker::PMDocument::isSupported(&rInput))
25 {
26 rTypeName = "draw_PageMaker_Document";
27 return true;
28 }
29
30 return false;
31}
32
33// XServiceInfo
35{
36 return "org.libreoffice.comp.Draw.PageMakerImportFilter";
37}
38
39sal_Bool SAL_CALL PageMakerImportFilter::supportsService(const OUString& rServiceName)
40{
41 return cppu::supportsService(this, rServiceName);
42}
43
44css::uno::Sequence<OUString> SAL_CALL PageMakerImportFilter::getSupportedServiceNames()
45{
46 return { "com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection" };
47}
48
49extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
51 css::uno::XComponentContext* const context, const css::uno::Sequence<css::uno::Any>&)
52{
53 return cppu::acquire(new PageMakerImportFilter(context));
54}
55
56/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * org_libreoffice_comp_Draw_PageMakerImportFilter_get_implementation(css::uno::XComponentContext *const context, const css::uno::Sequence< css::uno::Any > &)
virtual OUString SAL_CALL getImplementationName() override
virtual bool doImportDocument(weld::Window *pParent, librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
unsigned char sal_Bool