android: Update app-specific/MIME type icons
[LibreOffice.git] / sw / source / filter / xml / xmlitemm.cxx
bloba8de955916e994bbcb5c51f9196bff40ecb4a13a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <editeng/memberids.h>
21 #include <hintids.hxx>
22 #include <svx/unomid.hxx>
23 #include <xmloff/xmlnamespace.hxx>
24 #include "xmlitmap.hxx"
25 #include <xmloff/xmltoken.hxx>
26 #include <o3tl/safeint.hxx>
28 #include <unomid.h>
30 using namespace ::xmloff::token;
32 #define MAP_ENTRY( p, l, w, m ) \
33 { XML_NAMESPACE_##p, XML_##l, o3tl::narrowing<sal_uInt16>(w), m }
34 #define M_E_SI( p, l, w, m ) \
35 { XML_NAMESPACE_##p, XML_##l, o3tl::narrowing<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
36 #define M_E_SE( p, l, w, m ) \
37 { XML_NAMESPACE_##p, XML_##l, o3tl::narrowing<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_EXPORT|m }
38 #define M_E_SIE( p, l, w, m ) \
39 { XML_NAMESPACE_##p, XML_##l, o3tl::narrowing<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_EXPORT|MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
41 const SvXMLItemMapEntry aTableItemMap[] =
43 // RES_FILL_ORDER
44 // not required
45 // RES_FRM_SIZE
46 M_E_SE( STYLE, WIDTH, RES_FRM_SIZE, MID_FRMSIZE_WIDTH ),
47 M_E_SE( STYLE, REL_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_REL_WIDTH ),
48 // RES_PAPER_BIN
49 // not required
50 M_E_SE( FO, MARGIN, 0xFFFF/*invalid*/, MID_SW_FLAG_NO_ITEM_IMPORT),
51 M_E_SIE( FO, MARGIN_LEFT, RES_LR_SPACE, MID_L_MARGIN ),
52 M_E_SIE( FO, MARGIN_RIGHT, RES_LR_SPACE, MID_R_MARGIN ),
53 // RES_UL_SPACE
54 M_E_SI( FO, MARGIN_TOP, RES_UL_SPACE, MID_UP_MARGIN ),
55 M_E_SI( FO, MARGIN_BOTTOM, RES_UL_SPACE, MID_LO_MARGIN ),
56 // RES_PAGEDESC
57 MAP_ENTRY( STYLE, PAGE_NUMBER, RES_PAGEDESC, MID_PAGEDESC_PAGENUMOFFSET),
58 // RES_BREAK
59 MAP_ENTRY( FO, BREAK_BEFORE, RES_BREAK, MID_BREAK_BEFORE ),
60 MAP_ENTRY( FO, BREAK_AFTER, RES_BREAK, MID_BREAK_AFTER ),
61 // RES_CNTNT
62 // not required
63 // RES_HEADER
64 // not required
65 // RES_FOOTER
66 // not required
67 // RES_PRINT
68 // not required
69 // RES_OPAQUE
70 // not required
71 // RES_PROTECT
72 // not required
73 // RES_SURROUND
74 // not required
75 // RES_VERT_ORIENT
76 // not required
77 // RES_HORI_ORIENT
78 MAP_ENTRY( TABLE, ALIGN, RES_HORI_ORIENT, 0 ),
79 // RES_ANCHOR
80 // not required
81 // RES_BACKGROUND
82 MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
83 MAP_ENTRY( STYLE, BACKGROUND_IMAGE, RES_BACKGROUND, MID_SW_FLAG_ELEMENT_ITEM ),
84 // RES_BOX
85 // not required
86 // RES_SHADOW
87 MAP_ENTRY( STYLE, SHADOW, RES_SHADOW, 0 ),
88 // RES_FRMMACRO
89 // not required
90 // RES_COL
91 // not required
92 // RES_KEEP
93 MAP_ENTRY( FO, KEEP_WITH_NEXT, RES_KEEP, 0 ),
94 // RES_URL
95 // not required
96 // RES_EDIT_IN_READONLY
97 // not required
98 // RES_LAYOUT_SPLIT
99 MAP_ENTRY( STYLE, MAY_BREAK_BETWEEN_ROWS, RES_LAYOUT_SPLIT, 0 ),
100 // RES_CHAIN
101 // not required
102 // RES_LINENUMBER
103 // not required
104 // RES_FTN_AT_TXTEND
105 // not required
106 // RES_END_AT_TXTEND
107 // not required
108 // RES_UNKNOWNATR_CONTAINER
109 M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
111 // RES_FRAMEDIR
112 MAP_ENTRY( STYLE, WRITING_MODE, RES_FRAMEDIR, 0 ),
114 // RES_COLLAPSING_BORDERS
115 MAP_ENTRY( TABLE, BORDER_MODEL, RES_COLLAPSING_BORDERS, 0 )
117 const o3tl::span<SvXMLItemMapEntry const> aXMLTableItemMap(aTableItemMap);
119 const SvXMLItemMapEntry aTableColItemMap[] =
121 M_E_SI( STYLE, COLUMN_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_COL_WIDTH ),
122 MAP_ENTRY( STYLE, REL_COLUMN_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_REL_COL_WIDTH ),
124 const o3tl::span<SvXMLItemMapEntry const> aXMLTableColItemMap(aTableColItemMap);
126 const SvXMLItemMapEntry aTableRowItemMap[] =
128 // RES_FILL_ORDER
129 // not required
130 // RES_FRM_SIZE
131 MAP_ENTRY( STYLE, ROW_HEIGHT, RES_FRM_SIZE, MID_FRMSIZE_FIX_HEIGHT ),
132 MAP_ENTRY( STYLE, MIN_ROW_HEIGHT, RES_FRM_SIZE, MID_FRMSIZE_MIN_HEIGHT ),
133 // RES_PAPER_BIN
134 // not required
135 // RES_LR_SPACE
136 // not required
137 // RES_UL_SPACE
138 // not required
139 // RES_PAGEDESC
140 // not required
141 // RES_BREAK
142 // not required
143 // RES_CNTNT
144 // not required
145 // RES_HEADER
146 // not required
147 // RES_FOOTER
148 // not required
149 // RES_PRINT
150 // M_E_SE( STYLE, TEXT_CHANGES_ONLY, RES_PRINT, 0 ),
151 M_E_SE( LO_EXT, TEXT_CHANGES_ONLY, RES_PRINT, 0 ),
152 // RES_OPAQUE
153 // not required
154 // RES_PROTECT
155 // not required
156 // RES_SURROUND
157 // not required
158 // RES_VERT_ORIENT
159 // not required
160 // RES_HORI_ORIENT
161 // not required
162 // RES_ANCHOR
163 // not required
164 // RES_BACKGROUND
165 MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
166 MAP_ENTRY( STYLE, BACKGROUND_IMAGE, RES_BACKGROUND, MID_SW_FLAG_ELEMENT_ITEM ),
167 // RES_BOX
168 // not required
169 // RES_ANCHOR
170 // not required
171 // RES_SHADOW
172 // not required
173 // RES_FRMMACRO
174 // not required
175 // RES_COL
176 // not required
177 // RES_KEEP
178 // not required
179 // RES_URL
180 // not required
181 // RES_EDIT_IN_READONLY
182 // not required
183 // RES_LAYOUT_SPLIT
184 M_E_SE( STYLE, KEEP_TOGETHER, RES_ROW_SPLIT, 0 ),
185 M_E_SE( FO, KEEP_TOGETHER, RES_ROW_SPLIT, 0 ),
186 // RES_CHAIN
187 // not required
188 // RES_LINENUMBER
189 // not required
190 // RES_FTN_AT_TXTEND
191 // not required
192 // RES_END_AT_TXTEND
193 // not required
194 // RES_UNKNOWNATR_CONTAINER
195 M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 )
197 const o3tl::span<SvXMLItemMapEntry const> aXMLTableRowItemMap(aTableRowItemMap);
199 const SvXMLItemMapEntry aTableCellItemMap[] =
201 // RES_FILL_ORDER
202 // not required
203 // RES_FRM_SIZE
204 // not required
205 // RES_PAPER_BIN
206 // not required
207 // RES_LR_SPACE
208 // not required
209 // RES_UL_SPACE
210 // not required
211 // RES_PAGEDESC
212 // not required
213 // RES_BREAK
214 // not required
215 // RES_CNTNT
216 // not required
217 // RES_HEADER
218 // not required
219 // RES_FOOTER
220 // not required
221 // RES_PRINT
222 // M_E_SE( STYLE, TEXT_CHANGES_ONLY, RES_PRINT, 0 ),
223 M_E_SE( LO_EXT, TEXT_CHANGES_ONLY, RES_PRINT, 0 ),
224 // RES_OPAQUE
225 // not required
226 // RES_PROTECT
227 // not required
228 // RES_SURROUND
229 // not required
230 // RES_VERT_ORIENT
231 MAP_ENTRY( STYLE, VERTICAL_ALIGN, RES_VERT_ORIENT, 0 ),
232 // RES_HORI_ORIENT
233 // not required
234 // RES_ANCHOR
235 // not required
236 // RES_BACKGROUND
237 MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
238 MAP_ENTRY( STYLE, BACKGROUND_IMAGE, RES_BACKGROUND, MID_SW_FLAG_ELEMENT_ITEM ),
239 // RES_BOX
240 MAP_ENTRY( STYLE, BORDER_LINE_WIDTH, RES_BOX, ALL_BORDER_LINE_WIDTH ),
241 MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_LEFT, RES_BOX, LEFT_BORDER_LINE_WIDTH ),
242 MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_RIGHT, RES_BOX, RIGHT_BORDER_LINE_WIDTH ),
243 MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_TOP, RES_BOX, TOP_BORDER_LINE_WIDTH ),
244 MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_BOTTOM, RES_BOX, BOTTOM_BORDER_LINE_WIDTH ),
245 MAP_ENTRY( FO, PADDING, RES_BOX, ALL_BORDER_PADDING ),
246 MAP_ENTRY( FO, PADDING_LEFT, RES_BOX, LEFT_BORDER_PADDING ),
247 MAP_ENTRY( FO, PADDING_RIGHT, RES_BOX, RIGHT_BORDER_PADDING ),
248 MAP_ENTRY( FO, PADDING_TOP, RES_BOX, TOP_BORDER_PADDING ),
249 MAP_ENTRY( FO, PADDING_BOTTOM, RES_BOX, BOTTOM_BORDER_PADDING ),
250 MAP_ENTRY( FO, BORDER, RES_BOX, ALL_BORDER ),
251 MAP_ENTRY( FO, BORDER_LEFT, RES_BOX, LEFT_BORDER ),
252 MAP_ENTRY( FO, BORDER_RIGHT, RES_BOX, RIGHT_BORDER ),
253 MAP_ENTRY( FO, BORDER_TOP, RES_BOX, TOP_BORDER ),
254 MAP_ENTRY( FO, BORDER_BOTTOM, RES_BOX, BOTTOM_BORDER ),
255 // RES_SHADOW
256 // not required
257 // RES_FRMMACRO
258 // not required
259 // RES_COL
260 // not required
261 // RES_KEEP
262 // not required
263 // RES_URL
264 // not required
265 // RES_EDIT_IN_READONLY
266 // not required
267 // RES_LAYOUT_SPLIT
268 // not required
269 // RES_CHAIN
270 // not required
271 // RES_LINENUMBER
272 // not required
273 // RES_FTN_AT_TXTEND
274 // not required
275 // RES_END_AT_TXTEND
276 // not required
277 // RES_UNKNOWNATR_CONTAINER
278 M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
280 // RES_FRAMEDIR
281 MAP_ENTRY( STYLE, WRITING_MODE, RES_FRAMEDIR, 0 ),
282 MAP_ENTRY( LO_EXT, WRITING_MODE, RES_FRAMEDIR, 0 ),
284 const o3tl::span<SvXMLItemMapEntry const> aXMLTableCellItemMap(aTableCellItemMap);
286 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */