summaryrefslogtreecommitdiff
path: root/offapi
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-06-09 19:55:17 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-07-15 11:01:29 +0200
commit83535a28c57ffb59f795dd35332d6b3426071e32 (patch)
treea35406c5ed8c7971681385cbb081aad325e1cf54 /offapi
parent79f5cb620984c4d04d53a497e698472b2192d2bb (diff)
emfplus: create a wmf/emf/emf+ primitive based importer
First steps to organize an importer that can read/interpret wmf/emf/emf+ and deliver a primitive representation for the content by parsing it. Use the same mechanisms as already applied for Svg, so to reuse abilities to keep original binary data to allow save again and embedding in files and have an implemented replacement bitmap based representation. For this, unify the used helper classes to handle more than just Svg. For 1st try, add test code and static bool switches Change-Id: I6e0a82943541d811a8f8d65a84115569fcd8cee7
Diffstat (limited to 'offapi')
-rw-r--r--offapi/UnoApi_offapi.mk2
-rw-r--r--offapi/com/sun/star/graphic/EmfTools.idl39
-rw-r--r--offapi/com/sun/star/graphic/XEmfParser.idl54
3 files changed, 95 insertions, 0 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index f3e0274777a7..14a80f5e7bd8 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -210,6 +210,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/graphic,\
GraphicProvider \
Primitive2DTools \
SvgTools \
+ EmfTools \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/inspection,\
DefaultHelpProvider \
@@ -2705,6 +2706,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/graphic,\
XPrimitive3D \
XPrimitiveFactory2D \
XSvgParser \
+ XEmfParser \
))
$(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/i18n,\
AmPmValue \
diff --git a/offapi/com/sun/star/graphic/EmfTools.idl b/offapi/com/sun/star/graphic/EmfTools.idl
new file mode 100644
index 000000000000..f258214117e6
--- /dev/null
+++ b/offapi/com/sun/star/graphic/EmfTools.idl
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef com_sun_star_graphic_EmfTools_idl
+#define com_sun_star_graphic_EmfTools_idl
+
+#include <com/sun/star/graphic/XEmfParser.idl>
+
+module com { module sun { module star { module graphic
+{
+
+/** Service that describes the necessary interfaces and properties
+ to handle emf files.
+ Parses an WMF/EMF/EMF+ file to a sequence of B2DPrimitives for internal usage
+ */
+
+service EmfTools : XEmfParser;
+
+} ; } ; } ; } ;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/graphic/XEmfParser.idl b/offapi/com/sun/star/graphic/XEmfParser.idl
new file mode 100644
index 000000000000..6c55a8a0b963
--- /dev/null
+++ b/offapi/com/sun/star/graphic/XEmfParser.idl
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __com_sun_star_graphic_XEmfParser_idl__
+#define __com_sun_star_graphic_XEmfParser_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/io/XInputStream.idl>
+
+module com { module sun { module star { module graphic {
+
+interface XPrimitive2D;
+
+/** XEmfParser interface
+
+ This interface allows to parse an WMF/EMF/EMF+ stream in form of a sequence of bytes
+ to be parsed into a sequence of XPrimitive2Ds
+ */
+interface XEmfParser : ::com::sun::star::uno::XInterface
+{
+ /** Retrieve decomposed list of simpler primitives
+
+ @param xEmfStream
+ The file containing the WMF/EMF/EMF+ binary data
+
+ @param aAbsolutePath
+ The path containing the WMF/EMF/EMF+ data
+ */
+ sequence< XPrimitive2D > getDecomposition(
+ [in] io::XInputStream xEmfStream,
+ [in] string aAbsolutePath);
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */