LibreOffice Module writerperfect (master) 1
WPGImportFilter.cxx
Go to the documentation of this file.
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
4 *
5 * This file is part of the LibreOffice project.
6 *
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/.
10 */
11
12/* "This product is not manufactured, approved, or supported by
13 * Corel Corporation or Corel Corporation Limited."
14 */
15
17
18#include <libwpg/libwpg.h>
19
20#include "WPGImportFilter.hxx"
21
22bool WPGImportFilter::doImportDocument(weld::Window*, librevenge::RVNGInputStream& rInput,
23 OdgGenerator& rGenerator, utl::MediaDescriptor&)
24{
25 return libwpg::WPGraphics::parse(&rInput, &rGenerator);
26}
27
28bool WPGImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName)
29{
30 if (libwpg::WPGraphics::isSupported(&rInput))
31 {
32 rTypeName = "draw_WordPerfect_Graphics";
33 return true;
34 }
35
36 return false;
37}
38
39// XServiceInfo
41{
42 return "com.sun.star.comp.Draw.WPGImportFilter";
43}
44
45sal_Bool SAL_CALL WPGImportFilter::supportsService(const OUString& rServiceName)
46{
47 return cppu::supportsService(this, rServiceName);
48}
49
50css::uno::Sequence<OUString> SAL_CALL WPGImportFilter::getSupportedServiceNames()
51{
52 return { "com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection" };
53}
54
55extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
57 css::uno::XComponentContext* const context, const css::uno::Sequence<css::uno::Any>&)
58{
59 return cppu::acquire(new WPGImportFilter(context));
60}
61
62/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Draw_WPGImportFilter_get_implementation(css::uno::XComponentContext *const context, const css::uno::Sequence< css::uno::Any > &)
virtual bool doImportDocument(weld::Window *pParent, librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &) override
virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
unsigned char sal_Bool