nss: upgrade to release 3.73
[LibreOffice.git] / writerperfect / source / calc / NumbersImportFilter.cxx
blob813684361a0180b0926c29ced82583ce638503b2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* NumbersImportFilter: Sets up the filter, and calls DocumentCollector
3 * to do the actual filtering
5 * This file is part of the LibreOffice project.
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/.
12 #include <libetonyek/libetonyek.h>
14 #include <cppuhelper/supportsservice.hxx>
16 #include "NumbersImportFilter.hxx"
18 using libetonyek::EtonyekDocument;
20 bool NumbersImportFilter::doImportDocument(weld::Window*, librevenge::RVNGInputStream& rInput,
21 OdsGenerator& rGenerator, utl::MediaDescriptor&)
23 return EtonyekDocument::parse(&rInput, &rGenerator);
26 bool NumbersImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName)
28 EtonyekDocument::Type type = EtonyekDocument::TYPE_UNKNOWN;
29 const EtonyekDocument::Confidence confidence = EtonyekDocument::isSupported(&rInput, &type);
30 if ((confidence == EtonyekDocument::CONFIDENCE_EXCELLENT)
31 && (type == EtonyekDocument::TYPE_NUMBERS))
33 rTypeName = "calc_AppleNumbers";
34 return true;
37 return false;
40 void NumbersImportFilter::doRegisterHandlers(OdsGenerator&) {}
42 // XServiceInfo
43 OUString SAL_CALL NumbersImportFilter::getImplementationName()
45 return "org.libreoffice.comp.Calc.NumbersImportFilter";
48 sal_Bool SAL_CALL NumbersImportFilter::supportsService(const OUString& rServiceName)
50 return cppu::supportsService(this, rServiceName);
53 css::uno::Sequence<OUString> SAL_CALL NumbersImportFilter::getSupportedServiceNames()
55 return { "com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection" };
58 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
59 org_libreoffice_comp_Calc_NumbersImportFilter_get_implementation(
60 css::uno::XComponentContext* const context, const css::uno::Sequence<css::uno::Any>&)
62 return cppu::acquire(new NumbersImportFilter(context));
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */