15#include <libe-book/libe-book.h>
19using libebook::EBOOKDocument;
22 OdtGenerator& rGenerator,
28 assert(!aFilterName.isEmpty());
30 if (aFilterName ==
"Palm_Text_Document")
32 return EBOOKDocument::RESULT_OK == EBOOKDocument::parse(&rInput, &rGenerator);
36 EBOOKDocument::Type
type = EBOOKDocument::TYPE_UNKNOWN;
38 if (aFilterName ==
"BroadBand eBook")
39 type = EBOOKDocument::TYPE_BBEB;
40 else if (aFilterName ==
"FictionBook 2")
41 type = EBOOKDocument::TYPE_FICTIONBOOK2;
42 else if (aFilterName ==
"PalmDoc")
43 type = EBOOKDocument::TYPE_PALMDOC;
44 else if (aFilterName ==
"Plucker eBook")
45 type = EBOOKDocument::TYPE_PLUCKER;
47 if (EBOOKDocument::TYPE_UNKNOWN !=
type)
48 return EBOOKDocument::RESULT_OK == EBOOKDocument::parse(&rInput, &rGenerator,
type);
58 EBOOKDocument::Type
type = EBOOKDocument::TYPE_UNKNOWN;
60 if (EBOOKDocument::CONFIDENCE_EXCELLENT == EBOOKDocument::isSupported(&rInput, &
type))
64 case EBOOKDocument::TYPE_BBEB:
65 rTypeName =
"writer_BroadBand_eBook";
67 case EBOOKDocument::TYPE_FICTIONBOOK2:
68 rTypeName =
"writer_FictionBook_2";
70 case EBOOKDocument::TYPE_PALMDOC:
71 rTypeName =
"writer_PalmDoc";
73 case EBOOKDocument::TYPE_PLUCKER:
74 rTypeName =
"writer_Plucker_eBook";
76 case EBOOKDocument::TYPE_PEANUTPRESS:
77 case EBOOKDocument::TYPE_TEALDOC:
78 case EBOOKDocument::TYPE_ZTXT:
79 rTypeName =
"Palm_Text_Document";
83 "EBookImportFilter::doDetectFormat: document type "
84 <<
type <<
" detected, but ignored");
88 return !rTypeName.isEmpty();
94 return "org.libreoffice.comp.Writer.EBookImportFilter";
104 return {
"com.sun.star.document.ImportFilter",
"com.sun.star.document.ExtendedTypeDetection" };
107extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
109 css::uno::XComponentContext*
const context,
const css::uno::Sequence<css::uno::Any>&)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * org_libreoffice_comp_Writer_EBookImportFilter_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 &rDescriptor) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual OUString SAL_CALL getImplementationName() override
#define SAL_WARN_IF(condition, area, stream)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)