Update git submodules
[LibreOffice.git] / writerperfect / source / draw / FreehandImportFilter.cxx
blob938f36de5645a9296b6250c1e69a729fbef12f23
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* FreehandImportFilter: 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 <cppuhelper/supportsservice.hxx>
12 #include <libfreehand/libfreehand.h>
14 #include "FreehandImportFilter.hxx"
16 bool FreehandImportFilter::doImportDocument(weld::Window*, librevenge::RVNGInputStream& rInput,
17 OdgGenerator& rGenerator, utl::MediaDescriptor&)
19 return libfreehand::FreeHandDocument::parse(&rInput, &rGenerator);
22 bool FreehandImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName)
24 if (libfreehand::FreeHandDocument::isSupported(&rInput))
26 rTypeName = "draw_Freehand_Document";
27 return true;
30 return false;
33 // XServiceInfo
34 OUString SAL_CALL FreehandImportFilter::getImplementationName()
36 return u"com.sun.star.comp.Draw.FreehandImportFilter"_ustr;
39 sal_Bool SAL_CALL FreehandImportFilter::supportsService(const OUString& rServiceName)
41 return cppu::supportsService(this, rServiceName);
44 css::uno::Sequence<OUString> SAL_CALL FreehandImportFilter::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_FreehandImportFilter_get_implementation(
52 css::uno::XComponentContext* const context, const css::uno::Sequence<css::uno::Any>&)
54 return cppu::acquire(new FreehandImportFilter(context));
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */