1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* CMXImportFilter: 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 /* "This product is not manufactured, approved, or supported by
11 * Corel Corporation or Corel Corporation Limited."
14 #include <cppuhelper/supportsservice.hxx>
16 #include <libcdr/libcdr.h>
18 #include "CMXImportFilter.hxx"
20 bool CMXImportFilter::doImportDocument(weld::Window
*, librevenge::RVNGInputStream
& rInput
,
21 OdgGenerator
& rGenerator
, utl::MediaDescriptor
&)
23 return libcdr::CMXDocument::parse(&rInput
, &rGenerator
);
26 bool CMXImportFilter::doDetectFormat(librevenge::RVNGInputStream
& rInput
, OUString
& rTypeName
)
28 if (libcdr::CMXDocument::isSupported(&rInput
))
30 rTypeName
= "draw_Corel_Presentation_Exchange";
38 OUString SAL_CALL
CMXImportFilter::getImplementationName()
40 return u
"com.sun.star.comp.Draw.CMXImportFilter"_ustr
;
43 sal_Bool SAL_CALL
CMXImportFilter::supportsService(const OUString
& rServiceName
)
45 return cppu::supportsService(this, rServiceName
);
48 css::uno::Sequence
<OUString
> SAL_CALL
CMXImportFilter::getSupportedServiceNames()
50 return { u
"com.sun.star.document.ImportFilter"_ustr
,
51 u
"com.sun.star.document.ExtendedTypeDetection"_ustr
};
54 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
55 com_sun_star_comp_Draw_CMXImportFilter_get_implementation(
56 css::uno::XComponentContext
* const context
, const css::uno::Sequence
<css::uno::Any
>&)
58 return cppu::acquire(new CMXImportFilter(context
));
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */