Reduce logging verbosity and tune levels
[LibreOffice.git] / sw / inc / poolfmt.hxx
blob3ed8d52ab7f73c460c1686ea8639627b4b96ef36
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _POOLFMT_HXX
29 #define _POOLFMT_HXX
31 #include <limits.h>
32 #include <tools/solar.h>
33 #include <editeng/frmdir.hxx>
35 // POOLCOLL-IDs:
36 // +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
37 // !User! Range ! 0 ! Offset !
38 // +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
40 // Range: 1 - text
41 // 2 - lists
42 // 3 - special ranges
43 // 4 - indices
44 // 5 - chapter / document
45 // 6 - HTML-styles.
47 // Other IDs:
48 // +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
49 // !User! Range ! 1 ! Offset !
50 // +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
51 // Range: 0 - character styles
52 // 1 - frame styles
53 // 2 - page styles
54 // 3 - paragraph styles (?)
55 // 4 - graphics styles (?)
57 // For all IDs we have:
58 // Origin: 0 -pool
59 // 1 -user
60 // Offset: within the group
63 // Attention: New IDs can only be added to the ends of the groups.
64 // These IDs are read and written by the Reader/Writer.
65 // They are only aware of the Offset to Start.
67 // Mask for recognition of COLLPOOL-IDs:
69 const sal_uInt16 POOLGRP_NOCOLLID = (1 << 10);
71 // POLLCOLL-groups:
73 const sal_uInt16 USER_FMT = (1 << 15);
74 const sal_uInt16 POOL_FMT = (0 << 15);
76 const sal_uInt16 COLL_TEXT_BITS = (1 << 11);
77 const sal_uInt16 COLL_LISTS_BITS = (2 << 11);
78 const sal_uInt16 COLL_EXTRA_BITS = (3 << 11);
79 const sal_uInt16 COLL_REGISTER_BITS = (4 << 11);
80 const sal_uInt16 COLL_DOC_BITS = (5 << 11);
81 const sal_uInt16 COLL_HTML_BITS = (6 << 11);
82 const sal_uInt16 COLL_GET_RANGE_BITS = (15 << 11);
84 // Other groups:
86 const sal_uInt16 POOLGRP_CHARFMT = (0 << 11) + POOLGRP_NOCOLLID;
87 const sal_uInt16 POOLGRP_FRAMEFMT = (1 << 11) + POOLGRP_NOCOLLID;
88 const sal_uInt16 POOLGRP_PAGEDESC = (2 << 11) + POOLGRP_NOCOLLID;
89 const sal_uInt16 POOLGRP_NUMRULE = (3 << 11) + POOLGRP_NOCOLLID;
91 // Recognize whether it's a user defined style or not:
92 const sal_uInt16 POOL_IDUSER_FMT =
93 USHRT_MAX & ~(COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID);
95 inline sal_Bool IsPoolUserFmt( sal_uInt16 nId )
97 return POOL_IDUSER_FMT ==
98 (nId & ~(COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID))
99 ? sal_True : sal_False;
104 // IDs for the ranges.
105 enum RES_POOLFMT
107 RES_POOLFMT_BEGIN = 1,
108 RES_POOL_CHRFMT = RES_POOLFMT_BEGIN,
109 RES_POOL_FRMFMT,
110 RES_POOL_TXTCOLL,
111 RES_POOL_PAGEFMT,
113 RES_POOL_PARFMT,
114 RES_POOL_GRFFMT,
115 RES_POOLFMT_END
118 // Ranges for the IDs of the formats.
120 // IDs for character styles.
121 enum RES_POOL_CHRFMT_TYPE
123 RES_POOLCHR_BEGIN = POOLGRP_CHARFMT,
124 RES_POOLCHR_NORMAL_BEGIN = POOLGRP_CHARFMT,
126 RES_POOLCHR_FOOTNOTE = RES_POOLCHR_NORMAL_BEGIN, // Footnote.
127 RES_POOLCHR_PAGENO, // Pages/field.
128 RES_POOLCHR_LABEL, // Label.
129 RES_POOLCHR_DROPCAPS, // Dropcaps.
130 RES_POOLCHR_NUM_LEVEL, // Numbering symbols
131 RES_POOLCHR_BUL_LEVEL, // Bullets.
133 RES_POOLCHR_INET_NORMAL, // Internet normal.
134 RES_POOLCHR_INET_VISIT, // Internet visited.
135 RES_POOLCHR_JUMPEDIT, // Placeholder.
136 RES_POOLCHR_TOXJUMP, // Jump from index.
137 RES_POOLCHR_ENDNOTE, // Endnote.
138 RES_POOLCHR_LINENUM, // Line numbering.
139 RES_POOLCHR_IDX_MAIN_ENTRY, // Main entry in indices.
140 RES_POOLCHR_FOOTNOTE_ANCHOR, // Footnote anchor.
141 RES_POOLCHR_ENDNOTE_ANCHOR, // Endnote anchor.
142 RES_POOLCHR_RUBYTEXT, // Rubytext.
143 RES_POOLCHR_VERT_NUM, // Vertical numbering symbols.
145 RES_POOLCHR_NORMAL_END,
147 RES_POOLCHR_HTML_BEGIN = RES_POOLCHR_BEGIN + 50, // HTML-styles.
148 RES_POOLCHR_HTML_EMPHASIS= RES_POOLCHR_HTML_BEGIN,
149 RES_POOLCHR_HTML_CITIATION,
150 RES_POOLCHR_HTML_STRONG,
151 RES_POOLCHR_HTML_CODE,
152 RES_POOLCHR_HTML_SAMPLE,
153 RES_POOLCHR_HTML_KEYBOARD,
154 RES_POOLCHR_HTML_VARIABLE,
155 RES_POOLCHR_HTML_DEFINSTANCE,
156 RES_POOLCHR_HTML_TELETYPE,
157 RES_POOLCHR_HTML_END,
159 RES_POOLCHR_END = RES_POOLCHR_HTML_END
163 // IDs for frame styles.
164 enum RES_POOL_FRMFMT_TYPE
166 RES_POOLFRM_BEGIN = POOLGRP_FRAMEFMT,
168 RES_POOLFRM_FRAME = RES_POOLFRM_BEGIN, // Frame.
169 RES_POOLFRM_GRAPHIC, // Graphics.
170 RES_POOLFRM_OLE, // OLE.
171 RES_POOLFRM_FORMEL, // Formula.
172 RES_POOLFRM_MARGINAL, // Marginalia.
173 RES_POOLFRM_WATERSIGN, // Watermark.
174 RES_POOLFRM_LABEL, // Labels.
176 RES_POOLFRM_END
179 // IDs for page styles.
180 enum RES_POOL_PAGEFMT_TYPE
182 RES_POOLPAGE_BEGIN = POOLGRP_PAGEDESC,
184 RES_POOLPAGE_STANDARD = RES_POOLPAGE_BEGIN, // Standard page.
185 RES_POOLPAGE_FIRST, // First page.
186 RES_POOLPAGE_LEFT, // Left page.
187 RES_POOLPAGE_RIGHT, // Right page.
188 RES_POOLPAGE_JAKET, // Envelope.
189 RES_POOLPAGE_REGISTER, // Index.
190 RES_POOLPAGE_HTML, // HTML.
191 RES_POOLPAGE_FOOTNOTE, // Footnote at end of document.
192 RES_POOLPAGE_ENDNOTE, // Endnote page.
193 RES_POOLPAGE_LANDSCAPE, // Landscape page style.
195 RES_POOLPAGE_END
198 // IDs for list styles.
199 enum RES_POOL_NUMRULE_TYPE
201 RES_POOLNUMRULE_BEGIN = POOLGRP_NUMRULE,
202 RES_POOLNUMRULE_NUM1 = RES_POOLNUMRULE_BEGIN, // NumRule Numbering 1.
203 RES_POOLNUMRULE_NUM2, // NumRule Numbering 2.
204 RES_POOLNUMRULE_NUM3, // NumRule Numbering 3.
205 RES_POOLNUMRULE_NUM4, // NumRule Numbering 4.
206 RES_POOLNUMRULE_NUM5, // NumRule Numbering 5.
207 RES_POOLNUMRULE_BUL1, // NumRule Bullets 1.
208 RES_POOLNUMRULE_BUL2, // NumRule Bullets 2.
209 RES_POOLNUMRULE_BUL3, // NumRule Bullets 3.
210 RES_POOLNUMRULE_BUL4, // NumRule Bullets 4.
211 RES_POOLNUMRULE_BUL5, // NumRule Bullets 5.
212 RES_POOLNUMRULE_END
215 // IDs for paragraph styles.
216 enum RES_POOL_COLLFMT_TYPE
218 // Group text.
219 RES_POOLCOLL_TEXT_BEGIN = COLL_TEXT_BITS,
221 RES_POOLCOLL_STANDARD = RES_POOLCOLL_TEXT_BEGIN, // Standard.
222 RES_POOLCOLL_TEXT, // Text body.
223 RES_POOLCOLL_TEXT_IDENT, // Text body first line indent.
224 RES_POOLCOLL_TEXT_NEGIDENT, // Text body hanging indent.
225 RES_POOLCOLL_TEXT_MOVE, // Text body indent.
226 RES_POOLCOLL_GREETING, // Complimentary close.
227 RES_POOLCOLL_SIGNATURE, // Signature.
228 RES_POOLCOLL_CONFRONTATION, // List indent.
229 RES_POOLCOLL_MARGINAL, // Marginalia.
231 // Subgroup headings.
232 RES_POOLCOLL_HEADLINE_BASE, // Base heading.
233 RES_POOLCOLL_HEADLINE1, // Heading 1.
234 RES_POOLCOLL_HEADLINE2, // Heading 2.
235 RES_POOLCOLL_HEADLINE3, // Heading 3.
236 RES_POOLCOLL_HEADLINE4, // Heading 4.
237 RES_POOLCOLL_HEADLINE5, // Heading 5.
238 RES_POOLCOLL_HEADLINE6, // Heading 6.
239 RES_POOLCOLL_HEADLINE7, // Heading 7.
240 RES_POOLCOLL_HEADLINE8, // Heading 8.
241 RES_POOLCOLL_HEADLINE9, // Heading 9.
242 RES_POOLCOLL_HEADLINE10, // Heading 10.
244 RES_POOLCOLL_TEXT_END,
247 // Group lists.
248 RES_POOLCOLL_LISTS_BEGIN = COLL_LISTS_BITS,
250 RES_POOLCOLL_NUMBUL_BASE = RES_POOLCOLL_LISTS_BEGIN, // Base list.
251 RES_POOLCOLL_LISTS_END,
254 // Special ranges.
255 RES_POOLCOLL_EXTRA_BEGIN = COLL_EXTRA_BITS,
257 // Subgroup header.
258 RES_POOLCOLL_HEADER = RES_POOLCOLL_EXTRA_BEGIN, // Header Left&Right.
259 RES_POOLCOLL_HEADERL, // Header Left.
260 RES_POOLCOLL_HEADERR, // Header Right.
262 // Subgroup footer.
263 RES_POOLCOLL_FOOTER, // Footer Left&Right.
264 RES_POOLCOLL_FOOTERL, // Footer Left.
265 RES_POOLCOLL_FOOTERR, // Footer Right.
267 // Subgroup table.
268 RES_POOLCOLL_TABLE, // Table of Contents.
269 RES_POOLCOLL_TABLE_HDLN, // Table of Contents - heading.
272 // Subgroup labels.
273 RES_POOLCOLL_LABEL, // Base labels.
274 RES_POOLCOLL_LABEL_ABB, // Label illustration.
275 RES_POOLCOLL_LABEL_TABLE, // Label table.
276 RES_POOLCOLL_LABEL_FRAME, // Label frame.
278 // Other stuff.
279 RES_POOLCOLL_FRAME, // Frames.
280 RES_POOLCOLL_FOOTNOTE, // Footnotes.
281 RES_POOLCOLL_JAKETADRESS, // Addressee.
282 RES_POOLCOLL_SENDADRESS, // Sender.
283 RES_POOLCOLL_ENDNOTE, // Endnotes.
285 RES_POOLCOLL_LABEL_DRAWING, // Label drawing objects.
286 RES_POOLCOLL_EXTRA_END,
289 // Group indices.
290 RES_POOLCOLL_REGISTER_BEGIN = COLL_REGISTER_BITS,
292 RES_POOLCOLL_REGISTER_BASE = RES_POOLCOLL_REGISTER_BEGIN, // Base index.
294 // Subgroup index tables.
295 RES_POOLCOLL_TOX_IDXH, // Header.
296 RES_POOLCOLL_TOX_IDX1, // 1st level.
297 RES_POOLCOLL_TOX_IDX2, // 2nd level.
298 RES_POOLCOLL_TOX_IDX3, // 3rd level.
299 RES_POOLCOLL_TOX_IDXBREAK, // Separator.
301 // Subgroup table of contents.
302 RES_POOLCOLL_TOX_CNTNTH, // Header.
303 RES_POOLCOLL_TOX_CNTNT1, // Content 1st level.
304 RES_POOLCOLL_TOX_CNTNT2, // Content 2nd level.
305 RES_POOLCOLL_TOX_CNTNT3, // Content 3rd level.
306 RES_POOLCOLL_TOX_CNTNT4, // Content 4th level.
307 RES_POOLCOLL_TOX_CNTNT5, // Content 5th level.
310 // Subgroup user indices.
311 RES_POOLCOLL_TOX_USERH, // Header.
312 RES_POOLCOLL_TOX_USER1, // 1st level.
313 RES_POOLCOLL_TOX_USER2, // 2nd level.
314 RES_POOLCOLL_TOX_USER3, // 3rd level.
315 RES_POOLCOLL_TOX_USER4, // 4th level.
316 RES_POOLCOLL_TOX_USER5, // 5th level.
319 RES_POOLCOLL_TOX_CNTNT6, // Content 6th level.
320 RES_POOLCOLL_TOX_CNTNT7, // Content 7th level.
321 RES_POOLCOLL_TOX_CNTNT8, // Content 8th level.
322 RES_POOLCOLL_TOX_CNTNT9, // Content 9th level.
323 RES_POOLCOLL_TOX_CNTNT10, // Content 10th level.
325 // illustrations index.
326 RES_POOLCOLL_TOX_ILLUSH, // Illustrations header.
327 RES_POOLCOLL_TOX_ILLUS1, // Illustrations all levels.
329 // object index.
330 RES_POOLCOLL_TOX_OBJECTH, // Objects header.
331 RES_POOLCOLL_TOX_OBJECT1, // Objects all levels.
333 // tables index.
334 RES_POOLCOLL_TOX_TABLESH, // Tables header.
335 RES_POOLCOLL_TOX_TABLES1, // Tables all levels.
337 // index of authorities.
338 RES_POOLCOLL_TOX_AUTHORITIESH, // Authorities header.
339 RES_POOLCOLL_TOX_AUTHORITIES1, // Authorities all levels.
341 // user index 6..10.
342 RES_POOLCOLL_TOX_USER6, // 6th level.
343 RES_POOLCOLL_TOX_USER7, // 7th level.
344 RES_POOLCOLL_TOX_USER8, // 8th level.
345 RES_POOLCOLL_TOX_USER9, // 9th level.
346 RES_POOLCOLL_TOX_USER10, // 10th level.
348 RES_POOLCOLL_REGISTER_END,
351 // Group chapter / document.
352 RES_POOLCOLL_DOC_BEGIN = COLL_DOC_BITS,
354 RES_POOLCOLL_DOC_TITEL = RES_POOLCOLL_DOC_BEGIN, // Doc. titel.
355 RES_POOLCOLL_DOC_SUBTITEL, // Doc. subtitel.
357 RES_POOLCOLL_DOC_END,
359 // Group HTML-styles.
360 RES_POOLCOLL_HTML_BEGIN = COLL_HTML_BITS,
362 RES_POOLCOLL_HTML_BLOCKQUOTE = RES_POOLCOLL_HTML_BEGIN,
363 RES_POOLCOLL_HTML_PRE,
364 RES_POOLCOLL_HTML_HR,
365 RES_POOLCOLL_HTML_DD,
366 RES_POOLCOLL_HTML_DT,
368 RES_POOLCOLL_HTML_END
370 // End of text styles collection.
374 // Query defined parent of a POOL-ID
375 // Returns 0 if standard
376 // USHRT_MAX if no parent
377 // the parent in all other cases.
378 sal_uInt16 GetPoolParent( sal_uInt16 nId );
380 SvxFrameDirection GetDefaultFrameDirection(sal_uLong nLanguage);
382 inline sal_Bool IsConditionalByPoolId(sal_uInt16 nId)
384 return RES_POOLCOLL_TEXT == nId;
387 #endif
389 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */