xref: /aoo42x/main/sw/source/filter/xml/xmlithlp.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SW_XMLITHLP_HXX
25 #define _SW_XMLITHLP_HXX
26 
27 #include <sal/types.h>
28 #include <xmloff/xmlement.hxx>
29 #include "hintids.hxx"  // for following include
30 #include <editeng/brshitem.hxx> // for SvxGraphicsPosition
31 
32 class SvxBorderLine;
33 struct SvXMLEnumMapEntry;
34 class SvXMLUnitConverter;
35 class Color;
36 namespace rtl { class OUString; }
37 
38 
39 
40 /** Define various helper variables and functions for xmlimpit.cxx and
41  * xmlexpit.cxx.  */
42 
43 
44 #define SVX_XML_BORDER_STYLE_NONE 0
45 #define SVX_XML_BORDER_STYLE_SOLID 1
46 #define SVX_XML_BORDER_STYLE_DOUBLE 2
47 
48 #define SVX_XML_BORDER_WIDTH_THIN 0
49 #define SVX_XML_BORDER_WIDTH_MIDDLE 1
50 #define SVX_XML_BORDER_WIDTH_THICK 2
51 
52 
53 sal_Bool lcl_frmitems_parseXMLBorder( const ::rtl::OUString& rValue,
54                                       const SvXMLUnitConverter& rUnitConverter,
55                                       sal_Bool& rHasStyle, sal_uInt16& rStyle,
56                                       sal_Bool& rHasWidth, sal_uInt16& rWidth,
57                                       sal_uInt16& rNamedWidth,
58                                       sal_Bool& rHasColor, Color& rColor );
59 
60 void lcl_frmitems_setXMLBorderWidth( SvxBorderLine& rLine,
61                                      sal_uInt16 nOutWidth, sal_uInt16 nInWidth,
62                                      sal_uInt16 nDistance );
63 
64 void lcl_frmitems_setXMLBorderWidth( SvxBorderLine& rLine,
65                                      sal_uInt16 nWidth, sal_Bool bDouble );
66 
67 sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
68                                     sal_Bool bHasStyle, sal_uInt16 nStyle,
69                                     sal_Bool bHasWidth, sal_uInt16 nWidth,
70                                     sal_uInt16 nNamedWidth,
71                                     sal_Bool bHasColor, const Color& rColor );
72 
73 void lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
74                                 sal_uInt16 nWidth, sal_uInt16 nOutWidth,
75                                 sal_uInt16 nInWidth, sal_uInt16 nDistance );
76 
77 void lcl_frmitems_MergeXMLHoriPos( SvxGraphicPosition& ePos,
78 								   SvxGraphicPosition eHori );
79 
80 void lcl_frmitems_MergeXMLVertPos( SvxGraphicPosition& ePos,
81 							  	   SvxGraphicPosition eVert );
82 
83 extern const sal_uInt16 aSBorderWidths[];
84 extern const sal_uInt16 aDBorderWidths[5*11];
85 
86 extern const struct SvXMLEnumMapEntry psXML_BorderStyles[];
87 extern const struct SvXMLEnumMapEntry psXML_NamedBorderWidths[];
88 extern const struct SvXMLEnumMapEntry psXML_BrushRepeat[];
89 extern const struct SvXMLEnumMapEntry psXML_BrushHoriPos[];
90 extern const struct SvXMLEnumMapEntry psXML_BrushVertPos[];
91 extern const struct SvXMLEnumMapEntry psXML_BreakType[];
92 extern const struct SvXMLEnumMapEntry aXMLTableAlignMap[];
93 extern const struct SvXMLEnumMapEntry aXMLTableVAlignMap[];
94 extern const struct SvXMLEnumMapEntry aXML_KeepTogetherType[];
95 
96 
97 #endif
98