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 .
23 #include <tools/solar.h>
24 #include <editeng/frmdir.hxx>
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 */
54 /** Attention: New IDs can only be added to the ends of the groups.
55 These IDs are read and written by the Reader/Writer.
56 They are only aware of the Offset to Start. */
58 /// Mask for recognition of COLLPOOL-IDs:
60 const sal_uInt16 POOLGRP_NOCOLLID
= (1 << 10);
64 const sal_uInt16 USER_FMT
= (1 << 15);
65 const sal_uInt16 POOL_FMT
= (0 << 15);
67 const sal_uInt16 COLL_TEXT_BITS
= (1 << 11);
68 const sal_uInt16 COLL_LISTS_BITS
= (2 << 11);
69 const sal_uInt16 COLL_EXTRA_BITS
= (3 << 11);
70 const sal_uInt16 COLL_REGISTER_BITS
= (4 << 11);
71 const sal_uInt16 COLL_DOC_BITS
= (5 << 11);
72 const sal_uInt16 COLL_HTML_BITS
= (6 << 11);
73 const sal_uInt16 COLL_GET_RANGE_BITS
= (15 << 11);
77 const sal_uInt16 POOLGRP_CHARFMT
= (0 << 11) + POOLGRP_NOCOLLID
;
78 const sal_uInt16 POOLGRP_FRAMEFMT
= (1 << 11) + POOLGRP_NOCOLLID
;
79 const sal_uInt16 POOLGRP_PAGEDESC
= (2 << 11) + POOLGRP_NOCOLLID
;
80 const sal_uInt16 POOLGRP_NUMRULE
= (3 << 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 sal_Bool
IsPoolUserFmt( sal_uInt16 nId
)
88 return POOL_IDUSER_FMT
==
89 (nId
& ~(COLL_GET_RANGE_BITS
+ POOLGRP_NOCOLLID
))
90 ? sal_True
: sal_False
;
95 /// IDs for the ranges.
98 RES_POOLFMT_BEGIN
= 1,
99 RES_POOL_CHRFMT
= RES_POOLFMT_BEGIN
,
109 /// Ranges for the IDs of the formats.
111 /// IDs for character styles.
112 enum RES_POOL_CHRFMT_TYPE
114 RES_POOLCHR_BEGIN
= POOLGRP_CHARFMT
,
115 RES_POOLCHR_NORMAL_BEGIN
= POOLGRP_CHARFMT
,
117 RES_POOLCHR_FOOTNOTE
= RES_POOLCHR_NORMAL_BEGIN
, ///< Footnote.
118 RES_POOLCHR_PAGENO
, ///< Pages/field.
119 RES_POOLCHR_LABEL
, ///< Label.
120 RES_POOLCHR_DROPCAPS
, ///< Dropcaps.
121 RES_POOLCHR_NUM_LEVEL
, ///< Numbering symbols
122 RES_POOLCHR_BUL_LEVEL
, ///< Bullets.
124 RES_POOLCHR_INET_NORMAL
, ///< Internet normal.
125 RES_POOLCHR_INET_VISIT
, ///< Internet visited.
126 RES_POOLCHR_JUMPEDIT
, ///< Placeholder.
127 RES_POOLCHR_TOXJUMP
, ///< Jump from index.
128 RES_POOLCHR_ENDNOTE
, ///< Endnote.
129 RES_POOLCHR_LINENUM
, ///< Line numbering.
130 RES_POOLCHR_IDX_MAIN_ENTRY
, ///< Main entry in indices.
131 RES_POOLCHR_FOOTNOTE_ANCHOR
, ///< Footnote anchor.
132 RES_POOLCHR_ENDNOTE_ANCHOR
, ///< Endnote anchor.
133 RES_POOLCHR_RUBYTEXT
, ///< Rubytext.
134 RES_POOLCHR_VERT_NUM
, ///< Vertical numbering symbols.
136 RES_POOLCHR_NORMAL_END
,
138 RES_POOLCHR_HTML_BEGIN
= RES_POOLCHR_BEGIN
+ 50, ///< HTML-styles.
139 RES_POOLCHR_HTML_EMPHASIS
= RES_POOLCHR_HTML_BEGIN
,
140 RES_POOLCHR_HTML_CITIATION
,
141 RES_POOLCHR_HTML_STRONG
,
142 RES_POOLCHR_HTML_CODE
,
143 RES_POOLCHR_HTML_SAMPLE
,
144 RES_POOLCHR_HTML_KEYBOARD
,
145 RES_POOLCHR_HTML_VARIABLE
,
146 RES_POOLCHR_HTML_DEFINSTANCE
,
147 RES_POOLCHR_HTML_TELETYPE
,
148 RES_POOLCHR_HTML_END
,
150 RES_POOLCHR_END
= RES_POOLCHR_HTML_END
154 /// IDs for frame styles.
155 enum RES_POOL_FRMFMT_TYPE
157 RES_POOLFRM_BEGIN
= POOLGRP_FRAMEFMT
,
159 RES_POOLFRM_FRAME
= RES_POOLFRM_BEGIN
, ///< Frame.
160 RES_POOLFRM_GRAPHIC
, ///< Graphics.
161 RES_POOLFRM_OLE
, ///< OLE.
162 RES_POOLFRM_FORMEL
, ///< Formula.
163 RES_POOLFRM_MARGINAL
, ///< Marginalia.
164 RES_POOLFRM_WATERSIGN
, ///< Watermark.
165 RES_POOLFRM_LABEL
, ///< Labels.
170 /// IDs for page styles.
171 enum RES_POOL_PAGEFMT_TYPE
173 RES_POOLPAGE_BEGIN
= POOLGRP_PAGEDESC
,
175 RES_POOLPAGE_STANDARD
= RES_POOLPAGE_BEGIN
, ///< Standard page.
176 RES_POOLPAGE_FIRST
, ///< First page.
177 RES_POOLPAGE_LEFT
, ///< Left page.
178 RES_POOLPAGE_RIGHT
, ///< Right page.
179 RES_POOLPAGE_JAKET
, ///< Envelope.
180 RES_POOLPAGE_REGISTER
, ///< Index.
181 RES_POOLPAGE_HTML
, ///< HTML.
182 RES_POOLPAGE_FOOTNOTE
, ///< Footnote at end of document.
183 RES_POOLPAGE_ENDNOTE
, ///< Endnote page.
184 RES_POOLPAGE_LANDSCAPE
, ///< Landscape page style.
189 // IDs for list styles.
190 enum RES_POOL_NUMRULE_TYPE
192 RES_POOLNUMRULE_BEGIN
= POOLGRP_NUMRULE
,
193 RES_POOLNUMRULE_NUM1
= RES_POOLNUMRULE_BEGIN
, ///< NumRule Numbering 1.
194 RES_POOLNUMRULE_NUM2
, ///< NumRule Numbering 2.
195 RES_POOLNUMRULE_NUM3
, ///< NumRule Numbering 3.
196 RES_POOLNUMRULE_NUM4
, ///< NumRule Numbering 4.
197 RES_POOLNUMRULE_NUM5
, ///< NumRule Numbering 5.
198 RES_POOLNUMRULE_BUL1
, ///< NumRule Bullets 1.
199 RES_POOLNUMRULE_BUL2
, ///< NumRule Bullets 2.
200 RES_POOLNUMRULE_BUL3
, ///< NumRule Bullets 3.
201 RES_POOLNUMRULE_BUL4
, ///< NumRule Bullets 4.
202 RES_POOLNUMRULE_BUL5
, ///< NumRule Bullets 5.
206 // IDs for paragraph styles.
207 enum RES_POOL_COLLFMT_TYPE
210 RES_POOLCOLL_TEXT_BEGIN
= COLL_TEXT_BITS
,
212 RES_POOLCOLL_STANDARD
= RES_POOLCOLL_TEXT_BEGIN
, ///< Standard.
213 RES_POOLCOLL_TEXT
, ///< Text body.
214 RES_POOLCOLL_TEXT_IDENT
, ///< Text body first line indent.
215 RES_POOLCOLL_TEXT_NEGIDENT
, ///< Text body hanging indent.
216 RES_POOLCOLL_TEXT_MOVE
, ///< Text body indent.
217 RES_POOLCOLL_GREETING
, ///< Complimentary close.
218 RES_POOLCOLL_SIGNATURE
, ///< Signature.
219 RES_POOLCOLL_CONFRONTATION
, ///< List indent.
220 RES_POOLCOLL_MARGINAL
, ///< Marginalia.
222 /// Subgroup headings.
223 RES_POOLCOLL_HEADLINE_BASE
, ///< Base heading.
224 RES_POOLCOLL_HEADLINE1
, ///< Heading 1.
225 RES_POOLCOLL_HEADLINE2
, ///< Heading 2.
226 RES_POOLCOLL_HEADLINE3
, ///< Heading 3.
227 RES_POOLCOLL_HEADLINE4
, ///< Heading 4.
228 RES_POOLCOLL_HEADLINE5
, ///< Heading 5.
229 RES_POOLCOLL_HEADLINE6
, ///< Heading 6.
230 RES_POOLCOLL_HEADLINE7
, ///< Heading 7.
231 RES_POOLCOLL_HEADLINE8
, ///< Heading 8.
232 RES_POOLCOLL_HEADLINE9
, ///< Heading 9.
233 RES_POOLCOLL_HEADLINE10
, ///< Heading 10.
235 RES_POOLCOLL_TEXT_END
,
239 RES_POOLCOLL_LISTS_BEGIN
= COLL_LISTS_BITS
,
241 RES_POOLCOLL_NUMBUL_BASE
= RES_POOLCOLL_LISTS_BEGIN
, ///< Base list.
243 /// Subgroup numberings.
244 RES_POOLCOLL_NUM_LEVEL1S
, ///< Start 1st level.
245 RES_POOLCOLL_NUM_LEVEL1
, ///< 1st level.
246 RES_POOLCOLL_NUM_LEVEL1E
, ///< End 1st level.
247 RES_POOLCOLL_NUM_NONUM1
, ///< No numbering.
248 RES_POOLCOLL_NUM_LEVEL2S
, ///< Start 2nd level.
249 RES_POOLCOLL_NUM_LEVEL2
, ///< 2nd level.
250 RES_POOLCOLL_NUM_LEVEL2E
, ///< End 2nd level.
251 RES_POOLCOLL_NUM_NONUM2
, ///< No numbering.
252 RES_POOLCOLL_NUM_LEVEL3S
, ///< Start 3rd level.
253 RES_POOLCOLL_NUM_LEVEL3
, ///< 3rd level.
254 RES_POOLCOLL_NUM_LEVEL3E
, ///< End 3rd level.
255 RES_POOLCOLL_NUM_NONUM3
, ///< No numbering.
256 RES_POOLCOLL_NUM_LEVEL4S
, ///< Start 4th level.
257 RES_POOLCOLL_NUM_LEVEL4
, ///< 4th level.
258 RES_POOLCOLL_NUM_LEVEL4E
, ///< End 4th level.
259 RES_POOLCOLL_NUM_NONUM4
, ///< No numbering.
260 RES_POOLCOLL_NUM_LEVEL5S
, ///< Start 5th level.
261 RES_POOLCOLL_NUM_LEVEL5
, ///< 5th level.
262 RES_POOLCOLL_NUM_LEVEL5E
, ///< End 5th level.
263 RES_POOLCOLL_NUM_NONUM5
, ///< No numbering.
267 RES_POOLCOLL_BUL_LEVEL1S
, ///< Start 1st level.
268 RES_POOLCOLL_BUL_LEVEL1
, ///< 1st level.
269 RES_POOLCOLL_BUL_LEVEL1E
, ///< End 1st level
270 RES_POOLCOLL_BUL_NONUM1
, ///< No numbering.
271 RES_POOLCOLL_BUL_LEVEL2S
, ///< Start 2nd level.
272 RES_POOLCOLL_BUL_LEVEL2
, ///< 2nd level.
273 RES_POOLCOLL_BUL_LEVEL2E
, ///< End 2nd level.
274 RES_POOLCOLL_BUL_NONUM2
, ///< No numbering.
275 RES_POOLCOLL_BUL_LEVEL3S
, ///< Start 3rd level.
276 RES_POOLCOLL_BUL_LEVEL3
, ///< 3rd Level.
277 RES_POOLCOLL_BUL_LEVEL3E
, ///< End 3rd level.
278 RES_POOLCOLL_BUL_NONUM3
, ///< No numbering.
279 RES_POOLCOLL_BUL_LEVEL4S
, ///< Start 4th level.
280 RES_POOLCOLL_BUL_LEVEL4
, ///< 4th level.
281 RES_POOLCOLL_BUL_LEVEL4E
, ///< End 4th level.
282 RES_POOLCOLL_BUL_NONUM4
, ///< No numbering.
283 RES_POOLCOLL_BUL_LEVEL5S
, ///< Start 5th level.
284 RES_POOLCOLL_BUL_LEVEL5
, ///< 5th level.
285 RES_POOLCOLL_BUL_LEVEL5E
, ///< End 5th Level.
286 RES_POOLCOLL_BUL_NONUM5
, ///< No numbering.
288 RES_POOLCOLL_LISTS_END
,
292 RES_POOLCOLL_EXTRA_BEGIN
= COLL_EXTRA_BITS
,
295 RES_POOLCOLL_HEADER
= RES_POOLCOLL_EXTRA_BEGIN
, ///< Header Left&Right.
296 RES_POOLCOLL_HEADERL
, ///< Header Left.
297 RES_POOLCOLL_HEADERR
, ///< Header Right.
300 RES_POOLCOLL_FOOTER
, ///< Footer Left&Right.
301 RES_POOLCOLL_FOOTERL
, ///< Footer Left.
302 RES_POOLCOLL_FOOTERR
, ///< Footer Right.
305 RES_POOLCOLL_TABLE
, ///< Table of Contents.
306 RES_POOLCOLL_TABLE_HDLN
, ///< Table of Contents - heading.
310 RES_POOLCOLL_LABEL
, ///< Base labels.
311 RES_POOLCOLL_LABEL_ABB
, ///< Label illustration.
312 RES_POOLCOLL_LABEL_TABLE
, ///< Label table.
313 RES_POOLCOLL_LABEL_FRAME
, ///< Label frame.
316 RES_POOLCOLL_FRAME
, ///< Frames.
317 RES_POOLCOLL_FOOTNOTE
, ///< Footnotes.
318 RES_POOLCOLL_JAKETADRESS
, ///< Addressee.
319 RES_POOLCOLL_SENDADRESS
, ///< Sender.
320 RES_POOLCOLL_ENDNOTE
, ///< Endnotes.
322 RES_POOLCOLL_LABEL_DRAWING
, ///< Label drawing objects.
323 RES_POOLCOLL_EXTRA_END
,
327 RES_POOLCOLL_REGISTER_BEGIN
= COLL_REGISTER_BITS
,
329 RES_POOLCOLL_REGISTER_BASE
= RES_POOLCOLL_REGISTER_BEGIN
, ///< Base index.
331 /// Subgroup index tables.
332 RES_POOLCOLL_TOX_IDXH
, ///< Header.
333 RES_POOLCOLL_TOX_IDX1
, ///< 1st level.
334 RES_POOLCOLL_TOX_IDX2
, ///< 2nd level.
335 RES_POOLCOLL_TOX_IDX3
, ///< 3rd level.
336 RES_POOLCOLL_TOX_IDXBREAK
, ///< Separator.
338 /// Subgroup table of contents.
339 RES_POOLCOLL_TOX_CNTNTH
, ///< Header.
340 RES_POOLCOLL_TOX_CNTNT1
, ///< Content 1st level.
341 RES_POOLCOLL_TOX_CNTNT2
, ///< Content 2nd level.
342 RES_POOLCOLL_TOX_CNTNT3
, ///< Content 3rd level.
343 RES_POOLCOLL_TOX_CNTNT4
, ///< Content 4th level.
344 RES_POOLCOLL_TOX_CNTNT5
, ///< Content 5th level.
347 /// Subgroup user indices.
348 RES_POOLCOLL_TOX_USERH
, ///< Header.
349 RES_POOLCOLL_TOX_USER1
, ///< 1st level.
350 RES_POOLCOLL_TOX_USER2
, ///< 2nd level.
351 RES_POOLCOLL_TOX_USER3
, ///< 3rd level.
352 RES_POOLCOLL_TOX_USER4
, ///< 4th level.
353 RES_POOLCOLL_TOX_USER5
, ///< 5th level.
356 RES_POOLCOLL_TOX_CNTNT6
, ///< Content 6th level.
357 RES_POOLCOLL_TOX_CNTNT7
, ///< Content 7th level.
358 RES_POOLCOLL_TOX_CNTNT8
, ///< Content 8th level.
359 RES_POOLCOLL_TOX_CNTNT9
, ///< Content 9th level.
360 RES_POOLCOLL_TOX_CNTNT10
, ///< Content 10th level.
362 /// illustrations index.
363 RES_POOLCOLL_TOX_ILLUSH
, ///< Illustrations header.
364 RES_POOLCOLL_TOX_ILLUS1
, ///< Illustrations all levels.
367 RES_POOLCOLL_TOX_OBJECTH
, ///< Objects header.
368 RES_POOLCOLL_TOX_OBJECT1
, ///< Objects all levels.
371 RES_POOLCOLL_TOX_TABLESH
, ///< Tables header.
372 RES_POOLCOLL_TOX_TABLES1
, ///< Tables all levels.
374 /// index of authorities.
375 RES_POOLCOLL_TOX_AUTHORITIESH
, ///< Authorities header.
376 RES_POOLCOLL_TOX_AUTHORITIES1
, ///< Authorities all levels.
378 /// user index 6..10.
379 RES_POOLCOLL_TOX_USER6
, ///< 6th level.
380 RES_POOLCOLL_TOX_USER7
, ///< 7th level.
381 RES_POOLCOLL_TOX_USER8
, ///< 8th level.
382 RES_POOLCOLL_TOX_USER9
, ///< 9th level.
383 RES_POOLCOLL_TOX_USER10
, ///< 10th level.
385 RES_POOLCOLL_REGISTER_END
,
388 /// Group chapter / document.
389 RES_POOLCOLL_DOC_BEGIN
= COLL_DOC_BITS
,
391 RES_POOLCOLL_DOC_TITEL
= RES_POOLCOLL_DOC_BEGIN
, ///< Doc. titel.
392 RES_POOLCOLL_DOC_SUBTITEL
, ///< Doc. subtitel.
394 RES_POOLCOLL_DOC_END
,
396 /// Group HTML-styles.
397 RES_POOLCOLL_HTML_BEGIN
= COLL_HTML_BITS
,
399 RES_POOLCOLL_HTML_BLOCKQUOTE
= RES_POOLCOLL_HTML_BEGIN
,
400 RES_POOLCOLL_HTML_PRE
,
401 RES_POOLCOLL_HTML_HR
,
402 RES_POOLCOLL_HTML_DD
,
403 RES_POOLCOLL_HTML_DT
,
405 RES_POOLCOLL_HTML_END
407 /// End of text styles collection.
411 /** Query defined parent of a POOL-ID
412 Returns 0 if standard
413 USHRT_MAX if no parent
414 the parent in all other cases. */
415 sal_uInt16
GetPoolParent( sal_uInt16 nId
);
417 SvxFrameDirection
GetDefaultFrameDirection(sal_uLong nLanguage
);
419 inline sal_Bool
IsConditionalByPoolId(sal_uInt16 nId
)
421 return RES_POOLCOLL_TEXT
== nId
;
426 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */