LibreOffice Module writerperfect (master) 1
AbiWordImportFilter.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* AbiWordImportFilter: Sets up the filter, and calls DocumentCollector
3 * to do the actual filtering
4 *
5 * This file is part of the LibreOffice project.
6 *
7 * This Source Code Form is subject to the terms of the Mozilla Public
8 * License, v. 2.0. If a copy of the MPL was not distributed with this
9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 */
11
13
14#include <libabw/libabw.h>
15
17
18bool AbiWordImportFilter::doImportDocument(weld::Window*, librevenge::RVNGInputStream& rInput,
19 OdtGenerator& rGenerator, utl::MediaDescriptor&)
20{
21 return libabw::AbiDocument::parse(&rInput, &rGenerator);
22}
23
24bool AbiWordImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName)
25{
26 if (libabw::AbiDocument::isFileFormatSupported(&rInput))
27 {
28 rTypeName = "writer_AbiWord_Document";
29 return true;
30 }
31
32 return false;
33}
34
35// XServiceInfo
37{
38 return "com.sun.star.comp.Writer.AbiWordImportFilter";
39}
40
41sal_Bool SAL_CALL AbiWordImportFilter::supportsService(const OUString& rServiceName)
42{
43 return cppu::supportsService(this, rServiceName);
44}
45
46css::uno::Sequence<OUString> SAL_CALL AbiWordImportFilter::getSupportedServiceNames()
47{
48 return { "com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection" };
49}
50
51extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
53 css::uno::XComponentContext* const context, const css::uno::Sequence<css::uno::Any>&)
54{
55 return cppu::acquire(new AbiWordImportFilter(context));
56}
57
58/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_AbiWordImportFilter_get_implementation(css::uno::XComponentContext *const context, const css::uno::Sequence< css::uno::Any > &)
virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual bool doImportDocument(weld::Window *pParent, librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &) 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