12#include <libstaroffice/libstaroffice.hxx>
19using com::sun::star::uno::XComponentContext;
20using com::sun::star::uno::XInterface;
23 OdfDocumentHandler* pHandler,
24 const OdfStreamType streamType)
26 OdgGenerator exporter;
27 exporter.addDocumentHandler(pHandler, streamType);
28 return STOFFDocument::decodeGraphic(data, &exporter);
32 OdfDocumentHandler* pHandler,
33 const OdfStreamType streamType)
35 OdsGenerator exporter;
36 exporter.registerEmbeddedObjectHandler(
"image/stoff-odg",
38 exporter.addDocumentHandler(pHandler, streamType);
39 return STOFFDocument::decodeSpreadsheet(data, &exporter);
43 librevenge::RVNGInputStream& rInput,
46 STOFFDocument::Kind docKind = STOFFDocument::STOFF_K_UNKNOWN;
47 const STOFFDocument::Confidence confidence
48 = STOFFDocument::isFileFormatSupported(&rInput, docKind);
50 if (confidence == STOFFDocument::STOFF_C_SUPPORTED_ENCRYPTION)
57 if (!aPasswdDlg.
run())
67 return STOFFDocument::STOFF_R_OK
68 == STOFFDocument::parse(&rInput, &rGenerator,
69 !aUtf8Passwd.isEmpty() ? aUtf8Passwd.getStr() :
nullptr);
77 STOFFDocument::Kind docKind = STOFFDocument::STOFF_K_UNKNOWN;
78 const STOFFDocument::Confidence confidence
79 = STOFFDocument::isFileFormatSupported(&rInput, docKind);
81 if (confidence == STOFFDocument::STOFF_C_EXCELLENT
82 || confidence == STOFFDocument::STOFF_C_SUPPORTED_ENCRYPTION)
86 case STOFFDocument::STOFF_K_TEXT:
87 rTypeName =
"StarOffice_Writer";
94 return !rTypeName.isEmpty();
99 rGenerator.registerEmbeddedObjectHandler(
"image/stoff-odg",
101 rGenerator.registerEmbeddedObjectHandler(
"image/stoff-ods",
108 return "org.libreoffice.comp.Writer.StarOfficeWriterImportFilter";
118 return {
"com.sun.star.document.ImportFilter",
"com.sun.star.document.ExtendedTypeDetection" };
121extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
123 css::uno::XComponentContext*
const context,
const css::uno::Sequence<css::uno::Any>&)
static bool handleEmbeddedSTOFFWriterGraphicObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
static bool handleEmbeddedSTOFFWriterSpreadsheetObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * org_libreoffice_comp_Writer_StarOfficeWriterImportFilter_get_implementation(css::uno::XComponentContext *const context, const css::uno::Sequence< css::uno::Any > &)
OUString GetPassword() const
virtual short run() override
void SetMinLen(sal_uInt16 Len)
virtual void doRegisterHandlers(OdtGenerator &rGenerator) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual bool doImportDocument(weld::Window *pParent, librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &) override
virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)