LibreOffice Module writerperfect (master) 1
QXPImportFilter.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* QXPImportFilter: 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#include <libqxp/libqxp.h>
11
13
14#include "QXPImportFilter.hxx"
15
17using com::sun::star::uno::XComponentContext;
18using com::sun::star::uno::XInterface;
19
20bool QXPImportFilter::doImportDocument(weld::Window*, librevenge::RVNGInputStream& rInput,
21 OdgGenerator& rGenerator, utl::MediaDescriptor&)
22{
23 return libqxp::QXPDocument::parse(&rInput, &rGenerator) == libqxp::QXPDocument::RESULT_OK;
24}
25
26bool QXPImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName)
27{
28 if (libqxp::QXPDocument::isSupported(&rInput))
29 {
30 rTypeName = "draw_QXP_Document";
31 return true;
32 }
33
34 return false;
35}
36
37// XServiceInfo
39{
40 return "org.libreoffice.comp.Draw.QXPImportFilter";
41}
42
43sal_Bool SAL_CALL QXPImportFilter::supportsService(const OUString& rServiceName)
44{
45 return cppu::supportsService(this, rServiceName);
46}
47
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 QXPImportFilter(context));
58}
59
60/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * org_libreoffice_comp_Draw_QXPImportFilter_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 css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 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