summaryrefslogtreecommitdiff
path: root/oox/inc/oox
diff options
context:
space:
mode:
authorEilidh McAdam <eilidh@lanedo.com>2012-09-26 12:22:17 +0100
committerNoel Power <noel.power@suse.com>2012-09-26 19:32:15 +0000
commitf0efecfb69b336e064e7c8dd2597655eff07944f (patch)
tree1b8902ba6d3e063dd6d3b78c0ddc45810f1e6bec /oox/inc/oox
parent0cd97e8c33c49a6c44d26ba309493dbfec00eb8d (diff)
Import shadow effect properties for shapes in docx.
Change-Id: I0cfd6b45be268d688b7389c79c5e9ad7f48eb12d Reviewed-on: https://gerrit.libreoffice.org/702 Reviewed-by: Noel Power <noel.power@suse.com> Tested-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'oox/inc/oox')
-rw-r--r--oox/inc/oox/drawingml/drawingmltypes.hxx3
-rw-r--r--oox/inc/oox/drawingml/effectproperties.hxx53
-rw-r--r--oox/inc/oox/drawingml/effectpropertiescontext.hxx41
-rw-r--r--oox/inc/oox/drawingml/shape.hxx3
-rw-r--r--oox/inc/oox/drawingml/shapepropertymap.hxx1
5 files changed, 101 insertions, 0 deletions
diff --git a/oox/inc/oox/drawingml/drawingmltypes.hxx b/oox/inc/oox/drawingml/drawingmltypes.hxx
index c257e9fc671f..d7e0ac610c22 100644
--- a/oox/inc/oox/drawingml/drawingmltypes.hxx
+++ b/oox/inc/oox/drawingml/drawingmltypes.hxx
@@ -60,6 +60,9 @@ typedef ::boost::shared_ptr< TextCharacterProperties > TextCharacterPropertiesPt
struct TextBodyProperties;
typedef ::boost::shared_ptr< TextBodyProperties > TextBodyPropertiesPtr;
+struct EffectProperties;
+typedef ::boost::shared_ptr< EffectProperties > EffectPropertiesPtr;
+
class TextBody;
typedef ::boost::shared_ptr< TextBody > TextBodyPtr;
diff --git a/oox/inc/oox/drawingml/effectproperties.hxx b/oox/inc/oox/drawingml/effectproperties.hxx
new file mode 100644
index 000000000000..55c5ec34a20f
--- /dev/null
+++ b/oox/inc/oox/drawingml/effectproperties.hxx
@@ -0,0 +1,53 @@
+/* -*- 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/.
+ */
+
+#ifndef OOX_DRAWINGML_EFFECTPROPERTIES_HXX
+#define OOX_DRAWINGML_EFFECTPROPERTIES_HXX
+
+#include "oox/drawingml/fillproperties.hxx"
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+struct EffectShadowProperties
+{
+ OptValue< sal_Int64 > moShadowDist;
+ OptValue< sal_Int64 > moShadowDir;
+ OptValue< sal_Int64 > moShadowAlpha;
+ Color moShadowColor;
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const EffectShadowProperties& rSourceProps );
+};
+
+// ============================================================================
+
+struct OOX_DLLPUBLIC EffectProperties
+{
+ EffectShadowProperties maShadow;
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const EffectProperties& rSourceProps );
+
+ /** Writes the properties to the passed property map. */
+ void pushToPropMap(
+ PropertyMap& rPropMap,
+ const GraphicHelper& rGraphicHelper ) const;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/drawingml/effectpropertiescontext.hxx b/oox/inc/oox/drawingml/effectpropertiescontext.hxx
new file mode 100644
index 000000000000..cd5e2eba28f5
--- /dev/null
+++ b/oox/inc/oox/drawingml/effectpropertiescontext.hxx
@@ -0,0 +1,41 @@
+/* -*- 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/.
+ */
+
+#ifndef OOX_DRAWINGML_EFFECTPROPERTIESCONTEXT_HXX
+#define OOX_DRAWINGML_EFFECTPROPERTIESCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/dllapi.h"
+
+namespace oox { namespace drawingml {
+
+// ---------------------------------------------------------------------
+
+struct EffectProperties;
+
+class OOX_DLLPUBLIC EffectPropertiesContext : public ::oox::core::ContextHandler
+{
+public:
+ EffectPropertiesContext( ::oox::core::ContextHandler& rParent,
+ EffectProperties& rEffectProperties ) throw();
+ ~EffectPropertiesContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ EffectProperties& mrEffectProperties;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_EFFECTPROPERTIESCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 9ba7bcf97781..4e2b4914f05e 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -97,6 +97,8 @@ public:
table::TablePropertiesPtr getTableProperties();
+ inline EffectProperties& getEffectProperties() { return *mpEffectPropertiesPtr; }
+
void setChildPosition( com::sun::star::awt::Point nPosition ){ maChPosition = nPosition; }
void setChildSize( com::sun::star::awt::Size aSize ){ maChSize = aSize; }
void moveAllToPosition( const com::sun::star::awt::Point &rPoint );
@@ -215,6 +217,7 @@ protected:
CustomShapePropertiesPtr mpCustomShapePropertiesPtr;
table::TablePropertiesPtr mpTablePropertiesPtr;
Shape3DPropertiesPtr mp3DPropertiesPtr;
+ EffectPropertiesPtr mpEffectPropertiesPtr;
PropertyMap maShapeProperties;
PropertyMap maDefaultShapeProperties;
TextListStylePtr mpMasterTextListStyle;
diff --git a/oox/inc/oox/drawingml/shapepropertymap.hxx b/oox/inc/oox/drawingml/shapepropertymap.hxx
index 24c6c9a8e96e..994c0326139c 100644
--- a/oox/inc/oox/drawingml/shapepropertymap.hxx
+++ b/oox/inc/oox/drawingml/shapepropertymap.hxx
@@ -61,6 +61,7 @@ enum ShapePropertyId
SHAPEPROP_FillBitmapOffsetX,
SHAPEPROP_FillBitmapOffsetY,
SHAPEPROP_FillBitmapRectanglePoint,
+ SHAPEPROP_ShadowXDistance,
SHAPEPROP_END
};