1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* WPGImportFilter: Sets up the filter, and calls OdgExporter
3 * to do the actual filtering
5 * This file is part of the LibreOffice project.
7 * This Source Code Form is subject to the terms of the Mozilla Public
8 * License, v. 2.0. If a copy of the MPL was not distributed with this
9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 /* "This product is not manufactured, approved, or supported by
13 * Corel Corporation or Corel Corporation Limited."
16 #include <cppuhelper/supportsservice.hxx>
18 #include <libwpg/libwpg.h>
20 #include "WPGImportFilter.hxx"
22 bool WPGImportFilter::doImportDocument(weld::Window
*, librevenge::RVNGInputStream
& rInput
,
23 OdgGenerator
& rGenerator
, utl::MediaDescriptor
&)
25 return libwpg::WPGraphics::parse(&rInput
, &rGenerator
);
28 bool WPGImportFilter::doDetectFormat(librevenge::RVNGInputStream
& rInput
, OUString
& rTypeName
)
30 if (libwpg::WPGraphics::isSupported(&rInput
))
32 rTypeName
= "draw_WordPerfect_Graphics";
40 OUString SAL_CALL
WPGImportFilter::getImplementationName()
42 return u
"com.sun.star.comp.Draw.WPGImportFilter"_ustr
;
45 sal_Bool SAL_CALL
WPGImportFilter::supportsService(const OUString
& rServiceName
)
47 return cppu::supportsService(this, rServiceName
);
50 css::uno::Sequence
<OUString
> SAL_CALL
WPGImportFilter::getSupportedServiceNames()
52 return { u
"com.sun.star.document.ImportFilter"_ustr
,
53 u
"com.sun.star.document.ExtendedTypeDetection"_ustr
};
56 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
57 com_sun_star_comp_Draw_WPGImportFilter_get_implementation(
58 css::uno::XComponentContext
* const context
, const css::uno::Sequence
<css::uno::Any
>&)
60 return cppu::acquire(new WPGImportFilter(context
));
63 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */