LibreOffice Module oox (master) 1
fontworkhelpers.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
23#include <rtl/ustring.hxx>
24#include <sal/types.h>
25#include <svx/msdffdef.hxx>
26
28
29#include <com/sun/star/beans/PropertyValue.hpp>
30#include <com/sun/star/beans/XPropertySet.hpp>
31#include <com/sun/star/drawing/LineCap.hpp>
32#include <com/sun/star/drawing/LineDash.hpp>
33#include <com/sun/star/drawing/XShape.hpp>
34#include <com/sun/star/text/XText.hpp>
35
37{
39void resetPropertyValueInVec(std::vector<css::beans::PropertyValue>& rPropVec,
40 const OUString& rName);
41
46 const css::uno::Reference<css::drawing::XShape>& xShape,
47 const oox::drawingml::CustomShapePropertiesPtr& pCustomShapePropertiesPtr,
48 const OUString& sMSPresetType, const bool bFromWordArt);
49
53OString GetVMLFontworkShapetypeMarkup(const MSO_SPT eShapeType);
54
58void collectCharColorProps(const css::uno::Reference<css::text::XText>& rXText,
59 std::vector<css::beans::PropertyValue>& rCharPropVec);
60
63void applyPropsToRuns(const std::vector<css::beans::PropertyValue>& rTextPropVec,
64 css::uno::Reference<css::text::XText>& rXText);
65
70void createCharFillPropsFromShape(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet,
71 std::vector<css::beans::PropertyValue>& rCharPropVec);
72
77 const css::uno::Reference<css::beans::XPropertySet>& rXPropSet,
78 std::vector<css::beans::PropertyValue>& rUpdatePropVec);
79
82void applyUpdatesToCharInteropGrabBag(const std::vector<css::beans::PropertyValue>& rUpdatePropVec,
83 css::uno::Reference<css::text::XText>& rXText);
84
85// ToDo: This is essentially the same as contained in method DrawingML::WriteOutline. Change it
86// there to use this method too, perhaps move this method to a common location.
91bool createPrstDashFromLineDash(const css::drawing::LineDash& rLineDash,
92 const css::drawing::LineCap& rLineCap, OUString& rsPrstDash);
93
98bool getThemeColorFromShape(const OUString& rPropertyName,
99 const css::uno::Reference<css::beans::XPropertySet>& xPropertySet,
100 model::ComplexColor& rComplexColor);
101}
102/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
MSO_SPT
void applyUpdatesToCharInteropGrabBag(const std::vector< css::beans::PropertyValue > &rUpdatePropVec, css::uno::Reference< css::text::XText > &rXText)
Puts all properties in rUpdatePropVec into the "CharInteropGrabBag" of all non-empty runs in rXText.
void createCharFillPropsFromShape(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet, std::vector< css::beans::PropertyValue > &rCharPropVec)
Generates the properties "CharColor", "CharLumMod", "CharLumOff", "CharColorTheme",...
void collectCharColorProps(const css::uno::Reference< css::text::XText > &rXText, std::vector< css::beans::PropertyValue > &rCharPropVec)
Collects the properties "CharColor", "CharLumMod", "CharLumOff", "CharColorTheme",...
OString GetVMLFontworkShapetypeMarkup(const MSO_SPT eShapeType)
Returns the markup for the v:shapetype element for export of a Fontwork shape to VML.
void putCustomShapeIntoTextPathMode(const css::uno::Reference< css::drawing::XShape > &xShape, const oox::drawingml::CustomShapePropertiesPtr &pCustomShapePropertiesPtr, const OUString &sMSPresetType, const bool bFromWordArt)
Changes the EnhancedCustomShapeGeometry of xShape shape so, that it becomes a LO Fontwork shape corre...
bool getThemeColorFromShape(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertySet > &xPropertySet, model::ComplexColor &rComplexColor)
Returns true if a theme color with other type than model::ThemeColorType::Unknown was found.
bool createPrstDashFromLineDash(const css::drawing::LineDash &rLineDash, const css::drawing::LineCap &rLineCap, OUString &rsPrstDash)
Uses LineDash and LineCap to detect, whether the dashing comes from a prstDash in MS Office.
void resetPropertyValueInVec(std::vector< css::beans::PropertyValue > &rPropVec, const OUString &rName)
Removes the property specified by rName from the rPropVec vector of properties.
void applyPropsToRuns(const std::vector< css::beans::PropertyValue > &rTextPropVec, css::uno::Reference< css::text::XText > &rXText)
Applies all properties in rTextPropVec excluding "CharInteropGrabBag" to all non-empty runs in rXText...
void createCharInteropGrabBagUpdatesFromShapeProps(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet, std::vector< css::beans::PropertyValue > &rUpdatePropVec)
Creates the properties "CharTextFillTextEffect", "CharTextOutlineTextEffect", "CharThemeColor",...
std::shared_ptr< CustomShapeProperties > CustomShapePropertiesPtr