1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_SW_INC_POOLFMT_HXX
20 #define INCLUDED_SW_INC_POOLFMT_HXX
23 #include <editeng/frmdir.hxx>
24 #include <i18nlangtag/lang.h>
27 // +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
28 // !User! Range ! 0 ! Offset !
29 // +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
35 // 5 - chapter / document
39 // +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
40 // !User! Range ! 1 ! Offset !
41 // +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
42 // Range: 0 - character styles
45 // 3 - paragraph styles (?)
46 // 4 - graphics styles (?)
48 // For all IDs we have:
51 // Offset: within the group */
53 /** Attention: New IDs can only be added to the ends of the groups.
54 These IDs are read and written by the Reader/Writer.
55 They are only aware of the Offset to Start. */
57 /// Mask for recognition of COLLPOOL-IDs:
59 const sal_uInt16 POOLGRP_NOCOLLID
= (1 << 10);
63 const sal_uInt16 USER_FMT
= (1 << 15);
65 const sal_uInt16 COLL_TEXT_BITS
= (1 << 11);
66 const sal_uInt16 COLL_LISTS_BITS
= (2 << 11);
67 const sal_uInt16 COLL_EXTRA_BITS
= (3 << 11);
68 const sal_uInt16 COLL_REGISTER_BITS
= (4 << 11);
69 const sal_uInt16 COLL_DOC_BITS
= (5 << 11);
70 const sal_uInt16 COLL_HTML_BITS
= (6 << 11);
71 const sal_uInt16 COLL_GET_RANGE_BITS
= (15 << 11);
75 const sal_uInt16 POOLGRP_CHARFMT
= (0 << 11) + POOLGRP_NOCOLLID
;
76 const sal_uInt16 POOLGRP_FRAMEFMT
= (1 << 11) + POOLGRP_NOCOLLID
;
77 const sal_uInt16 POOLGRP_PAGEDESC
= (2 << 11) + POOLGRP_NOCOLLID
;
78 const sal_uInt16 POOLGRP_NUMRULE
= (3 << 11) + POOLGRP_NOCOLLID
;
79 const sal_uInt16 POOLGRP_TABSTYLE
= (4 << 11) + POOLGRP_NOCOLLID
;
80 const sal_uInt16 POOLGRP_CELLSTYLE
= (5 << 11) + POOLGRP_NOCOLLID
;
82 /// Recognize whether it's a user defined style or not:
83 const sal_uInt16 POOL_IDUSER_FMT
=
84 USHRT_MAX
& ~(COLL_GET_RANGE_BITS
+ POOLGRP_NOCOLLID
);
86 inline bool IsPoolUserFormat( sal_uInt16 nId
)
88 return POOL_IDUSER_FMT
== (nId
& ~(COLL_GET_RANGE_BITS
+ POOLGRP_NOCOLLID
));
91 /// IDs for the ranges.
94 RES_POOLFMT_BEGIN
= 1,
95 RES_POOL_CHRFMT
= RES_POOLFMT_BEGIN
,
105 /// Ranges for the IDs of the formats.
107 /// IDs for character styles.
108 enum RES_POOL_CHRFMT_TYPE
110 RES_POOLCHR_BEGIN
= POOLGRP_CHARFMT
,
111 RES_POOLCHR_NORMAL_BEGIN
= POOLGRP_CHARFMT
,
113 RES_POOLCHR_FOOTNOTE
= RES_POOLCHR_NORMAL_BEGIN
, ///< Footnote.
114 RES_POOLCHR_PAGENO
, ///< Pages/field.
115 RES_POOLCHR_LABEL
, ///< Label.
116 RES_POOLCHR_DROPCAPS
, ///< Dropcaps.
117 RES_POOLCHR_NUM_LEVEL
, ///< Numbering symbols
118 RES_POOLCHR_BULLET_LEVEL
, ///< Bullets.
120 RES_POOLCHR_INET_NORMAL
, ///< Internet normal.
121 RES_POOLCHR_INET_VISIT
, ///< Internet visited.
122 RES_POOLCHR_JUMPEDIT
, ///< Placeholder.
123 RES_POOLCHR_TOXJUMP
, ///< Jump from index.
124 RES_POOLCHR_ENDNOTE
, ///< Endnote.
125 RES_POOLCHR_LINENUM
, ///< Line numbering.
126 RES_POOLCHR_IDX_MAIN_ENTRY
, ///< Main entry in indices.
127 RES_POOLCHR_FOOTNOTE_ANCHOR
, ///< Footnote anchor.
128 RES_POOLCHR_ENDNOTE_ANCHOR
, ///< Endnote anchor.
129 RES_POOLCHR_RUBYTEXT
, ///< Rubytext.
130 RES_POOLCHR_VERT_NUM
, ///< Vertical numbering symbols.
132 RES_POOLCHR_NORMAL_END
,
134 RES_POOLCHR_HTML_BEGIN
= RES_POOLCHR_BEGIN
+ 50, ///< HTML-styles.
135 RES_POOLCHR_HTML_EMPHASIS
= RES_POOLCHR_HTML_BEGIN
,
136 RES_POOLCHR_HTML_CITATION
,
137 RES_POOLCHR_HTML_STRONG
,
138 RES_POOLCHR_HTML_CODE
,
139 RES_POOLCHR_HTML_SAMPLE
,
140 RES_POOLCHR_HTML_KEYBOARD
,
141 RES_POOLCHR_HTML_VARIABLE
,
142 RES_POOLCHR_HTML_DEFINSTANCE
,
143 RES_POOLCHR_HTML_TELETYPE
,
144 RES_POOLCHR_HTML_END
,
146 RES_POOLCHR_END
= RES_POOLCHR_HTML_END
149 /// IDs for frame styles.
150 enum RES_POOL_FRMFMT_TYPE
152 RES_POOLFRM_BEGIN
= POOLGRP_FRAMEFMT
,
154 RES_POOLFRM_FRAME
= RES_POOLFRM_BEGIN
, ///< Frame.
155 RES_POOLFRM_GRAPHIC
, ///< Graphics.
156 RES_POOLFRM_OLE
, ///< OLE.
157 RES_POOLFRM_FORMEL
, ///< Formula.
158 RES_POOLFRM_MARGINAL
, ///< Marginalia.
159 RES_POOLFRM_WATERSIGN
, ///< Watermark.
160 RES_POOLFRM_LABEL
, ///< Labels.
161 RES_POOLFRM_INLINE_HEADING
, ///< Inline Heading.
166 /// IDs for page styles.
167 enum RES_POOL_PAGEFMT_TYPE
169 RES_POOLPAGE_BEGIN
= POOLGRP_PAGEDESC
,
171 RES_POOLPAGE_STANDARD
= RES_POOLPAGE_BEGIN
, ///< Standard page.
172 RES_POOLPAGE_FIRST
, ///< First page.
173 RES_POOLPAGE_LEFT
, ///< Left page.
174 RES_POOLPAGE_RIGHT
, ///< Right page.
175 RES_POOLPAGE_ENVELOPE
, ///< Envelope.
176 RES_POOLPAGE_REGISTER
, ///< Index.
177 RES_POOLPAGE_HTML
, ///< HTML.
178 RES_POOLPAGE_FOOTNOTE
, ///< Footnote at end of document.
179 RES_POOLPAGE_ENDNOTE
, ///< Endnote page.
180 RES_POOLPAGE_LANDSCAPE
, ///< Landscape page style.
185 // IDs for list styles.
186 enum RES_POOL_NUMRULE_TYPE
188 RES_POOLNUMRULE_BEGIN
= POOLGRP_NUMRULE
,
189 RES_POOLNUMRULE_NOLIST
= RES_POOLNUMRULE_BEGIN
,
190 RES_POOLNUMRULE_NUM1
, ///< NumRule Numbering 123.
191 RES_POOLNUMRULE_NUM2
, ///< NumRule Numbering ABC.
192 RES_POOLNUMRULE_NUM3
, ///< NumRule Numbering abc.
193 RES_POOLNUMRULE_NUM4
, ///< NumRule Numbering IVX.
194 RES_POOLNUMRULE_NUM5
, ///< NumRule Numbering ivx.
195 RES_POOLNUMRULE_BUL1
, ///< NumRule Bullets 1.
196 RES_POOLNUMRULE_BUL2
, ///< NumRule Bullets 2.
197 RES_POOLNUMRULE_BUL3
, ///< NumRule Bullets 3.
198 RES_POOLNUMRULE_BUL4
, ///< NumRule Bullets 4.
199 RES_POOLNUMRULE_BUL5
, ///< NumRule Bullets 5.
203 // IDs for table styles.
204 enum RES_POOL_TABLESTYLE_TYPE
206 RES_POOLTABLESTYLE_BEGIN
= POOLGRP_TABSTYLE
,
207 RES_POOLTABLESTYLE_DEFAULT
= RES_POOLTABLESTYLE_BEGIN
,
209 RES_POOLTABLESTYLE_3D
,
210 RES_POOLTABLESTYLE_BLACK1
,
211 RES_POOLTABLESTYLE_BLACK2
,
212 RES_POOLTABLESTYLE_BLUE
,
213 RES_POOLTABLESTYLE_BROWN
,
214 RES_POOLTABLESTYLE_CURRENCY
,
215 RES_POOLTABLESTYLE_CURRENCY_3D
,
216 RES_POOLTABLESTYLE_CURRENCY_GRAY
,
217 RES_POOLTABLESTYLE_CURRENCY_LAVENDER
,
218 RES_POOLTABLESTYLE_CURRENCY_TURQUOISE
,
219 RES_POOLTABLESTYLE_GRAY
,
220 RES_POOLTABLESTYLE_GREEN
,
221 RES_POOLTABLESTYLE_LAVENDER
,
222 RES_POOLTABLESTYLE_RED
,
223 RES_POOLTABLESTYLE_TURQUOISE
,
224 RES_POOLTABLESTYLE_YELLOW
,
225 // 10 new styles since LibreOffice 6.0
226 RES_POOLTABLESTYLE_LO6_ACADEMIC
,
227 RES_POOLTABLESTYLE_LO6_BOX_LIST_BLUE
,
228 RES_POOLTABLESTYLE_LO6_BOX_LIST_GREEN
,
229 RES_POOLTABLESTYLE_LO6_BOX_LIST_RED
,
230 RES_POOLTABLESTYLE_LO6_BOX_LIST_YELLOW
,
231 RES_POOLTABLESTYLE_LO6_ELEGANT
,
232 RES_POOLTABLESTYLE_LO6_FINANCIAL
,
233 RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_COLUMNS
,
234 RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_ROWS
,
235 RES_POOLTABLESTYLE_LO6_SIMPLE_LIST_SHADED
,
236 RES_POOLTABLESTYLE_END
239 enum RES_POOL_CELLSTYLE_TYPE
241 RES_POOLCELLSTYLE_BEGIN
= POOLGRP_CELLSTYLE
,
242 RES_POOLCELLSTYLE_END
= RES_POOLCELLSTYLE_BEGIN
245 // IDs for paragraph styles.
246 enum RES_POOL_COLLFMT_TYPE
249 RES_POOLCOLL_TEXT_BEGIN
= COLL_TEXT_BITS
,
251 RES_POOLCOLL_STANDARD
= RES_POOLCOLL_TEXT_BEGIN
, ///< Standard.
252 RES_POOLCOLL_TEXT
, ///< Text body.
253 RES_POOLCOLL_TEXT_IDENT
, ///< Text body first line indent.
254 RES_POOLCOLL_TEXT_NEGIDENT
, ///< Text body hanging indent.
255 RES_POOLCOLL_TEXT_MOVE
, ///< Text body indent.
256 RES_POOLCOLL_GREETING
, ///< Complimentary close.
257 RES_POOLCOLL_SIGNATURE
, ///< Signature.
258 RES_POOLCOLL_CONFRONTATION
, ///< List indent.
259 RES_POOLCOLL_MARGINAL
, ///< Marginalia.
261 RES_POOLCOLL_TEXT_END
,
264 RES_POOLCOLL_LISTS_BEGIN
= COLL_LISTS_BITS
,
266 RES_POOLCOLL_NUMBER_BULLET_BASE
= RES_POOLCOLL_LISTS_BEGIN
, ///< Base list.
268 /// Subgroup numberings.
269 RES_POOLCOLL_NUM_LEVEL1S
, ///< Start 1st level.
270 RES_POOLCOLL_NUM_LEVEL1
, ///< 1st level.
271 RES_POOLCOLL_NUM_LEVEL1E
, ///< End 1st level.
272 RES_POOLCOLL_NUM_NONUM1
, ///< No numbering.
273 RES_POOLCOLL_NUM_LEVEL2S
, ///< Start 2nd level.
274 RES_POOLCOLL_NUM_LEVEL2
, ///< 2nd level.
275 RES_POOLCOLL_NUM_LEVEL2E
, ///< End 2nd level.
276 RES_POOLCOLL_NUM_NONUM2
, ///< No numbering.
277 RES_POOLCOLL_NUM_LEVEL3S
, ///< Start 3rd level.
278 RES_POOLCOLL_NUM_LEVEL3
, ///< 3rd level.
279 RES_POOLCOLL_NUM_LEVEL3E
, ///< End 3rd level.
280 RES_POOLCOLL_NUM_NONUM3
, ///< No numbering.
281 RES_POOLCOLL_NUM_LEVEL4S
, ///< Start 4th level.
282 RES_POOLCOLL_NUM_LEVEL4
, ///< 4th level.
283 RES_POOLCOLL_NUM_LEVEL4E
, ///< End 4th level.
284 RES_POOLCOLL_NUM_NONUM4
, ///< No numbering.
285 RES_POOLCOLL_NUM_LEVEL5S
, ///< Start 5th level.
286 RES_POOLCOLL_NUM_LEVEL5
, ///< 5th level.
287 RES_POOLCOLL_NUM_LEVEL5E
, ///< End 5th level.
288 RES_POOLCOLL_NUM_NONUM5
, ///< No numbering.
291 RES_POOLCOLL_BULLET_LEVEL1S
, ///< Start 1st level.
292 RES_POOLCOLL_BULLET_LEVEL1
, ///< 1st level.
293 RES_POOLCOLL_BULLET_LEVEL1E
, ///< End 1st level
294 RES_POOLCOLL_BULLET_NONUM1
, ///< No numbering.
295 RES_POOLCOLL_BULLET_LEVEL2S
, ///< Start 2nd level.
296 RES_POOLCOLL_BULLET_LEVEL2
, ///< 2nd level.
297 RES_POOLCOLL_BULLET_LEVEL2E
, ///< End 2nd level.
298 RES_POOLCOLL_BULLET_NONUM2
, ///< No numbering.
299 RES_POOLCOLL_BULLET_LEVEL3S
, ///< Start 3rd level.
300 RES_POOLCOLL_BULLET_LEVEL3
, ///< 3rd Level.
301 RES_POOLCOLL_BULLET_LEVEL3E
, ///< End 3rd level.
302 RES_POOLCOLL_BULLET_NONUM3
, ///< No numbering.
303 RES_POOLCOLL_BULLET_LEVEL4S
, ///< Start 4th level.
304 RES_POOLCOLL_BULLET_LEVEL4
, ///< 4th level.
305 RES_POOLCOLL_BULLET_LEVEL4E
, ///< End 4th level.
306 RES_POOLCOLL_BULLET_NONUM4
, ///< No numbering.
307 RES_POOLCOLL_BULLET_LEVEL5S
, ///< Start 5th level.
308 RES_POOLCOLL_BULLET_LEVEL5
, ///< 5th level.
309 RES_POOLCOLL_BULLET_LEVEL5E
, ///< End 5th Level.
310 RES_POOLCOLL_BULLET_NONUM5
, ///< No numbering.
312 RES_POOLCOLL_LISTS_END
,
315 RES_POOLCOLL_EXTRA_BEGIN
= COLL_EXTRA_BITS
,
318 RES_POOLCOLL_HEADERFOOTER
= RES_POOLCOLL_EXTRA_BEGIN
, ///< Header and Footer.
319 RES_POOLCOLL_HEADER
, ///< Header Left&Right.
320 RES_POOLCOLL_HEADERL
, ///< Header Left.
321 RES_POOLCOLL_HEADERR
, ///< Header Right.
324 RES_POOLCOLL_FOOTER
, ///< Footer Left&Right.
325 RES_POOLCOLL_FOOTERL
, ///< Footer Left.
326 RES_POOLCOLL_FOOTERR
, ///< Footer Right.
329 RES_POOLCOLL_TABLE
, ///< Table of Contents.
330 RES_POOLCOLL_TABLE_HDLN
, ///< Table of Contents - heading.
333 RES_POOLCOLL_LABEL
, ///< Base labels.
334 RES_POOLCOLL_LABEL_ABB
, ///< Label illustration.
335 RES_POOLCOLL_LABEL_TABLE
, ///< Label table.
336 RES_POOLCOLL_LABEL_FRAME
, ///< Label frame.
337 RES_POOLCOLL_LABEL_FIGURE
, ///< Label figure
340 RES_POOLCOLL_FRAME
, ///< Frames.
341 RES_POOLCOLL_FOOTNOTE
, ///< Footnotes.
342 RES_POOLCOLL_ENVELOPE_ADDRESS
, ///< Addressee.
343 RES_POOLCOLL_SEND_ADDRESS
, ///< Sender.
344 RES_POOLCOLL_ENDNOTE
, ///< Endnotes.
346 RES_POOLCOLL_LABEL_DRAWING
, ///< Label drawing objects.
347 RES_POOLCOLL_COMMENT
, ///< Comment
349 RES_POOLCOLL_EXTRA_END
,
352 RES_POOLCOLL_REGISTER_BEGIN
= COLL_REGISTER_BITS
,
354 RES_POOLCOLL_REGISTER_BASE
= RES_POOLCOLL_REGISTER_BEGIN
, ///< Base index.
356 /// Subgroup index tables.
357 RES_POOLCOLL_TOX_IDXH
, ///< Header.
358 RES_POOLCOLL_TOX_IDX1
, ///< 1st level.
359 RES_POOLCOLL_TOX_IDX2
, ///< 2nd level.
360 RES_POOLCOLL_TOX_IDX3
, ///< 3rd level.
361 RES_POOLCOLL_TOX_IDXBREAK
, ///< Separator.
363 /// Subgroup table of contents.
364 RES_POOLCOLL_TOX_CNTNTH
, ///< Header.
365 RES_POOLCOLL_TOX_CNTNT1
, ///< Content 1st level.
366 RES_POOLCOLL_TOX_CNTNT2
, ///< Content 2nd level.
367 RES_POOLCOLL_TOX_CNTNT3
, ///< Content 3rd level.
368 RES_POOLCOLL_TOX_CNTNT4
, ///< Content 4th level.
369 RES_POOLCOLL_TOX_CNTNT5
, ///< Content 5th level.
371 /// Subgroup user indices.
372 RES_POOLCOLL_TOX_USERH
, ///< Header.
373 RES_POOLCOLL_TOX_USER1
, ///< 1st level.
374 RES_POOLCOLL_TOX_USER2
, ///< 2nd level.
375 RES_POOLCOLL_TOX_USER3
, ///< 3rd level.
376 RES_POOLCOLL_TOX_USER4
, ///< 4th level.
377 RES_POOLCOLL_TOX_USER5
, ///< 5th level.
379 RES_POOLCOLL_TOX_CNTNT6
, ///< Content 6th level.
380 RES_POOLCOLL_TOX_CNTNT7
, ///< Content 7th level.
381 RES_POOLCOLL_TOX_CNTNT8
, ///< Content 8th level.
382 RES_POOLCOLL_TOX_CNTNT9
, ///< Content 9th level.
383 RES_POOLCOLL_TOX_CNTNT10
, ///< Content 10th level.
385 /// illustrations index.
386 RES_POOLCOLL_TOX_ILLUSH
, ///< Illustrations header.
387 RES_POOLCOLL_TOX_ILLUS1
, ///< Illustrations all levels.
390 RES_POOLCOLL_TOX_OBJECTH
, ///< Objects header.
391 RES_POOLCOLL_TOX_OBJECT1
, ///< Objects all levels.
394 RES_POOLCOLL_TOX_TABLESH
, ///< Tables header.
395 RES_POOLCOLL_TOX_TABLES1
, ///< Tables all levels.
397 /// index of authorities.
398 RES_POOLCOLL_TOX_AUTHORITIESH
, ///< Authorities header.
399 RES_POOLCOLL_TOX_AUTHORITIES1
, ///< Authorities all levels.
401 /// user index 6..10.
402 RES_POOLCOLL_TOX_USER6
, ///< 6th level.
403 RES_POOLCOLL_TOX_USER7
, ///< 7th level.
404 RES_POOLCOLL_TOX_USER8
, ///< 8th level.
405 RES_POOLCOLL_TOX_USER9
, ///< 9th level.
406 RES_POOLCOLL_TOX_USER10
, ///< 10th level.
408 RES_POOLCOLL_REGISTER_END
,
410 /// Group chapter / document.
411 RES_POOLCOLL_DOC_BEGIN
= COLL_DOC_BITS
,
413 RES_POOLCOLL_DOC_TITLE
= RES_POOLCOLL_DOC_BEGIN
, ///< Doc. title.
414 RES_POOLCOLL_DOC_SUBTITLE
, ///< Doc. subtitle.
415 RES_POOLCOLL_DOC_APPENDIX
, ///< Doc. appendix.
417 /// Subgroup headings.
418 RES_POOLCOLL_HEADLINE_BASE
, ///< Base heading.
419 RES_POOLCOLL_HEADLINE1
, ///< Heading 1.
420 RES_POOLCOLL_HEADLINE2
, ///< Heading 2.
421 RES_POOLCOLL_HEADLINE3
, ///< Heading 3.
422 RES_POOLCOLL_HEADLINE4
, ///< Heading 4.
423 RES_POOLCOLL_HEADLINE5
, ///< Heading 5.
424 RES_POOLCOLL_HEADLINE6
, ///< Heading 6.
425 RES_POOLCOLL_HEADLINE7
, ///< Heading 7.
426 RES_POOLCOLL_HEADLINE8
, ///< Heading 8.
427 RES_POOLCOLL_HEADLINE9
, ///< Heading 9.
428 RES_POOLCOLL_HEADLINE10
, ///< Heading 10.
430 RES_POOLCOLL_DOC_END
,
432 /// Group HTML-styles.
433 RES_POOLCOLL_HTML_BEGIN
= COLL_HTML_BITS
,
435 RES_POOLCOLL_HTML_BLOCKQUOTE
= RES_POOLCOLL_HTML_BEGIN
,
436 RES_POOLCOLL_HTML_PRE
,
437 RES_POOLCOLL_HTML_HR
,
438 RES_POOLCOLL_HTML_DD
,
439 RES_POOLCOLL_HTML_DT
,
441 RES_POOLCOLL_HTML_END
443 /// End of text styles collection.
446 /** Query defined parent of a POOL-ID
447 Returns 0 if standard
448 USHRT_MAX if no parent
449 the parent in all other cases. */
450 sal_uInt16
GetPoolParent( sal_uInt16 nId
);
452 SvxFrameDirection
GetDefaultFrameDirection(LanguageType nLanguage
);
454 bool IsConditionalByPoolId(sal_uInt16 nId
);
458 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */