LibreOffice Module writerperfect (master) 1
VisioImportFilter.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* VisioImportFilter: 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
11
12#include <libvisio/libvisio.h>
13
14#include "VisioImportFilter.hxx"
15
16bool VisioImportFilter::doImportDocument(weld::Window*, librevenge::RVNGInputStream& rInput,
17 OdgGenerator& rGenerator, utl::MediaDescriptor&)
18{
19 return libvisio::VisioDocument::parse(&rInput, &rGenerator);
20}
21
22bool VisioImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName)
23{
24 if (libvisio::VisioDocument::isSupported(&rInput))
25 {
26 rTypeName = "draw_Visio_Document";
27 return true;
28 }
29
30 return false;
31}
32
33// XServiceInfo
35{
36 return "com.sun.star.comp.Draw.VisioImportFilter";
37}
38
39sal_Bool SAL_CALL VisioImportFilter::supportsService(const OUString& rServiceName)
40{
41 return cppu::supportsService(this, rServiceName);
42}
43
44css::uno::Sequence<OUString> SAL_CALL VisioImportFilter::getSupportedServiceNames()
45{
46 return { "com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection" };
47}
48
49extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
51 css::uno::XComponentContext* const context, const css::uno::Sequence<css::uno::Any>&)
52{
53 return cppu::acquire(new VisioImportFilter(context));
54}
55
56/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Draw_VisioImportFilter_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 bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
unsigned char sal_Bool