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