1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* MSPUBImportFilter: 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/.
10 #include <cppuhelper/supportsservice.hxx>
12 #include <libmspub/libmspub.h>
14 #include "MSPUBImportFilter.hxx"
16 bool MSPUBImportFilter::doImportDocument(weld::Window
*, librevenge::RVNGInputStream
& rInput
,
17 OdgGenerator
& rGenerator
, utl::MediaDescriptor
&)
19 return libmspub::MSPUBDocument::parse(&rInput
, &rGenerator
);
22 bool MSPUBImportFilter::doDetectFormat(librevenge::RVNGInputStream
& rInput
, OUString
& rTypeName
)
24 if (libmspub::MSPUBDocument::isSupported(&rInput
))
26 rTypeName
= "draw_Publisher_Document";
34 OUString SAL_CALL
MSPUBImportFilter::getImplementationName()
36 return u
"com.sun.star.comp.Draw.MSPUBImportFilter"_ustr
;
39 sal_Bool SAL_CALL
MSPUBImportFilter::supportsService(const OUString
& rServiceName
)
41 return cppu::supportsService(this, rServiceName
);
44 css::uno::Sequence
<OUString
> SAL_CALL
MSPUBImportFilter::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 com_sun_star_comp_Draw_MSPUBImportFilter_get_implementation(
52 css::uno::XComponentContext
* const context
, const css::uno::Sequence
<css::uno::Any
>&)
54 return cppu::acquire(new MSPUBImportFilter(context
));
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */