1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlithlp.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SW_XMLITHLP_HXX
32 #define _SW_XMLITHLP_HXX
34 #include <sal/types.h>
35 #include <xmloff/xmlement.hxx>
36 #include "hintids.hxx" // for following include
37 #include <svx/brshitem.hxx> // for SvxGraphicsPosition
40 struct SvXMLEnumMapEntry
;
41 class SvXMLUnitConverter
;
43 namespace rtl
{ class OUString
; }
47 /** Define various helper variables and functions for xmlimpit.cxx and
51 #define SVX_XML_BORDER_STYLE_NONE 0
52 #define SVX_XML_BORDER_STYLE_SOLID 1
53 #define SVX_XML_BORDER_STYLE_DOUBLE 2
55 #define SVX_XML_BORDER_WIDTH_THIN 0
56 #define SVX_XML_BORDER_WIDTH_MIDDLE 1
57 #define SVX_XML_BORDER_WIDTH_THICK 2
60 sal_Bool
lcl_frmitems_parseXMLBorder( const ::rtl::OUString
& rValue
,
61 const SvXMLUnitConverter
& rUnitConverter
,
62 sal_Bool
& rHasStyle
, sal_uInt16
& rStyle
,
63 sal_Bool
& rHasWidth
, sal_uInt16
& rWidth
,
64 sal_uInt16
& rNamedWidth
,
65 sal_Bool
& rHasColor
, Color
& rColor
);
67 void lcl_frmitems_setXMLBorderWidth( SvxBorderLine
& rLine
,
68 sal_uInt16 nOutWidth
, sal_uInt16 nInWidth
,
69 sal_uInt16 nDistance
);
71 void lcl_frmitems_setXMLBorderWidth( SvxBorderLine
& rLine
,
72 sal_uInt16 nWidth
, sal_Bool bDouble
);
74 sal_Bool
lcl_frmitems_setXMLBorder( SvxBorderLine
*& rpLine
,
75 sal_Bool bHasStyle
, sal_uInt16 nStyle
,
76 sal_Bool bHasWidth
, sal_uInt16 nWidth
,
77 sal_uInt16 nNamedWidth
,
78 sal_Bool bHasColor
, const Color
& rColor
);
80 void lcl_frmitems_setXMLBorder( SvxBorderLine
*& rpLine
,
81 sal_uInt16 nWidth
, sal_uInt16 nOutWidth
,
82 sal_uInt16 nInWidth
, sal_uInt16 nDistance
);
84 void lcl_frmitems_MergeXMLHoriPos( SvxGraphicPosition
& ePos
,
85 SvxGraphicPosition eHori
);
87 void lcl_frmitems_MergeXMLVertPos( SvxGraphicPosition
& ePos
,
88 SvxGraphicPosition eVert
);
90 extern const sal_uInt16 aSBorderWidths
[];
91 extern const sal_uInt16 aDBorderWidths
[5*11];
93 extern const struct SvXMLEnumMapEntry psXML_BorderStyles
[];
94 extern const struct SvXMLEnumMapEntry psXML_NamedBorderWidths
[];
95 extern const struct SvXMLEnumMapEntry psXML_BrushRepeat
[];
96 extern const struct SvXMLEnumMapEntry psXML_BrushHoriPos
[];
97 extern const struct SvXMLEnumMapEntry psXML_BrushVertPos
[];
98 extern const struct SvXMLEnumMapEntry psXML_BreakType
[];
99 extern const struct SvXMLEnumMapEntry aXMLTableAlignMap
[];
100 extern const struct SvXMLEnumMapEntry aXMLTableVAlignMap
[];
101 extern const struct SvXMLEnumMapEntry aXML_KeepTogetherType
[];