diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:54:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:54:39 +0000 |
commit | 267c6f2ac71f92999e969232431ba04678e7437e (patch) | |
tree | 358c9467650e1d0a1d7227a21dac2e3d08b622b2 /xmloff/inc | |
parent | Initial commit. (diff) | |
download | libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip |
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xmloff/inc')
83 files changed, 7845 insertions, 0 deletions
diff --git a/xmloff/inc/AttributeContainerHandler.hxx b/xmloff/inc/AttributeContainerHandler.hxx new file mode 100644 index 0000000000..04c8127189 --- /dev/null +++ b/xmloff/inc/AttributeContainerHandler.hxx @@ -0,0 +1,38 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +/** + PropertyHandler for the XML-data-type: +*/ +class XMLAttributeContainerHandler final : public XMLPropertyHandler +{ +public: + virtual ~XMLAttributeContainerHandler() override; + + virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override; + + virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/AutoStyleEntry.hxx b/xmloff/inc/AutoStyleEntry.hxx new file mode 100644 index 0000000000..15f99f1b11 --- /dev/null +++ b/xmloff/inc/AutoStyleEntry.hxx @@ -0,0 +1,29 @@ +/* -*- 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/. + * + */ + +#pragma once + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <com/sun/star/uno/Any.hxx> +#include <xmloff/dllapi.h> +#include <utility> +#include <vector> + +namespace xmloff +{ +struct AutoStyleEntry +{ + std::vector<std::pair<OUString, css::uno::Any>> m_aXmlProperties; +}; + +} // end xmloff + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/DomBuilderContext.hxx b/xmloff/inc/DomBuilderContext.hxx new file mode 100644 index 0000000000..40435abbfc --- /dev/null +++ b/xmloff/inc/DomBuilderContext.hxx @@ -0,0 +1,93 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlictxt.hxx> + + +// forward declarations + + +namespace com::sun::star { + namespace xml::dom { + class XNode; + class XDocument; + } + namespace xml::sax { + class XAttributeList; + } +} +class SvXMLImport; +class SvXMLImportContext; + +/** + * DomBuilderContext creates a DOM tree suitable for in-memory processing of + * XML data from a sequence of SAX events */ +class DomBuilderContext final : public SvXMLImportContext +{ + css::uno::Reference<css::xml::dom::XNode> mxNode; + + void HandleAttributes(const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs); + +public: + + /** default constructor: create new DOM tree */ + DomBuilderContext( SvXMLImport& rImport, + sal_Int32 nElement ); + DomBuilderContext( SvXMLImport& rImport, + const OUString & Namespace, const OUString & Name ); + + /** constructor: create DOM subtree under the given node */ + DomBuilderContext( SvXMLImport& rImport, + sal_Int32 nElement, + css::uno::Reference<css::xml::dom::XNode> const & ); + /** constructor: create DOM subtree under the given node */ + DomBuilderContext( SvXMLImport& rImport, + const OUString & Namespace, const OUString & Name, + css::uno::Reference<css::xml::dom::XNode> const & ); + + virtual ~DomBuilderContext() override; + + + // access to the DOM tree + + + /** access the DOM tree */ + css::uno::Reference<css::xml::dom::XDocument> getTree(); + + + // implement SvXMLImportContext methods: + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext( + const OUString& Namespace, const OUString& Name, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override; + + virtual void SAL_CALL startFastElement( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override; + virtual void SAL_CALL startUnknownElement(const OUString & Namespace, const OUString & Name, + const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs) override; + + virtual void SAL_CALL characters( const OUString& rChars ) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/DomExport.hxx b/xmloff/inc/DomExport.hxx new file mode 100644 index 0000000000..b6646214f7 --- /dev/null +++ b/xmloff/inc/DomExport.hxx @@ -0,0 +1,33 @@ +/* -*- 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 . + */ +#pragma once + +// the Solaris compiler apparently needs the following include: +#include <com/sun/star/uno/Reference.hxx> + +class SvXMLExport; +namespace com::sun::star { + namespace uno { template<typename T> class Reference; } + namespace xml::dom { class XDocument; } + namespace xml::dom { class XNode; } +} + +void exportDom( SvXMLExport&, const css::uno::Reference<css::xml::dom::XDocument>& ); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/EnhancedCustomShapeToken.hxx b/xmloff/inc/EnhancedCustomShapeToken.hxx new file mode 100644 index 0000000000..dc0206fcb0 --- /dev/null +++ b/xmloff/inc/EnhancedCustomShapeToken.hxx @@ -0,0 +1,164 @@ +/* -*- 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 . + */ + +#pragma once + +#include <rtl/ustring.hxx> + +namespace xmloff::EnhancedCustomShapeToken { + + enum EnhancedCustomShapeTokenEnum + { + EAS_type, + EAS_name, + EAS_mirror_horizontal, + EAS_mirror_vertical, + EAS_viewBox, + EAS_text_rotate_angle, + EAS_extrusion_allowed, + EAS_text_path_allowed, + EAS_concentric_gradient_fill_allowed, + EAS_extrusion, + EAS_extrusion_brightness, + EAS_extrusion_depth, + EAS_extrusion_diffusion, + EAS_extrusion_number_of_line_segments, + EAS_extrusion_light_face, + EAS_extrusion_first_light_harsh, + EAS_extrusion_second_light_harsh, + EAS_extrusion_first_light_level, + EAS_extrusion_second_light_level, + EAS_extrusion_first_light_direction, + EAS_extrusion_second_light_direction, + EAS_extrusion_metal, + EAS_extrusion_metal_type, + EAS_shade_mode, + EAS_extrusion_rotation_angle, + EAS_extrusion_rotation_center, + EAS_extrusion_shininess, + EAS_extrusion_skew, + EAS_extrusion_specularity, + EAS_extrusion_specularity_loext, + EAS_projection, + EAS_extrusion_viewpoint, + EAS_extrusion_origin, + EAS_extrusion_color, + EAS_enhanced_path, + EAS_path_stretchpoint_x, + EAS_path_stretchpoint_y, + EAS_text_areas, + EAS_glue_points, + EAS_glue_point_type, + EAS_glue_point_leaving_directions, + EAS_text_path, + EAS_text_path_mode, + EAS_text_path_scale, + EAS_text_path_same_letter_heights, + EAS_modifiers, + EAS_equation, + EAS_formula, + EAS_handle, + EAS_handle_mirror_horizontal, + EAS_handle_mirror_vertical, + EAS_handle_switched, + EAS_handle_position, + EAS_handle_range_x_minimum, + EAS_handle_range_x_maximum, + EAS_handle_range_y_minimum, + EAS_handle_range_y_maximum, + EAS_handle_polar, + EAS_handle_radius_range_minimum, + EAS_handle_radius_range_maximum, + EAS_sub_view_size, + + EAS_CustomShapeEngine, + EAS_CustomShapeData, + EAS_Type, + EAS_MirroredX, + EAS_MirroredY, + EAS_ViewBox, + EAS_TextRotateAngle, + EAS_TextPreRotateAngle, + EAS_ExtrusionAllowed, + EAS_ConcentricGradientFillAllowed, + EAS_TextPathAllowed, + EAS_Extrusion, + EAS_Equations, + EAS_Equation, + EAS_Path, + EAS_TextPath, + EAS_Handles, + EAS_Handle, + EAS_Brightness, + EAS_Depth, + EAS_Diffusion, + EAS_NumberOfLineSegments, + EAS_LightFace, + EAS_FirstLightHarsh, + EAS_SecondLightHarsh, + EAS_FirstLightLevel, + EAS_SecondLightLevel, + EAS_FirstLightDirection, + EAS_SecondLightDirection, + EAS_Metal, + EAS_MetalType, + EAS_ShadeMode, + EAS_RotateAngle, + EAS_RotationCenter, + EAS_Shininess, + EAS_Skew, + EAS_Specularity, + EAS_ProjectionMode, + EAS_ViewPoint, + EAS_Origin, + EAS_Color, + EAS_Switched, + EAS_Polar, + EAS_RangeXMinimum, + EAS_RangeXMaximum, + EAS_RangeYMinimum, + EAS_RangeYMaximum, + EAS_RadiusRangeMinimum, + EAS_RadiusRangeMaximum, + EAS_Coordinates, + EAS_Segments, + EAS_StretchX, + EAS_StretchY, + EAS_TextFrames, + EAS_GluePoints, + EAS_GluePointLeavingDirections, + EAS_GluePointType, + EAS_TextPathMode, + EAS_ScaleX, + EAS_SameLetterHeights, + EAS_Position, + EAS_AdjustmentValues, + EAS_SubViewSize, + + EAS_Last, + EAS_NotFound + }; + + EnhancedCustomShapeTokenEnum EASGet( std::u16string_view ); + EnhancedCustomShapeTokenEnum EASGet( sal_Int32 nToken ); + OUString EASGet( const EnhancedCustomShapeTokenEnum ); +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/MetaExportComponent.hxx b/xmloff/inc/MetaExportComponent.hxx new file mode 100644 index 0000000000..ad8e36cf93 --- /dev/null +++ b/xmloff/inc/MetaExportComponent.hxx @@ -0,0 +1,55 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/document/XDocumentProperties.hpp> + +#include <xmloff/xmlexp.hxx> + +class XMLMetaExportComponent final : public SvXMLExport +{ + css::uno::Reference< css::document::XDocumentProperties > mxDocProps; + +public: + XMLMetaExportComponent( + const css::uno::Reference< css::uno::XComponentContext >& xContext, + OUString const & implementationName, SvXMLExportFlags nFlags + ); + + virtual ~XMLMetaExportComponent() override; + +private: + // export the events off all autotexts + virtual ErrCode exportDoc( + enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID ) override; + + // accept XDocumentProperties in addition to XModel + virtual void SAL_CALL setSourceDocument( const css::uno::Reference< css::lang::XComponent >& xDoc ) override; + + // override + virtual void ExportMeta_() override; + + // methods without content: + virtual void ExportAutoStyles_() override; + virtual void ExportMasterStyles_() override; + virtual void ExportContent_() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/MultiPropertySetHelper.hxx b/xmloff/inc/MultiPropertySetHelper.hxx new file mode 100644 index 0000000000..9d539fa262 --- /dev/null +++ b/xmloff/inc/MultiPropertySetHelper.hxx @@ -0,0 +1,186 @@ +/* -*- 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 . + */ +#pragma once + +#include <rtl/ustring.hxx> +#include <com/sun/star/uno/Sequence.hxx> +#include <memory> + +namespace com::sun::star +{ +namespace beans +{ +class XMultiPropertySet; +} +namespace beans +{ +class XPropertySet; +} +namespace beans +{ +class XPropertySetInfo; +} +} + +/** + * The MultiPropertySetHelper performs the following functions: + * + * Given a list of property names (as char** or OUString*), it can + * query an XMultiPropertySet (or XPropertySet) which of these properties + * it supports (method hasProperties(...)). The properties *MUST* be + * sorted alphabetically. + * + * Then, the X(Multi)PropertySet can be queried for values, and only + * the supported properties are queried. (method getValues(...)) The + * values are stored in the helper itself. + * + * Finally, each property can be queried for existence + * (method hasProperty(...)) or its value (method (getValue(...))). + * + * After some initial preparation (hasProperties, getValues) the + * MultiPropertySetHelper can be used similarly to an + * XPropertySet in that you can query the values in the places where you + * need them. However, if an XMultiPropertySet is supplied, the queries + * are more efficient, often significantly so. + */ +class MultiPropertySetHelper +{ + /// names of all properties + std::unique_ptr<OUString[]> pPropertyNames; + + /// length of pPropertyNames array + sal_Int16 nLength; + + /// the sequence of property names that the current (multi) + /// property set implementation supports + css::uno::Sequence<OUString> aPropertySequence; + + /// an array of indices that maps from pPropertyNames indices to + /// aPropertySequence indices + std::unique_ptr<sal_Int16[]> pSequenceIndex; + + /// the last set of values retrieved by getValues + css::uno::Sequence<css::uno::Any> aValues; + + /// result of aValues.getConstArray() + const css::uno::Any* pValues; + + /// an empty Any + css::uno::Any aEmptyAny; + +public: + MultiPropertySetHelper(const char** pNames); + + ~MultiPropertySetHelper(); + + /** + * Call hasPropertiesByName for the provided XPropertySetInfo and build + * list of allowed properties. + */ + void hasProperties(const css::uno::Reference<css::beans::XPropertySetInfo>&); + + /** + * Return whether hasProperties was called + * (i.e. if we are ready to call getValues) + */ + bool checkedProperties(); + + /** + * Get values from the XMultiPropertySet. + * + * May only be called after hasProperties() was called for the + * appropriate XPropertySetInfo. + */ + void getValues(const css::uno::Reference<css::beans::XMultiPropertySet>&); + + /** + * Get values from the XPropertySet. This can be much slower than + * getValues( const Reference<XMultiPropertySet& ) and hence + * should be avoided. + * + * May only be called after hasProperties() was called for the + * appropriate XPropertySetInfo. + */ + void getValues(const css::uno::Reference<css::beans::XPropertySet>&); + + /** + * Get a value from the values array. + * + * May only be called after getValues() was called. + */ + inline const css::uno::Any& getValue(sal_Int16 nIndex); + + /** + * Find out if this property is supported. + * + * May only be called after hasProperties() was called. + */ + inline bool hasProperty(sal_Int16 nIndex); + + /** + * Get a value from the XPropertySet on demand. + * + * If neither getValues nor getValueOnDemand has been called already + * after the last call to resetValues, the values are retrieved + * using getValues. Otherwise the value already retrieved is returned. + * In case XMultiPropertySet is supported by the XPropertySet and + * bTryMult is set, the XMultiPropertySet is used to get the values. + * + */ + const css::uno::Any& getValue(sal_Int16 nIndex, + const css::uno::Reference<css::beans::XPropertySet>&, + bool bTryMulti = false); + + /** + * Get a value from the XMultiPropertySet on demand. + * + * If neither getValues nor getValueOnDemand has been called already + * after the last call to resetValues, the values are retrieved + * using getValues. Otherwise the value already retrieved is returned. + * In case XMultiPropertySet is supported by the XPropertySet, + * XMultiPropertySet is used to get the values. + * + */ + const css::uno::Any& getValue(sal_Int16 nIndex, + const css::uno::Reference<css::beans::XMultiPropertySet>&); + + void resetValues() { pValues = nullptr; } +}; + +// inline implementations of the often-called methods getValue and hasProperty: + +const css::uno::Any& MultiPropertySetHelper::getValue(sal_Int16 nValueNo) +{ + assert(pValues && "called getValue() without calling getValues()"); + assert(pSequenceIndex && "called getValue() without calling hasProperties()"); + assert(nValueNo < nLength); + + sal_Int16 nIndex = pSequenceIndex[nValueNo]; + return (nIndex != -1) ? pValues[nIndex] : aEmptyAny; +} + +bool MultiPropertySetHelper::hasProperty(sal_Int16 nValueNo) +{ + assert(pSequenceIndex && "called hasProperty() without calling hasProperties()"); + assert(nValueNo < nLength); + + return pSequenceIndex[nValueNo] != -1; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/PageMasterImportContext.hxx b/xmloff/inc/PageMasterImportContext.hxx new file mode 100644 index 0000000000..7e164a1f23 --- /dev/null +++ b/xmloff/inc/PageMasterImportContext.hxx @@ -0,0 +1,56 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/prstylei.hxx> +#include <xmloff/xmlimp.hxx> + +class PageStyleContext final : public XMLPropStyleContext +{ +private: + OUString sPageUsage; + bool m_bIsFillStyleAlreadyConverted : 1; + + virtual void SetAttribute( sal_Int32 nElement, + const OUString& rValue ) override; + +public: + + + PageStyleContext( SvXMLImport& rImport, + SvXMLStylesContext& rStyles, + bool bDefaultStyle); + virtual ~PageStyleContext() override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + + // don't call this + virtual void FillPropertySet( + const css::uno::Reference< css::beans::XPropertySet > & rPropSet ) override; + void FillPropertySet_PageStyle( + const css::uno::Reference< css::beans::XPropertySet > & rPropSet, + XMLPropStyleContext * pDrawingPageStyle); + + //text grid enhancement + virtual void SetDefaults() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/PageMasterPropHdlFactory.hxx b/xmloff/inc/PageMasterPropHdlFactory.hxx new file mode 100644 index 0000000000..b215209082 --- /dev/null +++ b/xmloff/inc/PageMasterPropHdlFactory.hxx @@ -0,0 +1,33 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/prhdlfac.hxx> + +class XMLPageMasterPropHdlFactory final : public XMLPropertyHandlerFactory +{ +public: + XMLPageMasterPropHdlFactory(); + virtual ~XMLPageMasterPropHdlFactory() override; + + virtual const XMLPropertyHandler* GetPropertyHandler(sal_Int32 nType) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/PageMasterPropMapper.hxx b/xmloff/inc/PageMasterPropMapper.hxx new file mode 100644 index 0000000000..7da53acd2f --- /dev/null +++ b/xmloff/inc/PageMasterPropMapper.hxx @@ -0,0 +1,33 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlprmap.hxx> + +class XMLPageMasterPropSetMapper final : public XMLPropertySetMapper +{ +public: + explicit XMLPageMasterPropSetMapper(); + XMLPageMasterPropSetMapper(const XMLPropertyMapEntry* pEntries, + const rtl::Reference<XMLPropertyHandlerFactory>& rFactory); + virtual ~XMLPageMasterPropSetMapper() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/PageMasterStyleMap.hxx b/xmloff/inc/PageMasterStyleMap.hxx new file mode 100644 index 0000000000..746b67f1a1 --- /dev/null +++ b/xmloff/inc/PageMasterStyleMap.hxx @@ -0,0 +1,196 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/maptype.hxx> +#include <xmloff/xmltypes.hxx> +#include <xmloff/contextid.hxx> + + +#define XML_PM_TYPE_PAGESTYLELAYOUT (XML_PM_TYPES_START + 0) +#define XML_PM_TYPE_NUMFORMAT (XML_PM_TYPES_START + 1) +#define XML_PM_TYPE_NUMLETTERSYNC (XML_PM_TYPES_START + 2) +#define XML_PM_TYPE_PAPERTRAYNUMBER (XML_PM_TYPES_START + 3) +#define XML_PM_TYPE_PRINTORIENTATION (XML_PM_TYPES_START + 4) +#define XML_PM_TYPE_PRINTANNOTATIONS (XML_PM_TYPES_START + 5) +#define XML_PM_TYPE_PRINTCHARTS (XML_PM_TYPES_START + 6) +#define XML_PM_TYPE_PRINTDRAWING (XML_PM_TYPES_START + 7) +#define XML_PM_TYPE_PRINTFORMULAS (XML_PM_TYPES_START + 8) +#define XML_PM_TYPE_PRINTGRID (XML_PM_TYPES_START + 9) +#define XML_PM_TYPE_PRINTHEADERS (XML_PM_TYPES_START + 10) +#define XML_PM_TYPE_PRINTOBJECTS (XML_PM_TYPES_START + 11) +#define XML_PM_TYPE_PRINTZEROVALUES (XML_PM_TYPES_START + 12) +#define XML_PM_TYPE_PRINTPAGEORDER (XML_PM_TYPES_START + 13) +#define XML_PM_TYPE_FIRSTPAGENUMBER (XML_PM_TYPES_START + 14) +#define XML_PM_TYPE_CENTER_HORIZONTAL (XML_PM_TYPES_START + 15) +#define XML_PM_TYPE_CENTER_VERTICAL (XML_PM_TYPES_START + 16) + +// control flags +#define CTF_PM_FLAGMASK (XML_PM_CTF_START + 0x0F00) +#define CTF_PM_HEADERFLAG (XML_PM_CTF_START + 0x0100) +#define CTF_PM_FOOTERFLAG (XML_PM_CTF_START + 0x0200) +#define CTF_PM_PRINTMASK (XML_PM_CTF_START + 0x1000) +// page master +#define CTF_PM_BORDERALL (XML_PM_CTF_START + 0x0001) +#define CTF_PM_BORDERTOP (XML_PM_CTF_START + 0x0002) +#define CTF_PM_BORDERBOTTOM (XML_PM_CTF_START + 0x0003) +#define CTF_PM_BORDERLEFT (XML_PM_CTF_START + 0x0004) +#define CTF_PM_BORDERRIGHT (XML_PM_CTF_START + 0x0005) +#define CTF_PM_BORDERWIDTHALL (XML_PM_CTF_START + 0x0006) +#define CTF_PM_BORDERWIDTHTOP (XML_PM_CTF_START + 0x0007) +#define CTF_PM_BORDERWIDTHBOTTOM (XML_PM_CTF_START + 0x0008) +#define CTF_PM_BORDERWIDTHLEFT (XML_PM_CTF_START + 0x0009) +#define CTF_PM_BORDERWIDTHRIGHT (XML_PM_CTF_START + 0x000A) +#define CTF_PM_PADDINGALL (XML_PM_CTF_START + 0x000B) +#define CTF_PM_PADDINGTOP (XML_PM_CTF_START + 0x000C) +#define CTF_PM_PADDINGBOTTOM (XML_PM_CTF_START + 0x000D) +#define CTF_PM_PADDINGLEFT (XML_PM_CTF_START + 0x000E) +#define CTF_PM_PADDINGRIGHT (XML_PM_CTF_START + 0x000F) +#define CTF_PM_TEXTCOLUMNS (XML_PM_CTF_START + 0x0010) +#define CTF_PM_REGISTER_STYLE (XML_PM_CTF_START + 0x0011) +#define CTF_PM_PRINT_ANNOTATIONS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0012)) +#define CTF_PM_PRINT_CHARTS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0013)) +#define CTF_PM_PRINT_DRAWING (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0014)) +#define CTF_PM_PRINT_FORMULAS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0015)) +#define CTF_PM_PRINT_GRID (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0016)) +#define CTF_PM_PRINT_HEADERS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0017)) +#define CTF_PM_PRINT_OBJECTS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0018)) +#define CTF_PM_PRINT_ZEROVALUES (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0019)) +#define CTF_PM_MARGINALL (XML_PM_CTF_START + 0x001A) +#define CTF_PM_MARGINTOP (XML_PM_CTF_START + 0x001B) +#define CTF_PM_MARGINBOTTOM (XML_PM_CTF_START + 0x001C) +#define CTF_PM_MARGINLEFT (XML_PM_CTF_START + 0x001D) +#define CTF_PM_MARGINRIGHT (XML_PM_CTF_START + 0x001E) +#define CTF_PM_WRITINGMODE (XML_PM_CTF_START + 0x001F) +#define CTF_PM_RTLGUTTER (XML_PM_CTF_START + 0x0020) +#define CTF_PM_MARGINGUTTER (XML_PM_CTF_START + 0x0021) + +#define CTF_PM_PAGEUSAGE (XML_PM_CTF_START + 0x0031) +#define CTF_PM_GRAPHICPOSITION (XML_PM_CTF_START + 0x0032) +#define CTF_PM_GRAPHICFILTER (XML_PM_CTF_START + 0x0033) +#define CTF_PM_GRAPHICURL (XML_PM_CTF_START + 0x0034) + +// Need own entries for PageMasterStyleMap since these get *filtered* +// at export time using CTF_PM_FLAGMASK and XML_PM_CTF_START as detector +// to find the first entry for header/footer (!), see +// SvXMLAutoStylePoolP_Impl::exportXML, look for XmlStyleFamily::PAGE_MASTER +#define CTF_PM_REPEAT_OFFSET_X (XML_PM_CTF_START + 0x0037) +#define CTF_PM_REPEAT_OFFSET_Y (XML_PM_CTF_START + 0x0038) +#define CTF_PM_FILLGRADIENTNAME (XML_PM_CTF_START + 0x0039) +#define CTF_PM_FILLHATCHNAME (XML_PM_CTF_START + 0x0040) +#define CTF_PM_FILLBITMAPNAME (XML_PM_CTF_START + 0x0041) +#define CTF_PM_FILLTRANSNAME (XML_PM_CTF_START + 0x0042) +#define CTF_PM_FILLBITMAPMODE (XML_PM_CTF_START + 0x0043) +#define CTF_PM_FILL (XML_PM_CTF_START + 0x0044) +#define CTF_PM_BACKGROUNDSIZE (XML_PM_CTF_START + 0x0045) + +#define CTF_PM_SCALETO (XML_PM_CTF_START + 0x0051) // calc specific +#define CTF_PM_SCALETOPAGES (XML_PM_CTF_START + 0x0052) +#define CTF_PM_SCALETOX (XML_PM_CTF_START + 0x0053) +#define CTF_PM_SCALETOY (XML_PM_CTF_START + 0x0054) +#define CTF_PM_STANDARD_MODE (XML_PM_CTF_START + 0x0055) +#define CTP_PM_GRID_BASE_WIDTH (XML_PM_CTF_START + 0x0056) +#define CTP_PM_GRID_SNAP_TO_CHARS (XML_PM_CTF_START + 0x0057) +#define CTP_PM_GRID_SNAP_TO (XML_PM_CTF_START + 0x0058) +// header +#define CTF_PM_HEADERBORDERALL (CTF_PM_HEADERFLAG|CTF_PM_BORDERALL) +#define CTF_PM_HEADERBORDERTOP (CTF_PM_HEADERFLAG|CTF_PM_BORDERTOP) +#define CTF_PM_HEADERBORDERBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_BORDERBOTTOM) +#define CTF_PM_HEADERBORDERLEFT (CTF_PM_HEADERFLAG|CTF_PM_BORDERLEFT) +#define CTF_PM_HEADERBORDERRIGHT (CTF_PM_HEADERFLAG|CTF_PM_BORDERRIGHT) +#define CTF_PM_HEADERBORDERWIDTHALL (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHALL) +#define CTF_PM_HEADERBORDERWIDTHTOP (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHTOP) +#define CTF_PM_HEADERBORDERWIDTHBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHBOTTOM) +#define CTF_PM_HEADERBORDERWIDTHLEFT (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHLEFT) +#define CTF_PM_HEADERBORDERWIDTHRIGHT (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHRIGHT) +#define CTF_PM_HEADERPADDINGALL (CTF_PM_HEADERFLAG|CTF_PM_PADDINGALL) +#define CTF_PM_HEADERPADDINGTOP (CTF_PM_HEADERFLAG|CTF_PM_PADDINGTOP) +#define CTF_PM_HEADERPADDINGBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_PADDINGBOTTOM) +#define CTF_PM_HEADERPADDINGLEFT (CTF_PM_HEADERFLAG|CTF_PM_PADDINGLEFT) +#define CTF_PM_HEADERPADDINGRIGHT (CTF_PM_HEADERFLAG|CTF_PM_PADDINGRIGHT) +#define CTF_PM_HEADERHEIGHT (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0031)) +#define CTF_PM_HEADERMINHEIGHT (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0032)) +#define CTF_PM_HEADERDYNAMIC (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0033)) +#define CTF_PM_HEADERGRAPHICPOSITION (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0034)) +#define CTF_PM_HEADERGRAPHICFILTER (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0035)) +#define CTF_PM_HEADERGRAPHICURL (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0036)) +#define CTF_PM_HEADERMARGINALL (CTF_PM_HEADERFLAG|CTF_PM_MARGINALL) +#define CTF_PM_HEADERMARGINTOP (CTF_PM_HEADERFLAG|CTF_PM_MARGINTOP) +#define CTF_PM_HEADERMARGINBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_MARGINBOTTOM) +#define CTF_PM_HEADERMARGINLEFT (CTF_PM_HEADERFLAG|CTF_PM_MARGINLEFT) +#define CTF_PM_HEADERMARGINRIGHT (CTF_PM_HEADERFLAG|CTF_PM_MARGINRIGHT) + +// Need own entries for PageMasterStyleMap ORed with the CTF_PM_HEADERFLAG +#define CTF_PM_HEADERREPEAT_OFFSET_X (CTF_PM_HEADERFLAG|CTF_PM_REPEAT_OFFSET_X) +#define CTF_PM_HEADERREPEAT_OFFSET_Y (CTF_PM_HEADERFLAG|CTF_PM_REPEAT_OFFSET_Y) +#define CTF_PM_HEADERFILLGRADIENTNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLGRADIENTNAME) +#define CTF_PM_HEADERFILLHATCHNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLHATCHNAME) +#define CTF_PM_HEADERFILLBITMAPNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLBITMAPNAME) +#define CTF_PM_HEADERFILLTRANSNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLTRANSNAME) + +// footer +#define CTF_PM_FOOTERBORDERALL (CTF_PM_FOOTERFLAG|CTF_PM_BORDERALL) +#define CTF_PM_FOOTERBORDERTOP (CTF_PM_FOOTERFLAG|CTF_PM_BORDERTOP) +#define CTF_PM_FOOTERBORDERBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_BORDERBOTTOM) +#define CTF_PM_FOOTERBORDERLEFT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERLEFT) +#define CTF_PM_FOOTERBORDERRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERRIGHT) +#define CTF_PM_FOOTERBORDERWIDTHALL (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHALL) +#define CTF_PM_FOOTERBORDERWIDTHTOP (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHTOP) +#define CTF_PM_FOOTERBORDERWIDTHBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHBOTTOM) +#define CTF_PM_FOOTERBORDERWIDTHLEFT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHLEFT) +#define CTF_PM_FOOTERBORDERWIDTHRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHRIGHT) +#define CTF_PM_FOOTERPADDINGALL (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGALL) +#define CTF_PM_FOOTERPADDINGTOP (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGTOP) +#define CTF_PM_FOOTERPADDINGBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGBOTTOM) +#define CTF_PM_FOOTERPADDINGLEFT (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGLEFT) +#define CTF_PM_FOOTERPADDINGRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGRIGHT) +#define CTF_PM_FOOTERHEIGHT (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0031)) +#define CTF_PM_FOOTERMINHEIGHT (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0032)) +#define CTF_PM_FOOTERDYNAMIC (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0033)) +#define CTF_PM_FOOTERGRAPHICPOSITION (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0034)) +#define CTF_PM_FOOTERGRAPHICFILTER (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0035)) +#define CTF_PM_FOOTERGRAPHICURL (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0036)) +#define CTF_PM_FOOTERMARGINALL (CTF_PM_FOOTERFLAG|CTF_PM_MARGINALL) +#define CTF_PM_FOOTERMARGINTOP (CTF_PM_FOOTERFLAG|CTF_PM_MARGINTOP) +#define CTF_PM_FOOTERMARGINBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_MARGINBOTTOM) +#define CTF_PM_FOOTERMARGINLEFT (CTF_PM_FOOTERFLAG|CTF_PM_MARGINLEFT) +#define CTF_PM_FOOTERMARGINRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_MARGINRIGHT) + +// Need own entries for PageMasterStyleMap ORed with the CTF_PM_FOOTERFLAG +#define CTF_PM_FOOTERREPEAT_OFFSET_X (CTF_PM_FOOTERFLAG|CTF_PM_REPEAT_OFFSET_X) +#define CTF_PM_FOOTERREPEAT_OFFSET_Y (CTF_PM_FOOTERFLAG|CTF_PM_REPEAT_OFFSET_Y) +#define CTF_PM_FOOTERFILLGRADIENTNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLGRADIENTNAME) +#define CTF_PM_FOOTERFILLHATCHNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLHATCHNAME) +#define CTF_PM_FOOTERFILLBITMAPNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLBITMAPNAME) +#define CTF_PM_FOOTERFILLTRANSNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLTRANSNAME) + +#define CTF_PM_FTN_HEIGHT (XML_PM_CTF_START + 0x0060) +#define CTF_PM_FTN_LINE_WEIGHT (XML_PM_CTF_START + 0x0061) +#define CTF_PM_FTN_LINE_COLOR (XML_PM_CTF_START + 0x0062) +#define CTF_PM_FTN_LINE_WIDTH (XML_PM_CTF_START + 0x0063) +#define CTF_PM_FTN_LINE_ADJUST (XML_PM_CTF_START + 0x0064) +#define CTF_PM_FTN_LINE_DISTANCE (XML_PM_CTF_START + 0x0065) +#define CTF_PM_FTN_DISTANCE (XML_PM_CTF_START + 0x0066) +#define CTF_PM_FTN_LINE_STYLE (XML_PM_CTF_START + 0x0067) + +extern const XMLPropertyMapEntry aXMLPageMasterStyleMap[]; +extern const XMLPropertyMapEntry g_XMLPageMasterDrawingPageStyleMap[]; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/PropertySetMerger.hxx b/xmloff/inc/PropertySetMerger.hxx new file mode 100644 index 0000000000..f002f4c8f6 --- /dev/null +++ b/xmloff/inc/PropertySetMerger.hxx @@ -0,0 +1,28 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/beans/XPropertySet.hpp> + +extern css::uno::Reference<css::beans::XPropertySet> PropertySetMerger_CreateInstance( + const css::uno::Reference<css::beans::XPropertySet>& rPropSet1, + const css::uno::Reference<css::beans::XPropertySet>& rPropSet2) noexcept; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/RDFaExportHelper.hxx b/xmloff/inc/RDFaExportHelper.hxx new file mode 100644 index 0000000000..8a8c494589 --- /dev/null +++ b/xmloff/inc/RDFaExportHelper.hxx @@ -0,0 +1,66 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/uno/Reference.h> + +#include <rtl/ustring.hxx> +#include <tools/long.hxx> + +#include <map> + + +namespace com::sun::star { + namespace rdf { class XBlankNode; } + namespace rdf { class XMetadatable; } + namespace rdf { class XDocumentRepository; } +} + +class SvXMLExport; + +namespace xmloff { + +class RDFaExportHelper +{ +private: + SvXMLExport & m_rExport; + + css::uno::Reference<css::rdf::XDocumentRepository> m_xRepository; + + typedef ::std::map< OUString, OUString > + BlankNodeMap_t; + + BlankNodeMap_t m_BlankNodeMap; + + tools::Long m_Counter; + + OUString + LookupBlankNode( css::uno::Reference<css::rdf::XBlankNode> const & i_xBlankNode); + +public: + RDFaExportHelper(SvXMLExport & i_rExport); + + void + AddRDFa(css::uno::Reference<css::rdf::XMetadatable> const & i_xMetadatable); +}; + +} // namespace xmloff + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/RDFaImportHelper.hxx b/xmloff/inc/RDFaImportHelper.hxx new file mode 100644 index 0000000000..31e00af93d --- /dev/null +++ b/xmloff/inc/RDFaImportHelper.hxx @@ -0,0 +1,86 @@ +/* -*- 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 . + */ + +#pragma once + +#include <memory> +#include <vector> + +#include <com/sun/star/uno/Reference.h> +#include <rtl/ustring.hxx> + +namespace com::sun::star { + namespace uno { class XComponentContext; } + namespace rdf { class XMetadatable; } + namespace rdf { class XRepositorySupplier; } +} + +class SvXMLImport; + +namespace xmloff { + +struct RDFaEntry; +struct ParsedRDFaAttributes; + +class RDFaImportHelper +{ + +private: + const SvXMLImport & m_rImport; + + ::std::vector< RDFaEntry > m_RDFaEntries; + + const SvXMLImport & GetImport() const { return m_rImport; } + + +public: + RDFaImportHelper(const SvXMLImport & i_rImport); + + ~RDFaImportHelper(); + + /** Parse RDFa attributes */ + std::shared_ptr<ParsedRDFaAttributes> ParseRDFa( + OUString const & i_rAbout, + OUString const & i_rProperty, + OUString const & i_rContent, + OUString const & i_rDatatype); + + /** Add a RDFa statement; must have been parsed with ParseRDFa */ + void AddRDFa( + css::uno::Reference< css::rdf::XMetadatable> const & i_xObject, + std::shared_ptr<ParsedRDFaAttributes> const & i_pRDFaAttributes); + + /** Parse and add a RDFa statement; parameters are XML attribute values */ + void ParseAndAddRDFa( + css::uno::Reference< css::rdf::XMetadatable> const & i_xObject, + OUString const & i_rAbout, + OUString const & i_rProperty, + OUString const & i_rContent, + OUString const & i_rDatatype); + + /** Insert all added statements into the RDF repository. + <p> This is done <em>after</em> the input file has been read, + to prevent collision between generated ids and ids in the file.</p> + */ + void InsertRDFa( css::uno::Reference< css::rdf::XRepositorySupplier > const & i_xModel); +}; + +} // namespace xmloff + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/SchXMLAutoStylePoolP.hxx b/xmloff/inc/SchXMLAutoStylePoolP.hxx new file mode 100644 index 0000000000..c349a09056 --- /dev/null +++ b/xmloff/inc/SchXMLAutoStylePoolP.hxx @@ -0,0 +1,43 @@ +/* -*- 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 . + */ +#pragma once + +#include <xmloff/xmlaustp.hxx> + +class SchXMLExport; + +class SchXMLAutoStylePoolP final : public SvXMLAutoStylePoolP +{ + SchXMLExport& mrSchXMLExport; + + virtual void exportStyleAttributes( + comphelper::AttributeList& rAttrList, + XmlStyleFamily nFamily, + const ::std::vector< XMLPropertyState >& rProperties, + const SvXMLExportPropertyMapper& rPropExp + , const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap + ) const override; + +public: + explicit SchXMLAutoStylePoolP( SchXMLExport& rSchXMLExport ); + virtual ~SchXMLAutoStylePoolP() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/SchXMLExport.hxx b/xmloff/inc/SchXMLExport.hxx new file mode 100644 index 0000000000..55ac112565 --- /dev/null +++ b/xmloff/inc/SchXMLExport.hxx @@ -0,0 +1,58 @@ +/* -*- 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 . + */ +#pragma once + +#include <xmloff/SchXMLExportHelper.hxx> +#include "SchXMLAutoStylePoolP.hxx" +#include <xmloff/xmlexp.hxx> +#include <xmloff/xmlprmap.hxx> + +namespace com::sun::star { + namespace task { + class XStatusIndicator; + } +} + +// export class for a complete chart document + +class SchXMLExport final : public SvXMLExport +{ +private: + rtl::Reference<SchXMLAutoStylePoolP> maAutoStylePool; + + rtl::Reference<SchXMLExportHelper> maExportHelper; + + virtual ErrCode exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ) override; + + virtual void ExportAutoStyles_() override; + virtual void ExportMasterStyles_() override; + virtual void ExportContent_() override; + +public: + SchXMLExport( + const css::uno::Reference< css::uno::XComponentContext >& xContext, + OUString const & implementationName, + SvXMLExportFlags nExportFlags ); + virtual ~SchXMLExport() override; + + void collectAutoStyles() override; + rtl::Reference< XMLPropertySetMapper > const & GetPropertySetMapper() const; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/SchXMLImport.hxx b/xmloff/inc/SchXMLImport.hxx new file mode 100644 index 0000000000..b61b038be7 --- /dev/null +++ b/xmloff/inc/SchXMLImport.hxx @@ -0,0 +1,47 @@ +/* -*- 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 . + */ +#pragma once + +#include <xmloff/SchXMLImportHelper.hxx> +#include <xmloff/xmlimp.hxx> +#include <xmloff/xmlictxt.hxx> + +class SchXMLImport final : public SvXMLImport +{ +private: + rtl::Reference<SchXMLImportHelper> maImportHelper; + + virtual SvXMLImportContext* CreateFastContext( + sal_Int32 nElement, + const ::css::uno::Reference<::css::xml::sax::XFastAttributeList>& xAttrList) override; + +public: + SchXMLImport(const css::uno::Reference<css::uno::XComponentContext>& xContext, + OUString const& implementationName, SvXMLImportFlags nImportFlags); + + virtual ~SchXMLImport() noexcept override; + + SvXMLImportContext* CreateStylesContext(); + + // XImporter + virtual void SAL_CALL + setTargetDocument(const css::uno::Reference<css::lang::XComponent>& xDoc) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/StyleMap.hxx b/xmloff/inc/StyleMap.hxx new file mode 100644 index 0000000000..796245f52f --- /dev/null +++ b/xmloff/inc/StyleMap.hxx @@ -0,0 +1,77 @@ +/* -*- 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 . + */ + +#pragma once + +#include <comphelper/servicehelper.hxx> +#include <cppuhelper/implbase.hxx> +#include <o3tl/hash_combine.hxx> +#include <unordered_map> +#include <utility> + +enum class XmlStyleFamily; + +struct StyleNameKey_Impl +{ + XmlStyleFamily m_nFamily; + OUString m_aName; + + StyleNameKey_Impl( XmlStyleFamily nFamily, + OUString sName ) : + m_nFamily( nFamily ), + m_aName(std::move( sName )) + { + } +}; + +struct StyleNameHash_Impl +{ + inline size_t operator()( const StyleNameKey_Impl& r ) const; + inline bool operator()( const StyleNameKey_Impl& r1, + const StyleNameKey_Impl& r2 ) const; +}; + +inline size_t StyleNameHash_Impl::operator()( const StyleNameKey_Impl& r ) const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, r.m_nFamily); + o3tl::hash_combine(seed, r.m_aName.hashCode()); + return seed; +} + +inline bool StyleNameHash_Impl::operator()( + const StyleNameKey_Impl& r1, + const StyleNameKey_Impl& r2 ) const +{ + return r1.m_nFamily == r2.m_nFamily && r1.m_aName == r2.m_aName; +} + +class StyleMap final : + public ::cppu::WeakImplHelper<>, + public std::unordered_map< StyleNameKey_Impl, OUString, + StyleNameHash_Impl, StyleNameHash_Impl > +{ + +public: + + StyleMap(); + virtual ~StyleMap() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/TransGradientStyle.hxx b/xmloff/inc/TransGradientStyle.hxx new file mode 100644 index 0000000000..781969f7db --- /dev/null +++ b/xmloff/inc/TransGradientStyle.hxx @@ -0,0 +1,57 @@ +/* -*- 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 . + */ + +#pragma once + + +#include <rtl/ustring.hxx> + +class SvXMLImport; +class SvXMLExport; +namespace com::sun::star { + namespace uno { template<class A> class Reference; } + namespace xml::sax { class XFastAttributeList; } + namespace uno { class Any; } +} + + +class XMLTransGradientStyleImport +{ + SvXMLImport& rImport; + +public: + XMLTransGradientStyleImport( SvXMLImport& rImport ); + + void importXML( + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, + css::uno::Any& rValue, + OUString& rStrName ); +}; + +class XMLTransGradientStyleExport +{ + SvXMLExport& rExport; + +public: + XMLTransGradientStyleExport( SvXMLExport& rExport ); + + void exportXML( const OUString& rStrName, const css::uno::Any& rValue ); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/WordWrapPropertyHdl.hxx b/xmloff/inc/WordWrapPropertyHdl.hxx new file mode 100644 index 0000000000..b64d53faf6 --- /dev/null +++ b/xmloff/inc/WordWrapPropertyHdl.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/. + * + * 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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +/** + PropertyHandler for a named xml bool type: +*/ +class SvXMLImport; +class XMLWordWrapPropertyHdl final : public XMLPropertyHandler +{ +private: + SvXMLImport* mpImport; + +public: + XMLWordWrapPropertyHdl( SvXMLImport* pImport ); + virtual ~XMLWordWrapPropertyHdl() override; + + virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLBackgroundImageContext.hxx b/xmloff/inc/XMLBackgroundImageContext.hxx new file mode 100644 index 0000000000..c19032de2d --- /dev/null +++ b/xmloff/inc/XMLBackgroundImageContext.hxx @@ -0,0 +1,69 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/style/GraphicLocation.hpp> +#include <xmloff/XMLElementPropertyContext.hxx> + +namespace com::sun::star { + namespace io { class XOutputStream; } +} + +class XMLBackgroundImageContext final : public XMLElementPropertyContext +{ + XMLPropertyState aPosProp; + sal_Int32 m_nBitmapModeIdx; + XMLPropertyState aFilterProp; + XMLPropertyState aTransparencyProp; + + css::style::GraphicLocation ePos; + OUString m_sURL; + OUString sFilter; + sal_Int8 nTransparency; + + css::uno::Reference < css::io::XOutputStream > m_xBase64Stream; + +private: + void ProcessAttrs( + const css::uno::Reference<css::xml::sax::XFastAttributeList > & xAttrList ); + +public: + + XMLBackgroundImageContext( + SvXMLImport& rImport, + sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList > & xAttrList, + const XMLPropertyState& rProp, + sal_Int32 nPosIdx, + sal_Int32 nFilterIdx, + sal_Int32 nTransparencyIdx, + sal_Int32 nBitmapModeIdx, + ::std::vector< XMLPropertyState > &rProps ); + + virtual ~XMLBackgroundImageContext() override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLBackgroundImageExport.hxx b/xmloff/inc/XMLBackgroundImageExport.hxx new file mode 100644 index 0000000000..401df38ef2 --- /dev/null +++ b/xmloff/inc/XMLBackgroundImageExport.hxx @@ -0,0 +1,50 @@ +/* -*- 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 . + */ + +#pragma once + +#include <sal/types.h> +#include <rtl/ustring.hxx> + +namespace com::sun::star::uno { + class Any; +} + +class SvXMLExport; + +class XMLBackgroundImageExport +{ + SvXMLExport& rExport; + +public: + + SvXMLExport& GetExport() const { return rExport; } + + XMLBackgroundImageExport( SvXMLExport& rExport ); + + void exportXML( const css::uno::Any& rURL, + const css::uno::Any *pPos, + const css::uno::Any *pFilter, + const css::uno::Any *pTransparency, + sal_uInt16 nPrefix, + const OUString& rLocalName ); +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLBase64Export.hxx b/xmloff/inc/XMLBase64Export.hxx new file mode 100644 index 0000000000..89a9155387 --- /dev/null +++ b/xmloff/inc/XMLBase64Export.hxx @@ -0,0 +1,45 @@ +/* -*- 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 . + */ +#pragma once + +#include <com/sun/star/uno/Reference.h> +#include <xmloff/xmltoken.hxx> + +namespace com::sun::star::io { class XInputStream; } +class SvXMLExport; + +class XMLBase64Export +{ + SvXMLExport& rExport; + + SvXMLExport& GetExport() { return rExport; } + +public: + + XMLBase64Export( SvXMLExport& rExport ); + + bool exportXML( const css::uno::Reference < css::io::XInputStream > & rIn ); + bool exportElement( const css::uno::Reference < css::io::XInputStream > & rIn, + enum ::xmloff::token::XMLTokenEnum eName ); + bool exportOfficeBinaryDataElement( + const css::uno::Reference < css::io::XInputStream > & rIn ); +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLBasicExportFilter.hxx b/xmloff/inc/XMLBasicExportFilter.hxx new file mode 100644 index 0000000000..2ed39d409d --- /dev/null +++ b/xmloff/inc/XMLBasicExportFilter.hxx @@ -0,0 +1,51 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <cppuhelper/implbase.hxx> + + +typedef ::cppu::WeakImplHelper< + css::xml::sax::XDocumentHandler > XMLBasicExportFilter_BASE; + +class XMLBasicExportFilter final : public XMLBasicExportFilter_BASE +{ +private: + css::uno::Reference< css::xml::sax::XDocumentHandler > m_xHandler; + +public: + XMLBasicExportFilter( + const css::uno::Reference< css::xml::sax::XDocumentHandler >& rxHandler ); + virtual ~XMLBasicExportFilter() override; + + // XDocumentHandler + virtual void SAL_CALL startDocument() override; + virtual void SAL_CALL endDocument() override; + virtual void SAL_CALL startElement( const OUString& aName, + const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs ) override; + virtual void SAL_CALL endElement( const OUString& aName ) override; + virtual void SAL_CALL characters( const OUString& aChars ) override; + virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) override; + virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) override; + virtual void SAL_CALL setDocumentLocator( const css::uno::Reference< css::xml::sax::XLocator >& xLocator ) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx b/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx new file mode 100644 index 0000000000..a3be8f99cb --- /dev/null +++ b/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx @@ -0,0 +1,52 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +template<typename EnumT> struct SvXMLEnumMapEntry; + + +/** Abstract base-class for different XML-types. Derivations of this class + knows how to compare, im/export a special XML-type +*/ +class XMLBitmapLogicalSizePropertyHandler final : public XMLPropertyHandler +{ +public: + + XMLBitmapLogicalSizePropertyHandler(); + + // Just needed for virtual destruction + virtual ~XMLBitmapLogicalSizePropertyHandler() override; + + /// Imports the given value in case of the given XML-data-type + virtual bool importXML( + const OUString& rStrImpValue, + css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; + + /// Exports the given value in case of the given XML-data-type + virtual bool exportXML( + OUString& rStrExpValue, + const css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx b/xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx new file mode 100644 index 0000000000..d008935acf --- /dev/null +++ b/xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx @@ -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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +template<typename EnumT> struct SvXMLEnumMapEntry; + +/** Abstract base-class for different XML-types. Derivations of this class + knows how to compare, im/export a special XML-type +*/ +class XMLBitmapRepeatOffsetPropertyHandler final : public XMLPropertyHandler +{ + bool mbX; + OUString msVertical; + OUString msHorizontal; +public: + + XMLBitmapRepeatOffsetPropertyHandler( bool bX ); + + // Just needed for virtual destruction + virtual ~XMLBitmapRepeatOffsetPropertyHandler() override; + + /// Imports the given value in case of the given XML-data-type + virtual bool importXML( + const OUString& rStrImpValue, + css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; + + /// Exports the given value in case of the given XML-data-type + virtual bool exportXML( + OUString& rStrExpValue, + const css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLChartPropertySetMapper.hxx b/xmloff/inc/XMLChartPropertySetMapper.hxx new file mode 100644 index 0000000000..835dd3cc9a --- /dev/null +++ b/xmloff/inc/XMLChartPropertySetMapper.hxx @@ -0,0 +1,102 @@ +/* -*- 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 . + */ +#pragma once + +#include <xmloff/xmlprmap.hxx> +#include <xmloff/xmlexppr.hxx> +#include <xmloff/xmlimppr.hxx> +#include <xmloff/xmlimp.hxx> +#include <xmloff/prhdlfac.hxx> + +class SvXMLExport; + +class XMLChartPropHdlFactory final : public XMLPropertyHandlerFactory +{ +private: + SvXMLExport const*const m_pExport; + +public: + XMLChartPropHdlFactory(SvXMLExport const*); + virtual ~XMLChartPropHdlFactory() override; + virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const override; +}; + +class XMLChartPropertySetMapper final : public XMLPropertySetMapper +{ +public: + explicit XMLChartPropertySetMapper(SvXMLExport const* pExport); + virtual ~XMLChartPropertySetMapper() override; +}; + +class XMLChartExportPropertyMapper final : public SvXMLExportPropertyMapper +{ +private: + SvXMLExport& mrExport; + css::uno::Reference< css::chart2::XChartDocument > mxChartDoc; + + virtual void ContextFilter( + bool bEnableFoFontFamily, + ::std::vector< XMLPropertyState >& rProperties, + const css::uno::Reference<css::beans::XPropertySet >& rPropSet ) const override; + + /// this method is called for every item that has the MID_FLAG_ELEMENT_EXPORT flag set + virtual void handleElementItem( + SvXMLExport& rExport, + const XMLPropertyState& rProperty, SvXmlExportFlags nFlags, + const ::std::vector< XMLPropertyState > *pProperties, + sal_uInt32 nIdx ) const override; + + /// this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set + virtual void handleSpecialItem( + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, + const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, + const ::std::vector< XMLPropertyState > *pProperties, + sal_uInt32 nIdx ) const override; + +public: + XMLChartExportPropertyMapper( const rtl::Reference< XMLPropertySetMapper >& rMapper, + SvXMLExport& rExport ); + virtual ~XMLChartExportPropertyMapper() override; + + void setChartDoc( const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc ); +}; + +class XMLChartImportPropertyMapper final : public SvXMLImportPropertyMapper +{ +private: + SvXMLImport& mrImport; + +public: + XMLChartImportPropertyMapper( const rtl::Reference< XMLPropertySetMapper >& rMapper, + const SvXMLImport& rImport ); + virtual ~XMLChartImportPropertyMapper() override; + + virtual bool handleSpecialItem( + XMLPropertyState& rProperty, + ::std::vector< XMLPropertyState >& rProperties, + const OUString& rValue, + const SvXMLUnitConverter& rUnitConverter, + const SvXMLNamespaceMap& rNamespaceMap ) const override; + + virtual void finished( + ::std::vector< XMLPropertyState >& rProperties, + sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLChartStyleContext.hxx b/xmloff/inc/XMLChartStyleContext.hxx new file mode 100644 index 0000000000..57744a774c --- /dev/null +++ b/xmloff/inc/XMLChartStyleContext.hxx @@ -0,0 +1,51 @@ +/* -*- 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 . + */ +#pragma once + +#include <xmloff/XMLShapeStyleContext.hxx> + +class XMLChartStyleContext final : public XMLShapeStyleContext +{ +private: + OUString msDataStyleName; + OUString msPercentageDataStyleName; + SvXMLStylesContext& mrStyles; + + /// is called when an attribute at the (auto)style element is found + virtual void SetAttribute( sal_Int32 nElement, const OUString& rValue ) override; + +public: + + XMLChartStyleContext( + SvXMLImport& rImport, + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ); + virtual ~XMLChartStyleContext() override; + + /// is called after all styles have been read to apply styles + void FillPropertySet( + const css::uno::Reference<css::beans::XPropertySet > & rPropSet ) override; + + /// necessary for property context (element-property symbol-image) + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + + bool isEmptyDataStyleName() override { return msDataStyleName.isEmpty(); } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLClipPropertyHandler.hxx b/xmloff/inc/XMLClipPropertyHandler.hxx new file mode 100644 index 0000000000..0f97301716 --- /dev/null +++ b/xmloff/inc/XMLClipPropertyHandler.hxx @@ -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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +/** + PropertyHandler for the XML-data-type: +*/ +class XMLClipPropertyHandler final : public XMLPropertyHandler +{ + bool m_bODF11; +public: + XMLClipPropertyHandler( bool bODF11 ); + virtual ~XMLClipPropertyHandler() override; + + virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override; + virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLEmbeddedObjectExportFilter.hxx b/xmloff/inc/XMLEmbeddedObjectExportFilter.hxx new file mode 100644 index 0000000000..cfbe5d9e75 --- /dev/null +++ b/xmloff/inc/XMLEmbeddedObjectExportFilter.hxx @@ -0,0 +1,68 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase.hxx> + +class XMLEmbeddedObjectExportFilter final : public cppu::WeakImplHelper< + css::xml::sax::XExtendedDocumentHandler, + css::lang::XServiceInfo, + css::lang::XInitialization> +{ + css::uno::Reference< css::xml::sax::XDocumentHandler > xHandler; + css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > xExtHandler; + +public: + XMLEmbeddedObjectExportFilter( const css::uno::Reference< css::xml::sax::XDocumentHandler > & rHandler ) noexcept; + virtual ~XMLEmbeddedObjectExportFilter () noexcept override; + + // css::xml::sax::XDocumentHandler + virtual void SAL_CALL startDocument() override; + virtual void SAL_CALL endDocument() override; + virtual void SAL_CALL startElement(const OUString& aName, + const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs) override; + virtual void SAL_CALL endElement(const OUString& aName) override; + virtual void SAL_CALL characters(const OUString& aChars) override; + virtual void SAL_CALL ignorableWhitespace(const OUString& aWhitespaces) override; + virtual void SAL_CALL processingInstruction(const OUString& aTarget, + const OUString& aData) override; + virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > & xLocator) override; + + // css::xml::sax::XExtendedDocumentHandler + virtual void SAL_CALL startCDATA() override; + virtual void SAL_CALL endCDATA() override; + virtual void SAL_CALL comment(const OUString& sComment) override; + virtual void SAL_CALL allowLineBreak() override; + virtual void SAL_CALL unknown(const OUString& sString) override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName( ) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; + +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLEmbeddedObjectImportContext.hxx b/xmloff/inc/XMLEmbeddedObjectImportContext.hxx new file mode 100644 index 0000000000..ca1ea2ac4d --- /dev/null +++ b/xmloff/inc/XMLEmbeddedObjectImportContext.hxx @@ -0,0 +1,61 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp> +#include <xmloff/xmlictxt.hxx> + +namespace com::sun::star::lang { class XComponent; } + +class XMLEmbeddedObjectImportContext final : public SvXMLImportContext +{ + css::uno::Reference<css::xml::sax::XFastDocumentHandler > mxFastHandler; + css::uno::Reference<css::lang::XComponent > xComp; + + OUString sFilterService; + OUString sCLSID; + +public: + + const OUString& GetFilterServiceName() const { return sFilterService; } + const OUString& GetFilterCLSID() const { return sCLSID; } + + XMLEmbeddedObjectImportContext( SvXMLImport& rImport, sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ); + + virtual ~XMLEmbeddedObjectImportContext() override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + + virtual void SAL_CALL startFastElement( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override; + + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; + + virtual void SAL_CALL characters( const OUString& rChars ) override; + + void SetComponent( css::uno::Reference< css::lang::XComponent > const & rComp ); + +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLEventImportHelper.hxx b/xmloff/inc/XMLEventImportHelper.hxx new file mode 100644 index 0000000000..ccb475ac12 --- /dev/null +++ b/xmloff/inc/XMLEventImportHelper.hxx @@ -0,0 +1,93 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/uno/Reference.hxx> +#include <xmloff/xmlevent.hxx> + +#include <map> +#include <vector> +#include <memory> + + +namespace com::sun::star { + namespace xml::sax { class XFastAttributeList; } +} +class XMLEventContextFactory; +class XMLEventsImportContext; +struct XMLEventNameTranslation; + +typedef ::std::map< OUString, std::unique_ptr<XMLEventContextFactory> > FactoryMap; +typedef ::std::map< XMLEventName, OUString > NameMap; + + +/** + * Helps the XMLEventsImportContext. + * + * This class stores + * a) the translation from XML event names to API event names, and + * b) a mapping from script language names to XMLEventContextFactory objects + * (that handle particular languages). + * + * Event name translation tables may be added, i.e. they will be joined + * together. If different translations are needed (i.e., if the same XML name + * needs to be translated to different API names in different contexts), then + * translation tables may be saved on a translation table stack. + */ +class XMLEventImportHelper +{ + /// map of XMLEventContextFactory objects + FactoryMap aFactoryMap; + + /// map from XML to API names + std::unique_ptr<NameMap> pEventNameMap; + + /// stack of previous aEventNameMap + std::vector< std::unique_ptr<NameMap> > aEventNameMapVector; + +public: + XMLEventImportHelper(); + + ~XMLEventImportHelper(); + + /// register a handler for a particular language type + void RegisterFactory( const OUString& rLanguage, + std::unique_ptr<XMLEventContextFactory> aFactory ); + + /// add event name translation to the internal table + void AddTranslationTable( const XMLEventNameTranslation* pTransTable ); + + /// save the old translation table on a stack and install an empty table + void PushTranslationTable(); + + /// recover the top-most previously saved translation table + void PopTranslationTable(); + + /// create an appropriate import context for a particular event + SvXMLImportContext* CreateContext( + SvXMLImport& rImport, + const css::uno::Reference< css::xml::sax::XFastAttributeList> & xAttrList, + XMLEventsImportContext* rEvents, + const OUString& rXmlEventName, + const OUString& rLanguage); + +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx b/xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx new file mode 100644 index 0000000000..4d5a21fae6 --- /dev/null +++ b/xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx @@ -0,0 +1,52 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +template<typename EnumT> struct SvXMLEnumMapEntry; + + +/** Abstract base-class for different XML-types. Derivations of this class + knows how to compare, im/export a special XML-type +*/ +class XMLFillBitmapSizePropertyHandler final : public XMLPropertyHandler +{ +public: + + XMLFillBitmapSizePropertyHandler(); + + // Just needed for virtual destruction + virtual ~XMLFillBitmapSizePropertyHandler() override; + + /// Imports the given value in case of the given XML-data-type + virtual bool importXML( + const OUString& rStrImpValue, + css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; + + /// Exports the given value in case of the given XML-data-type + virtual bool exportXML( + OUString& rStrExpValue, + const css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx b/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx new file mode 100644 index 0000000000..2bd8efc403 --- /dev/null +++ b/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx @@ -0,0 +1,85 @@ +/* -*- 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 . + */ + +#pragma once + +#include <memory> +#include <xmloff/xmlstyle.hxx> + +namespace com::sun::star { + namespace uno { template<class X> class Reference; } + namespace xml::sax { class XAttributeList; } + namespace beans { class XPropertySet; } +} +class SvXMLImport; + +/// import footnote and endnote configuration elements +class XMLFootnoteConfigurationImportContext final : public SvXMLStyleContext +{ + OUString sCitationStyle; + OUString sAnchorStyle; + OUString sDefaultStyle; + OUString sPageStyle; + OUString sPrefix; + OUString sSuffix; + OUString sNumFormat; + OUString sNumSync; + OUString sBeginNotice; + OUString sEndNotice; + + sal_Int16 nOffset; + sal_Int16 nNumbering; + bool bPosition; + bool bIsEndnote; + + /// parse attributes + virtual void SetAttribute( sal_Int32 nElement, const OUString& rValue ) override; + +public: + + + XMLFootnoteConfigurationImportContext( + SvXMLImport& rImport, + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList> & xAttrList); + + virtual ~XMLFootnoteConfigurationImportContext() override; + + /// for footnotes, also parse begin and end notices + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + + /// set configuration at document; calls ProcessSettings + /* Move code from <CreateAndInsertLate(..)> to <Finish(..)>, because + at this time all styles it references have been set. (#i40579#) + */ + virtual void Finish( bool bOverwrite) override; + + /// set configuration at document + void ProcessSettings( + const css::uno::Reference< css::beans::XPropertySet> & rConfig); + + /// for helper class: set begin notice + void SetBeginNotice( const OUString& sText); + + /// for helper class: set end notice + void SetEndNotice( const OUString& sText); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLImageMapContext.hxx b/xmloff/inc/XMLImageMapContext.hxx new file mode 100644 index 0000000000..aec96fb29e --- /dev/null +++ b/xmloff/inc/XMLImageMapContext.hxx @@ -0,0 +1,57 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlictxt.hxx> +#include <rtl/ustring.hxx> +#include <com/sun/star/uno/Reference.h> + +namespace com::sun::star { + namespace container { class XIndexContainer; } + namespace beans { class XPropertySet; } + namespace xml::sax { class XAttributeList; } +} + + +class XMLImageMapContext final : public SvXMLImportContext +{ + /// the image map to be imported + css::uno::Reference< css::container::XIndexContainer> xImageMap; + + /// the property set from which to get and where eventually to set the + /// image map + css::uno::Reference< css::beans::XPropertySet> xPropertySet; + +public: + + XMLImageMapContext( + SvXMLImport& rImport, + css::uno::Reference< css::beans::XPropertySet> const & rPropertySet); + + virtual ~XMLImageMapContext() override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLImageMapExport.hxx b/xmloff/inc/XMLImageMapExport.hxx new file mode 100644 index 0000000000..12679b6dbb --- /dev/null +++ b/xmloff/inc/XMLImageMapExport.hxx @@ -0,0 +1,88 @@ +/* -*- 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 . + */ + +#pragma once + +#include <sal/types.h> + +namespace com::sun::star { + namespace uno { template<class X> class Reference; } + namespace beans { class XPropertySet; } + namespace container { class XIndexContainer; } +} +class SvXMLExport; + + +/** + * Export an ImageMap as defined by service com.sun.star.image.ImageMap to XML. + */ +class XMLImageMapExport +{ + SvXMLExport& mrExport; + +public: + XMLImageMapExport(SvXMLExport& rExport); + + /** + * Get the ImageMap object from the "ImageMap" property and subsequently + * export the map (if present). + */ + void Export( + /// the property set containing the ImageMap property + const css::uno::Reference< css::beans::XPropertySet> & rPropertySet); + /** + * Export an ImageMap (XIndexContainer). + */ + void Export( + /// the container containing the image map elements + const css::uno::Reference< css::container::XIndexContainer> & rContainer); + +private: + + /** + * Export a single, named map entry. + * (as given by com.sun.star.image.ImageMapObject) + * Calls methods for specific image map entries. + */ + void ExportMapEntry( + const css::uno::Reference< css::beans::XPropertySet> & rPropertySet); + + /** + * Export the specifics of a rectangular image map entry. + * To be called by ExportMapEntry. + */ + void ExportRectangle( + const css::uno::Reference< css::beans::XPropertySet> & rPropertySet); + + /** + * Export the specifics of a circular image map entry. + * To be called by ExportMapEntry. + */ + void ExportCircle( + const css::uno::Reference< css::beans::XPropertySet> & rPropertySet); + + /** + * Export the specifics of a polygonal image map entry; + * To be called by ExportMapEntry. + */ + void ExportPolygon( + const css::uno::Reference< css::beans::XPropertySet> & rPropertySet); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx b/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx new file mode 100644 index 0000000000..fe0b24b904 --- /dev/null +++ b/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx @@ -0,0 +1,71 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlstyle.hxx> +#include <xmloff/languagetagodf.hxx> +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <rtl/ustring.hxx> + + +#include <vector> + +namespace com::sun::star { + namespace xml::sax { class XAttributeList; } +} + + +/** + * Import bibliography configuration. + * + * Little cheat: Cover all child elements in CreateChildContext. + */ +class XMLIndexBibliographyConfigurationContext final : public SvXMLStyleContext +{ + OUString sSuffix; + OUString sPrefix; + OUString sAlgorithm; + LanguageTagODF maLanguageTagODF; + bool bNumberedEntries; + bool bSortByPosition; + + ::std::vector< css::uno::Sequence< css::beans::PropertyValue> > aSortKeys; + +public: + + + XMLIndexBibliographyConfigurationContext(SvXMLImport& rImport); + + virtual ~XMLIndexBibliographyConfigurationContext() override; + +private: + + virtual void SetAttribute( sal_Int32 nElement, + const OUString& rValue ) override; + + virtual void CreateAndInsert( bool bOverwrite ) override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLIsPercentagePropertyHandler.hxx b/xmloff/inc/XMLIsPercentagePropertyHandler.hxx new file mode 100644 index 0000000000..78ddde3361 --- /dev/null +++ b/xmloff/inc/XMLIsPercentagePropertyHandler.hxx @@ -0,0 +1,43 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +/** + This is a handler that returns true for import if the attribute string + contains a '%' value. For export this is only usable for filtering. +*/ +class XMLIsPercentagePropertyHandler final : public XMLPropertyHandler +{ +public: + virtual ~XMLIsPercentagePropertyHandler () override; + + virtual bool importXML( + const OUString& rStrImpValue, + css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( + OUString& rStrExpValue, + const css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLLineNumberingImportContext.hxx b/xmloff/inc/XMLLineNumberingImportContext.hxx new file mode 100644 index 0000000000..9a2083b374 --- /dev/null +++ b/xmloff/inc/XMLLineNumberingImportContext.hxx @@ -0,0 +1,68 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlstyle.hxx> +#include <rtl/ustring.hxx> +#include <com/sun/star/uno/Reference.h> + +namespace com::sun::star { + namespace xml::sax { class XAttributeList; } +} + + +/** import <text:linenumbering-configuration> elements */ +class XMLLineNumberingImportContext final : public SvXMLStyleContext +{ + OUString sStyleName; + OUString sNumFormat; + OUString sNumLetterSync; + OUString sSeparator; + sal_Int32 nOffset; + sal_Int16 nNumberPosition; + sal_Int16 nIncrement; + sal_Int16 nSeparatorIncrement; + bool bNumberLines; + bool bCountEmptyLines; + bool bCountInFloatingFrames; + bool bRestartNumbering; + +public: + + XMLLineNumberingImportContext(SvXMLImport& rImport); + + virtual ~XMLLineNumberingImportContext() override; + + // to be used by child context: set separator info + void SetSeparatorText(const OUString& sText); + void SetSeparatorIncrement(sal_Int16 nIncr); + +private: + + virtual void SetAttribute( sal_Int32 nElement, + const OUString& rValue ) override; + + virtual void CreateAndInsert(bool bOverwrite) override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLNumberStylesImport.hxx b/xmloff/inc/XMLNumberStylesImport.hxx new file mode 100644 index 0000000000..7ff731245d --- /dev/null +++ b/xmloff/inc/XMLNumberStylesImport.hxx @@ -0,0 +1,62 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlnumfi.hxx> + +// presentations:animations + +struct SdXMLFixedDataStyle; +class SdXMLImport; +enum class DataStyleNumber : sal_uInt8; + +class SdXMLNumberFormatImportContext final : public SvXMLNumFormatContext +{ + friend class SdXMLNumberFormatMemberImportContext; + + bool mbTimeStyle; + bool mbAutomatic; + DataStyleNumber mnElements[16]; + sal_Int16 mnIndex; + + sal_Int32 mnKey; + + bool compareStyle( const SdXMLFixedDataStyle* pStyle, sal_Int16& nIndex ) const; + + void add( std::u16string_view rNumberStyle, bool bLong, bool bTextual, bool bDecimal02, std::u16string_view rText ); + +public: + + SdXMLNumberFormatImportContext( SdXMLImport& rImport, + sal_Int32 nElement, + SvXMLNumImpData* pNewData, SvXMLStylesTokens nNewType, + const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList, + SvXMLStylesContext& rStyles); + virtual ~SdXMLNumberFormatImportContext() override; + + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + + sal_Int32 GetDrawKey() const { return mnKey; } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLNumberWithAutoForVoidPropHdl.hxx b/xmloff/inc/XMLNumberWithAutoForVoidPropHdl.hxx new file mode 100644 index 0000000000..c08054b2ec --- /dev/null +++ b/xmloff/inc/XMLNumberWithAutoForVoidPropHdl.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/. + * + * 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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +/** + PropertyHandler for the XML-data-type: XML_TYPE_NUMBER16_AUTO + Reads/writes numeric properties with special handling for "void" value + (i.e., void property will be written as "auto") +*/ +class XMLNumberWithAutoForVoidPropHdl final : public XMLPropertyHandler +{ +public: + explicit XMLNumberWithAutoForVoidPropHdl() {} + virtual ~XMLNumberWithAutoForVoidPropHdl() override; + + virtual bool importXML(const OUString& rStrImpValue, css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter) const override; + virtual bool exportXML(OUString& rStrExpValue, const css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLPercentOrMeasurePropertyHandler.hxx b/xmloff/inc/XMLPercentOrMeasurePropertyHandler.hxx new file mode 100644 index 0000000000..d2928d19df --- /dev/null +++ b/xmloff/inc/XMLPercentOrMeasurePropertyHandler.hxx @@ -0,0 +1,43 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +/** + This is a handler either only import/exports percent or measure. +*/ +class XMLPercentOrMeasurePropertyHandler final : public XMLPropertyHandler +{ +public: + XMLPercentOrMeasurePropertyHandler(); + virtual ~XMLPercentOrMeasurePropertyHandler () override; + + virtual bool importXML( + const OUString& rStrImpValue, + css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( + OUString& rStrExpValue, + const css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLRectangleMembersHandler.hxx b/xmloff/inc/XMLRectangleMembersHandler.hxx new file mode 100644 index 0000000000..5b97661498 --- /dev/null +++ b/xmloff/inc/XMLRectangleMembersHandler.hxx @@ -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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +template<typename EnumT> struct SvXMLEnumMapEntry; + + +/** Abstract base-class for different XML-types. Derivations of this class + knows how to compare, im/export a special XML-type +*/ +class XMLRectangleMembersHdl final : public XMLPropertyHandler +{ +private: + sal_Int32 mnType; +public: + + XMLRectangleMembersHdl( sal_Int32 nType ); + + // Just needed for virtual destruction + virtual ~XMLRectangleMembersHdl() override; + + /// Imports the given value in case of the given XML-data-type + virtual bool importXML( + const OUString& rStrImpValue, + css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; + + /// Exports the given value in case of the given XML-data-type + virtual bool exportXML( + OUString& rStrExpValue, + const css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLReplacementImageContext.hxx b/xmloff/inc/XMLReplacementImageContext.hxx new file mode 100644 index 0000000000..5fbf683f36 --- /dev/null +++ b/xmloff/inc/XMLReplacementImageContext.hxx @@ -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 . + */ + +#pragma once + +#include <xmloff/xmlictxt.hxx> + + +namespace com::sun::star { + namespace beans { class XPropertySet; } + namespace io { class XOutputStream; } +} + +class XMLReplacementImageContext final : public SvXMLImportContext +{ + css::uno::Reference < css::io::XOutputStream > m_xBase64Stream; + css::uno::Reference < css::beans::XPropertySet > m_xPropSet; + + OUString m_sHRef; + +public: + + + XMLReplacementImageContext( SvXMLImport& rImport, + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList > & rAttrList, + const css::uno::Reference< css::beans::XPropertySet >& rPropSet ); + virtual ~XMLReplacementImageContext() override; + + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLRtlGutterPropertyHandler.hxx b/xmloff/inc/XMLRtlGutterPropertyHandler.hxx new file mode 100644 index 0000000000..513320e154 --- /dev/null +++ b/xmloff/inc/XMLRtlGutterPropertyHandler.hxx @@ -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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +/// Maps <style:page-layout-properties style:writing-mode="..."> to RtlGutter. +class XMLRtlGutterPropertyHandler final : public XMLPropertyHandler +{ +public: + XMLRtlGutterPropertyHandler(); + + ~XMLRtlGutterPropertyHandler() override; + + bool importXML(const OUString& rStrImpValue, css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter) const override; + + bool exportXML(OUString& rStrExpValue, const css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLScriptContextFactory.hxx b/xmloff/inc/XMLScriptContextFactory.hxx new file mode 100644 index 0000000000..cde5bb916e --- /dev/null +++ b/xmloff/inc/XMLScriptContextFactory.hxx @@ -0,0 +1,48 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/uno/Reference.hxx> +#include <xmloff/xmlevent.hxx> + + +namespace com::sun::star { + namespace xml::sax { class XAttributeList; } +} +class SvXMLImport; +class XMLEventsImportContext; + +class XMLScriptContextFactory final : public XMLEventContextFactory +{ +public: + XMLScriptContextFactory(); + virtual ~XMLScriptContextFactory() override; + + virtual SvXMLImportContext * + CreateContext(SvXMLImport & rImport, /// import context + /// attribute list + const css::uno::Reference< css::xml::sax::XFastAttributeList> & xAttrList, + /// the context for the enclosing <script:events> element + XMLEventsImportContext * rEvents, + /// the event name (as understood by the API) + const OUString & rApiEventName) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLScriptExportHandler.hxx b/xmloff/inc/XMLScriptExportHandler.hxx new file mode 100644 index 0000000000..4197ba77ee --- /dev/null +++ b/xmloff/inc/XMLScriptExportHandler.hxx @@ -0,0 +1,44 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/uno/Sequence.hxx> +#include <rtl/ustring.hxx> +#include <xmloff/xmlevent.hxx> + +class SvXMLExport; +namespace com::sun::star { + namespace beans { struct PropertyValue; } +} + +class XMLScriptExportHandler final : public XMLEventExportHandler +{ +public: + XMLScriptExportHandler(); + virtual ~XMLScriptExportHandler() override; + + virtual void Export( + SvXMLExport& rExport, + const OUString& rEventName, + const css::uno::Sequence<css::beans::PropertyValue> & rValues, + bool bUseWhitespace) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLShapePropertySetContext.hxx b/xmloff/inc/XMLShapePropertySetContext.hxx new file mode 100644 index 0000000000..4f63935ed8 --- /dev/null +++ b/xmloff/inc/XMLShapePropertySetContext.hxx @@ -0,0 +1,51 @@ +/* -*- 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 . + */ +#pragma once + + +#include <xmloff/xmlprcon.hxx> +class SvxXMLListStyleContext; + +class XMLShapePropertySetContext : public SvXMLPropertySetContext +{ + rtl::Reference<SvxXMLListStyleContext> mxBulletStyle; + sal_Int32 mnBulletIndex; + +public: + + + XMLShapePropertySetContext( SvXMLImport& rImport, sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList >& xAttrList, + sal_uInt32 nFam, + ::std::vector< XMLPropertyState > &rProps, + const rtl::Reference < SvXMLImportPropertyMapper > &rMap ); + + virtual ~XMLShapePropertySetContext() override; + + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; + + using SvXMLPropertySetContext::createFastChildContext; + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, + ::std::vector< XMLPropertyState > &rProperties, + const XMLPropertyState& rProp ) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLStarBasicContextFactory.hxx b/xmloff/inc/XMLStarBasicContextFactory.hxx new file mode 100644 index 0000000000..ad0ac89399 --- /dev/null +++ b/xmloff/inc/XMLStarBasicContextFactory.hxx @@ -0,0 +1,48 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/uno/Reference.hxx> +#include <xmloff/xmlevent.hxx> + + +namespace com::sun::star { + namespace xml::sax { class XAttributeList; } +} +class SvXMLImport; +class XMLEventsImportContext; + + +class XMLStarBasicContextFactory final : public XMLEventContextFactory +{ +public: + XMLStarBasicContextFactory(); + virtual ~XMLStarBasicContextFactory() override; + + virtual SvXMLImportContext* CreateContext( + SvXMLImport& rImport, /// import context + const css::uno::Reference<css::xml::sax::XFastAttributeList> & xAttrList,/// attribute list + /// the context for the enclosing <script:events> element + XMLEventsImportContext* rEvents, + /// the event name (as understood by the API) + const OUString& rApiEventName) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLStarBasicExportHandler.hxx b/xmloff/inc/XMLStarBasicExportHandler.hxx new file mode 100644 index 0000000000..c1eb9f76a8 --- /dev/null +++ b/xmloff/inc/XMLStarBasicExportHandler.hxx @@ -0,0 +1,44 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/uno/Sequence.hxx> +#include <rtl/ustring.hxx> +#include <xmloff/xmlevent.hxx> + +class SvXMLExport; +namespace com::sun::star { + namespace beans { struct PropertyValue; } +} + +class XMLStarBasicExportHandler final : public XMLEventExportHandler +{ +public: + XMLStarBasicExportHandler(); + virtual ~XMLStarBasicExportHandler() override; + + virtual void Export( + SvXMLExport& rExport, + const OUString& rEventName, + const css::uno::Sequence<css::beans::PropertyValue> & rValues, + bool bUseWhitespace) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLStringBufferImportContext.hxx b/xmloff/inc/XMLStringBufferImportContext.hxx new file mode 100644 index 0000000000..ea44eb1c66 --- /dev/null +++ b/xmloff/inc/XMLStringBufferImportContext.hxx @@ -0,0 +1,50 @@ +/* -*- 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 . + */ +#pragma once + + +#include <xmloff/xmlictxt.hxx> + +#include <xmloff/xmlimp.hxx> +#include <rtl/ustrbuf.hxx> + + +/** + * Import all text into a string buffer. Paragraph elements (<text:p>) + * are recognized and cause a return character (0x0a) to be added. + */ +class XMLStringBufferImportContext final : public SvXMLImportContext +{ + OUStringBuffer& rTextBuffer; + +public: + + XMLStringBufferImportContext( + SvXMLImport& rImport, + OUStringBuffer& rBuffer); + + virtual ~XMLStringBufferImportContext() override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; + virtual void SAL_CALL characters(const OUString& rChars) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLTextColumnsContext.hxx b/xmloff/inc/XMLTextColumnsContext.hxx new file mode 100644 index 0000000000..e3993b2853 --- /dev/null +++ b/xmloff/inc/XMLTextColumnsContext.hxx @@ -0,0 +1,55 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmltkmap.hxx> + +#include <memory> + +#include <xmloff/XMLElementPropertyContext.hxx> + +class XMLTextColumnContext_Impl; +class XMLTextColumnSepContext_Impl; +class SvXMLTokenMap; + +class XMLTextColumnsContext final :public XMLElementPropertyContext +{ + std::vector<rtl::Reference<XMLTextColumnContext_Impl>> maColumns; + rtl::Reference<XMLTextColumnSepContext_Impl> mxColumnSep; + sal_Int16 nCount; + bool bAutomatic; + sal_Int32 nAutomaticDistance; + +public: + + XMLTextColumnsContext( + SvXMLImport& rImport, sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList > & xAttrList, + const XMLPropertyState& rProp, + ::std::vector< XMLPropertyState > &rProps ); + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLTextColumnsExport.hxx b/xmloff/inc/XMLTextColumnsExport.hxx new file mode 100644 index 0000000000..7aa2bc78dc --- /dev/null +++ b/xmloff/inc/XMLTextColumnsExport.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/. + * + * 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 . + */ +#pragma once + +#include <sal/types.h> + +namespace com::sun::star::uno +{ +class Any; +} +class SvXMLExport; + +class XMLTextColumnsExport +{ + SvXMLExport& rExport; + + SvXMLExport& GetExport() { return rExport; } + +public: + XMLTextColumnsExport(SvXMLExport& rExport); + + void exportXML(const css::uno::Any& rAny); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLTextColumnsPropertyHandler.hxx b/xmloff/inc/XMLTextColumnsPropertyHandler.hxx new file mode 100644 index 0000000000..4c06bc8ff8 --- /dev/null +++ b/xmloff/inc/XMLTextColumnsPropertyHandler.hxx @@ -0,0 +1,47 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +/** + PropertyHandler for the XML-data-type: +*/ +class XMLTextColumnsPropertyHandler final : public XMLPropertyHandler +{ +public: + virtual ~XMLTextColumnsPropertyHandler () override; + + virtual bool equals( + const css::uno::Any& r1, + const css::uno::Any& r2 ) const override; + + /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place. + virtual bool importXML( + const OUString& rStrImpValue, + css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( + OUString& rStrExpValue, + const css::uno::Any& rValue, + const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLTextHeaderFooterContext.hxx b/xmloff/inc/XMLTextHeaderFooterContext.hxx new file mode 100644 index 0000000000..27b1b35c04 --- /dev/null +++ b/xmloff/inc/XMLTextHeaderFooterContext.hxx @@ -0,0 +1,60 @@ +/* -*- 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 . + */ +#pragma once + + +#include <xmloff/xmlictxt.hxx> + +namespace com::sun::star { + namespace text { class XTextCursor; } + namespace beans { class XPropertySet; } +} + +class XMLTextHeaderFooterContext final : public SvXMLImportContext +{ + css::uno::Reference< css::text::XTextCursor > xOldTextCursor; + css::uno::Reference< css::beans::XPropertySet > xPropSet; + + const OUString sOn; + const OUString sShareContent; + const OUString sText; + const OUString sTextFirst; + const OUString sTextLeft; + + bool bInsertContent : 1; + bool bLeft : 1; + bool bFirst : 1; + +public: + + XMLTextHeaderFooterContext( SvXMLImport& rImport, + const css::uno::Reference< css::beans::XPropertySet > & rPageStylePropSet, + bool bFooter, bool bLft, bool bFrst ); + + virtual ~XMLTextHeaderFooterContext() override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLThemeContext.hxx b/xmloff/inc/XMLThemeContext.hxx new file mode 100644 index 0000000000..c3056fa742 --- /dev/null +++ b/xmloff/inc/XMLThemeContext.hxx @@ -0,0 +1,69 @@ +/* -*- 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/. + */ + +#include <utility> +#include <xmloff/xmlprcon.hxx> + +#include <com/sun/star/uno/XInterface.hpp> +#include <com/sun/star/util/Color.hpp> +#include <com/sun/star/container/XNameContainer.hpp> + +#include <docmodel/theme/ColorSet.hxx> + +namespace model +{ +class Theme; +} + +/// Imports the theme +class XMLThemeContext : public SvXMLImportContext +{ + // Any UNO object that has the "Theme" property - usually XPage (master page) or XModel + css::uno::Reference<css::uno::XInterface> m_xObjectWithThemeProperty; + std::shared_ptr<model::Theme> mpTheme; + +public: + XMLThemeContext(SvXMLImport& rImport, + css::uno::Reference<css::xml::sax::XFastAttributeList> const& xAttrList, + css::uno::Reference<css::uno::XInterface> const& xObjectWithThemeProperty); + ~XMLThemeContext(); + + css::uno::Reference<css::xml::sax::XFastContextHandler> SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttribs) override; +}; + +/// Imports the theme colors of a theme +class XMLThemeColorsContext : public SvXMLImportContext +{ + model::Theme& mrTheme; + std::shared_ptr<model::ColorSet> m_pColorSet; + std::vector<css::util::Color> m_aColorScheme; + +public: + XMLThemeColorsContext(SvXMLImport& rImport, + css::uno::Reference<css::xml::sax::XFastAttributeList> const& xAttrList, + model::Theme& mrTheme); + ~XMLThemeColorsContext(); + + css::uno::Reference<css::xml::sax::XFastContextHandler> SAL_CALL createFastChildContext( + sal_Int32 nElement, + css::uno::Reference<css::xml::sax::XFastAttributeList> const& xAttribs) override; +}; + +/// Imports a color for a color table +class XMLColorContext : public SvXMLImportContext +{ +public: + XMLColorContext(SvXMLImport& rImport, + css::uno::Reference<css::xml::sax::XFastAttributeList> const& xAttrList, + std::shared_ptr<model::ColorSet>& rpColorSet); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/anim.hxx b/xmloff/inc/anim.hxx new file mode 100644 index 0000000000..b0a4e61d22 --- /dev/null +++ b/xmloff/inc/anim.hxx @@ -0,0 +1,95 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/presentation/AnimationEffect.hpp> +#include <com/sun/star/presentation/AnimationSpeed.hpp> +#include <xmloff/xmlement.hxx> + +enum XMLEffect +{ + EK_none, + EK_fade, + EK_move, + EK_stripes, + EK_open, + EK_close, + EK_dissolve, + EK_wavyline, + EK_random, + EK_lines, + EK_laser, + EK_appear, + EK_hide, + EK_move_short, + EK_checkerboard, + EK_rotate, + EK_stretch +}; + +extern const SvXMLEnumMapEntry<XMLEffect> aXML_AnimationEffect_EnumMap[]; + +enum XMLEffectDirection +{ + ED_none, + ED_from_left, + ED_from_top, + ED_from_right, + ED_from_bottom, + ED_from_center, + ED_from_upperleft, + ED_from_upperright, + ED_from_lowerleft, + ED_from_lowerright, + + ED_to_left, + ED_to_top, + ED_to_right, + ED_to_bottom, + ED_to_upperleft, + ED_to_upperright, + ED_to_lowerright, + ED_to_lowerleft, + + ED_path, + ED_spiral_inward_left, + ED_spiral_inward_right, + ED_spiral_outward_left, + ED_spiral_outward_right, + + ED_vertical, + ED_horizontal, + + ED_to_center, + + ED_clockwise, + ED_cclockwise +}; + +extern const SvXMLEnumMapEntry<XMLEffectDirection> aXML_AnimationDirection_EnumMap[]; + +extern const SvXMLEnumMapEntry<css::presentation::AnimationSpeed> aXML_AnimationSpeed_EnumMap[]; + +void SdXMLImplSetEffect(css::presentation::AnimationEffect eEffect, XMLEffect& eKind, + XMLEffectDirection& eDirection, sal_Int16& nStartScale, bool& bIn); +css::presentation::AnimationEffect +ImplSdXMLgetEffect(XMLEffect eKind, XMLEffectDirection eDirection, sal_Int16 nStartScale, bool bIn); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/animationimport.hxx b/xmloff/inc/animationimport.hxx new file mode 100644 index 0000000000..b8f8c9068f --- /dev/null +++ b/xmloff/inc/animationimport.hxx @@ -0,0 +1,58 @@ +/* -*- 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 . + */ + +#pragma once + +#include <memory> + +#include <xmloff/xmlictxt.hxx> +#include <com/sun/star/animations/XAnimationNode.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> + +// presentations:animations + +namespace xmloff +{ +class AnimationsImportHelperImpl; + +class AnimationNodeContext final : public SvXMLImportContext +{ + std::shared_ptr<AnimationsImportHelperImpl> mpHelper; + css::uno::Reference< css::animations::XAnimationNode > mxNode; + + void init_node( const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ); + +public: + + AnimationNodeContext( + const css::uno::Reference< css::animations::XAnimationNode >& xParentNode, + SvXMLImport& rImport, + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList, + const std::shared_ptr<AnimationsImportHelperImpl>& pImpl = nullptr ); + + virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& Attribs) override; + + static void postProcessRootNode( const css::uno::Reference< css::animations::XAnimationNode >& xNode, css::uno::Reference< css::beans::XPropertySet > const & xPageProps ); +}; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/animations.hxx b/xmloff/inc/animations.hxx new file mode 100644 index 0000000000..935ebf0396 --- /dev/null +++ b/xmloff/inc/animations.hxx @@ -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 . + */ + +#pragma once + +#include <xmloff/xmltoken.hxx> + +template <typename EnumT> struct SvXMLEnumMapEntry; + +namespace xmloff +{ +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Fill[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_FillDefault[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Restart[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_RestartDefault[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Endsync[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_CalcMode[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_AdditiveMode[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransformType[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransitionType[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransitionSubType[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EventTrigger[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EffectPresetClass[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EffectNodeType[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_SubItem[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_IterateType[]; +extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Command[]; + +struct ImplAttributeNameConversion +{ + token::XMLTokenEnum meXMLToken; + const char* mpAPIName; +}; + +extern const struct ImplAttributeNameConversion* getAnimationAttributeNamesConversionList(); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/animimp.hxx b/xmloff/inc/animimp.hxx new file mode 100644 index 0000000000..b26c138ab6 --- /dev/null +++ b/xmloff/inc/animimp.hxx @@ -0,0 +1,42 @@ +/* -*- 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 . + */ + +#pragma once + +#include <memory> + +#include <xmloff/xmlictxt.hxx> +#include <com/sun/star/beans/XPropertySet.hpp> + +// presentations:animations + +class XMLAnimationsContext final : public SvXMLImportContext +{ +public: + css::uno::Reference<css::beans::XPropertySet> mxLastShape; + OUString maLastShapeId; + + XMLAnimationsContext(SvXMLImport& rImport); + + virtual css::uno::Reference<css::xml::sax::XFastContextHandler> SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& AttrList) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/enummaps.hxx b/xmloff/inc/enummaps.hxx new file mode 100644 index 0000000000..4d061a7369 --- /dev/null +++ b/xmloff/inc/enummaps.hxx @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#pragma once + +#include <sal/config.h> +#include <com/sun/star/drawing/BitmapMode.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/drawing/RectanglePoint.hpp> + +template <typename EnumT> struct SvXMLEnumMapEntry; + +extern SvXMLEnumMapEntry<css::drawing::FillStyle> const aXML_FillStyle_EnumMap[]; +extern SvXMLEnumMapEntry<css::drawing::RectanglePoint> const aXML_RefPoint_EnumMap[]; +extern SvXMLEnumMapEntry<css::drawing::BitmapMode> const aXML_BitmapMode_EnumMap[]; +extern SvXMLEnumMapEntry<sal_Int16> const pXML_ThemeColor_Enum[]; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/xmloff/inc/fasttokenhandler.hxx b/xmloff/inc/fasttokenhandler.hxx new file mode 100644 index 0000000000..528ecde175 --- /dev/null +++ b/xmloff/inc/fasttokenhandler.hxx @@ -0,0 +1,91 @@ +/* -*- 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/. + */ + +#pragma once + +#include <com/sun/star/xml/sax/XFastTokenHandler.hpp> +#include <cppuhelper/implbase.hxx> +#include <sax/fastattribs.hxx> +#include <xmloff/token/tokens.hxx> +#include <sal/log.hxx> +#include <xmloff/dllapi.h> + +namespace xmloff::token { + +class TokenMap +{ +public: + explicit TokenMap(); + ~TokenMap(); + + /** Returns the UTF-8 name of the passed token identifier as byte sequence. */ + css::uno::Sequence< sal_Int8 > const & getUtf8TokenName( sal_Int32 nToken ) const + { + SAL_WARN_IF(nToken < 0 || nToken >= XML_TOKEN_COUNT, "xmloff", "Wrong nToken parameter"); + if( 0 <= nToken && nToken < XML_TOKEN_COUNT ) + return maTokenNamesUtf8[ nToken ]; + return EMPTY_BYTE_SEQ; + } + + const OUString& getTokenName( sal_Int32 nToken ) const + { + SAL_WARN_IF(nToken < 0 || nToken >= XML_TOKEN_COUNT, "xmloff", "Wrong nToken parameter"); + if( 0 <= nToken && nToken < XML_TOKEN_COUNT ) + return maTokenNames[ nToken ]; + return EMPTY_STRING; + } + + /** Returns the token identifier for the passed UTF-8 token name. */ + static sal_Int32 getTokenFromUtf8( const css::uno::Sequence< sal_Int8 >& rUtf8Name ) + { + return getTokenFromUTF8( reinterpret_cast< const char* >( + rUtf8Name.getConstArray() ), rUtf8Name.getLength() ); + } + + /** Returns the token identifier for a UTF-8 string */ + static sal_Int32 getTokenFromUTF8( const char *pToken, sal_Int32 nLength ) + { + return getTokenPerfectHash( pToken, nLength ); + } + +private: + static sal_Int32 getTokenPerfectHash( const char *pToken, sal_Int32 nLength ); + + std::vector< css::uno::Sequence< sal_Int8 > > maTokenNamesUtf8; + std::vector< OUString > maTokenNames; + + static const css::uno::Sequence< sal_Int8 > EMPTY_BYTE_SEQ; + static const OUString EMPTY_STRING; +}; + +TokenMap& StaticTokenMap(); + +class FastTokenHandler final : + public sax_fastparser::FastTokenHandlerBase +{ +public: + explicit FastTokenHandler(); + virtual ~FastTokenHandler() override; + + // XFastTokenHandler + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getUTF8Identifier( sal_Int32 nToken ) override; + virtual sal_Int32 SAL_CALL getTokenFromUTF8( const css::uno::Sequence< sal_Int8 >& Identifier ) override; + + const OUString & getIdentifier( sal_Int32 nToken ) const; + + // Much faster direct C++ shortcut to the method that matters + virtual sal_Int32 getTokenDirect( const char *pToken, sal_Int32 nLength ) const override; + +private: + TokenMap& mrTokenMap; +}; + +} // namespace xmloff::token + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/forms/form_handler_factory.hxx b/xmloff/inc/forms/form_handler_factory.hxx new file mode 100644 index 0000000000..181c1bc144 --- /dev/null +++ b/xmloff/inc/forms/form_handler_factory.hxx @@ -0,0 +1,35 @@ +/* -*- 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 . + */ + +#pragma once + +#include <forms/property_handler.hxx> + +namespace xmloff +{ +//= FormHandlerFactory +class FormHandlerFactory +{ +public: + static PPropertyHandler getFormPropertyHandler(const PropertyId i_propertyId); +}; + +} // namespace xmloff + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/forms/property_handler.hxx b/xmloff/inc/forms/property_handler.hxx new file mode 100644 index 0000000000..822baaf3c9 --- /dev/null +++ b/xmloff/inc/forms/property_handler.hxx @@ -0,0 +1,59 @@ +/* -*- 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 . + */ + +#pragma once + +#include <forms/property_ids.hxx> + +#include <com/sun/star/uno/Any.hxx> + +#include <rtl/ref.hxx> +#include <salhelper/simplereferenceobject.hxx> + +#include <map> +#include <vector> + +namespace xmloff +{ + + typedef ::std::map< PropertyId, css::uno::Any > PropertyValues; + + class PropertyHandlerBase : public ::salhelper::SimpleReferenceObject + { + public: + /** is a convenience method for XML attributes whose value comprises of only one UNO API property + */ + virtual OUString + getAttributeValue( const css::uno::Any& i_propertyValue ) const = 0; + + /** retrieves the values of the properties controlled by an XML attributed, described by a given attribute value + */ + virtual bool + getPropertyValues( const OUString& i_attributeValue, PropertyValues& o_propertyValues ) const = 0; + }; + + //= PPropertyHandler + typedef rtl::Reference< PropertyHandlerBase > PPropertyHandler; + + //= PropertyHandlerFactory + typedef PPropertyHandler (*PropertyHandlerFactory)( const PropertyId i_propertyId ); + +} // namespace xmloff + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/forms/property_ids.hxx b/xmloff/inc/forms/property_ids.hxx new file mode 100644 index 0000000000..49c896fc20 --- /dev/null +++ b/xmloff/inc/forms/property_ids.hxx @@ -0,0 +1,42 @@ +/* -*- 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 . + */ + +#pragma once + +namespace xmloff +{ + + //= PropertyId + enum PropertyId + { + PID_DATE_MIN, + PID_DATE_MAX, + PID_DEFAULT_DATE, + PID_DATE, + PID_TIME_MIN, + PID_TIME_MAX, + PID_DEFAULT_TIME, + PID_TIME, + + PID_INVALID + }; + +} // namespace xmloff + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/pch/precompiled_xo.cxx b/xmloff/inc/pch/precompiled_xo.cxx new file mode 100644 index 0000000000..64b16a2cb1 --- /dev/null +++ b/xmloff/inc/pch/precompiled_xo.cxx @@ -0,0 +1,12 @@ +/* -*- 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/. + */ + +#include "precompiled_xo.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/pch/precompiled_xo.hxx b/xmloff/inc/pch/precompiled_xo.hxx new file mode 100644 index 0000000000..471c6ad804 --- /dev/null +++ b/xmloff/inc/pch/precompiled_xo.hxx @@ -0,0 +1,248 @@ +/* -*- 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 has been autogenerated by update_pch.sh. It is possible to edit it + manually (such as when an include file has been moved/renamed/removed). All such + manual changes will be rewritten by the next run of update_pch.sh (which presumably + also fixes all possible problems, so it's usually better to use it). + + Generated on 2021-08-22 14:50:18 using: + ./bin/update_pch xmloff xo --cutoff=7 --exclude:system --include:module --include:local + + If after updating build fails, use the following command to locate conflicting headers: + ./bin/update_pch_bisect ./xmloff/inc/pch/precompiled_xo.hxx "make xmloff.build" --find-conflicts +*/ + +#include <sal/config.h> +#if PCH_LEVEL >= 1 +#include <algorithm> +#include <array> +#include <cassert> +#include <cmath> +#include <cstddef> +#include <cstdlib> +#include <float.h> +#include <functional> +#include <initializer_list> +#include <iomanip> +#include <limits.h> +#include <limits> +#include <map> +#include <math.h> +#include <memory> +#include <new> +#include <numeric> +#include <optional> +#include <ostream> +#include <set> +#include <stddef.h> +#include <string.h> +#include <string> +#include <string_view> +#include <type_traits> +#include <unordered_map> +#include <utility> +#include <vector> +#include <boost/property_tree/ptree_fwd.hpp> +#endif // PCH_LEVEL >= 1 +#if PCH_LEVEL >= 2 +#include <osl/diagnose.h> +#include <osl/doublecheckedlocking.h> +#include <osl/endian.h> +#include <osl/file.hxx> +#include <osl/getglobalmutex.hxx> +#include <osl/interlck.h> +#include <osl/mutex.h> +#include <osl/mutex.hxx> +#include <osl/thread.h> +#include <rtl/alloc.h> +#include <rtl/character.hxx> +#include <rtl/digest.h> +#include <rtl/instance.hxx> +#include <rtl/locale.h> +#include <rtl/math.h> +#include <rtl/math.hxx> +#include <rtl/ref.hxx> +#include <rtl/strbuf.hxx> +#include <rtl/string.h> +#include <rtl/textcvt.h> +#include <rtl/textenc.h> +#include <rtl/ustrbuf.hxx> +#include <rtl/ustring.h> +#include <rtl/ustring.hxx> +#include <rtl/uuid.h> +#include <sal/backtrace.hxx> +#include <sal/log.hxx> +#include <sal/macros.h> +#include <sal/saldllapi.h> +#include <sal/types.h> +#include <sal/typesizes.h> +#include <vcl/Scanline.hxx> +#include <vcl/alpha.hxx> +#include <vcl/bitmap.hxx> +#include <vcl/bitmap/BitmapTypes.hxx> +#include <vcl/bitmapex.hxx> +#include <vcl/checksum.hxx> +#include <vcl/dllapi.h> +#include <vcl/mapmod.hxx> +#include <vcl/region.hxx> +#endif // PCH_LEVEL >= 2 +#if PCH_LEVEL >= 3 +#include <basegfx/basegfxdllapi.h> +#include <basegfx/numeric/ftools.hxx> +#include <basegfx/point/b2dpoint.hxx> +#include <basegfx/point/b2ipoint.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> +#include <basegfx/range/b2drange.hxx> +#include <basegfx/range/basicrange.hxx> +#include <basegfx/tuple/Tuple2D.hxx> +#include <basegfx/tuple/Tuple3D.hxx> +#include <basegfx/tuple/b2dtuple.hxx> +#include <basegfx/tuple/b2ituple.hxx> +#include <basegfx/tuple/b3dtuple.hxx> +#include <basegfx/utils/common.hxx> +#include <basegfx/vector/b2dvector.hxx> +#include <basegfx/vector/b2enums.hxx> +#include <basegfx/vector/b2ivector.hxx> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/chart/XChartDocument.hpp> +#include <com/sun/star/chart2/XChartDocument.hpp> +#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> +#include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/container/XEnumerationAccess.hpp> +#include <com/sun/star/container/XIndexReplace.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XNameReplace.hpp> +#include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/lang/Locale.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/style/NumberingType.hpp> +#include <com/sun/star/style/XStyle.hpp> +#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> +#include <com/sun/star/text/VertOrientation.hpp> +#include <com/sun/star/text/XText.hpp> +#include <com/sun/star/text/XTextContent.hpp> +#include <com/sun/star/uno/Any.h> +#include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/uno/Type.h> +#include <com/sun/star/uno/TypeClass.hdl> +#include <com/sun/star/uno/XAggregation.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/uno/XInterface.hpp> +#include <com/sun/star/uno/XWeak.hpp> +#include <com/sun/star/uno/genfunc.h> +#include <com/sun/star/uno/genfunc.hxx> +#include <com/sun/star/util/Date.hpp> +#include <com/sun/star/util/DateTime.hpp> +#include <com/sun/star/util/Duration.hpp> +#include <com/sun/star/util/MeasureUnit.hpp> +#include <com/sun/star/util/Time.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <comphelper/base64.hxx> +#include <comphelper/comphelperdllapi.h> +#include <comphelper/extract.hxx> +#include <comphelper/processfactory.hxx> +#include <comphelper/sequence.hxx> +#include <cppu/cppudllapi.h> +#include <cppu/unotype.hxx> +#include <cppuhelper/cppuhelperdllapi.h> +#include <cppuhelper/implbase.hxx> +#include <cppuhelper/implbase_ex.hxx> +#include <cppuhelper/implbase_ex_post.hxx> +#include <cppuhelper/implbase_ex_pre.hxx> +#include <cppuhelper/weak.hxx> +#include <cppuhelper/weakref.hxx> +#include <i18nlangtag/i18nlangtagdllapi.h> +#include <i18nlangtag/lang.h> +#include <i18nlangtag/languagetag.hxx> +#include <o3tl/any.hxx> +#include <o3tl/cow_wrapper.hxx> +#include <o3tl/safeint.hxx> +#include <o3tl/strong_int.hxx> +#include <o3tl/typed_flags_set.hxx> +#include <o3tl/underlyingenumvalue.hxx> +#include <o3tl/unit_conversion.hxx> +#include <salhelper/salhelperdllapi.h> +#include <salhelper/simplereferenceobject.hxx> +#include <sax/tools/converter.hxx> +#include <svl/svldllapi.h> +#include <tools/color.hxx> +#include <tools/date.hxx> +#include <tools/debug.hxx> +#include <tools/degree.hxx> +#include <comphelper/diagnose_ex.hxx> +#include <tools/gen.hxx> +#include <tools/link.hxx> +#include <tools/long.hxx> +#include <tools/mapunit.hxx> +#include <tools/poly.hxx> +#include <tools/solar.h> +#include <tools/time.hxx> +#include <tools/toolsdllapi.h> +#include <typelib/typeclass.h> +#include <typelib/typedescription.h> +#include <typelib/uik.h> +#include <uno/any2.h> +#include <uno/data.h> +#include <uno/sequence2.h> +#include <unotools/unotoolsdllapi.h> +#endif // PCH_LEVEL >= 3 +#if PCH_LEVEL >= 4 +#include <PageMasterStyleMap.hxx> +#include <XMLStringBufferImportContext.hxx> +#include <xexptran.hxx> +#include <xmloff/ProgressBarHelper.hxx> +#include <xmloff/XMLBase64ImportContext.hxx> +#include <xmloff/XMLEventsImportContext.hxx> +#include <xmloff/dllapi.h> +#include <xmloff/families.hxx> +#include <xmloff/maptype.hxx> +#include <xmloff/namespacemap.hxx> +#include <xmloff/prstylei.hxx> +#include <xmloff/txtimp.hxx> +#include <xmloff/txtprmap.hxx> +#include <xmloff/unointerfacetouniqueidentifiermapper.hxx> +#include <xmloff/xmlement.hxx> +#include <xmloff/xmlerror.hxx> +#include <xmloff/xmlevent.hxx> +#include <xmloff/xmlexp.hxx> +#include <xmloff/xmlictxt.hxx> +#include <xmloff/xmlimp.hxx> +#include <xmloff/xmlimppr.hxx> +#include <xmloff/xmlnamespace.hxx> +#include <xmloff/xmlnumi.hxx> +#include <xmloff/xmlprhdl.hxx> +#include <xmloff/xmlprmap.hxx> +#include <xmloff/xmlstyle.hxx> +#include <xmloff/xmltkmap.hxx> +#include <xmloff/xmltoken.hxx> +#include <xmloff/xmltypes.hxx> +#include <xmloff/xmluconv.hxx> +#include <xmlsdtypes.hxx> +#endif // PCH_LEVEL >= 4 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/pch/precompiled_xof.cxx b/xmloff/inc/pch/precompiled_xof.cxx new file mode 100644 index 0000000000..c1330d253e --- /dev/null +++ b/xmloff/inc/pch/precompiled_xof.cxx @@ -0,0 +1,12 @@ +/* -*- 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/. + */ + +#include "precompiled_xof.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/pch/precompiled_xof.hxx b/xmloff/inc/pch/precompiled_xof.hxx new file mode 100644 index 0000000000..293b041f06 --- /dev/null +++ b/xmloff/inc/pch/precompiled_xof.hxx @@ -0,0 +1,66 @@ +/* -*- 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 has been autogenerated by update_pch.sh. It is possible to edit it + manually (such as when an include file has been moved/renamed/removed). All such + manual changes will be rewritten by the next run of update_pch.sh (which presumably + also fixes all possible problems, so it's usually better to use it). + + Generated on 2021-03-08 13:22:55 using: + ./bin/update_pch xmloff xof --cutoff=1 --exclude:system --exclude:module --include:local + + If after updating build fails, use the following command to locate conflicting headers: + ./bin/update_pch_bisect ./xmloff/inc/pch/precompiled_xof.hxx "make xmloff.build" --find-conflicts +*/ + +#include <sal/config.h> +#if PCH_LEVEL >= 1 +#include <array> +#include <unordered_map> +#include <vector> +#endif // PCH_LEVEL >= 1 +#if PCH_LEVEL >= 2 +#include <osl/diagnose.h> +#include <rtl/math.hxx> +#include <rtl/ref.hxx> +#include <rtl/ustrbuf.hxx> +#include <sal/log.hxx> +#endif // PCH_LEVEL >= 2 +#if PCH_LEVEL >= 3 +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <com/sun/star/i18n/CharacterClassification.hpp> +#include <com/sun/star/i18n/UnicodeType.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> +#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp> +#include <com/sun/star/util/MeasureUnit.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/xml/sax/SAXException.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <comphelper/base64.hxx> +#include <comphelper/processfactory.hxx> +#include <comphelper/servicehelper.hxx> +#include <cppuhelper/supportsservice.hxx> +#include <cppuhelper/typeprovider.hxx> +#include <sax/tools/converter.hxx> +#include <tools/UnitConversion.hxx> +#include <comphelper/diagnose_ex.hxx> +#endif // PCH_LEVEL >= 3 +#if PCH_LEVEL >= 4 +#include <xmloff/namespacemap.hxx> +#include <xmloff/xmlimp.hxx> +#include <xmloff/xmlnamespace.hxx> +#include <xmloff/xmltoken.hxx> +#include <xmloff/xmluconv.hxx> +#endif // PCH_LEVEL >= 4 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/propimp0.hxx b/xmloff/inc/propimp0.hxx new file mode 100644 index 0000000000..341cdc73e6 --- /dev/null +++ b/xmloff/inc/propimp0.hxx @@ -0,0 +1,67 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlprhdl.hxx> + +// graphic property Stroke + +class XMLDurationPropertyHdl final : public XMLPropertyHandler +{ +public: + virtual ~XMLDurationPropertyHdl() override; + virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +class SvXMLImport; +class XMLOpacityPropertyHdl final : public XMLPropertyHandler +{ +private: + SvXMLImport* mpImport; +public: + explicit XMLOpacityPropertyHdl( SvXMLImport* pImport ); + virtual ~XMLOpacityPropertyHdl() override; + virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +class XMLTextAnimationStepPropertyHdl final : public XMLPropertyHandler +{ +public: + virtual ~XMLTextAnimationStepPropertyHdl() override; + virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +class SvXMLExport; +class XMLDateTimeFormatHdl final : public XMLPropertyHandler +{ +private: + SvXMLExport* mpExport; + +public: + explicit XMLDateTimeFormatHdl( SvXMLExport* pExport ); + virtual ~XMLDateTimeFormatHdl() override; + virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/prstylecond.hxx b/xmloff/inc/prstylecond.hxx new file mode 100644 index 0000000000..ca4240bb53 --- /dev/null +++ b/xmloff/inc/prstylecond.hxx @@ -0,0 +1,24 @@ +/* -*- 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 . + */ + +#include <rtl/ustring.hxx> + +OUString GetParaStyleCondExternal(std::u16string_view); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/txtfld.hxx b/xmloff/inc/txtfld.hxx new file mode 100644 index 0000000000..c562644a5f --- /dev/null +++ b/xmloff/inc/txtfld.hxx @@ -0,0 +1,28 @@ +/* -*- 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 . + */ + +/** @#file + * Constants, helpers etc. that need to be shared between text field import + * and export + */ + +#pragma once + +#define REFFLDFLAG_STYLE_FROM_BOTTOM 0xc100 +#define REFFLDFLAG_STYLE_HIDE_NON_NUMERICAL 0xc200 diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx new file mode 100644 index 0000000000..f98fb7c5c4 --- /dev/null +++ b/xmloff/inc/txtflde.hxx @@ -0,0 +1,424 @@ +/* -*- 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 . + */ + +/** @#file + * XML export of all text fields + */ + +#pragma once + +#include <com/sun/star/uno/Reference.h> +#include <xmloff/xmlnamespace.hxx> + +#include <rtl/ustring.hxx> +#include <xmloff/xmltoken.hxx> + +#include <map> +#include <set> +#include <memory> +#include <string_view> + +#include "txtfld.hxx" + +class SvXMLExport; +struct XMLPropertyState; + +namespace com::sun::star { + namespace util { struct DateTime; } + namespace util { struct Date; } + namespace text { class XTextField; } + namespace text { class XText; } + namespace beans { class XPropertySet; } + namespace beans { class XPropertySetInfo; } + namespace frame { class XModel; } + namespace uno { template<typename A> class Sequence; } +} + + +/// field IDs, +// including translation between UNO speak and XML speak if appropriate + +enum FieldIdEnum { + FIELD_ID_SENDER, // sender == extended user + FIELD_ID_AUTHOR, + FIELD_ID_DATE, // current date + FIELD_ID_TIME, // current time (+date) + FIELD_ID_PAGENAME, // page/slide name + FIELD_ID_PAGENUMBER, // page number + FIELD_ID_PAGESTRING, // page continuation string (page number string) + FIELD_ID_REFPAGE_SET, // set reference page + FIELD_ID_REFPAGE_GET, // get reference page number + + FIELD_ID_PLACEHOLDER, // placeholder field == jump edit field + + FIELD_ID_VARIABLE_GET, // get variable == get expression + FIELD_ID_VARIABLE_SET, // set variable == set expression + FIELD_ID_VARIABLE_INPUT, // input field (variable) + FIELD_ID_USER_GET, // user field + FIELD_ID_USER_INPUT, // input field (user field) + FIELD_ID_TEXT_INPUT, // input field (text) + FIELD_ID_EXPRESSION, // expression field = formula field + FIELD_ID_SEQUENCE, // sequence field + + FIELD_ID_DATABASE_NEXT, // select next row + FIELD_ID_DATABASE_SELECT, // select row # (NumSet) + FIELD_ID_DATABASE_DISPLAY, // display data (form letter field) + FIELD_ID_DATABASE_NAME, // display current db name (database name) + FIELD_ID_DATABASE_NUMBER, // display row # (SetNumber) + + FIELD_ID_DOCINFO_CREATION_AUTHOR, // docinfo fields + FIELD_ID_DOCINFO_CREATION_TIME, + FIELD_ID_DOCINFO_CREATION_DATE, + FIELD_ID_DOCINFO_DESCRIPTION, + FIELD_ID_DOCINFO_CUSTOM, + FIELD_ID_DOCINFO_PRINT_TIME, + FIELD_ID_DOCINFO_PRINT_DATE, + FIELD_ID_DOCINFO_PRINT_AUTHOR, + FIELD_ID_DOCINFO_TITLE, + FIELD_ID_DOCINFO_SUBJECT, + FIELD_ID_DOCINFO_KEYWORDS, + FIELD_ID_DOCINFO_REVISION, + FIELD_ID_DOCINFO_EDIT_DURATION, + FIELD_ID_DOCINFO_SAVE_TIME, + FIELD_ID_DOCINFO_SAVE_DATE, + FIELD_ID_DOCINFO_SAVE_AUTHOR, + + FIELD_ID_CONDITIONAL_TEXT, // conditionally choose between 2 texts + FIELD_ID_HIDDEN_TEXT, // conditionally hide a text + FIELD_ID_HIDDEN_PARAGRAPH, // conditionally hide a paragraph + + FIELD_ID_TEMPLATE_NAME, // display name of template + FIELD_ID_CHAPTER, // display name/number of current chapter + FIELD_ID_FILE_NAME, // display name of current file + + FIELD_ID_COUNT_PARAGRAPHS, // statistics fields: - paragraphs + FIELD_ID_COUNT_WORDS, // - words + FIELD_ID_COUNT_CHARACTERS, // - chars + FIELD_ID_COUNT_PAGES, // - pages + FIELD_ID_COUNT_TABLES, // - tables + FIELD_ID_COUNT_GRAPHICS, // - graphics + FIELD_ID_COUNT_OBJECTS, // - objects + + FIELD_ID_MACRO, // macro fields + FIELD_ID_REF_REFERENCE, // get reference field (reference) + FIELD_ID_REF_SEQUENCE, // get reference field (sequence) + FIELD_ID_REF_BOOKMARK, // get reference field (bookmark) + FIELD_ID_REF_FOOTNOTE, // get reference field (footnote) + FIELD_ID_REF_ENDNOTE, // get reference field (endnote) + FIELD_ID_REF_STYLE, // styleref field + FIELD_ID_DDE, // DDE field + + FIELD_ID_BIBLIOGRAPHY, // bibliography index entry + + FIELD_ID_SHEET_NAME, // name of current (spread-)sheet + FIELD_ID_URL, // URL field (only Calc, Draw, Impress) + + FIELD_ID_SCRIPT, // script fields (for HTML pages, mostly) + FIELD_ID_ANNOTATION, // annotation (notice) field + + FIELD_ID_COMBINED_CHARACTERS, // combined characters (asian typography) + + FIELD_ID_META, // text:meta-field (RDF metadata) + + FIELD_ID_MEASURE, // for measure shapes + + FIELD_ID_TABLE_FORMULA, // DEPRECATED: table formulas (Writer 2.0) + FIELD_ID_DROP_DOWN, // DEPRECATED: dropdown fields (WW8) + + FIELD_ID_DRAW_HEADER, + FIELD_ID_DRAW_FOOTER, + FIELD_ID_DRAW_DATE_TIME, + + FIELD_ID_UNKNOWN // invalid or unknown field type! +}; + + +class XMLTextFieldExport final +{ + SvXMLExport& rExport; + + /// store used text field master names (NULL means: don't collect) + std::unique_ptr< ::std::map< + css::uno::Reference< css::text::XText >, + ::std::set< OUString > > > + pUsedMasters; + +public: + + XMLTextFieldExport( SvXMLExport& rExp, + /// XMLPropertyState for the combined characters field + std::unique_ptr<XMLPropertyState> pCombinedCharState ); + ~XMLTextFieldExport(); + + /// Export this field and the surrounding span element with the formatting. + /// To be called for every field in the document body. + void ExportField(const css::uno::Reference < css::text::XTextField > & rTextField, + bool bProgress, bool & rPrevCharIsSpace); + + /// collect styles (character styles, data styles, ...) for this field + /// (if appropriate). + /// Also collect used field masters (if pUsedMasters is set) + /// to be called for every field during style export. + void ExportFieldAutoStyle(const css::uno::Reference < css::text::XTextField > & rTextField, + const bool bProgress, const bool bRecursive ); + + /// export field declarations. + /// to be called once at beginning of document body. + void ExportFieldDeclarations(); + + /// export field declarations for fields used in the particular XText. + /// (Requires that a list of used field declarations has previously been + /// built-up in ExportFieldAutoStyle() ) + void ExportFieldDeclarations( + const css::uno::Reference < css::text::XText > & rText); + + /// export all field declarations, or only those that have been used? + /// Calling this method will reset the list of used field declarations. + void SetExportOnlyUsedFieldDeclarations( + bool bExportOnlyUsed = true); + + // determine element or attribute names + // (public, because they may be useful in related XML export classes) + static enum ::xmloff::token::XMLTokenEnum MapPlaceholderType(sal_uInt16 nType); + static enum ::xmloff::token::XMLTokenEnum MapTemplateDisplayFormat(sal_Int16 nType); + static enum ::xmloff::token::XMLTokenEnum MapChapterDisplayFormat(sal_Int16 nType); + static enum ::xmloff::token::XMLTokenEnum MapFilenameDisplayFormat(sal_Int16 nType); + static enum ::xmloff::token::XMLTokenEnum MapDocInfoFieldName(enum FieldIdEnum nToken); + static enum ::xmloff::token::XMLTokenEnum MapReferenceSource(sal_Int16 nType); + static enum ::xmloff::token::XMLTokenEnum MapReferenceType(sal_Int16 nType); + static enum ::xmloff::token::XMLTokenEnum MapCountFieldName(FieldIdEnum nToken); + static enum ::xmloff::token::XMLTokenEnum MapBibliographyFieldName(std::u16string_view sName); + static enum ::xmloff::token::XMLTokenEnum MapMeasureKind(sal_Int16 nKind); + static enum ::xmloff::token::XMLTokenEnum MapPageNumberName(const css::uno::Reference< css::beans::XPropertySet> & xPropSet, + sal_Int32& nOffset); /// also adjust page offset + static enum ::xmloff::token::XMLTokenEnum MapAuthorFieldName(const css::uno::Reference< css::beans::XPropertySet > & xPropSet); + static enum ::xmloff::token::XMLTokenEnum MapSenderFieldName(const css::uno::Reference< css::beans::XPropertySet > & xPropSet); + +private: + + SvXMLExport& GetExport() { return rExport; } + + /// export a field after <text:span> is already written + void ExportFieldHelper( + const css::uno::Reference< css::text::XTextField> & rTextField, + const css::uno::Reference< css::beans::XPropertySet> & rPropSet, + const css::uno::Reference< css::beans::XPropertySet> & rRangePropSet, + enum FieldIdEnum nToken, + bool bProgress, + bool & rPrevCharIsSpace); + + /// export an empty element + void ExportElement(enum ::xmloff::token::XMLTokenEnum eElement, /// element token + bool bAddSpace = false); /// add blanks around + /// element? + + /// export an element with string content + void ExportElement(enum ::xmloff::token::XMLTokenEnum eElement, /// element token + const OUString& sContent); /// element content + + /// export a macro (as used in the macro field) + void ExportMacro( const css::uno::Reference< css::beans::XPropertySet> & rPropSet, + const OUString& rContent); + + /// export text:meta-field (RDF metadata) + void ExportMetaField( const css::uno::Reference< css::beans::XPropertySet> & i_xMeta, + bool i_bAutoStyles, bool i_bProgress, + bool & rPrevCharIsSpace); + + + void ProcessBoolean( + enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token + bool bBool, /// attribute value + bool bDefault, + sal_uInt16 nPrefix); /// namespace + + /// export a boolean attribute + void ProcessBoolean( + enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) + bool bBool, /// attribute value + bool bDefault); /// attribute default; omit, if attribute differs + + /// export an integer attribute + void ProcessInteger( + enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) + sal_Int32 nNum); /// attribute value + + /// export an integer attribute, omit if default + void ProcessIntegerDef( + enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) + sal_Int32 nNum, /// attribute value + sal_Int32 nDefault); /// default value + + /// export a string attribute + void ProcessString( + enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) + const OUString& sValue, /// attribute value + bool bOmitEmpty = false, /// omit attribute, if value is empty + sal_uInt16 nPrefix = XML_NAMESPACE_TEXT); /// attribute name prefix + + /// export a string attribute that gets a QName value + void ProcessString( + enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) + sal_uInt16 nValuePrefix, + const OUString& sValue); /// attribute value + + + /// export a string attribute, omit if default + void ProcessString( + enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) + const OUString& sValue, /// attribute value + std::u16string_view sDefault); /// default value; omit if equal + + /// export a string attribute, omit if default + void ProcessString( + enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) + sal_uInt16 nValuePrefix, + const OUString& sValue, /// attribute value + std::u16string_view sDefault); /// default value; omit if equal + + /// export a string attribute + void ProcessString( + enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) + enum ::xmloff::token::XMLTokenEnum eValue, /// attribute token + sal_uInt16 nPrefix = XML_NAMESPACE_TEXT); /// attribute name prefix + + /// export a string attribute, omit if default + void ProcessString( + enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) + enum ::xmloff::token::XMLTokenEnum eValue, /// attribute value token + enum ::xmloff::token::XMLTokenEnum eDefault); /// default value token + + /// export a string as a sequence of paragraphs + void ProcessParagraphSequence( + /// string containing the paragraphs + std::u16string_view sParagraphSequence); + + /// export a numbering format (numeric, roman, alphabetic, etc.) + void ProcessNumberingType( + sal_Int16 nNumberingType); /// numbering type key + + /// export display attribute (value, formula, none) + void ProcessDisplay(bool bIsVisible, /// is visible? + bool bIsCommand); /// is show command/show name? + + /// export all data-style related attributes + void ProcessValueAndType( + bool bIsString, /// do we process a string or a number? + sal_Int32 nFormatKey, /// format key for NumberFormatter; possibly -1 + const OUString& sContent, /// string content; possibly invalid + std::u16string_view sDefault, /// default string + double fValue, /// float content; possibly invalid + bool bExportValue, /// export value attribute? + bool bExportValueType, /// export value-type attribute? + bool bExportStyle, /// export style-attribute? + bool bForceSystemLanguage, /// no style language export + bool bTimeStyle = false); /// exporting a time style? + + /// export times, dates and durations according to ISO 8601 + void ProcessDateTime( + enum ::xmloff::token::XMLTokenEnum eXMLName, /// attribute token + double dValue, /// date/time value + bool bIsDate, /// export as date (rather than date/time)? + bool bIsDuration, /// export as duration + bool bOmitDurationIfZero = true, /// omit zero-length durat. + sal_uInt16 nPrefix = XML_NAMESPACE_TEXT); /// attribute name prefix + + /// export a date, time, or duration + void ProcessDateTime( + enum ::xmloff::token::XMLTokenEnum eXMLName, /// attribute token + sal_Int32 nMinutes, /// date/time value in minutes + bool bIsDate, /// export as date? + bool bIsDuration); /// export as duration? + + /// export times, dates and durations according to ISO 8601 + void ProcessDateTime( + enum ::xmloff::token::XMLTokenEnum eXMLName, /// attribute token + const css::util::DateTime& rTime); /// date/time value + + /// export time or dateTime + void ProcessTimeOrDateTime( + enum ::xmloff::token::XMLTokenEnum eXMLName, /// attribute token + const css::util::DateTime& rTime); /// date/time value + + /// export all attributes for bibliography data fields + void ProcessBibliographyData( + const css::uno::Reference < + css::beans::XPropertySet > & rPropertySet); + + /// export CommandTypeAttribute + void ProcessCommandType( + sal_Int32 nCommandType); /// css::sdb::CommandType + + void ProcessStringSequence( + const css::uno::Sequence<OUString>& rSequence, + const OUString& sSelected ); + + void ProcessStringSequence( + const css::uno::Sequence<OUString>& rSequence, + sal_Int32 nSelected ); + + /// export attributes that describe a data source + void ExportDataBaseElement( + enum ::xmloff::token::XMLTokenEnum eElement, + const OUString& sContent, + const css::uno::Reference < css::beans::XPropertySet > & rPropertySet, + const css::uno::Reference < css::beans::XPropertySetInfo > & rPropertySetInfo ); + + /// for XDependentTextFields, get PropertySet of FieldMaster + static css::uno::Reference < css::beans::XPropertySet > + GetMasterPropertySet(const css::uno::Reference < css::text::XTextField > & rTextField); + + /// get PropertySet of (any) DependentTextField for this FieldMaster + static bool GetDependentFieldPropertySet( + const css::uno::Reference< css::beans::XPropertySet> & xmaster, + css::uno::Reference< css::beans::XPropertySet> & xField); + + + /// get field ID from XTextField (and it's Property-Set) + static enum FieldIdEnum GetFieldID(const css::uno::Reference < css::text::XTextField > & rTextField, + const css::uno::Reference < css::beans::XPropertySet > & xPropSet); + + /// get field ID from XTextField service name (and it's PropertySet) + static enum FieldIdEnum MapFieldName(std::u16string_view sFieldName, + const css::uno::Reference < css::beans::XPropertySet> & xPropSet); + + /// determine, whether field has string or numeric content + static bool IsStringField(FieldIdEnum nFieldType, /// field ID + const css::uno::Reference < css::beans::XPropertySet > & xPropSet); + + + /// explode a field master name into field type and field name + static void ExplodeFieldMasterName( + std::u16string_view sMasterName, /// name as returned by SO API + OUString& sFieldType, /// out: field type + OUString& sVarName); /// out: variable name + + /// make reference name for a foot- or endnote + static OUString MakeFootnoteRefName(sal_Int16 nSeqNo); + + /// make reference name for a sequence field + static OUString MakeSequenceRefName(sal_Int16 nSeqNo, + std::u16string_view rSeqName); + + std::unique_ptr<XMLPropertyState> pCombinedCharactersPropertyState; + +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx new file mode 100644 index 0000000000..3d56c54781 --- /dev/null +++ b/xmloff/inc/txtfldi.hxx @@ -0,0 +1,1125 @@ +/* -*- 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 . + */ + +/** @#file + * + * import of all text fields + * (except variable related + database display field: see txtvfldi.hxx) + */ + +#pragma once + +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/text/PageNumberType.hpp> +#include <com/sun/star/util/DateTime.hpp> +#include <xmloff/xmlictxt.hxx> +#include <xmloff/txtimp.hxx> +#include <xmloff/xmltkmap.hxx> +#include <rtl/ustrbuf.hxx> +#include <vector> +#include "txtfld.hxx" + +namespace com::sun::star { + namespace xml::sax { class XAttributeList; } + namespace text { class XTextField; } + namespace beans { class XPropertySet; struct PropertyValue; } +} + +class SvXMLImport; +class XMLTextImportHelper; +class SvXMLTokenMap; + +/// abstract class for text field import +class XMLTextFieldImportContext : public SvXMLImportContext +{ + // data members + OUStringBuffer sContentBuffer; /// collect character data + OUString sContent; /// character data after collection + OUString sServiceName; /// service name for text field + XMLTextImportHelper& rTextImportHelper; /// the import helper + +protected: + OUString sServicePrefix; + + // data members for use in subclasses + bool bValid; /// whether this field is valid ? + +public: + + XMLTextFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp, /// Text import helper + OUString aService); /// name of SO API service + + /// process character data: will be collected in member sContentBuffer + virtual void SAL_CALL characters( const OUString& sContent ) override; + + /// parses attributes and calls ProcessAttribute + virtual void SAL_CALL startFastElement( + sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList> & xAttrList) override; + + /// create XTextField and insert into document; calls PrepareTextField + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; + + /// create the appropriate field context from + /// (for use in paragraph import) + static XMLTextFieldImportContext* CreateTextFieldImportContext( + SvXMLImport& rImport, + XMLTextImportHelper& rHlp, + sal_Int32 nElement); + +protected: + /// get helper + XMLTextImportHelper& GetImportHelper() { return rTextImportHelper; } + + const OUString& GetServiceName() const { return sServiceName; } + void SetServiceName(const OUString& sStr) { sServiceName = sStr; } + + OUString const & GetContent(); + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) = 0; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) = 0; + + /// create field from ServiceName + bool CreateField(css::uno::Reference< css::beans::XPropertySet> & xField, + const OUString& sServiceName); + + /// force an update of the field's value + /// call update on optional XUpdatable interface; (disable Fixed property) + static void ForceUpdate( + const css::uno::Reference< css::beans::XPropertySet> & rPropertySet); +}; + +class XMLSenderFieldImportContext : public XMLTextFieldImportContext +{ + + sal_Int16 nSubType; /// API subtype for ExtUser field + + const OUString sPropertyFixed; + const OUString sPropertyContent; + +protected: + // variables for access in subclass + bool bFixed; + +public: + + XMLSenderFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + +protected: + /// start element + virtual void SAL_CALL startFastElement( + sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList> & xAttrList) override; + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; +}; + +/** inherit sender field because of fixed attribute in ProcessAttributes */ +class XMLAuthorFieldImportContext final : public XMLSenderFieldImportContext +{ + bool bAuthorFullName; + const OUString sPropertyFixed; + const OUString sPropertyContent; + +public: + + XMLAuthorFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + +private: + /// start element + virtual void SAL_CALL startFastElement( + sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList> & xAttrList) override; + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; +}; + +class XMLPlaceholderFieldImportContext final : public XMLTextFieldImportContext +{ + const OUString sPropertyHint; + + OUString sDescription; + + sal_Int16 nPlaceholderType; + +public: + + XMLPlaceholderFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; +}; + +class XMLTimeFieldImportContext : public XMLTextFieldImportContext +{ +protected: + const OUString sPropertyNumberFormat; + const OUString sPropertyFixed; + const OUString sPropertyDateTimeValue; + const OUString sPropertyDateTime; + const OUString sPropertyIsDate; + const OUString sPropertyIsFixedLanguage; + + css::util::DateTime aDateTimeValue; + sal_Int32 nAdjust; + sal_Int32 nFormatKey; + bool bTimeOK; + bool bFormatOK; + bool bFixed; + bool bIsDate; // is this a date? + // (for XMLDateFieldImportContext, really) + bool bIsDefaultLanguage; + +public: + + XMLTimeFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import date fields (<text:date>); + inherit from TimeField to reuse implementation */ +class XMLDateFieldImportContext final : public XMLTimeFieldImportContext +{ +public: + + XMLDateFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; +}; + +/** import page continuation fields (<text:page-continuation-string>) */ +class XMLPageContinuationImportContext final : public XMLTextFieldImportContext +{ + const OUString sPropertySubType; + const OUString sPropertyNumberingType; + + OUString sString; /// continuation string + css::text::PageNumberType eSelectPage; /// previous, current + /// or next page + bool sStringOK; /// continuation string encountered? + +public: + + XMLPageContinuationImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import page number fields (<text:page-number>) */ +class XMLPageNumberImportContext final : public XMLTextFieldImportContext +{ + const OUString sPropertySubType; + const OUString sPropertyNumberingType; + const OUString sPropertyOffset; + + OUString sNumberFormat; + OUString sNumberSync; + sal_Int16 nPageAdjust; + css::text::PageNumberType eSelectPage; /// previous, current + /// or next page + bool sNumberFormatOK; + +public: + + XMLPageNumberImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; +}; + +/** superclass for database fields: handle database and table names */ +class XMLDatabaseFieldImportContext : public XMLTextFieldImportContext +{ + OUString m_sDatabaseName; + OUString m_sDatabaseURL; + OUString m_sTableName; + + sal_Int32 m_nCommandType; + bool m_bCommandTypeOK; + + bool m_bDisplay; + bool m_bDisplayOK; + bool m_bUseDisplay; + +protected: + bool m_bDatabaseOK; + bool m_bDatabaseNameOK; + bool m_bDatabaseURLOK; + bool m_bTableOK; + + /// protected constructor: only for subclasses + XMLDatabaseFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp, + const OUString& pServiceName, + bool bUseDisplay ); + +public: + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; + + /// handle database-location children + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; +}; + +/** import database name fields (<text:database-name>) */ +class XMLDatabaseNameImportContext final : public XMLDatabaseFieldImportContext +{ +public: + + XMLDatabaseNameImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; +}; + +/** import database next fields (<text:database-next>) */ +class XMLDatabaseNextImportContext : public XMLDatabaseFieldImportContext +{ + const OUString sPropertyCondition; + const OUString sTrue; + OUString sCondition; + bool bConditionOK; + +protected: + // for use in child classes + XMLDatabaseNextImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp, + const OUString& pServiceName); + +public: + + XMLDatabaseNextImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import database select fields (<text:database-select>) */ +class XMLDatabaseSelectImportContext final : public XMLDatabaseNextImportContext +{ + const OUString sPropertySetNumber; + sal_Int32 nNumber; + bool bNumberOK; + +public: + + XMLDatabaseSelectImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< + css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import database display number fields (<text:database-row-number>) */ +class XMLDatabaseNumberImportContext final : public XMLDatabaseFieldImportContext +{ + const OUString sPropertyNumberingType; + const OUString sPropertySetNumber; + OUString sNumberFormat; + OUString sNumberSync; + sal_Int32 nValue; + bool bValueOK; + +public: + + XMLDatabaseNumberImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import docinfo fields with only fixed attribute */ +class XMLSimpleDocInfoImportContext : public XMLTextFieldImportContext +{ + const OUString sPropertyFixed; + const OUString sPropertyContent; + const OUString sPropertyAuthor; + const OUString sPropertyCurrentPresentation; + +protected: + bool bFixed; + bool bHasAuthor; + bool bHasContent; + +public: + + XMLSimpleDocInfoImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp, + sal_Int32 nElementToken, + bool bContent, + bool bAuthor); + +protected: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; + + static OUString MapTokenToServiceName(sal_Int32 nElementToken); +}; + +/** import docinfo fields with date or time attributes and numberformats */ +class XMLDateTimeDocInfoImportContext final : public XMLSimpleDocInfoImportContext +{ + const OUString sPropertyNumberFormat; + const OUString sPropertyIsDate; + const OUString sPropertyIsFixedLanguage; + + sal_Int32 nFormat; + bool bFormatOK; + bool bIsDate; + bool bHasDateTime; + bool bIsDefaultLanguage; + +public: + + XMLDateTimeDocInfoImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp, + sal_Int32 nElement); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import revision field (<text:editing-cycles>) */ +class XMLRevisionDocInfoImportContext final : public XMLSimpleDocInfoImportContext +{ +public: + + XMLRevisionDocInfoImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp, + sal_Int32 nElement); + +private: + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import user docinfo field (<text:user-defined>) */ +class XMLUserDocInfoImportContext final : public XMLSimpleDocInfoImportContext +{ + OUString aName; + const OUString sPropertyName; + const OUString sPropertyNumberFormat; + const OUString sPropertyIsFixedLanguage; + sal_Int32 nFormat; + bool bFormatOK; + bool bIsDefaultLanguage; + +public: + + XMLUserDocInfoImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp, + sal_Int32 nElement); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import hidden paragraph fields (<text:hidden-paragraph>) */ +class XMLHiddenParagraphImportContext final : public XMLTextFieldImportContext +{ + const OUString sPropertyCondition; + const OUString sPropertyIsHidden; + + OUString sCondition; + bool bIsHidden; + +public: + + XMLHiddenParagraphImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import conditional text fields (<text:conditional-text>) */ +class XMLConditionalTextImportContext final : public XMLTextFieldImportContext +{ + const OUString sPropertyCondition; + const OUString sPropertyCurrentPresentation; + + OUString sCondition; + OUString sTrueContent; + OUString sFalseContent; + + bool bConditionOK; + bool bTrueOK; + bool bFalseOK; + bool bCurrentValue; + +public: + + XMLConditionalTextImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import conditional text fields (<text:hidden-text>) */ +class XMLHiddenTextImportContext final : public XMLTextFieldImportContext +{ + const OUString sPropertyCondition; + const OUString sPropertyContent; + const OUString sPropertyIsHidden; + + OUString sCondition; + OUString sString; + + bool bConditionOK; + bool bStringOK; + bool bIsHidden; + +public: + + XMLHiddenTextImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import file name fields (<text:file-name>) */ +class XMLFileNameImportContext final : public XMLTextFieldImportContext +{ + const OUString sPropertyFixed; + const OUString sPropertyFileFormat; + const OUString sPropertyCurrentPresentation; + + sal_Int16 nFormat; + bool bFixed; + +public: + + XMLFileNameImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import document template name fields (<text:template-name>) */ +class XMLTemplateNameImportContext final : public XMLTextFieldImportContext +{ + const OUString sPropertyFileFormat; + + sal_Int16 nFormat; + +public: + + XMLTemplateNameImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import chapter fields (<text:chapter>) */ +class XMLChapterImportContext final : public XMLTextFieldImportContext +{ + sal_Int16 nFormat; + sal_Int8 nLevel; + +public: + + XMLChapterImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import count fields (<text:[XXX]-count>) */ +class XMLCountFieldImportContext final : public XMLTextFieldImportContext +{ + const OUString sPropertyNumberingType; + + OUString sNumberFormat; + OUString sLetterSync; + + bool bNumberFormatOK; + +public: + + XMLCountFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp, + sal_Int32 nElement); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; + + static OUString MapTokenToServiceName(sal_Int32 nElement); +}; + +/** import page variable fields (<text:get-page-variable>) */ +class XMLPageVarGetFieldImportContext final : public XMLTextFieldImportContext +{ + OUString sNumberFormat; + OUString sLetterSync; + + bool bNumberFormatOK; + +public: + + XMLPageVarGetFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import page variable fields (<text:get-page-variable>) */ +class XMLPageVarSetFieldImportContext final : public XMLTextFieldImportContext +{ + sal_Int16 nAdjust; + bool bActive; + +public: + + XMLPageVarSetFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import macro fields (<text:execute-macro>) */ +class XMLMacroFieldImportContext final : public XMLTextFieldImportContext +{ + OUString sDescription; + rtl::Reference<XMLEventsImportContext> xEventContext; + + OUString sMacro; // macro for old documents (pre 638i) + + bool bDescriptionOK; + +public: + + XMLMacroFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// for <office:events> children + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import reference fields (<text:reference-get>) */ +class XMLReferenceFieldImportContext final : public XMLTextFieldImportContext +{ + OUString sName; + OUString sLanguage; + sal_Int32 nElementToken; + sal_Int16 nSource; + sal_Int16 nType; + sal_uInt16 nFlags; + + bool bNameOK; + bool bTypeOK; + +public: + + XMLReferenceFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp, + sal_Int32 nToken); + +private: + /// start element + virtual void SAL_CALL startFastElement( + sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList> & xAttrList) override; + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import dde field declaration container (<text:dde-connection-decls>) */ +class XMLDdeFieldDeclsImportContext final : public SvXMLImportContext +{ +public: + + XMLDdeFieldDeclsImportContext(SvXMLImport& rImport); + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; +}; + +/** import dde field declaration (<text:dde-connection-decl>) */ +class XMLDdeFieldDeclImportContext final : public SvXMLImportContext +{ +public: + + XMLDdeFieldDeclImportContext(SvXMLImport& rImport); + + // create fieldmaster + virtual void SAL_CALL startFastElement( + sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList> & xAttrList) override; +}; + +/** import dde fields (<text:dde-connection>) */ +class XMLDdeFieldImportContext final : public XMLTextFieldImportContext +{ + OUString sName; + OUString sPropertyContent; + +public: + + XMLDdeFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// create textfield, attach master, and insert into document + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; + + /// empty method + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import sheet name fields (Calc) dde fields (<text:sheet-name>) */ +class XMLSheetNameImportContext final : public XMLTextFieldImportContext +{ + +public: + + XMLSheetNameImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// no attributes -> empty method + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// no attributes -> empty method + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import page|slide name fields (<text:page-name>) */ +class XMLPageNameFieldImportContext final : public XMLTextFieldImportContext +{ +public: + + XMLPageNameFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import hyperlinks as URL fields (Calc, Impress, Draw) (<office:a>) */ +class XMLUrlFieldImportContext final : public XMLTextFieldImportContext +{ + OUString sURL; + OUString sFrame; + bool bFrameOK; + +public: + + XMLUrlFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// no attributes -> empty method + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// no attributes -> empty method + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import bibliography info fields (<text:bibliography-mark>) */ +class XMLBibliographyFieldImportContext final : public XMLTextFieldImportContext +{ + ::std::vector< css::beans::PropertyValue> aValues; + +public: + + XMLBibliographyFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attributes (fill aValues) + virtual void SAL_CALL startFastElement( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList) override; + + /// empty method; all attributes are handled in StartElement + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// convert aValues into sequence and set property + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; + + static const char* MapBibliographyFieldName(sal_Int32 nElement); +}; + +/** Import an annotation field (<text:annotation>) */ +class XMLAnnotationImportContext final : public XMLTextFieldImportContext +{ + OUStringBuffer aAuthorBuffer; + OUStringBuffer aInitialsBuffer; + OUString aName; + OUString aParentName; + OUStringBuffer aTextBuffer; + OUStringBuffer aDateBuffer; + OUString aResolved; + + css::uno::Reference < css::beans::XPropertySet > mxField; + css::uno::Reference < css::text::XTextCursor > mxCursor; + css::uno::Reference < css::text::XTextCursor > mxOldCursor; + + sal_Int32 mnElement; + +public: + + XMLAnnotationImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp, + sal_Int32 nElement); + +private: + /// process attributes + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// set properties + virtual void PrepareField( + const css::uno::Reference< css::beans::XPropertySet > & xPropertySet) override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; +}; + +/** Import a script field (<text:script>) */ +class XMLScriptImportContext final : public XMLTextFieldImportContext +{ + OUString sContent; + OUString sScriptType; + + bool bContentOK; + +public: + + XMLScriptImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attributes + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// set properties + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import measure fields (<text:measure>) */ +class XMLMeasureFieldImportContext final : public XMLTextFieldImportContext +{ + sal_Int16 mnKind; + +public: + + XMLMeasureFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** dropdown field (filter legacy) */ +class XMLDropDownFieldImportContext final : public XMLTextFieldImportContext +{ + std::vector<OUString> aLabels; + OUString sName; + OUString sHelp; + OUString sHint; + sal_Int32 nSelected; + bool bNameOK; + bool bHelpOK; + bool bHintOK; + +public: + + XMLDropDownFieldImportContext(SvXMLImport& rImport, + XMLTextImportHelper& rHlp); + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; + +private: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import header fields (<draw:header>) */ +class XMLHeaderFieldImportContext final : public XMLTextFieldImportContext +{ +public: + + XMLHeaderFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import footer fields (<draw:footer>) */ +class XMLFooterFieldImportContext final : public XMLTextFieldImportContext +{ +public: + + XMLFooterFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/** import footer fields (<draw:date-and-time>) */ +class XMLDateTimeFieldImportContext final : public XMLTextFieldImportContext +{ +public: + + XMLDateTimeFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/txtlists.hxx b/xmloff/inc/txtlists.hxx new file mode 100644 index 0000000000..dda522c441 --- /dev/null +++ b/xmloff/inc/txtlists.hxx @@ -0,0 +1,182 @@ +/* -*- 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 . + */ + +#pragma once + +#include <rtl/ustring.hxx> +#include <map> +#include <memory> +#include <stack> +#include <string_view> +#include <tuple> +#include <vector> +#include <com/sun/star/container/XIndexReplace.hpp> +#include <xmloff/xmlictxt.hxx> + +class SvXMLImport; +class XMLTextListBlockContext; +class XMLTextListItemContext; +class XMLNumberedParaContext; + +class XMLTextListsHelper +{ + public: + XMLTextListsHelper(); + XMLTextListsHelper(const XMLTextListsHelper&) = delete; + XMLTextListsHelper& operator=(const XMLTextListsHelper&) = delete; + + /// list stack for importing: + + /// push a list context on the list context stack + void PushListContext(XMLTextListBlockContext *i_pListBlock); + void PushListContext(XMLNumberedParaContext *i_pNumberedParagraph); + /// pop the list context stack + void PopListContext(); + /// peek at the top of the list context stack + void ListContextTop(XMLTextListBlockContext*& o_pListBlockContext, + XMLTextListItemContext*& o_pListItemContext, + XMLNumberedParaContext*& o_pNumberedParagraphContext ); + /// set list item on top of the list context stack + void SetListItem( XMLTextListItemContext *pListItem ); + + + // keeping track of processed lists for import and export + // Add optional parameter <sListStyleDefaultListId> (#i92811#) + void KeepListAsProcessed( const OUString& sListId, + const OUString& sListStyleName, + const OUString& sContinueListId, + const OUString& sListStyleDefaultListId = OUString() ); + + bool IsListProcessed( const OUString& sListId ) const; + OUString GetListStyleOfProcessedList( + const OUString& sListId ) const; + OUString GetContinueListIdOfProcessedList( + const OUString& sListId ) const; + const OUString& GetLastProcessedListId() const { return msLastProcessedListId;} + const OUString& GetListStyleOfLastProcessedList() const { return msListStyleOfLastProcessedList;} + + OUString GenerateNewListId() const; + + // Provide list id for a certain list block for import (#i92811#) + OUString GetListIdForListBlock( XMLTextListBlockContext const & rListBlock ); + + // keep track of continue list chain for export + void StoreLastContinuingList( const OUString& sListId, + const OUString& sContinuingListId ); + + OUString GetLastContinuingListId( const OUString& sListId ) const; + + // keep track of opened list elements of a certain list for export + void PushListOnStack( const OUString& sListId, + const OUString& sListStyleName ); + void PopListFromStack(); + bool EqualsToTopListStyleOnStack( std::u16string_view sListId ) const; + + /** for importing numbered-paragraph + note that the ID namespace for numbered-paragraph and regular list + is distinct; we never combine a list and a n-p + */ + css::uno::Reference< css::container::XIndexReplace> + EnsureNumberedParagraph( + SvXMLImport & i_rImport, + const OUString& i_ListId, + sal_Int16 & io_rLevel, const OUString& i_StyleName); + + /// get ID of the last numbered-paragraph iff it has given style-name + OUString GetNumberedParagraphListId( + const sal_uInt16 i_Level, + std::u16string_view i_StyleName); + + /** Creates a NumRule from given style-name. + @param i_rImport the SvXMLImport + @param i_xNumRule parent num rule + @param i_ParentStyleName parent list style name + @param i_StyleName the list style name + @param io_rLevel the list level (may be reset if too large) + @param o_rRestartNumbering set to true if no style (defaulting) + @param io_rSetDefaults set to true if no style (defaulting) + */ + static css::uno::Reference< css::container::XIndexReplace> MakeNumRule( + SvXMLImport & i_rImport, + const css::uno::Reference< css::container::XIndexReplace>& i_xNumRule, + std::u16string_view i_ParentStyleName, + const OUString& i_StyleName, + sal_Int16 & io_rLevel, + bool* o_pRestartNumbering = nullptr, + bool* io_pSetDefaults = nullptr); + + /// Looks up the last list id of a given list style, by name. + OUString GetLastIdOfStyleName(const OUString& sListStyleName) const; + + private: + + /** list context: list, list-item, numbered-paragraph + XMLTextListBlockContext, XMLTextListItemContext, + XMLNumberedParaContext + */ + typedef std::tuple<SvXMLImportContextRef, + SvXMLImportContextRef, SvXMLImportContextRef> ListStackFrame_t; + std::stack< ListStackFrame_t > mListStack; + + // container type for processed lists: + // map with <ListId> as key and pair( <ListStyleName, ContinueListId> ) + // as value + typedef ::std::map< OUString, + ::std::pair< OUString, OUString > > tMapForLists; + std::unique_ptr<tMapForLists> mpProcessedLists; + OUString msLastProcessedListId; + OUString msListStyleOfLastProcessedList; + + /* additional container for processed lists. + map with <ListStyleName> as key and pair( <ListId, ListStyleDefaultListId> ) + as value. (#i92811#) + */ + std::unique_ptr<tMapForLists> mpMapListIdToListStyleDefaultListId; + + // container type to build up continue list chain: + // map with <ListId> of master list as key and <ListId> of last list + // continuing the master list as value + typedef ::std::map< OUString, OUString > tMapForContinuingLists; + std::unique_ptr<tMapForContinuingLists> mpContinuingLists; + + std::unique_ptr<std::map<OUString, OUString>> mpStyleNameLastListIds; + + // stack type for opened list elements and its list style: + // vector with pair( <ListId>, <ListStyleName> ) as value + typedef ::std::vector< ::std::pair< OUString, OUString > > + tStackForLists; + std::unique_ptr<tStackForLists> mpListStack; + + /// to connect numbered-paragraphs that have no list-id attribute: + /// vector of pair of style-name and list-id (indexed by level) + typedef ::std::vector< ::std::pair< OUString, OUString > > + LastNumberedParagraphs_t; + + LastNumberedParagraphs_t mLastNumberedParagraphs; + + /// numbered-paragraphs + typedef ::std::vector< + ::std::pair< + OUString, + css::uno::Reference< css::container::XIndexReplace > > > NumParaList_t; + ::std::map< OUString, NumParaList_t > mNPLists; + +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/txtvfldi.hxx b/xmloff/inc/txtvfldi.hxx new file mode 100644 index 0000000000..d5a4176d5d --- /dev/null +++ b/xmloff/inc/txtvfldi.hxx @@ -0,0 +1,452 @@ +/* -*- 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 . + */ + +/** @#file + * + * XML import of all variable related text fields plus database display field + */ + +#pragma once + +#include "txtfldi.hxx" +#include <com/sun/star/beans/XPropertySet.hpp> + + +/** helper class: parses value-type and associated value attributes */ +class XMLValueImportHelper final +{ + SvXMLImport& rImport; + XMLTextImportHelper& rHelper; + + OUString sValue; /// string value (only valid if bStringValueOK) + double fValue; /// double value (only valid if bFloatValueOK) + sal_Int32 nFormatKey; /// format key (only valid of bFormatOK) + OUString sFormula; /// formula string + OUString sDefault; /// default (see bStringDefault/bFormulaDef.) + bool bIsDefaultLanguage;/// format (of nFormatKey) has system language? + + bool bStringType; /// is this a string (or a float) type? + bool bFormatOK; /// have we read a style:data-style-name attr.? + bool bStringValueOK; /// have we read a string-value attr.? + bool bFormulaOK; /// have we read the formula attribute? + + const bool bSetType; /// should PrepareField set the SetExp subtype? + const bool bSetValue; /// should PrepareField set content/value? + const bool bSetStyle; /// should PrepareField set NumberFormat? + const bool bSetFormula; /// should PrepareField set Formula? + +public: + XMLValueImportHelper( + SvXMLImport& rImprt, /// XML Import + XMLTextImportHelper& rHlp, /// text import helper + bool bType, /// process type (PrepareField) + bool bStyle, /// process data style (P.F.) + bool bValue, /// process value (Prep.Field) + bool bFormula); /// process formula (Prep.F.) + + /// process attribute values + void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ); + + /// prepare XTextField for insertion into document + void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet); + + /// is value a string (rather than double)? + bool IsStringValue() const { return bStringType; } + + /// has format been read? + bool IsFormatOK() const { return bFormatOK; } + + void SetDefault(const OUString& sStr) { sDefault = sStr; } +}; + + +/** + * abstract parent class for all variable related fields + * - variable-set/get/decl (not -decls), + * - user-field-get/decl (not -decls), + * - sequence/-decl (not -decls), + * - expression, + * - text-input + * + * Processes the following attributes: + * - name + * - formula + * - display + * - value, value-type, data-style-name (via XMLValueImportHelper) + * - description. + * + * Each attribute has a corresponding member, a bool variable to indicate + * whether it was set or not, and a bool variable whether it should be set + * using the standard property name. + * + * bValid is set true, when name is found! + * (Most variable related fields are valid, if a name is + * found. However, some are always valid. In this case, setting bValid + * does not matter.) + */ +class XMLVarFieldImportContext : public XMLTextFieldImportContext +{ +private: + OUString sName; /// name attribute + OUString sFormula; /// formula attribute + OUString sDescription; /// description + OUString sHelp; /// help text + OUString sHint; /// hint + XMLValueImportHelper aValueHelper; /// value, value-type, and style + bool bDisplayFormula; /// display formula?(rather than value) + bool bDisplayNone; /// hide field? + + bool bFormulaOK; /// sFormula was set + bool bDescriptionOK; /// sDescription was set + bool bHelpOK; /// sHelp was set + bool bHintOK; /// sHint was set + bool bDisplayOK; /// sDisplayFormula/-None were set + + bool bSetFormula; /// set Formula property + bool bSetFormulaDefault; /// use content as default for formula + bool bSetDescription; /// set sDescription with Hint-property + bool bSetHelp; + bool bSetHint; + bool bSetVisible; /// set IsVisible + bool bSetDisplayFormula; /// set DisplayFormula (sub type???) + bool bSetPresentation; /// set presentation frm elem. content? + +public: + + + XMLVarFieldImportContext( + // for XMLTextFieldImportContext: + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp, /// text import helper + const OUString& pServiceName, /// name of SO API service + // config variables for PrepareField behavior: + bool bFormula, /// set Formula property + bool bFormulaDefault, /// use content as default for formula + bool bDescription, /// set sDescription with Hint-property + bool bHelp, + bool bHint, + bool bVisible, /// set IsVisible (display attr) + bool bDisplayFormula, /// set ??? (display attr.) + bool bType, /// set value type with ???-property + bool bStyle, /// set data style (NumberFormat-Prop.) + bool bValue, /// set value with Content/Value-Prop. + bool bPresentation); /// set presentation from elem. content + +protected: + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< + css::beans::XPropertySet> & xPropertySet) override; + + // various accessor methods: + const OUString& GetName() const { return sName; } + bool IsStringValue() const { return aValueHelper.IsStringValue();} +}; + + +/** import variable get fields (<text:variable-get>) */ +class XMLVariableGetFieldImportContext final : public XMLVarFieldImportContext +{ +public: + + + XMLVariableGetFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + + +private: + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference< + css::beans::XPropertySet> & xPropertySet) override; +}; + + +/** import expression fields (<text:expression>) */ +class XMLExpressionFieldImportContext final : public XMLVarFieldImportContext +{ +public: + + XMLExpressionFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + +private: + virtual void PrepareField( + const css::uno::Reference< + css::beans::XPropertySet> & xPropertySet) override; +}; + +/*** import text input fields (<text:text-input>) */ +class XMLTextInputFieldImportContext final : public XMLVarFieldImportContext +{ +public: + + XMLTextInputFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + +private: + virtual void PrepareField( + const css::uno::Reference< + css::beans::XPropertySet> & xPropertySet) override; +}; + + +/** + * upperclass for variable/user-set, var/user-input, and sequence fields + * inds field master of appropriate type and attaches field to it. + */ +class XMLSetVarFieldImportContext : public XMLVarFieldImportContext +{ + const VarType eFieldType; + +public: + + + XMLSetVarFieldImportContext( + // for XMLTextFieldImportContext: + SvXMLImport& rImport, /// see XMLTextFieldImportContext + XMLTextImportHelper& rHlp, /// see XMLTextFieldImportContext + const OUString& pServiceName, /// see XMLTextFieldImportContext + // for finding appropriate field master (see endFastElement()) + VarType eVarType, /// variable type + // config variables: + bool bFormula, /// see XMLTextFieldImportContext + bool bFormulaDefault, /// see XMLTextFieldImportContext + bool bDescription, /// see XMLTextFieldImportContext + bool bHelp, /// see XMLTextFieldImportContext + bool bHint, /// see XMLTextFieldImportContext + bool bVisible, /// see XMLTextFieldImportContext + bool bDisplayFormula, /// see XMLTextFieldImportContext + bool bType, /// see XMLTextFieldImportContext + bool bStyle, /// see XMLTextFieldImportContext + bool bValue, /// see XMLTextFieldImportContext + bool bPresentation); /// see XMLTextFieldImportContext + +protected: + + /// create XTextField, attach master and insert into document; + /// also calls PrepareTextField + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; + + /// find appropriate field master + bool FindFieldMaster( + css::uno::Reference< + css::beans::XPropertySet> & xMaster); +}; + + +/** import variable set fields (<text:variable-set>) */ +class XMLVariableSetFieldImportContext final : public XMLSetVarFieldImportContext +{ +public: + + XMLVariableSetFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper +\ +private: + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + + +/** variable input fields (<text:variable-input>) */ +class XMLVariableInputFieldImportContext final : public XMLSetVarFieldImportContext +{ +public: + + + XMLVariableInputFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + +private: + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + + +/** user fields (<text:user-field-get>) */ +class XMLUserFieldImportContext final : public XMLSetVarFieldImportContext +{ + +public: + + + XMLUserFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper +}; + +/** user input fields (<text:user-field-input>) */ +class XMLUserFieldInputImportContext final : public XMLVarFieldImportContext +{ + +public: + + + XMLUserFieldInputImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + + +/** sequence fields (<text:sequence>) */ +class XMLSequenceFieldImportContext final : public XMLSetVarFieldImportContext +{ + OUString sNumFormat; + OUString sNumFormatSync; + OUString sRefName; + + bool bRefNameOK; + +public: + + + XMLSequenceFieldImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// Text import helper + +private: + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + + +/** + * variable declaration container for all variable fields + * (variable-decls, user-field-decls, sequence-decls) + */ +class XMLVariableDeclsImportContext final : public SvXMLImportContext +{ + enum VarType eVarDeclsContextType; + XMLTextImportHelper& rImportHelper; + +public: + + XMLVariableDeclsImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp, /// text import helper + enum VarType eVarType); /// variable type + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; +}; + +/** + * variable field declarations + * (variable-decl, user-field-decl, sequence-decl) + */ +class XMLVariableDeclImportContext final : public SvXMLImportContext +{ +public: + + + XMLVariableDeclImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp, /// text import helper + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList> & xAttrList,/// list of element attributes + enum VarType eVarType); /// variable type + + /// get field master for name and rename if appropriate + static bool FindFieldMaster(css::uno::Reference<css::beans::XPropertySet> & xMaster, + SvXMLImport& rImport, + XMLTextImportHelper& rHelper, + const OUString& sVarName, + enum VarType eVarType); +}; + + +/** import table formula fields (deprecated; for Writer 2.0 compatibility) */ +class XMLTableFormulaImportContext final : public XMLTextFieldImportContext +{ + XMLValueImportHelper aValueHelper; + + bool bIsShowFormula; + +public: + + XMLTableFormulaImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// text import helper + +private: + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// prepare XTextField for insertion into document + virtual void PrepareField( + const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; +}; + + +/** import database display fields (<text:database-display>) */ +class XMLDatabaseDisplayImportContext final : public XMLDatabaseFieldImportContext +{ + XMLValueImportHelper aValueHelper; + + OUString sColumnName; + bool bColumnOK; + + bool bDisplay; + bool bDisplayOK; + +public: + + + XMLDatabaseDisplayImportContext( + SvXMLImport& rImport, /// XML Import + XMLTextImportHelper& rHlp); /// text import helper + +private: + + /// process attribute values + virtual void ProcessAttribute( sal_Int32 nAttrToken, + std::string_view sAttrValue ) override; + + /// create, prepare and insert database field master and database field + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/xexptran.hxx b/xmloff/inc/xexptran.hxx new file mode 100644 index 0000000000..9136e620fa --- /dev/null +++ b/xmloff/inc/xexptran.hxx @@ -0,0 +1,101 @@ +/* -*- 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 . + */ + +#pragma once + +#include <rtl/ustring.hxx> +#include <com/sun/star/drawing/HomogenMatrix.hpp> + +#include <memory> +#include <vector> + +struct ImpSdXMLExpTransObj2DBase; +struct ImpSdXMLExpTransObj3DBase; +class SvXMLUnitConverter; +class SvXMLImport; +class SvXMLExport; + +namespace basegfx +{ + class B2DTuple; + class B2DHomMatrix; + class B3DHomMatrix; +} + +class SdXMLImExTransform2D +{ + // NOTE: This uses shared_ptr, because with unique_ptr the code + // fails to compile because of incomplete type. + std::vector< std::shared_ptr< ImpSdXMLExpTransObj2DBase > > maList; + OUString msString; + +public: + SdXMLImExTransform2D() {} + + void AddRotate(double fNew); + void AddTranslate(const ::basegfx::B2DTuple& rNew); + void AddSkewX(double fNew); + + bool NeedsAction() const { return !maList.empty(); } + void GetFullTransform(::basegfx::B2DHomMatrix& rFullTrans); + const OUString& GetExportString(const SvXMLUnitConverter& rConv); + void SetString(const OUString& rNew, const SvXMLUnitConverter& rConv); +}; + +class SdXMLImExTransform3D +{ + // NOTE: This uses shared_ptr, because with unique_ptr the code + // fails to compile because of incomplete type. + std::vector< std::shared_ptr< ImpSdXMLExpTransObj3DBase > > maList; + OUString msString; + +public: + SdXMLImExTransform3D() {} + SdXMLImExTransform3D(const OUString& rNew, const SvXMLUnitConverter& rConv); + + void AddMatrix(const ::basegfx::B3DHomMatrix& rNew); + + void AddHomogenMatrix(const css::drawing::HomogenMatrix& xHomMat); + bool NeedsAction() const { return !maList.empty(); } + void GetFullTransform(::basegfx::B3DHomMatrix& rFullTrans); + bool GetFullHomogenTransform(css::drawing::HomogenMatrix& xHomMat); + const OUString& GetExportString(const SvXMLUnitConverter& rConv); + void SetString(const OUString& rNew, const SvXMLUnitConverter& rConv); +}; + +class SdXMLImExViewBox +{ + OUString msString; + double mfX; + double mfY; + double mfW; + double mfH; + +public: + SdXMLImExViewBox(double fX, double fY, double fW, double fH); + SdXMLImExViewBox(OUString aNew, const SvXMLUnitConverter& rConv); + + double GetX() const { return mfX; } + double GetY() const { return mfY; } + double GetWidth() const { return mfW; } + double GetHeight() const { return mfH; } + const OUString& GetExportString(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/xmlmultiimagehelper.hxx b/xmloff/inc/xmlmultiimagehelper.hxx new file mode 100644 index 0000000000..b55e59324e --- /dev/null +++ b/xmloff/inc/xmlmultiimagehelper.hxx @@ -0,0 +1,57 @@ +/* -*- 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 . + */ + +#pragma once + +#include <xmloff/xmlimp.hxx> + + +class MultiImageImportHelper +{ +private: + std::vector< SvXMLImportContextRef > maImplContextVector; + bool mbSupportsMultipleContents; + +protected: + /// helper to get the created xShape instance, override this + virtual void removeGraphicFromImportContext(const SvXMLImportContext& rContext) = 0; + virtual OUString getGraphicPackageURLFromImportContext(const SvXMLImportContext& rContext) const = 0; + virtual OUString getMimeTypeFromImportContext(const SvXMLImportContext& rContext) const = 0; + virtual css::uno::Reference<css::graphic::XGraphic> getGraphicFromImportContext(const SvXMLImportContext& rContext) const = 0; + +public: + MultiImageImportHelper(); + virtual ~MultiImageImportHelper(); + + /// solve multiple imported images. The most valuable one is chosen, + /// see implementation for evtl. changing weights and/or adding filetypes. + /// + /// @returns import context of the selected image + SvXMLImportContextRef solveMultipleImages(); + + /// add a content to the remembered image import contexts + void addContent(const SvXMLImportContext& rSvXMLImportContext); + + /// read/write access to boolean switch + bool getSupportsMultipleContents() const { return mbSupportsMultipleContents; } + void setSupportsMultipleContents(bool bNew) { mbSupportsMultipleContents = bNew; } +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx new file mode 100644 index 0000000000..d93e0b89fb --- /dev/null +++ b/xmloff/inc/xmlprop.hxx @@ -0,0 +1,668 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ +#pragma once + +inline constexpr OUString PROP_ = u""_ustr; +inline constexpr OUString PROP_AdjustBlue = u"AdjustBlue"_ustr; +inline constexpr OUString PROP_AdjustContrast = u"AdjustContrast"_ustr; +inline constexpr OUString PROP_AdjustGreen = u"AdjustGreen"_ustr; +inline constexpr OUString PROP_AdjustLuminance = u"AdjustLuminance"_ustr; +inline constexpr OUString PROP_AdjustRed = u"AdjustRed"_ustr; +inline constexpr OUString PROP_AllowOverlap = u"AllowOverlap"_ustr; +inline constexpr OUString PROP_AnchorType = u"AnchorType"_ustr; +inline constexpr OUString PROP_ArrangeOrder = u"ArrangeOrder"_ustr; +inline constexpr OUString PROP_Aspect = u"Aspect"_ustr; +inline constexpr OUString PROP_AutomaticPosition = u"AutomaticPosition"_ustr; +inline constexpr OUString PROP_AutomaticSize = u"AutomaticSize"_ustr; +inline constexpr OUString PROP_BackColor = u"BackColor"_ustr; +inline constexpr OUString PROP_BackColorRGB = u"BackColorRGB"_ustr; +inline constexpr OUString PROP_BackColorTransparency = u"BackColorTransparency"_ustr; +inline constexpr OUString PROP_BackGraphic = u"BackGraphic"_ustr; +inline constexpr OUString PROP_BackGraphicFilter = u"BackGraphicFilter"_ustr; +inline constexpr OUString PROP_BackGraphicLocation = u"BackGraphicLocation"_ustr; +inline constexpr OUString PROP_BackGraphicTransparency = u"BackGraphicTransparency"_ustr; +inline constexpr OUString PROP_BackTransparent = u"BackTransparent"_ustr; +inline constexpr OUString PROP_BackgroundFullSize = u"BackgroundFullSize"_ustr; +inline constexpr OUString PROP_BorderColor = u"BorderColor"_ustr; +inline constexpr OUString PROP_BorderDistance = u"BorderDistance"_ustr; +inline constexpr OUString PROP_BottomBorder = u"BottomBorder"_ustr; +inline constexpr OUString PROP_BottomBorderDistance = u"BottomBorderDistance"_ustr; +inline constexpr OUString PROP_BottomMargin = u"BottomMargin"_ustr; +inline constexpr OUString PROP_BreakType = u"BreakType"_ustr; +inline constexpr OUString PROP_BuiltInUnit = u"BuiltInUnit"_ustr; +inline constexpr OUString PROP_CaptionAngle = u"CaptionAngle"_ustr; +inline constexpr OUString PROP_CaptionEscapeAbsolute = u"CaptionEscapeAbsolute"_ustr; +inline constexpr OUString PROP_CaptionEscapeDirection = u"CaptionEscapeDirection"_ustr; +inline constexpr OUString PROP_CaptionEscapeRelative = u"CaptionEscapeRelative"_ustr; +inline constexpr OUString PROP_CaptionGap = u"CaptionGap"_ustr; +inline constexpr OUString PROP_CaptionIsEscapeRelative = u"CaptionIsEscapeRelative"_ustr; +inline constexpr OUString PROP_CaptionIsFitLineLength = u"CaptionIsFitLineLength"_ustr; +inline constexpr OUString PROP_CaptionIsFixedAngle = u"CaptionIsFixedAngle"_ustr; +inline constexpr OUString PROP_CaptionLineLength = u"CaptionLineLength"_ustr; +inline constexpr OUString PROP_CaptionType = u"CaptionType"_ustr; +inline constexpr OUString PROP_CenterHorizontally = u"CenterHorizontally"_ustr; +inline constexpr OUString PROP_CenterVertically = u"CenterVertically"_ustr; +inline constexpr OUString PROP_Change = u"Change"_ustr; +inline constexpr OUString PROP_CharAutoKerning = u"CharAutoKerning"_ustr; +inline constexpr OUString PROP_CharBackColor = u"CharBackColor"_ustr; +inline constexpr OUString PROP_CharBackTransparent = u"CharBackTransparent"_ustr; +inline constexpr OUString PROP_CharBottomBorder = u"CharBottomBorder"_ustr; +inline constexpr OUString PROP_CharBottomBorderDistance = u"CharBottomBorderDistance"_ustr; +inline constexpr OUString PROP_CharCaseMap = u"CharCaseMap"_ustr; +inline constexpr OUString PROP_CharColor = u"CharColor"_ustr; +inline constexpr OUString PROP_CharComplexColor = u"CharComplexColor"_ustr; +inline constexpr OUString PROP_CharCombineIsOn = u"CharCombineIsOn"_ustr; +inline constexpr OUString PROP_CharCombinePrefix = u"CharCombinePrefix"_ustr; +inline constexpr OUString PROP_CharCombineSuffix = u"CharCombineSuffix"_ustr; +inline constexpr OUString PROP_CharContoured = u"CharContoured"_ustr; +inline constexpr OUString PROP_CharDiffHeight = u"CharDiffHeight"_ustr; +inline constexpr OUString PROP_CharDiffHeightAsian = u"CharDiffHeightAsian"_ustr; +inline constexpr OUString PROP_CharDiffHeightComplex = u"CharDiffHeightComplex"_ustr; +inline constexpr OUString PROP_CharEmphasis = u"CharEmphasis"_ustr; +inline constexpr OUString PROP_CharEscapement = u"CharEscapement"_ustr; +inline constexpr OUString PROP_CharEscapementHeight = u"CharEscapementHeight"_ustr; +inline constexpr OUString PROP_CharFlash = u"CharFlash"_ustr; +inline constexpr OUString PROP_CharFontCharSet = u"CharFontCharSet"_ustr; +inline constexpr OUString PROP_CharFontCharSetAsian = u"CharFontCharSetAsian"_ustr; +inline constexpr OUString PROP_CharFontCharSetComplex = u"CharFontCharSetComplex"_ustr; +inline constexpr OUString PROP_CharFontFamily = u"CharFontFamily"_ustr; +inline constexpr OUString PROP_CharFontFamilyAsian = u"CharFontFamilyAsian"_ustr; +inline constexpr OUString PROP_CharFontFamilyComplex = u"CharFontFamilyComplex"_ustr; +inline constexpr OUString PROP_CharFontName = u"CharFontName"_ustr; +inline constexpr OUString PROP_CharFontNameAsian = u"CharFontNameAsian"_ustr; +inline constexpr OUString PROP_CharFontNameComplex = u"CharFontNameComplex"_ustr; +inline constexpr OUString PROP_CharFontPitch = u"CharFontPitch"_ustr; +inline constexpr OUString PROP_CharFontPitchAsian = u"CharFontPitchAsian"_ustr; +inline constexpr OUString PROP_CharFontPitchComplex = u"CharFontPitchComplex"_ustr; +inline constexpr OUString PROP_CharFontStyleName = u"CharFontStyleName"_ustr; +inline constexpr OUString PROP_CharFontStyleNameAsian = u"CharFontStyleNameAsian"_ustr; +inline constexpr OUString PROP_CharFontStyleNameComplex = u"CharFontStyleNameComplex"_ustr; +inline constexpr OUString PROP_CharHeight = u"CharHeight"_ustr; +inline constexpr OUString PROP_CharHeightAsian = u"CharHeightAsian"_ustr; +inline constexpr OUString PROP_CharHeightComplex = u"CharHeightComplex"_ustr; +inline constexpr OUString PROP_CharHidden = u"CharHidden"_ustr; +inline constexpr OUString PROP_CharHighlight = u"CharHighlight"_ustr; +inline constexpr OUString PROP_CharKerning = u"CharKerning"_ustr; +inline constexpr OUString PROP_CharLeftBorder = u"CharLeftBorder"_ustr; +inline constexpr OUString PROP_CharLeftBorderDistance = u"CharLeftBorderDistance"_ustr; +inline constexpr OUString PROP_CharLocale = u"CharLocale"_ustr; +inline constexpr OUString PROP_CharLocaleAsian = u"CharLocaleAsian"_ustr; +inline constexpr OUString PROP_CharLocaleComplex = u"CharLocaleComplex"_ustr; +inline constexpr OUString PROP_CharOverline = u"CharOverline"_ustr; +inline constexpr OUString PROP_CharOverlineColor = u"CharOverlineColor"_ustr; +inline constexpr OUString PROP_CharOverlineHasColor = u"CharOverlineHasColor"_ustr; +inline constexpr OUString PROP_CharPosture = u"CharPosture"_ustr; +inline constexpr OUString PROP_CharPostureAsian = u"CharPostureAsian"_ustr; +inline constexpr OUString PROP_CharPostureComplex = u"CharPostureComplex"_ustr; +inline constexpr OUString PROP_CharPropHeight = u"CharPropHeight"_ustr; +inline constexpr OUString PROP_CharPropHeightAsian = u"CharPropHeightAsian"_ustr; +inline constexpr OUString PROP_CharPropHeightComplex = u"CharPropHeightComplex"_ustr; +inline constexpr OUString PROP_CharRelief = u"CharRelief"_ustr; +inline constexpr OUString PROP_CharRightBorder = u"CharRightBorder"_ustr; +inline constexpr OUString PROP_CharRightBorderDistance = u"CharRightBorderDistance"_ustr; +inline constexpr OUString PROP_CharRotation = u"CharRotation"_ustr; +inline constexpr OUString PROP_CharRotationIsFitToLine = u"CharRotationIsFitToLine"_ustr; +inline constexpr OUString PROP_CharScaleWidth = u"CharScaleWidth"_ustr; +inline constexpr OUString PROP_CharShadingValue = u"CharShadingValue"_ustr; +inline constexpr OUString PROP_CharShadowFormat = u"CharShadowFormat"_ustr; +inline constexpr OUString PROP_CharShadowed = u"CharShadowed"_ustr; +inline constexpr OUString PROP_CharStrikeout = u"CharStrikeout"_ustr; +inline constexpr OUString PROP_CharStyleName = u"CharStyleName"_ustr; +inline constexpr OUString PROP_CharTopBorder = u"CharTopBorder"_ustr; +inline constexpr OUString PROP_CharTopBorderDistance = u"CharTopBorderDistance"_ustr; +inline constexpr OUString PROP_CharTransparence = u"CharTransparence"_ustr; +inline constexpr OUString PROP_CharUnderline = u"CharUnderline"_ustr; +inline constexpr OUString PROP_CharUnderlineColor = u"CharUnderlineColor"_ustr; +inline constexpr OUString PROP_CharUnderlineHasColor = u"CharUnderlineHasColor"_ustr; +inline constexpr OUString PROP_CharWeight = u"CharWeight"_ustr; +inline constexpr OUString PROP_CharWeightAsian = u"CharWeightAsian"_ustr; +inline constexpr OUString PROP_CharWeightComplex = u"CharWeightComplex"_ustr; +inline constexpr OUString PROP_CharWordMode = u"CharWordMode"_ustr; +inline constexpr OUString PROP_ChartUserDefinedAttributes = u"ChartUserDefinedAttributes"_ustr; +inline constexpr OUString PROP_CollapsingBorders = u"CollapsingBorders"_ustr; +inline constexpr OUString PROP_ContentProtected = u"ContentProtected"_ustr; +inline constexpr OUString PROP_ContourOutside = u"ContourOutside"_ustr; +inline constexpr OUString PROP_ControlBackground = u"ControlBackground"_ustr; +inline constexpr OUString PROP_ControlBorder = u"ControlBorder"_ustr; +inline constexpr OUString PROP_ControlBorderColor = u"ControlBorderColor"_ustr; +inline constexpr OUString PROP_ControlDataStyle = u"ControlDataStyle"_ustr; +inline constexpr OUString PROP_ControlSymbolColor = u"ControlSymbolColor"_ustr; +inline constexpr OUString PROP_ControlTextEmphasis = u"ControlTextEmphasis"_ustr; +inline constexpr OUString PROP_ControlWritingMode = u"ControlWritingMode"_ustr; +inline constexpr OUString PROP_CrossoverPosition = u"CrossoverPosition"_ustr; +inline constexpr OUString PROP_CrossoverValue = u"CrossoverValue"_ustr; +inline constexpr OUString PROP_CurveName = u"CurveName"_ustr; +inline constexpr OUString PROP_D3DBackscale = u"D3DBackscale"_ustr; +inline constexpr OUString PROP_D3DCloseBack = u"D3DCloseBack"_ustr; +inline constexpr OUString PROP_D3DCloseFront = u"D3DCloseFront"_ustr; +inline constexpr OUString PROP_D3DDepth = u"D3DDepth"_ustr; +inline constexpr OUString PROP_D3DDoubleSided = u"D3DDoubleSided"_ustr; +inline constexpr OUString PROP_D3DEndAngle = u"D3DEndAngle"_ustr; +inline constexpr OUString PROP_D3DHorizontalSegments = u"D3DHorizontalSegments"_ustr; +inline constexpr OUString PROP_D3DMaterialColor = u"D3DMaterialColor"_ustr; +inline constexpr OUString PROP_D3DMaterialEmission = u"D3DMaterialEmission"_ustr; +inline constexpr OUString PROP_D3DMaterialSpecular = u"D3DMaterialSpecular"_ustr; +inline constexpr OUString PROP_D3DMaterialSpecularIntensity = u"D3DMaterialSpecularIntensity"_ustr; +inline constexpr OUString PROP_D3DNormalsInvert = u"D3DNormalsInvert"_ustr; +inline constexpr OUString PROP_D3DNormalsKind = u"D3DNormalsKind"_ustr; +inline constexpr OUString PROP_D3DPercentDiagonal = u"D3DPercentDiagonal"_ustr; +inline constexpr OUString PROP_D3DShadow3D = u"D3DShadow3D"_ustr; +inline constexpr OUString PROP_D3DTextureFilter = u"D3DTextureFilter"_ustr; +inline constexpr OUString PROP_D3DTextureKind = u"D3DTextureKind"_ustr; +inline constexpr OUString PROP_D3DTextureMode = u"D3DTextureMode"_ustr; +inline constexpr OUString PROP_D3DTextureProjectionX = u"D3DTextureProjectionX"_ustr; +inline constexpr OUString PROP_D3DTextureProjectionY = u"D3DTextureProjectionY"_ustr; +inline constexpr OUString PROP_D3DVerticalSegments = u"D3DVerticalSegments"_ustr; +inline constexpr OUString PROP_DataCaption = u"DataCaption"_ustr; +inline constexpr OUString PROP_DataRowSource = u"DataRowSource"_ustr; +inline constexpr OUString PROP_DataTableHBorder = u"DataTableHBorder"_ustr; +inline constexpr OUString PROP_DataTableOutline = u"DataTableOutline"_ustr; +inline constexpr OUString PROP_DataTableVBorder = u"DataTableVBorder"_ustr; +inline constexpr OUString PROP_Decorative = u"Decorative"_ustr; +inline constexpr OUString PROP_Deep = u"Deep"_ustr; +inline constexpr OUString PROP_DefaultOutlineLevel = u"DefaultOutlineLevel"_ustr; +inline constexpr OUString PROP_Dim3D = u"Dim3D"_ustr; +inline constexpr OUString PROP_DisplayLabels = u"DisplayLabels"_ustr; +inline constexpr OUString PROP_DisplayUnits = u"DisplayUnits"_ustr; +inline constexpr OUString PROP_DontBalanceTextColumns = u"DontBalanceTextColumns"_ustr; +inline constexpr OUString PROP_DropCapCharStyleName = u"DropCapCharStyleName"_ustr; +inline constexpr OUString PROP_DropCapFormat = u"DropCapFormat"_ustr; +inline constexpr OUString PROP_DropCapWholeWord = u"DropCapWholeWord"_ustr; +inline constexpr OUString PROP_EdgeNode1HorzDist = u"EdgeNode1HorzDist"_ustr; +inline constexpr OUString PROP_EdgeNode1VertDist = u"EdgeNode1VertDist"_ustr; +inline constexpr OUString PROP_EdgeNode2HorzDist = u"EdgeNode2HorzDist"_ustr; +inline constexpr OUString PROP_EdgeNode2VertDist = u"EdgeNode2VertDist"_ustr; +inline constexpr OUString PROP_EditInReadonly = u"EditInReadonly"_ustr; +inline constexpr OUString PROP_Effect = u"Effect"_ustr; +inline constexpr OUString PROP_EndnoteIsCollectAtTextEnd = u"EndnoteIsCollectAtTextEnd"_ustr; +inline constexpr OUString PROP_EndnoteIsOwnNumbering = u"EndnoteIsOwnNumbering"_ustr; +inline constexpr OUString PROP_EndnoteIsRestartNumbering = u"EndnoteIsRestartNumbering"_ustr; +inline constexpr OUString PROP_EndnoteNumberingPrefix = u"EndnoteNumberingPrefix"_ustr; +inline constexpr OUString PROP_EndnoteNumberingSuffix = u"EndnoteNumberingSuffix"_ustr; +inline constexpr OUString PROP_EndnoteNumberingType = u"EndnoteNumberingType"_ustr; +inline constexpr OUString PROP_EndnoteRestartNumberingAt = u"EndnoteRestartNumberingAt"_ustr; +inline constexpr OUString PROP_ErrorBarRangeNegative = u"ErrorBarRangeNegative"_ustr; +inline constexpr OUString PROP_ErrorBarRangePositive = u"ErrorBarRangePositive"_ustr; +inline constexpr OUString PROP_ErrorBarStyle = u"ErrorBarStyle"_ustr; +inline constexpr OUString PROP_ErrorMargin = u"ErrorMargin"_ustr; +inline constexpr OUString PROP_ExternalData = u"ExternalData"_ustr; +inline constexpr OUString PROP_ExtrapolateBackward = u"ExtrapolateBackward"_ustr; +inline constexpr OUString PROP_ExtrapolateForward = u"ExtrapolateForward"_ustr; +inline constexpr OUString PROP_FillBackground = u"FillBackground"_ustr; +inline constexpr OUString PROP_FillBitmapLogicalSize = u"FillBitmapLogicalSize"_ustr; +inline constexpr OUString PROP_FillBitmapMode = u"FillBitmapMode"_ustr; +inline constexpr OUString PROP_FillBitmapName = u"FillBitmapName"_ustr; +inline constexpr OUString PROP_FillBitmapOffsetX = u"FillBitmapOffsetX"_ustr; +inline constexpr OUString PROP_FillBitmapOffsetY = u"FillBitmapOffsetY"_ustr; +inline constexpr OUString PROP_FillBitmapPositionOffsetX = u"FillBitmapPositionOffsetX"_ustr; +inline constexpr OUString PROP_FillBitmapPositionOffsetY = u"FillBitmapPositionOffsetY"_ustr; +inline constexpr OUString PROP_FillBitmapRectanglePoint = u"FillBitmapRectanglePoint"_ustr; +inline constexpr OUString PROP_FillBitmapSizeX = u"FillBitmapSizeX"_ustr; +inline constexpr OUString PROP_FillBitmapSizeY = u"FillBitmapSizeY"_ustr; +inline constexpr OUString PROP_FillColor = u"FillColor"_ustr; +inline constexpr OUString PROP_FillColor2 = u"FillColor2"_ustr; +inline constexpr OUString PROP_FillComplexColor = u"FillComplexColor"_ustr; +inline constexpr OUString PROP_FillGradientName = u"FillGradientName"_ustr; +inline constexpr OUString PROP_FillGradientStepCount = u"FillGradientStepCount"_ustr; +inline constexpr OUString PROP_FillHatchName = u"FillHatchName"_ustr; +inline constexpr OUString PROP_FillStyle = u"FillStyle"_ustr; +inline constexpr OUString PROP_FillTransparence = u"FillTransparence"_ustr; +inline constexpr OUString PROP_FillTransparenceGradientName = u"FillTransparenceGradientName"_ustr; +inline constexpr OUString PROP_FillUseSlideBackground = u"FillUseSlideBackground"_ustr; +inline constexpr OUString PROP_FirstPageNumber = u"FirstPageNumber"_ustr; +inline constexpr OUString PROP_FontCharWidth = u"FontCharWidth"_ustr; +inline constexpr OUString PROP_FontCharset = u"FontCharset"_ustr; +inline constexpr OUString PROP_FontEmphasisMark = u"FontEmphasisMark"_ustr; +inline constexpr OUString PROP_FontFamily = u"FontFamily"_ustr; +inline constexpr OUString PROP_FontHeight = u"FontHeight"_ustr; +inline constexpr OUString PROP_FontIndependentLineSpacing = u"FontIndependentLineSpacing"_ustr; +inline constexpr OUString PROP_FontKerning = u"FontKerning"_ustr; +inline constexpr OUString PROP_FontName = u"FontName"_ustr; +inline constexpr OUString PROP_FontOrientation = u"FontOrientation"_ustr; +inline constexpr OUString PROP_FontPitch = u"FontPitch"_ustr; +inline constexpr OUString PROP_FontRelief = u"FontRelief"_ustr; +inline constexpr OUString PROP_FontSlant = u"FontSlant"_ustr; +inline constexpr OUString PROP_FontStrikeout = u"FontStrikeout"_ustr; +inline constexpr OUString PROP_FontStyleName = u"FontStyleName"_ustr; +inline constexpr OUString PROP_FontUnderline = u"FontUnderline"_ustr; +inline constexpr OUString PROP_FontWeight = u"FontWeight"_ustr; +inline constexpr OUString PROP_FontWidth = u"FontWidth"_ustr; +inline constexpr OUString PROP_FontWordLineMode = u"FontWordLineMode"_ustr; +inline constexpr OUString PROP_FontWorkAdjust = u"FontWorkAdjust"_ustr; +inline constexpr OUString PROP_FontWorkDistance = u"FontWorkDistance"_ustr; +inline constexpr OUString PROP_FontWorkForm = u"FontWorkForm"_ustr; +inline constexpr OUString PROP_FontWorkHideForm = u"FontWorkHideForm"_ustr; +inline constexpr OUString PROP_FontWorkMirror = u"FontWorkMirror"_ustr; +inline constexpr OUString PROP_FontWorkOutline = u"FontWorkOutline"_ustr; +inline constexpr OUString PROP_FontWorkShadow = u"FontWorkShadow"_ustr; +inline constexpr OUString PROP_FontWorkShadowColor = u"FontWorkShadowColor"_ustr; +inline constexpr OUString PROP_FontWorkShadowOffsetX = u"FontWorkShadowOffsetX"_ustr; +inline constexpr OUString PROP_FontWorkShadowOffsetY = u"FontWorkShadowOffsetY"_ustr; +inline constexpr OUString PROP_FontWorkShadowTransparence = u"FontWorkShadowTransparence"_ustr; +inline constexpr OUString PROP_FontWorkStart = u"FontWorkStart"_ustr; +inline constexpr OUString PROP_FontWorkStyle = u"FontWorkStyle"_ustr; +inline constexpr OUString PROP_FooterBackColor = u"FooterBackColor"_ustr; +inline constexpr OUString PROP_FooterBackGraphic = u"FooterBackGraphic"_ustr; +inline constexpr OUString PROP_FooterBackGraphicFilter = u"FooterBackGraphicFilter"_ustr; +inline constexpr OUString PROP_FooterBackGraphicLocation = u"FooterBackGraphicLocation"_ustr; +inline constexpr OUString PROP_FooterBackTransparent = u"FooterBackTransparent"_ustr; +inline constexpr OUString PROP_FooterBodyDistance = u"FooterBodyDistance"_ustr; +inline constexpr OUString PROP_FooterBottomBorder = u"FooterBottomBorder"_ustr; +inline constexpr OUString PROP_FooterBottomBorderDistance = u"FooterBottomBorderDistance"_ustr; +inline constexpr OUString PROP_FooterDynamicSpacing = u"FooterDynamicSpacing"_ustr; +inline constexpr OUString PROP_FooterFillBackground = u"FooterFillBackground"_ustr; +inline constexpr OUString PROP_FooterFillBitmapLogicalSize = u"FooterFillBitmapLogicalSize"_ustr; +inline constexpr OUString PROP_FooterFillBitmapMode = u"FooterFillBitmapMode"_ustr; +inline constexpr OUString PROP_FooterFillBitmapName = u"FooterFillBitmapName"_ustr; +inline constexpr OUString PROP_FooterFillBitmapOffsetX = u"FooterFillBitmapOffsetX"_ustr; +inline constexpr OUString PROP_FooterFillBitmapOffsetY = u"FooterFillBitmapOffsetY"_ustr; +inline constexpr OUString PROP_FooterFillBitmapPositionOffsetX + = u"FooterFillBitmapPositionOffsetX"_ustr; +inline constexpr OUString PROP_FooterFillBitmapPositionOffsetY + = u"FooterFillBitmapPositionOffsetY"_ustr; +inline constexpr OUString PROP_FooterFillBitmapRectanglePoint + = u"FooterFillBitmapRectanglePoint"_ustr; +inline constexpr OUString PROP_FooterFillBitmapSizeX = u"FooterFillBitmapSizeX"_ustr; +inline constexpr OUString PROP_FooterFillBitmapSizeY = u"FooterFillBitmapSizeY"_ustr; +inline constexpr OUString PROP_FooterFillColor = u"FooterFillColor"_ustr; +inline constexpr OUString PROP_FooterFillColor2 = u"FooterFillColor2"_ustr; +inline constexpr OUString PROP_FooterFillGradientName = u"FooterFillGradientName"_ustr; +inline constexpr OUString PROP_FooterFillGradientStepCount = u"FooterFillGradientStepCount"_ustr; +inline constexpr OUString PROP_FooterFillHatchName = u"FooterFillHatchName"_ustr; +inline constexpr OUString PROP_FooterFillStyle = u"FooterFillStyle"_ustr; +inline constexpr OUString PROP_FooterFillTransparence = u"FooterFillTransparence"_ustr; +inline constexpr OUString PROP_FooterFillTransparenceGradientName + = u"FooterFillTransparenceGradientName"_ustr; +inline constexpr OUString PROP_FooterHeight = u"FooterHeight"_ustr; +inline constexpr OUString PROP_FooterIsDynamicHeight = u"FooterIsDynamicHeight"_ustr; +inline constexpr OUString PROP_FooterLeftBorder = u"FooterLeftBorder"_ustr; +inline constexpr OUString PROP_FooterLeftBorderDistance = u"FooterLeftBorderDistance"_ustr; +inline constexpr OUString PROP_FooterLeftMargin = u"FooterLeftMargin"_ustr; +inline constexpr OUString PROP_FooterRightBorder = u"FooterRightBorder"_ustr; +inline constexpr OUString PROP_FooterRightBorderDistance = u"FooterRightBorderDistance"_ustr; +inline constexpr OUString PROP_FooterRightMargin = u"FooterRightMargin"_ustr; +inline constexpr OUString PROP_FooterShadowFormat = u"FooterShadowFormat"_ustr; +inline constexpr OUString PROP_FooterTopBorder = u"FooterTopBorder"_ustr; +inline constexpr OUString PROP_FooterTopBorderDistance = u"FooterTopBorderDistance"_ustr; +inline constexpr OUString PROP_FootnoteHeight = u"FootnoteHeight"_ustr; +inline constexpr OUString PROP_FootnoteIsCollectAtTextEnd = u"FootnoteIsCollectAtTextEnd"_ustr; +inline constexpr OUString PROP_FootnoteIsOwnNumbering = u"FootnoteIsOwnNumbering"_ustr; +inline constexpr OUString PROP_FootnoteIsRestartNumbering = u"FootnoteIsRestartNumbering"_ustr; +inline constexpr OUString PROP_FootnoteLineAdjust = u"FootnoteLineAdjust"_ustr; +inline constexpr OUString PROP_FootnoteLineColor = u"FootnoteLineColor"_ustr; +inline constexpr OUString PROP_FootnoteLineDistance = u"FootnoteLineDistance"_ustr; +inline constexpr OUString PROP_FootnoteLineRelativeWidth = u"FootnoteLineRelativeWidth"_ustr; +inline constexpr OUString PROP_FootnoteLineStyle = u"FootnoteLineStyle"_ustr; +inline constexpr OUString PROP_FootnoteLineTextDistance = u"FootnoteLineTextDistance"_ustr; +inline constexpr OUString PROP_FootnoteLineWeight = u"FootnoteLineWeight"_ustr; +inline constexpr OUString PROP_FootnoteNumberingPrefix = u"FootnoteNumberingPrefix"_ustr; +inline constexpr OUString PROP_FootnoteNumberingSuffix = u"FootnoteNumberingSuffix"_ustr; +inline constexpr OUString PROP_FootnoteNumberingType = u"FootnoteNumberingType"_ustr; +inline constexpr OUString PROP_FootnoteRestartNumberingAt = u"FootnoteRestartNumberingAt"_ustr; +inline constexpr OUString PROP_ForceIntercept = u"ForceIntercept"_ustr; +inline constexpr OUString PROP_FrameIsAutoScroll = u"FrameIsAutoScroll"_ustr; +inline constexpr OUString PROP_FrameIsBorder = u"FrameIsBorder"_ustr; +inline constexpr OUString PROP_FrameMarginHeight = u"FrameMarginHeight"_ustr; +inline constexpr OUString PROP_FrameMarginWidth = u"FrameMarginWidth"_ustr; +inline constexpr OUString PROP_Gamma = u"Gamma"_ustr; +inline constexpr OUString PROP_GapWidth = u"GapWidth"_ustr; +inline constexpr OUString PROP_GlowEffectColor = u"GlowEffectColor"_ustr; +inline constexpr OUString PROP_GlowEffectRadius = u"GlowEffectRadius"_ustr; +inline constexpr OUString PROP_GlowEffectTransparency = u"GlowEffectTransparency"_ustr; +inline constexpr OUString PROP_GraphicColorMode = u"GraphicColorMode"_ustr; +inline constexpr OUString PROP_GraphicCrop = u"GraphicCrop"_ustr; +inline constexpr OUString PROP_GraphicIsInverted = u"GraphicIsInverted"_ustr; +inline constexpr OUString PROP_GridBaseHeight = u"GridBaseHeight"_ustr; +inline constexpr OUString PROP_GridBaseWidth = u"GridBaseWidth"_ustr; +inline constexpr OUString PROP_GridColor = u"GridColor"_ustr; +inline constexpr OUString PROP_GridDisplay = u"GridDisplay"_ustr; +inline constexpr OUString PROP_GridLines = u"GridLines"_ustr; +inline constexpr OUString PROP_GridMode = u"GridMode"_ustr; +inline constexpr OUString PROP_GridPrint = u"GridPrint"_ustr; +inline constexpr OUString PROP_GridRubyHeight = u"GridRubyHeight"_ustr; +inline constexpr OUString PROP_GridSnapToChars = u"GridSnapToChars"_ustr; +inline constexpr OUString PROP_GroupBarsPerAxis = u"GroupBarsPerAxis"_ustr; +inline constexpr OUString PROP_GutterMargin = u"GutterMargin"_ustr; +inline constexpr OUString PROP_HBorder = u"HBorder"_ustr; +inline constexpr OUString PROP_HeaderBackColor = u"HeaderBackColor"_ustr; +inline constexpr OUString PROP_HeaderBackGraphic = u"HeaderBackGraphic"_ustr; +inline constexpr OUString PROP_HeaderBackGraphicFilter = u"HeaderBackGraphicFilter"_ustr; +inline constexpr OUString PROP_HeaderBackGraphicLocation = u"HeaderBackGraphicLocation"_ustr; +inline constexpr OUString PROP_HeaderBackTransparent = u"HeaderBackTransparent"_ustr; +inline constexpr OUString PROP_HeaderBodyDistance = u"HeaderBodyDistance"_ustr; +inline constexpr OUString PROP_HeaderBottomBorder = u"HeaderBottomBorder"_ustr; +inline constexpr OUString PROP_HeaderBottomBorderDistance = u"HeaderBottomBorderDistance"_ustr; +inline constexpr OUString PROP_HeaderDynamicSpacing = u"HeaderDynamicSpacing"_ustr; +inline constexpr OUString PROP_HeaderFillBackground = u"HeaderFillBackground"_ustr; +inline constexpr OUString PROP_HeaderFillBitmapLogicalSize = u"HeaderFillBitmapLogicalSize"_ustr; +inline constexpr OUString PROP_HeaderFillBitmapMode = u"HeaderFillBitmapMode"_ustr; +inline constexpr OUString PROP_HeaderFillBitmapName = u"HeaderFillBitmapName"_ustr; +inline constexpr OUString PROP_HeaderFillBitmapOffsetX = u"HeaderFillBitmapOffsetX"_ustr; +inline constexpr OUString PROP_HeaderFillBitmapOffsetY = u"HeaderFillBitmapOffsetY"_ustr; +inline constexpr OUString PROP_HeaderFillBitmapPositionOffsetX + = u"HeaderFillBitmapPositionOffsetX"_ustr; +inline constexpr OUString PROP_HeaderFillBitmapPositionOffsetY + = u"HeaderFillBitmapPositionOffsetY"_ustr; +inline constexpr OUString PROP_HeaderFillBitmapRectanglePoint + = u"HeaderFillBitmapRectanglePoint"_ustr; +inline constexpr OUString PROP_HeaderFillBitmapSizeX = u"HeaderFillBitmapSizeX"_ustr; +inline constexpr OUString PROP_HeaderFillBitmapSizeY = u"HeaderFillBitmapSizeY"_ustr; +inline constexpr OUString PROP_HeaderFillColor = u"HeaderFillColor"_ustr; +inline constexpr OUString PROP_HeaderFillColor2 = u"HeaderFillColor2"_ustr; +inline constexpr OUString PROP_HeaderFillGradientName = u"HeaderFillGradientName"_ustr; +inline constexpr OUString PROP_HeaderFillGradientStepCount = u"HeaderFillGradientStepCount"_ustr; +inline constexpr OUString PROP_HeaderFillHatchName = u"HeaderFillHatchName"_ustr; +inline constexpr OUString PROP_HeaderFillStyle = u"HeaderFillStyle"_ustr; +inline constexpr OUString PROP_HeaderFillTransparence = u"HeaderFillTransparence"_ustr; +inline constexpr OUString PROP_HeaderFillTransparenceGradientName + = u"HeaderFillTransparenceGradientName"_ustr; +inline constexpr OUString PROP_HeaderHeight = u"HeaderHeight"_ustr; +inline constexpr OUString PROP_HeaderIsDynamicHeight = u"HeaderIsDynamicHeight"_ustr; +inline constexpr OUString PROP_HeaderLeftBorder = u"HeaderLeftBorder"_ustr; +inline constexpr OUString PROP_HeaderLeftBorderDistance = u"HeaderLeftBorderDistance"_ustr; +inline constexpr OUString PROP_HeaderLeftMargin = u"HeaderLeftMargin"_ustr; +inline constexpr OUString PROP_HeaderRightBorder = u"HeaderRightBorder"_ustr; +inline constexpr OUString PROP_HeaderRightBorderDistance = u"HeaderRightBorderDistance"_ustr; +inline constexpr OUString PROP_HeaderRightMargin = u"HeaderRightMargin"_ustr; +inline constexpr OUString PROP_HeaderShadowFormat = u"HeaderShadowFormat"_ustr; +inline constexpr OUString PROP_HeaderTopBorder = u"HeaderTopBorder"_ustr; +inline constexpr OUString PROP_HeaderTopBorderDistance = u"HeaderTopBorderDistance"_ustr; +inline constexpr OUString PROP_Height = u"Height"_ustr; +inline constexpr OUString PROP_HelpMarks = u"HelpMarks"_ustr; +inline constexpr OUString PROP_HighResDuration = u"HighResDuration"_ustr; +inline constexpr OUString PROP_HoriMirroredOnEvenPages = u"HoriMirroredOnEvenPages"_ustr; +inline constexpr OUString PROP_HoriMirroredOnOddPages = u"HoriMirroredOnOddPages"_ustr; +inline constexpr OUString PROP_HoriOrient = u"HoriOrient"_ustr; +inline constexpr OUString PROP_HoriOrientPosition = u"HoriOrientPosition"_ustr; +inline constexpr OUString PROP_HoriOrientRelation = u"HoriOrientRelation"_ustr; +inline constexpr OUString PROP_HyperLinkURL = u"HyperLinkURL"_ustr; +inline constexpr OUString PROP_ImageScaleMode = u"ImageScaleMode"_ustr; +inline constexpr OUString PROP_IncludeHiddenCells = u"IncludeHiddenCells"_ustr; +inline constexpr OUString PROP_InterceptValue = u"InterceptValue"_ustr; +inline constexpr OUString PROP_IsBackgroundObjectsVisible = u"IsBackgroundObjectsVisible"_ustr; +inline constexpr OUString PROP_IsBackgroundVisible = u"IsBackgroundVisible"_ustr; +inline constexpr OUString PROP_IsDateTimeVisible = u"IsDateTimeVisible"_ustr; +inline constexpr OUString PROP_IsFollowingTextFlow = u"IsFollowingTextFlow"_ustr; +inline constexpr OUString PROP_IsFooterVisible = u"IsFooterVisible"_ustr; +inline constexpr OUString PROP_IsHeaderVisible = u"IsHeaderVisible"_ustr; +inline constexpr OUString PROP_IsInternal = u"IsInternal"_ustr; +inline constexpr OUString PROP_IsLandscape = u"IsLandscape"_ustr; +inline constexpr OUString PROP_IsMirrored = u"IsMirrored"_ustr; +inline constexpr OUString PROP_IsPageNumberVisible = u"IsPageNumberVisible"_ustr; +inline constexpr OUString PROP_IsSplitAllowed = u"IsSplitAllowed"_ustr; +inline constexpr OUString PROP_Keys = u"Keys"_ustr; +inline constexpr OUString PROP_LabelBorderColor = u"LabelBorderColor"_ustr; +inline constexpr OUString PROP_LabelBorderStyle = u"LabelBorderStyle"_ustr; +inline constexpr OUString PROP_LabelBorderTransparency = u"LabelBorderTransparency"_ustr; +inline constexpr OUString PROP_LabelBorderWidth = u"LabelBorderWidth"_ustr; +inline constexpr OUString PROP_LabelFillBackground = u"LabelFillBackground"_ustr; +inline constexpr OUString PROP_LabelFillColor = u"LabelFillColor"_ustr; +inline constexpr OUString PROP_LabelFillHatchName = u"LabelFillHatchName"_ustr; +inline constexpr OUString PROP_LabelFillStyle = u"LabelFillStyle"_ustr; +inline constexpr OUString PROP_LabelPlacement = u"LabelPlacement"_ustr; +inline constexpr OUString PROP_LabelPosition = u"LabelPosition"_ustr; +inline constexpr OUString PROP_LabelSeparator = u"LabelSeparator"_ustr; +inline constexpr OUString PROP_LeftBorder = u"LeftBorder"_ustr; +inline constexpr OUString PROP_LeftBorderDistance = u"LeftBorderDistance"_ustr; +inline constexpr OUString PROP_LeftMargin = u"LeftMargin"_ustr; +inline constexpr OUString PROP_LineCap = u"LineCap"_ustr; +inline constexpr OUString PROP_LineColor = u"LineColor"_ustr; +inline constexpr OUString PROP_LineComplexColor = u"LineComplexColor"_ustr; +inline constexpr OUString PROP_LineDashName = u"LineDashName"_ustr; +inline constexpr OUString PROP_LineEndCenter = u"LineEndCenter"_ustr; +inline constexpr OUString PROP_LineEndName = u"LineEndName"_ustr; +inline constexpr OUString PROP_LineEndWidth = u"LineEndWidth"_ustr; +inline constexpr OUString PROP_LineJoint = u"LineJoint"_ustr; +inline constexpr OUString PROP_LineStartCenter = u"LineStartCenter"_ustr; +inline constexpr OUString PROP_LineStartName = u"LineStartName"_ustr; +inline constexpr OUString PROP_LineStartWidth = u"LineStartWidth"_ustr; +inline constexpr OUString PROP_LineStyle = u"LineStyle"_ustr; +inline constexpr OUString PROP_LineTransparence = u"LineTransparence"_ustr; +inline constexpr OUString PROP_LineWidth = u"LineWidth"_ustr; +inline constexpr OUString PROP_Lines = u"Lines"_ustr; +inline constexpr OUString PROP_LinkNumberFormatToSource = u"LinkNumberFormatToSource"_ustr; +inline constexpr OUString PROP_ListAutoFormat = u"ListAutoFormat"_ustr; +inline constexpr OUString PROP_Logarithmic = u"Logarithmic"_ustr; +inline constexpr OUString PROP_MajorOrigin = u"MajorOrigin"_ustr; +inline constexpr OUString PROP_MarkPosition = u"MarkPosition"_ustr; +inline constexpr OUString PROP_Marks = u"Marks"_ustr; +inline constexpr OUString PROP_Max = u"Max"_ustr; +inline constexpr OUString PROP_MeanValue = u"MeanValue"_ustr; +inline constexpr OUString PROP_MeasureBelowReferenceEdge = u"MeasureBelowReferenceEdge"_ustr; +inline constexpr OUString PROP_MeasureDecimalPlaces = u"MeasureDecimalPlaces"_ustr; +inline constexpr OUString PROP_MeasureHelpLine1Length = u"MeasureHelpLine1Length"_ustr; +inline constexpr OUString PROP_MeasureHelpLine2Length = u"MeasureHelpLine2Length"_ustr; +inline constexpr OUString PROP_MeasureHelpLineDistance = u"MeasureHelpLineDistance"_ustr; +inline constexpr OUString PROP_MeasureHelpLineOverhang = u"MeasureHelpLineOverhang"_ustr; +inline constexpr OUString PROP_MeasureLineDistance = u"MeasureLineDistance"_ustr; +inline constexpr OUString PROP_MeasureShowUnit = u"MeasureShowUnit"_ustr; +inline constexpr OUString PROP_MeasureTextHorizontalPosition + = u"MeasureTextHorizontalPosition"_ustr; +inline constexpr OUString PROP_MeasureTextRotate90 = u"MeasureTextRotate90"_ustr; +inline constexpr OUString PROP_MeasureTextVerticalPosition = u"MeasureTextVerticalPosition"_ustr; +inline constexpr OUString PROP_MeasureUnit = u"MeasureUnit"_ustr; +inline constexpr OUString PROP_Min = u"Min"_ustr; +inline constexpr OUString PROP_MinHeight = u"MinHeight"_ustr; +inline constexpr OUString PROP_MissingValueTreatment = u"MissingValueTreatment"_ustr; +inline constexpr OUString PROP_MoveProtect = u"MoveProtect"_ustr; +inline constexpr OUString PROP_MovingAveragePeriod = u"MovingAveragePeriod"_ustr; +inline constexpr OUString PROP_MovingAverageType = u"MovingAverageType"_ustr; +inline constexpr OUString PROP_NegativeError = u"NegativeError"_ustr; +inline constexpr OUString PROP_NumberFormat = u"NumberFormat"_ustr; +inline constexpr OUString PROP_NumberOfLines = u"NumberOfLines"_ustr; +inline constexpr OUString PROP_NumberingRules = u"NumberingRules"_ustr; +inline constexpr OUString PROP_NumberingStyleName = u"NumberingStyleName"_ustr; +inline constexpr OUString PROP_NumberingType = u"NumberingType"_ustr; +inline constexpr OUString PROP_Opaque = u"Opaque"_ustr; +inline constexpr OUString PROP_OptimalHeight = u"OptimalHeight"_ustr; +inline constexpr OUString PROP_OptimalWidth = u"OptimalWidth"_ustr; +inline constexpr OUString PROP_Origin = u"Origin"_ustr; +inline constexpr OUString PROP_Outline = u"Outline"_ustr; +inline constexpr OUString PROP_Overlap = u"Overlap"_ustr; +inline constexpr OUString PROP_PageDescName = u"PageDescName"_ustr; +inline constexpr OUString PROP_PageNumberOffset = u"PageNumberOffset"_ustr; +inline constexpr OUString PROP_PageScale = u"PageScale"_ustr; +inline constexpr OUString PROP_PageStyleLayout = u"PageStyleLayout"_ustr; +inline constexpr OUString PROP_PageToggle = u"PageToggle"_ustr; +inline constexpr OUString PROP_ParRsid = u"ParRsid"_ustr; +inline constexpr OUString PROP_ParaAdjust = u"ParaAdjust"_ustr; +inline constexpr OUString PROP_ParaBackColor = u"ParaBackColor"_ustr; +inline constexpr OUString PROP_ParaBackGraphic = u"ParaBackGraphic"_ustr; +inline constexpr OUString PROP_ParaBackGraphicFilter = u"ParaBackGraphicFilter"_ustr; +inline constexpr OUString PROP_ParaBackGraphicLocation = u"ParaBackGraphicLocation"_ustr; +inline constexpr OUString PROP_ParaBackTransparent = u"ParaBackTransparent"_ustr; +inline constexpr OUString PROP_ParaBottomMargin = u"ParaBottomMargin"_ustr; +inline constexpr OUString PROP_ParaBottomMarginRelative = u"ParaBottomMarginRelative"_ustr; +inline constexpr OUString PROP_ParaContextMargin = u"ParaContextMargin"_ustr; +inline constexpr OUString PROP_ParaExpandSingleWord = u"ParaExpandSingleWord"_ustr; +inline constexpr OUString PROP_ParaFirstLineIndent = u"ParaFirstLineIndent"_ustr; +inline constexpr OUString PROP_ParaFirstLineIndentRelative = u"ParaFirstLineIndentRelative"_ustr; +inline constexpr OUString PROP_ParaHyphenationMaxHyphens = u"ParaHyphenationMaxHyphens"_ustr; +inline constexpr OUString PROP_ParaHyphenationMaxLeadingChars + = u"ParaHyphenationMaxLeadingChars"_ustr; +inline constexpr OUString PROP_ParaHyphenationMaxTrailingChars + = u"ParaHyphenationMaxTrailingChars"_ustr; +inline constexpr OUString PROP_ParaHyphenationMinWordLength = u"ParaHyphenationMinWordLength"_ustr; +inline constexpr OUString PROP_ParaHyphenationNoCaps = u"ParaHyphenationNoCaps"_ustr; +inline constexpr OUString PROP_ParaHyphenationNoLastWord = u"ParaHyphenationNoLastWord"_ustr; +inline constexpr OUString PROP_ParaHyphenationZone = u"ParaHyphenationZone"_ustr; +inline constexpr OUString PROP_ParaIsAutoFirstLineIndent = u"ParaIsAutoFirstLineIndent"_ustr; +inline constexpr OUString PROP_ParaIsCharacterDistance = u"ParaIsCharacterDistance"_ustr; +inline constexpr OUString PROP_ParaIsConnectBorder = u"ParaIsConnectBorder"_ustr; +inline constexpr OUString PROP_ParaIsForbiddenRules = u"ParaIsForbiddenRules"_ustr; +inline constexpr OUString PROP_ParaIsHangingPunctuation = u"ParaIsHangingPunctuation"_ustr; +inline constexpr OUString PROP_ParaIsHyphenation = u"ParaIsHyphenation"_ustr; +inline constexpr OUString PROP_ParaKeepTogether = u"ParaKeepTogether"_ustr; +inline constexpr OUString PROP_ParaLastLineAdjust = u"ParaLastLineAdjust"_ustr; +inline constexpr OUString PROP_ParaLeftMargin = u"ParaLeftMargin"_ustr; +inline constexpr OUString PROP_ParaLeftMarginRelative = u"ParaLeftMarginRelative"_ustr; +inline constexpr OUString PROP_ParaLineNumberCount = u"ParaLineNumberCount"_ustr; +inline constexpr OUString PROP_ParaLineNumberStartValue = u"ParaLineNumberStartValue"_ustr; +inline constexpr OUString PROP_ParaLineSpacing = u"ParaLineSpacing"_ustr; +inline constexpr OUString PROP_ParaOrphans = u"ParaOrphans"_ustr; +inline constexpr OUString PROP_ParaRegisterModeActive = u"ParaRegisterModeActive"_ustr; +inline constexpr OUString PROP_ParaRightMargin = u"ParaRightMargin"_ustr; +inline constexpr OUString PROP_ParaRightMarginRelative = u"ParaRightMarginRelative"_ustr; +inline constexpr OUString PROP_ParaShadowFormat = u"ParaShadowFormat"_ustr; +inline constexpr OUString PROP_ParaSplit = u"ParaSplit"_ustr; +inline constexpr OUString PROP_ParaTabStops = u"ParaTabStops"_ustr; +inline constexpr OUString PROP_ParaTabStopDefaultDistance = u"ParaTabStopDefaultDistance"_ustr; +inline constexpr OUString PROP_ParaTopMargin = u"ParaTopMargin"_ustr; +inline constexpr OUString PROP_ParaTopMarginRelative = u"ParaTopMarginRelative"_ustr; +inline constexpr OUString PROP_ParaUserDefinedAttributes = u"ParaUserDefinedAttributes"_ustr; +inline constexpr OUString PROP_ParaVertAlignment = u"ParaVertAlignment"_ustr; +inline constexpr OUString PROP_ParaWidows = u"ParaWidows"_ustr; +inline constexpr OUString PROP_Percent = u"Percent"_ustr; +inline constexpr OUString PROP_PercentageError = u"PercentageError"_ustr; +inline constexpr OUString PROP_PercentageNumberFormat = u"PercentageNumberFormat"_ustr; +inline constexpr OUString PROP_PolynomialDegree = u"PolynomialDegree"_ustr; +inline constexpr OUString PROP_PositionProtected = u"PositionProtected"_ustr; +inline constexpr OUString PROP_PositiveError = u"PositiveError"_ustr; +inline constexpr OUString PROP_Print = u"Print"_ustr; +inline constexpr OUString PROP_PrintAnnotations = u"PrintAnnotations"_ustr; +inline constexpr OUString PROP_PrintCharts = u"PrintCharts"_ustr; +inline constexpr OUString PROP_PrintDownFirst = u"PrintDownFirst"_ustr; +inline constexpr OUString PROP_PrintDrawing = u"PrintDrawing"_ustr; +inline constexpr OUString PROP_PrintFormulas = u"PrintFormulas"_ustr; +inline constexpr OUString PROP_PrintGrid = u"PrintGrid"_ustr; +inline constexpr OUString PROP_PrintHeaders = u"PrintHeaders"_ustr; +inline constexpr OUString PROP_PrintObjects = u"PrintObjects"_ustr; +inline constexpr OUString PROP_PrintZeroValues = u"PrintZeroValues"_ustr; +inline constexpr OUString PROP_PrinterPaperTray = u"PrinterPaperTray"_ustr; +inline constexpr OUString PROP_RegisterModeActive = u"RegisterModeActive"_ustr; +inline constexpr OUString PROP_RegisterParagraphStyle = u"RegisterParagraphStyle"_ustr; +inline constexpr OUString PROP_RegressionType = u"RegressionType"_ustr; +inline constexpr OUString PROP_RelativeHeight = u"RelativeHeight"_ustr; +inline constexpr OUString PROP_RelativeHeightRelation = u"RelativeHeightRelation"_ustr; +inline constexpr OUString PROP_RelativeWidth = u"RelativeWidth"_ustr; +inline constexpr OUString PROP_RelativeWidthRelation = u"RelativeWidthRelation"_ustr; +inline constexpr OUString PROP_ReverseDirection = u"ReverseDirection"_ustr; +inline constexpr OUString PROP_RightAngledAxes = u"RightAngledAxes"_ustr; +inline constexpr OUString PROP_RightBorder = u"RightBorder"_ustr; +inline constexpr OUString PROP_RightBorderDistance = u"RightBorderDistance"_ustr; +inline constexpr OUString PROP_RightMargin = u"RightMargin"_ustr; +inline constexpr OUString PROP_RotateAngle = u"RotateAngle"_ustr; +inline constexpr OUString PROP_Rsid = u"Rsid"_ustr; +inline constexpr OUString PROP_RtlGutter = u"RtlGutter"_ustr; +inline constexpr OUString PROP_RubyAdjust = u"RubyAdjust"_ustr; +inline constexpr OUString PROP_RubyBelow = u"RubyBelow"_ustr; +inline constexpr OUString PROP_RubyIsAbove = u"RubyIsAbove"_ustr; +inline constexpr OUString PROP_RubyPosition = u"RubyPosition"_ustr; +inline constexpr OUString PROP_ScaleText = u"ScaleText"_ustr; +inline constexpr OUString PROP_ScaleToPages = u"ScaleToPages"_ustr; +inline constexpr OUString PROP_ScaleToPagesX = u"ScaleToPagesX"_ustr; +inline constexpr OUString PROP_ScaleToPagesY = u"ScaleToPagesY"_ustr; +inline constexpr OUString PROP_SectionLeftMargin = u"SectionLeftMargin"_ustr; +inline constexpr OUString PROP_SectionRightMargin = u"SectionRightMargin"_ustr; +inline constexpr OUString PROP_SegmentOffset = u"SegmentOffset"_ustr; +inline constexpr OUString PROP_Shadow = u"Shadow"_ustr; +inline constexpr OUString PROP_ShadowBlur = u"ShadowBlur"_ustr; +inline constexpr OUString PROP_ShadowColor = u"ShadowColor"_ustr; +inline constexpr OUString PROP_ShadowFormat = u"ShadowFormat"_ustr; +inline constexpr OUString PROP_ShadowTransparence = u"ShadowTransparence"_ustr; +inline constexpr OUString PROP_ShadowXDistance = u"ShadowXDistance"_ustr; +inline constexpr OUString PROP_ShadowYDistance = u"ShadowYDistance"_ustr; +inline constexpr OUString PROP_ShowCustomLeaderLines = u"ShowCustomLeaderLines"_ustr; +inline constexpr OUString PROP_ShowNegativeError = u"ShowNegativeError"_ustr; +inline constexpr OUString PROP_ShowPositiveError = u"ShowPositiveError"_ustr; +inline constexpr OUString PROP_SizeProtect = u"SizeProtect"_ustr; +inline constexpr OUString PROP_SizeProtected = u"SizeProtected"_ustr; +inline constexpr OUString PROP_SizeType = u"SizeType"_ustr; +inline constexpr OUString PROP_SnapToGrid = u"SnapToGrid"_ustr; +inline constexpr OUString PROP_SoftEdgeRadius = u"SoftEdgeRadius"_ustr; +inline constexpr OUString PROP_SolidType = u"SolidType"_ustr; +inline constexpr OUString PROP_SortByXValues = u"SortByXValues"_ustr; +inline constexpr OUString PROP_Sound = u"Sound"_ustr; +inline constexpr OUString PROP_Speed = u"Speed"_ustr; +inline constexpr OUString PROP_SplineOrder = u"SplineOrder"_ustr; +inline constexpr OUString PROP_SplineResolution = u"SplineResolution"_ustr; +inline constexpr OUString PROP_SplineType = u"SplineType"_ustr; +inline constexpr OUString PROP_Stacked = u"Stacked"_ustr; +inline constexpr OUString PROP_StackedBarsConnected = u"StackedBarsConnected"_ustr; +inline constexpr OUString PROP_StackedText = u"StackedText"_ustr; +inline constexpr OUString PROP_StandardPageMode = u"StandardPageMode"_ustr; +inline constexpr OUString PROP_StartingAngle = u"StartingAngle"_ustr; +inline constexpr OUString PROP_StepHelpCount = u"StepHelpCount"_ustr; +inline constexpr OUString PROP_StepMain = u"StepMain"_ustr; +inline constexpr OUString PROP_SurroundAnchorOnly = u"SurroundAnchorOnly"_ustr; +inline constexpr OUString PROP_SurroundContour = u"SurroundContour"_ustr; +inline constexpr OUString PROP_SymbolBitmap = u"SymbolBitmap"_ustr; +inline constexpr OUString PROP_SymbolColor = u"SymbolColor"_ustr; +inline constexpr OUString PROP_SymbolSize = u"SymbolSize"_ustr; +inline constexpr OUString PROP_SymbolType = u"SymbolType"_ustr; +inline constexpr OUString PROP_TabStopDistance = u"TabStopDistance"_ustr; +inline constexpr OUString PROP_TextAnimationAmount = u"TextAnimationAmount"_ustr; +inline constexpr OUString PROP_TextAnimationCount = u"TextAnimationCount"_ustr; +inline constexpr OUString PROP_TextAnimationDelay = u"TextAnimationDelay"_ustr; +inline constexpr OUString PROP_TextAnimationDirection = u"TextAnimationDirection"_ustr; +inline constexpr OUString PROP_TextAnimationKind = u"TextAnimationKind"_ustr; +inline constexpr OUString PROP_TextAnimationStartInside = u"TextAnimationStartInside"_ustr; +inline constexpr OUString PROP_TextAnimationStopInside = u"TextAnimationStopInside"_ustr; +inline constexpr OUString PROP_TextAutoGrowHeight = u"TextAutoGrowHeight"_ustr; +inline constexpr OUString PROP_TextAutoGrowWidth = u"TextAutoGrowWidth"_ustr; +inline constexpr OUString PROP_TextBreak = u"TextBreak"_ustr; +inline constexpr OUString PROP_TextCanOverlap = u"TextCanOverlap"_ustr; +inline constexpr OUString PROP_TextChainNextName = u"TextChainNextName"_ustr; +inline constexpr OUString PROP_TextClipVerticalOverflow = u"TextClipVerticalOverflow"_ustr; +inline constexpr OUString PROP_TextColor = u"TextColor"_ustr; +inline constexpr OUString PROP_TextColumns = u"TextColumns"_ustr; +inline constexpr OUString PROP_TextContourFrame = u"TextContourFrame"_ustr; +inline constexpr OUString PROP_TextFitToSize = u"TextFitToSize"_ustr; +inline constexpr OUString PROP_TextHorizontalAdjust = u"TextHorizontalAdjust"_ustr; +inline constexpr OUString PROP_TextLeftDistance = u"TextLeftDistance"_ustr; +inline constexpr OUString PROP_TextLineColor = u"TextLineColor"_ustr; +inline constexpr OUString PROP_TextLowerDistance = u"TextLowerDistance"_ustr; +inline constexpr OUString PROP_TextMaximumFrameHeight = u"TextMaximumFrameHeight"_ustr; +inline constexpr OUString PROP_TextMaximumFrameWidth = u"TextMaximumFrameWidth"_ustr; +inline constexpr OUString PROP_TextMinimumFrameHeight = u"TextMinimumFrameHeight"_ustr; +inline constexpr OUString PROP_TextMinimumFrameWidth = u"TextMinimumFrameWidth"_ustr; +inline constexpr OUString PROP_TextRightDistance = u"TextRightDistance"_ustr; +inline constexpr OUString PROP_TextRotation = u"TextRotation"_ustr; +inline constexpr OUString PROP_TextUpperDistance = u"TextUpperDistance"_ustr; +inline constexpr OUString PROP_TextUserDefinedAttributes = u"TextUserDefinedAttributes"_ustr; +inline constexpr OUString PROP_TextVerticalAdjust = u"TextVerticalAdjust"_ustr; +inline constexpr OUString PROP_TextWordWrap = u"TextWordWrap"_ustr; +inline constexpr OUString PROP_TextWrap = u"TextWrap"_ustr; +inline constexpr OUString PROP_TextWritingMode = u"TextWritingMode"_ustr; +inline constexpr OUString PROP_TopBorder = u"TopBorder"_ustr; +inline constexpr OUString PROP_TopBorderDistance = u"TopBorderDistance"_ustr; +inline constexpr OUString PROP_TopMargin = u"TopMargin"_ustr; +inline constexpr OUString PROP_TransitionDirection = u"TransitionDirection"_ustr; +inline constexpr OUString PROP_TransitionFadeColor = u"TransitionFadeColor"_ustr; +inline constexpr OUString PROP_TransitionSubtype = u"TransitionSubtype"_ustr; +inline constexpr OUString PROP_TransitionType = u"TransitionType"_ustr; +inline constexpr OUString PROP_Transparency = u"Transparency"_ustr; +inline constexpr OUString PROP_TryStaggeringFirst = u"TryStaggeringFirst"_ustr; +inline constexpr OUString PROP_UpDown = u"UpDown"_ustr; +inline constexpr OUString PROP_UseBandingColumnStyle = u"UseBandingColumnStyle"_ustr; +inline constexpr OUString PROP_UseBandingRowStyle = u"UseBandingRowStyle"_ustr; +inline constexpr OUString PROP_UseFirstColumnStyle = u"UseFirstColumnStyle"_ustr; +inline constexpr OUString PROP_UseFirstRowStyle = u"UseFirstRowStyle"_ustr; +inline constexpr OUString PROP_UseLastColumnStyle = u"UseLastColumnStyle"_ustr; +inline constexpr OUString PROP_UseLastRowStyle = u"UseLastRowStyle"_ustr; +inline constexpr OUString PROP_UserDefinedAttributes = u"UserDefinedAttributes"_ustr; +inline constexpr OUString PROP_VBorder = u"VBorder"_ustr; +inline constexpr OUString PROP_VertMirrored = u"VertMirrored"_ustr; +inline constexpr OUString PROP_VertOrient = u"VertOrient"_ustr; +inline constexpr OUString PROP_VertOrientPosition = u"VertOrientPosition"_ustr; +inline constexpr OUString PROP_VertOrientRelation = u"VertOrientRelation"_ustr; +inline constexpr OUString PROP_Vertical = u"Vertical"_ustr; +inline constexpr OUString PROP_Visible = u"Visible"_ustr; +inline constexpr OUString PROP_VisibleArea = u"VisibleArea"_ustr; +inline constexpr OUString PROP_Volume = u"Volume"_ustr; +inline constexpr OUString PROP_Weight = u"Weight"_ustr; +inline constexpr OUString PROP_Width = u"Width"_ustr; +inline constexpr OUString PROP_WidthType = u"WidthType"_ustr; +inline constexpr OUString PROP_WrapInfluenceOnPosition = u"WrapInfluenceOnPosition"_ustr; +inline constexpr OUString PROP_WrapTextAtFlyStart = u"WrapTextAtFlyStart"_ustr; +inline constexpr OUString PROP_WritingMode = u"WritingMode"_ustr; +inline constexpr OUString PROP_XName = u"XName"_ustr; +inline constexpr OUString PROP_YName = u"YName"_ustr; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/xmloff/inc/xmlsdtypes.hxx b/xmloff/inc/xmlsdtypes.hxx new file mode 100644 index 0000000000..c6e0ad315e --- /dev/null +++ b/xmloff/inc/xmlsdtypes.hxx @@ -0,0 +1,206 @@ +/* -*- 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 . + */ +#pragma once + +//#include <xmloff/xmlnume.hxx> +//#include <xmloff/maptype.hxx> +#include <xmloff/xmltypes.hxx> +//#include <xmloff/xmlement.hxx> +//#include <xmloff/prhdlfac.hxx> +//#include <xmloff/xmlprmap.hxx> +//#include "xmloff/XMLTextListAutoStylePool.hxx" +//#include <xmloff/xmlexppr.hxx> + +////////////////////////////////////////////////////////////////////////////// +// types of own properties + +#define XML_SD_TYPE_STROKE (XML_SD_TYPES_START + 0) +#define XML_SD_TYPE_PRESPAGE_TYPE (XML_SD_TYPES_START + 1) +#define XML_SD_TYPE_PRESPAGE_STYLE (XML_SD_TYPES_START + 2) +#define XML_SD_TYPE_PRESPAGE_SPEED (XML_SD_TYPES_START + 3) +#define XML_SD_TYPE_PRESPAGE_DURATION (XML_SD_TYPES_START + 4) +#define XML_SD_TYPE_PRESPAGE_VISIBILITY (XML_SD_TYPES_START + 5) +#define XML_SD_TYPE_MARKER (XML_SD_TYPES_START + 6 ) +#define XML_SD_TYPE_OPACITY (XML_SD_TYPES_START + 7 ) +#define XML_SD_TYPE_LINEJOIN (XML_SD_TYPES_START + 8 ) +#define XML_SD_TYPE_FILLSTYLE (XML_SD_TYPES_START + 9 ) +#define XML_SD_TYPE_GRADIENT (XML_SD_TYPES_START + 10 ) +#define XML_SD_TYPE_GRADIENT_STEPCOUNT (XML_SD_TYPES_START + 11 ) +#define XML_SD_TYPE_VISIBLE_HIDDEN (XML_SD_TYPES_START + 12 ) +#define XML_SD_TYPE_TEXT_CROSSEDOUT (XML_SD_TYPES_START + 13 ) +#define XML_SD_TYPE_NUMBULLET (XML_SD_TYPES_START + 14 ) +#define XML_SD_TYPE_WRITINGMODE (XML_SD_TYPES_START + 15 ) +#define XML_SD_TYPE_BITMAP_MODE (XML_SD_TYPES_START + 16 ) +#define XML_SD_TYPE_BITMAPREPOFFSETX (XML_SD_TYPES_START + 17 ) +#define XML_SD_TYPE_BITMAPREPOFFSETY (XML_SD_TYPES_START + 18 ) +#define XML_SD_TYPE_FILLBITMAPSIZE (XML_SD_TYPES_START + 19 ) +#define XML_SD_TYPE_LOGICAL_SIZE (XML_SD_TYPES_START + 20 ) +#define XML_SD_TYPE_BITMAP_REFPOINT (XML_SD_TYPES_START + 21 ) +#define XML_SD_TYPE_PRESPAGE_BACKSIZE (XML_SD_TYPES_START + 22 ) +#define XML_TYPE_TEXT_ANIMATION_BLINKING (XML_SD_TYPES_START + 23 ) +#define XML_TYPE_TEXT_ANIMATION_STEPS (XML_SD_TYPES_START + 24 ) +#define XML_SD_TYPE_TEXT_ALIGN (XML_SD_TYPES_START + 25 ) +#define XML_SD_TYPE_VERTICAL_ALIGN (XML_SD_TYPES_START + 26 ) +#define XML_SD_TYPE_FITTOSIZE (XML_SD_TYPES_START + 27 ) +#define XML_SD_TYPE_MEASURE_HALIGN (XML_SD_TYPES_START + 28 ) +#define XML_SD_TYPE_MEASURE_VALIGN (XML_SD_TYPES_START + 29 ) +#define XML_SD_TYPE_MEASURE_UNIT (XML_SD_TYPES_START + 30 ) +#define XML_SD_TYPE_MEASURE_PLACING (XML_SD_TYPES_START + 31 ) +#define XML_SD_TYPE_CONTROL_BORDER (XML_SD_TYPES_START + 32 ) +#define XML_SD_TYPE_CONTROL_BORDER_COLOR (XML_SD_TYPES_START + 33 ) +#define XML_SD_TYPE_IMAGE_SCALE_MODE (XML_SD_TYPES_START + 34 ) +#define XML_SD_TYPE_LINECAP (XML_SD_TYPES_START + 35 ) +#define XML_SD_TYPE_FITTOSIZE_AUTOFIT (XML_SD_TYPES_START + 36 ) + +////////////////////////////////////////////////////////////////////////////// +// 3D property types +#define XML_SD_TYPE_BACKFACE_CULLING (XML_SD_TYPES_START + 40 ) +#define XML_SD_TYPE_NORMALS_KIND (XML_SD_TYPES_START + 41 ) +#define XML_SD_TYPE_NORMALS_DIRECTION (XML_SD_TYPES_START + 42 ) +#define XML_SD_TYPE_TEX_GENERATION_MODE_X (XML_SD_TYPES_START + 43 ) +#define XML_SD_TYPE_TEX_GENERATION_MODE_Y (XML_SD_TYPES_START + 44 ) +#define XML_SD_TYPE_TEX_KIND (XML_SD_TYPES_START + 45 ) +#define XML_SD_TYPE_TEX_MODE (XML_SD_TYPES_START + 46 ) + +////////////////////////////////////////////////////////////////////////////// +// #FontWork# types +#define XML_SD_TYPE_FONTWORK_STYLE (XML_SD_TYPES_START + 47 ) +#define XML_SD_TYPE_FONTWORK_ADJUST (XML_SD_TYPES_START + 48 ) +#define XML_SD_TYPE_FONTWORK_SHADOW (XML_SD_TYPES_START + 49 ) +#define XML_SD_TYPE_FONTWORK_FORM (XML_SD_TYPES_START + 50 ) + +////////////////////////////////////////////////////////////////////////////// +// Caption types +#define XML_SD_TYPE_CAPTION_ANGLE_TYPE (XML_SD_TYPES_START + 60 ) +#define XML_SD_TYPE_CAPTION_IS_ESC_REL (XML_SD_TYPES_START + 61 ) +#define XML_SD_TYPE_CAPTION_ESC_REL (XML_SD_TYPES_START + 62 ) +#define XML_SD_TYPE_CAPTION_ESC_ABS (XML_SD_TYPES_START + 63 ) +#define XML_SD_TYPE_CAPTION_ESC_DIR (XML_SD_TYPES_START + 64 ) +#define XML_SD_TYPE_CAPTION_TYPE (XML_SD_TYPES_START + 65 ) + +////////////////////////////////////////////////////////////////////////////// +// header & footer types +#define XML_SD_TYPE_DATETIMEUPDATE (XML_SD_TYPES_START + 70 ) +#define XML_SD_TYPE_DATETIME_FORMAT (XML_SD_TYPES_START + 71 ) + +////////////////////////////////////////////////////////////////////////////// +// new types for merged style:protect attribute +#define XML_SD_TYPE_MOVE_PROTECT (XML_SD_TYPES_START + 72 ) +#define XML_SD_TYPE_SIZE_PROTECT (XML_SD_TYPES_START + 73 ) + +////////////////////////////////////////////////////////////////////////////// +// new type for style:mirror attribute +#define XML_TYPE_SD_MIRROR (XML_SD_TYPES_START + 74 ) + +////////////////////////////////////////////////////////////////////////////// +// new smil transition types for pages +#define XML_SD_TYPE_TRANSITION_TYPE (XML_SD_TYPES_START + 75 ) +#define XML_SD_TYPE_TRANSTIION_SUBTYPE (XML_SD_TYPES_START + 76 ) +#define XML_SD_TYPE_TRANSTIION_DIRECTION (XML_SD_TYPES_START + 77 ) +#define XML_SD_TYPE_HEADER_FOOTER_VISIBILITY_TYPE (XML_SD_TYPES_START + 78 ) + +////////////////////////////////////////////////////////////////////////////// + +#define XML_SD_TYPE_CELL_ROTATION_ANGLE (XML_SD_TYPES_START + 79 ) +#define XML_SD_TYPE_WRITINGMODE2 (XML_SD_TYPES_START + 80 ) + +#define CTF_NUMBERINGRULES 1000 +#define CTF_CONTROLWRITINGMODE 1001 +#define CTF_WRITINGMODE 1002 +#define CTF_REPEAT_OFFSET_X 1003 +#define CTF_REPEAT_OFFSET_Y 1004 +#define CTF_PAGE_SOUND_URL 1005 +#define CTF_PAGE_VISIBLE 1006 +#define CTF_PAGE_TRANS_TYPE 1007 +#define CTF_PAGE_TRANS_STYLE 1008 +#define CTF_PAGE_TRANS_SPEED 1009 +#define CTF_PAGE_TRANS_DURATION 1010 +#define CTF_PAGE_BACKSIZE 1011 +#define CTF_DASHNAME 1012 +#define CTF_LINESTARTNAME 1013 +#define CTF_LINEENDNAME 1014 +#define CTF_FILLGRADIENTNAME 1015 +#define CTF_FILLHATCHNAME 1016 +#define CTF_FILLBITMAPNAME 1017 +#define CTF_FILLTRANSNAME 1018 +#define CTF_TEXTANIMATION_BLINKING 1019 +#define CTF_TEXTANIMATION_KIND 1020 + +#define CTF_PAGE_TRANSITION_TYPE 1021 +#define CTF_PAGE_TRANSITION_SUBTYPE 1022 +#define CTF_PAGE_TRANSITION_DIRECTION 1023 +#define CTF_PAGE_TRANSITION_FADECOLOR 1024 + +////////////////////////////////////////////////////////////////////////////// +// #FontWork# +#define CTF_FONTWORK_STYLE 1021 +#define CTF_FONTWORK_ADJUST 1022 +#define CTF_FONTWORK_DISTANCE 1023 +#define CTF_FONTWORK_START 1024 +#define CTF_FONTWORK_MIRROR 1025 +#define CTF_FONTWORK_OUTLINE 1026 +#define CTF_FONTWORK_SHADOW 1027 +#define CTF_FONTWORK_SHADOWCOLOR 1028 +#define CTF_FONTWORK_SHADOWOFFSETX 1029 +#define CTF_FONTWORK_SHADOWOFFSETY 1030 +#define CTF_FONTWORK_FORM 1031 +#define CTF_FONTWORK_HIDEFORM 1032 +#define CTF_FONTWORK_SHADOWTRANSPARENCE 1033 + +////////////////////////////////////////////////////////////////////////////// +// OLE part 1 +#define CTF_SD_OLE_VIS_AREA_IMPORT_LEFT 1040 +#define CTF_SD_OLE_VIS_AREA_IMPORT_TOP 1041 +#define CTF_SD_OLE_VIS_AREA_IMPORT_WIDTH 1042 +#define CTF_SD_OLE_VIS_AREA_IMPORT_HEIGHT 1043 +#define CTF_SD_OLE_ISINTERNAL 1044 + +#define CTF_SD_MOVE_PROTECT 1045 +#define CTF_SD_SIZE_PROTECT 1046 + +////////////////////////////////////////////////////////////////////////////// +// caption +#define CTF_CAPTION_ISESCREL 1047 +#define CTF_CAPTION_ESCREL 1048 +#define CTF_CAPTION_ESCABS 1049 + +////////////////////////////////////////////////////////////////////////////// +// header&footer +#define CTF_HEADER_VISIBLE 1050 +#define CTF_FOOTER_VISIBLE 1051 +#define CTF_PAGE_NUMBER_VISIBLE 1052 +#define CTF_DATE_TIME_VISIBLE 1053 +#define CTF_HEADER_TEXT 1054 +#define CTF_FOOTER_TEXT 1055 +#define CTF_DATE_TIME_TEXT 1056 +#define CTF_DATE_TIME_FORMAT 1057 +#define CTF_DATE_TIME_UPDATE 1058 + +////////////////////////////////////////////////////////////////////////////// +// OLE part 2 +#define CTF_SD_OLE_ASPECT 1059 +#define CTF_SD_OLE_VIS_AREA_EXPORT_LEFT 1060 +#define CTF_SD_OLE_VIS_AREA_EXPORT_TOP 1061 +#define CTF_SD_OLE_VIS_AREA_EXPORT_WIDTH 1062 +#define CTF_SD_OLE_VIS_AREA_EXPORT_HEIGHT 1063 + +////////////////////////////////////////////////////////////////////////////// +#define CTF_WRITINGMODE2 1064 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/xmltabe.hxx b/xmloff/inc/xmltabe.hxx new file mode 100644 index 0000000000..ad28e77147 --- /dev/null +++ b/xmloff/inc/xmltabe.hxx @@ -0,0 +1,47 @@ +/* -*- 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 . + */ + +#pragma once + +// prevent funny things like "#define sun 1" from the compiler +#include <sal/config.h> +#include <sal/types.h> + +class SvXMLExport; +namespace com::sun::star { + namespace style { struct TabStop; } + namespace uno { class Any; } +} + + +class SvxXMLTabStopExport final +{ + SvXMLExport& rExport; // for access to document handler + + void exportTabStop( const css::style::TabStop* pTabStop ); + +public: + + SvxXMLTabStopExport( SvXMLExport& rExport ); + + // core API + void Export( const css::uno::Any& rAny ); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/xmltabi.hxx b/xmloff/inc/xmltabi.hxx new file mode 100644 index 0000000000..e5ba010488 --- /dev/null +++ b/xmloff/inc/xmltabi.hxx @@ -0,0 +1,46 @@ +/* -*- 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 . + */ + +#pragma once + +#include <memory> + +#include <xmloff/XMLElementPropertyContext.hxx> + +class SvXMLImport; +class SvxXMLTabStopContext_Impl; + +class SvxXMLTabStopImportContext final : public XMLElementPropertyContext +{ +private: + std::vector<rtl::Reference<SvxXMLTabStopContext_Impl>> maTabStops; + +public: + SvxXMLTabStopImportContext(SvXMLImport& rImport, sal_Int32 nElement, + const XMLPropertyState& rProp, + ::std::vector<XMLPropertyState>& rProps); + + virtual css::uno::Reference<css::xml::sax::XFastContextHandler> SAL_CALL createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& AttrList) override; + + virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/xmlversion.hxx b/xmloff/inc/xmlversion.hxx new file mode 100644 index 0000000000..5039fc7d7c --- /dev/null +++ b/xmloff/inc/xmlversion.hxx @@ -0,0 +1,112 @@ +/* -*- 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 . + */ +#pragma once + +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/document/XDocumentRevisionListPersistence.hpp> +#include <com/sun/star/util/RevisionTag.hpp> +#include <com/sun/star/embed/XStorage.hpp> + +#include <cppuhelper/implbase.hxx> +#include <xmloff/xmlictxt.hxx> +#include <xmloff/xmlexp.hxx> +#include <xmloff/xmlimp.hxx> +#include <xmloff/xmltoken.hxx> + +class XMLVersionListExport final : public SvXMLExport +{ +private: + const css::uno::Sequence < css::util::RevisionTag >& maVersions; +public: + XMLVersionListExport( + const css::uno::Reference< css::uno::XComponentContext >& rContext, + const css::uno::Sequence < css::util::RevisionTag >& rVersions, + const OUString &rFileName, + css::uno::Reference< css::xml::sax::XDocumentHandler > const &rHandler ); + + ErrCode exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ) override; + void ExportAutoStyles_() override {} + void ExportMasterStyles_ () override {} + void ExportContent_() override {} +}; + +class XMLVersionListImport final : public SvXMLImport +{ +private: + css::uno::Sequence < css::util::RevisionTag >& maVersions; + + virtual SvXMLImportContext *CreateFastContext( sal_Int32 Element, + const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& xAttrList ) override; + +public: + + XMLVersionListImport( + const css::uno::Reference< css::uno::XComponentContext >& rContext, + css::uno::Sequence < css::util::RevisionTag >& rVersions ); + virtual ~XMLVersionListImport() noexcept override; + + css::uno::Sequence < css::util::RevisionTag >& + GetList() { return maVersions; } +}; + +class XMLVersionListContext final : public SvXMLImportContext +{ +private: + XMLVersionListImport & GetImport() { return static_cast<XMLVersionListImport&>(SvXMLImportContext::GetImport()); } + +public: + + XMLVersionListContext( XMLVersionListImport& rImport ); + + virtual ~XMLVersionListContext() override; + + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL + createFastChildContext(sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttribs) override; +}; + +class XMLVersionContext final : public SvXMLImportContext +{ +private: + static bool ParseISODateTimeString( + std::u16string_view rString, + css::util::DateTime& rDateTime ); + +public: + + XMLVersionContext( XMLVersionListImport& rImport, + const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ); + + virtual ~XMLVersionContext() override; +}; + +class XMLVersionListPersistence final : public ::cppu::WeakImplHelper< css::document::XDocumentRevisionListPersistence, css::lang::XServiceInfo > +{ +public: + virtual css::uno::Sequence< css::util::RevisionTag > SAL_CALL load( const css::uno::Reference< css::embed::XStorage >& Storage ) override; + virtual void SAL_CALL store( const css::uno::Reference< css::embed::XStorage >& Storage, const css::uno::Sequence< css::util::RevisionTag >& List ) override; + + OUString SAL_CALL getImplementationName() override; + + sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override; + + css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |