1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
4 * This file is part of the LibreOffice project.
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 #ifndef OLEHANDLER_HXX_
12 #define OLEHANDLER_HXX_
19 #include <libxml/parser.h>
20 #include <libxml/tree.h>
21 #include <libxml/xmlIO.h>
22 #include <libxslt/transform.h>
23 #include <libxslt/xsltutils.h>
24 #include <libxslt/variables.h>
26 #include <cppuhelper/factory.hxx>
27 #include <cppuhelper/implbase4.hxx>
28 #include <cppuhelper/implbase.hxx>
29 #include <osl/module.h>
30 #include <osl/file.hxx>
31 #include <osl/process.h>
32 #include <com/sun/star/lang/XComponent.hpp>
33 #include <com/sun/star/lang/XInitialization.hpp>
34 #include <com/sun/star/uno/Any.hxx>
35 #include <com/sun/star/beans/NamedValue.hpp>
36 #include <com/sun/star/container/XNameContainer.hpp>
37 #include <com/sun/star/io/XInputStream.hpp>
38 #include <com/sun/star/io/XOutputStream.hpp>
39 #include <com/sun/star/io/XStream.hpp>
41 using namespace ::com::sun::star::uno
;
42 using namespace ::com::sun::star::lang
;
43 using namespace ::com::sun::star::container
;
44 using namespace ::com::sun::star::io
;
45 using namespace ::rtl
;
50 * OleHandler provides implementations for the XSLT extension functions used by the WordML 2003 XSLT filters.
52 * The extension functions takes base64 encoded string representations of embedded OLE objects provided by the XML filter framework,
53 * stores them into a com.sun.star.embed.OLESimpleStorage and retrieves them later as individual base64 OLE objects.
55 * The implementation is ported from the former Java based implementation XSLTOleExtrater (sic)
57 * I believe the whole thing should provide round-trip editing of embedded OLE objects.
58 * I'm not sure if it currently does anything meaningful, because the Java implementation seems to be broken both in OOo and LibO.
64 OleHandler(const com::sun::star::uno::Reference
<XMultiServiceFactory
>& msf
){
68 insertByName(const OUString
& streamName
, const OString
& content
);
69 const OString SAL_CALL
70 getByName(const OUString
& streamName
);
73 com::sun::star::uno::Reference
<XMultiServiceFactory
> m_msf
;
74 com::sun::star::uno::Reference
<XNameContainer
> m_storage
;
75 com::sun::star::uno::Reference
<XStream
> m_rootStream
;
77 ensureCreateRootStorage();
79 encodeSubStorage(const OUString
& streamName
);
81 insertSubStorage(const OUString
& streamName
, const OString
& content
);
83 initRootStorageFromBase64(const OString
& content
);
84 com::sun::star::uno::Reference
<XStream
> SAL_CALL
90 #endif /* OLEHANDLER_HXX_ */