bump product version to 4.1.6.2
[LibreOffice.git] / filter / source / xsltfilter / OleHandler.hxx
blobe7e0f4c268cc3bbc920983f6fcafc240b27184ed
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /*
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/.
9 */
11 #ifndef OLEHANDLER_HXX_
12 #define OLEHANDLER_HXX_
13 #include <cstdio>
14 #include <cstring>
15 #include <list>
16 #include <map>
17 #include <vector>
18 #include <iostream>
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;
47 namespace XSLT
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.
61 class OleHandler
63 public:
64 OleHandler(const com::sun::star::uno::Reference<XMultiServiceFactory>& msf){
65 m_msf =msf;
67 void SAL_CALL
68 insertByName(const OUString& streamName, const OString& content);
69 const OString SAL_CALL
70 getByName(const OUString& streamName);
72 private:
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;
76 void SAL_CALL
77 ensureCreateRootStorage();
78 OString SAL_CALL
79 encodeSubStorage(const OUString& streamName);
80 void SAL_CALL
81 insertSubStorage(const OUString& streamName, const OString& content);
82 void SAL_CALL
83 initRootStorageFromBase64(const OString& content);
84 com::sun::star::uno::Reference<XStream> SAL_CALL
85 createTempFile();
90 #endif /* OLEHANDLER_HXX_ */