fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / writerperfect / source / writer / PagesImportFilter.cxx
blob3942aa0984b887eb982fe3828948c2233a7c9bd9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* PagesImportFilter: 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 <com/sun/star/uno/Reference.h>
16 #include <cppuhelper/supportsservice.hxx>
18 #include "PagesImportFilter.hxx"
20 using com::sun::star::uno::Sequence;
21 using com::sun::star::uno::Reference;
22 using com::sun::star::uno::Any;
23 using com::sun::star::uno::XInterface;
24 using com::sun::star::uno::Exception;
25 using com::sun::star::uno::RuntimeException;
26 using com::sun::star::uno::XComponentContext;
28 using libetonyek::EtonyekDocument;
30 bool PagesImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &)
32 return EtonyekDocument::parse(&rInput, &rGenerator);
35 bool PagesImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName)
37 EtonyekDocument::Type type = EtonyekDocument::TYPE_UNKNOWN;
38 const EtonyekDocument::Confidence confidence = EtonyekDocument::isSupported(&rInput, &type);
39 if ((confidence == EtonyekDocument::CONFIDENCE_EXCELLENT) && (type == EtonyekDocument::TYPE_PAGES))
41 rTypeName = "writer_ApplePages";
42 return true;
45 return false;
48 OUString PagesImportFilter_getImplementationName()
49 throw (RuntimeException)
51 return OUString("org.libreoffice.comp.Writer.PagesImportFilter");
54 Sequence< OUString > SAL_CALL PagesImportFilter_getSupportedServiceNames()
55 throw (RuntimeException)
57 Sequence < OUString > aRet(2);
58 OUString *pArray = aRet.getArray();
59 pArray[0] = "com.sun.star.document.ImportFilter";
60 pArray[1] = "com.sun.star.document.ExtendedTypeDetection";
61 return aRet;
64 Reference< XInterface > SAL_CALL PagesImportFilter_createInstance(const Reference< XComponentContext > &rContext)
65 throw(Exception)
67 return static_cast<cppu::OWeakObject *>(new PagesImportFilter(rContext));
70 // XServiceInfo
71 OUString SAL_CALL PagesImportFilter::getImplementationName()
72 throw (RuntimeException, std::exception)
74 return PagesImportFilter_getImplementationName();
76 sal_Bool SAL_CALL PagesImportFilter::supportsService(const OUString &rServiceName)
77 throw (RuntimeException, std::exception)
79 return cppu::supportsService(this, rServiceName);
81 Sequence< OUString > SAL_CALL PagesImportFilter::getSupportedServiceNames()
82 throw (RuntimeException, std::exception)
84 return PagesImportFilter_getSupportedServiceNames();
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */