Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 : : *
5 : : * The contents of this file are subject to the Mozilla Public License Version
6 : : * 1.1 (the "License"); you may not use this file except in compliance with
7 : : * the License or as specified alternatively below. You may obtain a copy of
8 : : * the License at http://www.mozilla.org/MPL/
9 : : *
10 : : * Software distributed under the License is distributed on an "AS IS" basis,
11 : : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : : * for the specific language governing rights and limitations under the
13 : : * License.
14 : : *
15 : : * Major Contributor(s):
16 : : * Copyright (C) 2012 Artur Dorda <artur.dorda+libo@gmail.com> (initial developer)
17 : : *
18 : : * All Rights Reserved.
19 : : *
20 : : * For minor contributions see the git repository.
21 : : *
22 : : * Alternatively, the contents of this file may be used under the terms of
23 : : * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 : : * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 : : * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 : : * instead of those above.
27 : : */
28 : :
29 : : #include <libxml/xmlwriter.h>
30 : :
31 : : #include <com/sun/star/beans/XPropertySet.hpp>
32 : : #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
33 : : #include <com/sun/star/drawing/Direction3D.hpp>
34 : : #include <com/sun/star/drawing/ShadeMode.hpp>
35 : : #include <com/sun/star/drawing/ProjectionMode.hpp>
36 : : #include <com/sun/star/drawing/Position3D.hpp>
37 : :
38 : : #include <com/sun/star/awt/Rectangle.hpp>
39 : : #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
40 : : #include <com/sun/star/beans/PropertyValue.hpp>
41 : : #include <com/sun/star/beans/PropertyValues.hpp>
42 : : #include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp>
43 : :
44 : : #include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
45 : : #include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
46 : : #include <com/sun/star/awt/Size.hpp>
47 : :
48 : : #include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
49 : :
50 : : #ifndef EnhancedShapeDumper_hxx
51 : : #define EnhancedShapeDumper_hxx
52 : :
53 : : class EnhancedShapeDumper
54 : : {
55 : : public:
56 : 0 : EnhancedShapeDumper(xmlTextWriterPtr writer)
57 : : :
58 : 0 : xmlWriter(writer)
59 : : {
60 : :
61 : 0 : }
62 : :
63 : : // auxiliary functions
64 : : void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair);
65 : : void dumpDirection3D(com::sun::star::drawing::Direction3D aDirection3D);
66 : : void dumpPropertyValueAsElement(com::sun::star::beans::PropertyValue aPropertyValue);
67 : : void dumpEnhancedCustomShapeParameter(com::sun::star::drawing::EnhancedCustomShapeParameter aParameter);
68 : :
69 : : // EnhancedCustomShapeExtrusion.idl
70 : : void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet);
71 : : void dumpExtrusionAsAttribute(sal_Bool bExtrusion);
72 : : void dumpBrightnessAsAttribute(double aBrightness);
73 : : void dumpDepthAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepth);
74 : : void dumpDiffusionAsAttribute(double aDiffusion);
75 : : void dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments);
76 : : void dumpLightFaceAsAttribute(sal_Bool bLightFace);
77 : : void dumpFirstLightHarshAsAttribute(sal_Bool bFirstLightHarsh);
78 : : void dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh);
79 : : void dumpFirstLightLevelAsAttribute(double aFirstLightLevel);
80 : : void dumpSecondLightLevelAsAttribute(double aSecondLightLevel);
81 : : void dumpFirstLightDirectionAsElement(com::sun::star::drawing::Direction3D aFirstLightDirection);
82 : : void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection);
83 : : void dumpMetalAsAttribute(sal_Bool bMetal);
84 : : void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode);
85 : : void dumpRotateAngleAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aRotateAngle);
86 : : void dumpRotationCenterAsElement(com::sun::star::drawing::Direction3D aRotationCenter);
87 : : void dumpShininessAsAttribute(double aShininess);
88 : : void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew);
89 : : void dumpSpecularityAsAttribute(double aSpecularity);
90 : : void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode);
91 : : void dumpViewPointAsElement(com::sun::star::drawing::Position3D aViewPoint);
92 : : void dumpOriginAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aOrigin);
93 : : void dumpExtrusionColorAsAttribute(sal_Bool bExtrusionColor);
94 : :
95 : : // EnhancedCustomShapeGeometry.idl
96 : : void dumpEnhancedCustomShapeGeometryService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet);
97 : : void dumpTypeAsAttribute(rtl::OUString sType);
98 : : void dumpViewBoxAsElement(com::sun::star::awt::Rectangle aViewBox);
99 : : void dumpMirroredXAsAttribute(sal_Bool bMirroredX); // also used in EnhancedCustomShapeHandle
100 : : void dumpMirroredYAsAttribute(sal_Bool bMirroredY); // also used in EnhancedCustomShapeHandle
101 : : void dumpTextRotateAngleAsAttribute(double aTextRotateAngle);
102 : : void dumpAdjustmentValuesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues);
103 : : void dumpExtrusionAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aExtrusion);
104 : : void dumpPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aPath);
105 : : void dumpTextPathAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aTextPath);
106 : : void dumpEquationsAsElement(com::sun::star::uno::Sequence< rtl::OUString > aEquations);
107 : : void dumpHandlesAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValues > aHandles);
108 : :
109 : : // EnhancedCustomShapeHandle.idl
110 : : void dumpEnhancedCustomShapeHandleService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet);
111 : : void dumpSwitchedAsAttribute(sal_Bool bSwitched);
112 : : void dumpPositionAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aPosition);
113 : : void dumpPolarAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aPolar);
114 : : void dumpRefXAsAttribute(sal_Int32 aRefX);
115 : : void dumpRefYAsAttribute(sal_Int32 aRefY);
116 : : void dumpRefAngleAsAttribute(sal_Int32 aRefAngle);
117 : : void dumpRefRAsAttribute(sal_Int32 aRefR);
118 : : void dumpRangeXMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMinimum);
119 : : void dumpRangeXMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum);
120 : : void dumpRangeYMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeYMinimum);
121 : : void dumpRangeYMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum);
122 : : void dumpRadiusRangeMinimumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum);
123 : : void dumpRadiusRangeMaximumAsElement(com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum);
124 : :
125 : : // EnhancedCustomShapePath.idl
126 : : void dumpEnhancedCustomShapePathService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet);
127 : : void dumpCoordinatesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates);
128 : : void dumpSegmentsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments);
129 : : void dumpStretchXAsAttribute(sal_Int32 aStretchX);
130 : : void dumpStretchYAsAttribute(sal_Int32 aStretchY);
131 : : void dumpTextFramesAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrames);
132 : : void dumpGluePointsAsElement(com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints);
133 : : void dumpGluePointLeavingDirectionsAsElement(com::sun::star::uno::Sequence< double > aGluePointLeavingDirections);
134 : : void dumpGluePointTypeAsAttribute(sal_Int32 aGluePointType);
135 : : void dumpExtrusionAllowedAsAttribute(sal_Bool bExtrusionAllowed);
136 : : void dumpConcentricGradientFillAllowedAsAttribute(sal_Bool bConcentricGradientFillAllowed);
137 : : void dumpTextPathAllowedAsAttribute(sal_Bool bTextPathAllowed);
138 : : void dumpSubViewSizeAsElement(com::sun::star::uno::Sequence< com::sun::star::awt::Size > aSubViewSize);
139 : :
140 : : // EnhancedCustomShapePath.idl
141 : : void dumpEnhancedCustomShapeTextPathService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet);
142 : : void dumpTextPathAsAttribute(sal_Bool bTextPath);
143 : : void dumpTextPathModeAsAttribute(com::sun::star::drawing::EnhancedCustomShapeTextPathMode eTextPathMode);
144 : : void dumpScaleXAsAttribute(sal_Bool bScaleX);
145 : :
146 : : private:
147 : : xmlTextWriterPtr xmlWriter;
148 : : };
149 : : #endif
|