tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / sw / inc / hintids.hxx
blobfab0a027a0aa1925f1f6825c99447b6f663d5738
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 .
19 #ifndef INCLUDED_SW_INC_HINTIDS_HXX
20 #define INCLUDED_SW_INC_HINTIDS_HXX
22 #include <sal/types.h>
23 #include <rtl/ustring.hxx>
24 #include <svx/xdef.hxx>
25 #include "swdllapi.h"
26 #include <svl/typedwhich.hxx>
27 #include <svl/whichranges.hxx>
28 #include <vector>
30 class SfxStringItem;
31 class SwFormatChg;
32 class SwUpdateAttr;
33 class SwFormatMeta;
34 class SwFormatContentControl;
35 class SvXMLAttrContainerItem;
36 class SwMsgPoolItem;
37 class SwPtrMsgPoolItem;
38 class SfxBoolItem;
39 class SvxColorItem;
40 class SvxLeftMarginItem;
41 class SvxTextLeftMarginItem;
42 class SvxFirstLineIndentItem;
43 class SvxRightMarginItem;
44 class SvxGutterLeftMarginItem;
45 class SvxGutterRightMarginItem;
46 class SvxLRSpaceItem;
47 class SdrTextVertAdjustItem;
48 class SfxGrabBagItem;
49 class SfxInt16Item;
50 class SfxUInt16Item;
51 class SvxAdjustItem;
52 class SvxAutoKernItem;
53 class SvxBlinkItem;
54 class SvxBoxItem;
55 class SvxBrushItem;
56 class SvxCaseMapItem;
57 class SvxCharHiddenItem;
58 class SvxCharReliefItem;
59 class SvxCharRotateItem;
60 class SvxCharScaleWidthItem;
61 class SvxContourItem;
62 class SvxCrossedOutItem;
63 class SvxEmphasisMarkItem;
64 class SvxEscapementItem;
65 class SvxFontHeightItem;
66 class SvxFontItem;
67 class SvxForbiddenRuleItem;
68 class SvxFormatBreakItem;
69 class SvxFormatKeepItem;
70 class SvxFormatSplitItem;
71 class SvxFrameDirectionItem;
72 class SvxHangingPunctuationItem;
73 class SvxHyphenZoneItem;
74 class SvxKerningItem;
75 class SvxLanguageItem;
76 class SvxLineSpacingItem;
77 class SvxNoHyphenItem;
78 class SvxOpaqueItem;
79 class SvxOrphansItem;
80 class SvxOverlineItem;
81 class SvxPaperBinItem;
82 class SvxParaGridItem;
83 class SvxParaVertAlignItem;
84 class SvxPostureItem;
85 class SvxPrintItem;
86 class SvxProtectItem;
87 class SvxRsidItem;
88 class SvxScriptSpaceItem;
89 class SvxShadowedItem;
90 class SvxShadowItem;
91 class SvxTabStopItem;
92 class SvxTwoLinesItem;
93 class SvxULSpaceItem;
94 class SvxUnderlineItem;
95 class SvxWeightItem;
96 class SvxWidowsItem;
97 class SvxWordLineModeItem;
98 class SwChannelBGrf;
99 class SwChannelGGrf;
100 class SwChannelRGrf;
101 class SwContrastGrf;
102 class SwCropGrf;
103 class SwDrawModeGrf;
104 class SwFormatAnchor;
105 class SwFormatAutoFormat;
106 class SwFormatChain;
107 class SwFormatCharFormat;
108 class SwFormatCol;
109 class SwFormatDrop;
110 class SwFormatEditInReadonly;
111 class SwFormatEndAtTextEnd;
112 class SwFormatFlyCnt;
113 class SwFormatFollowTextFlow;
114 class SwFormatFootnoteAtTextEnd;
115 class SwFormatFrameSize;
116 class SwFormatHoriOrient;
117 class SwFormatINetFormat;
118 class SwFormatLayoutSplit;
119 class SwFormatLineNumber;
120 class SwFormatNoBalancedColumns;
121 class SwFormatPageDesc;
122 class SwFormatRowSplit;
123 class SwFormatFlySplit;
124 class SwFormatWrapTextAtFlyStart;
125 class SwFormatSurround;
126 class SwFormatURL;
127 class SwFormatVertOrient;
128 class SwFormatWrapInfluenceOnObjPos;
129 class SwGammaGrf;
130 class SwHeaderAndFooterEatSpacingItem;
131 class SwInvertGrf;
132 class SwLuminanceGrf;
133 class SwMirrorGrf;
134 class SwNumRuleItem;
135 class SwParaConnectBorderItem;
136 class SwRegisterItem;
137 class SwRotationGrf;
138 class SwTableBoxNumFormat;
139 class SwTextGridItem;
140 class SwTransparencyGrf;
141 class SwFormatRuby;
142 class SwTableFormulaUpdate;
143 class VirtPageNumHint;
144 class SwFltAnchor;
145 class SwFltTOX;
146 class SwFltRedline;
147 class SwFltRDFMark;
148 class SwCharFormat;
149 class SwConditionTextFormatColl;
150 class SwDrawFrameFormat;
151 class SwFlyFrameFormat;
152 class SwFormatField;
153 class SwFormatFootnote;
154 class SwFormatLineBreak;
155 class SwFormatRefMark;
156 class SwGrfFormatColl;
157 class SwTextFormatColl;
158 class SwTOXMark;
159 class CntUInt16Item;
160 class SwFormatFillOrder;
161 class SwFormatHeader;
162 class SwFormatFooter;
163 class SwFormatContent;
164 class SvxMacroItem;
165 class SwTableBoxFormula;
166 class SwTableBoxValue;
167 class SwFrameFormat;
168 class SfxVoidItem;
170 // For SwTextHints without end index the following char is added:
172 #define CH_TXTATR_BREAKWORD u'\x0001'
173 #define CH_TXTATR_INWORD u'\xFFF9'
174 #define CH_TXTATR_TAB u'\t'
175 #define CH_TXTATR_NEWLINE u'\n'
176 #define CH_TXT_ATR_INPUTFIELDSTART u'\x0004'
177 #define CH_TXT_ATR_INPUTFIELDEND u'\x0005'
179 #define CH_TXT_ATR_FORMELEMENT u'\x0006'
181 #define CH_TXT_ATR_FIELDSTART u'\x0007'
182 #define CH_TXT_ATR_FIELDSEP u'\x0003'
183 #define CH_TXT_ATR_FIELDEND u'\x0008'
184 inline constexpr OUString CH_TXT_ATR_SUBST_FIELDSTART = u"["_ustr;
185 inline constexpr OUString CH_TXT_ATR_SUBST_FIELDEND = u"]"_ustr;
187 // a non-visible dummy character to track deleted tables,
188 // table rows, and images anchored to characters
189 #define CH_TXT_TRACKED_DUMMY_CHAR u'\x200D'
192 * Enums for the hints
195 inline constexpr sal_uInt16 HINT_BEGIN = 1;
197 inline constexpr sal_uInt16 POOLATTR_BEGIN(HINT_BEGIN);
199 // Ranges for the IDs of the format-attributes.
200 // Which-values for character-format attributes.
201 inline constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN);
202 inline constexpr TypedWhichId<SvxCaseMapItem> RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN); // 1
203 inline constexpr TypedWhichId<SvxColorItem> RES_CHRATR_CHARSETCOLOR(2);
204 inline constexpr TypedWhichId<SvxColorItem> RES_CHRATR_COLOR(3);
205 inline constexpr TypedWhichId<SvxContourItem> RES_CHRATR_CONTOUR(4);
206 inline constexpr TypedWhichId<SvxCrossedOutItem> RES_CHRATR_CROSSEDOUT(5);
207 inline constexpr TypedWhichId<SvxEscapementItem> RES_CHRATR_ESCAPEMENT(6);
208 inline constexpr TypedWhichId<SvxFontItem> RES_CHRATR_FONT(7);
209 inline constexpr TypedWhichId<SvxFontHeightItem> RES_CHRATR_FONTSIZE(8);
210 inline constexpr TypedWhichId<SvxKerningItem> RES_CHRATR_KERNING(9);
211 inline constexpr TypedWhichId<SvxLanguageItem> RES_CHRATR_LANGUAGE(10);
212 inline constexpr TypedWhichId<SvxPostureItem> RES_CHRATR_POSTURE(11);
213 inline constexpr TypedWhichId<SfxVoidItem> RES_CHRATR_UNUSED1(12);
214 inline constexpr TypedWhichId<SvxShadowedItem> RES_CHRATR_SHADOWED(13);
215 inline constexpr TypedWhichId<SvxUnderlineItem> RES_CHRATR_UNDERLINE(14);
216 inline constexpr TypedWhichId<SvxWeightItem> RES_CHRATR_WEIGHT(15);
217 inline constexpr TypedWhichId<SvxWordLineModeItem> RES_CHRATR_WORDLINEMODE(16);
218 inline constexpr TypedWhichId<SvxAutoKernItem> RES_CHRATR_AUTOKERN(17);
219 inline constexpr TypedWhichId<SvxBlinkItem> RES_CHRATR_BLINK(18);
220 inline constexpr TypedWhichId<SvxNoHyphenItem> RES_CHRATR_NOHYPHEN(19);
221 inline constexpr TypedWhichId<SfxVoidItem> RES_CHRATR_UNUSED2(20);
222 inline constexpr TypedWhichId<SvxBrushItem> RES_CHRATR_BACKGROUND(21);
223 inline constexpr TypedWhichId<SvxFontItem> RES_CHRATR_CJK_FONT(22);
224 inline constexpr TypedWhichId<SvxFontHeightItem> RES_CHRATR_CJK_FONTSIZE(23);
225 inline constexpr TypedWhichId<SvxLanguageItem> RES_CHRATR_CJK_LANGUAGE(24);
226 inline constexpr TypedWhichId<SvxPostureItem> RES_CHRATR_CJK_POSTURE(25);
227 inline constexpr TypedWhichId<SvxWeightItem> RES_CHRATR_CJK_WEIGHT(26);
228 inline constexpr TypedWhichId<SvxFontItem> RES_CHRATR_CTL_FONT(27);
229 inline constexpr TypedWhichId<SvxFontHeightItem> RES_CHRATR_CTL_FONTSIZE(28);
230 inline constexpr TypedWhichId<SvxLanguageItem> RES_CHRATR_CTL_LANGUAGE(29);
231 inline constexpr TypedWhichId<SvxPostureItem> RES_CHRATR_CTL_POSTURE(30);
232 inline constexpr TypedWhichId<SvxWeightItem> RES_CHRATR_CTL_WEIGHT(31);
233 inline constexpr TypedWhichId<SvxCharRotateItem> RES_CHRATR_ROTATE(32);
234 inline constexpr TypedWhichId<SvxEmphasisMarkItem> RES_CHRATR_EMPHASIS_MARK(33);
235 inline constexpr TypedWhichId<SvxTwoLinesItem> RES_CHRATR_TWO_LINES(34);
236 inline constexpr TypedWhichId<SvxCharScaleWidthItem> RES_CHRATR_SCALEW(35);
237 inline constexpr TypedWhichId<SvxCharReliefItem> RES_CHRATR_RELIEF(36);
238 inline constexpr TypedWhichId<SvxCharHiddenItem> RES_CHRATR_HIDDEN(37);
239 inline constexpr TypedWhichId<SvxOverlineItem> RES_CHRATR_OVERLINE(38);
240 inline constexpr TypedWhichId<SvxRsidItem> RES_CHRATR_RSID(39);
241 inline constexpr TypedWhichId<SvxBoxItem> RES_CHRATR_BOX(40);
242 inline constexpr TypedWhichId<SvxShadowItem> RES_CHRATR_SHADOW(41);
243 inline constexpr TypedWhichId<SvxBrushItem> RES_CHRATR_HIGHLIGHT(42);
244 inline constexpr TypedWhichId<SfxGrabBagItem> RES_CHRATR_GRABBAG(43);
245 inline constexpr TypedWhichId<SfxInt16Item> RES_CHRATR_BIDIRTL(44);
246 inline constexpr TypedWhichId<SfxInt16Item> RES_CHRATR_IDCTHINT(45);
247 inline constexpr sal_uInt16 RES_CHRATR_END(46);
249 // this Attribute used only in a TextNodes SwpAttr-Array
250 inline constexpr sal_uInt16 RES_TXTATR_BEGIN(RES_CHRATR_END);
252 /** text attributes with start and end.
253 #i105453#:
254 Hints (SwTextAttr) with the same start and end position are sorted by
255 WhichId, i.e., the TXTATR constants defined here.
256 The text formatting (SwAttrIter) poses some requirements on TXTATR order:
257 - AUTOFMT must precede CHARFMT, so that auto style can overwrite char style.
258 - INETFMT must precede CHARFMT, so that link style can overwrite char style.
259 (this is actually surprising: CHARFMT hints are not split at INETFMT
260 hints on insertion, but on exporting to ODF. if CHARFMT would precede
261 INETFMT, then exporting and importing will effectively change precedence)
263 Nesting hints (SwTextAttrNesting) also have requirements on TXTATR order,
264 to ensure proper nesting (because CJK_RUBY and INETFMT have no CH_TXTATR):
265 - INETFMT should precede CJK_RUBY (for UNO API it does not matter...)
266 - META and METAFIELD must precede CJK_RUBY and INETFMT
268 inline constexpr sal_uInt16 RES_TXTATR_WITHEND_BEGIN(RES_TXTATR_BEGIN);
269 inline constexpr TypedWhichId<SwFormatRefMark> RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN); // 46
270 inline constexpr TypedWhichId<SwTOXMark> RES_TXTATR_TOXMARK(47);
271 inline constexpr TypedWhichId<SwFormatMeta> RES_TXTATR_META(48);
272 inline constexpr TypedWhichId<SwFormatMeta> RES_TXTATR_METAFIELD(49);
273 inline constexpr TypedWhichId<SwFormatAutoFormat> RES_TXTATR_AUTOFMT(50);
274 inline constexpr TypedWhichId<SwFormatINetFormat> RES_TXTATR_INETFMT(51);
275 inline constexpr TypedWhichId<SwFormatCharFormat> RES_TXTATR_CHARFMT(52);
276 inline constexpr TypedWhichId<SwFormatRuby> RES_TXTATR_CJK_RUBY(53);
277 inline constexpr TypedWhichId<SvXMLAttrContainerItem> RES_TXTATR_UNKNOWN_CONTAINER(54);
278 inline constexpr TypedWhichId<SwFormatField> RES_TXTATR_INPUTFIELD(55);
279 inline constexpr TypedWhichId<SwFormatContentControl> RES_TXTATR_CONTENTCONTROL(56);
280 inline constexpr sal_uInt16 RES_TXTATR_WITHEND_END(57);
282 // all TextAttributes without an end
283 inline constexpr sal_uInt16 RES_TXTATR_NOEND_BEGIN(RES_TXTATR_WITHEND_END);
284 inline constexpr TypedWhichId<SwFormatField> RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN); // 57
285 inline constexpr TypedWhichId<SwFormatFlyCnt> RES_TXTATR_FLYCNT(58);
286 inline constexpr TypedWhichId<SwFormatFootnote> RES_TXTATR_FTN(59);
287 inline constexpr TypedWhichId<SwFormatField> RES_TXTATR_ANNOTATION(60);
288 inline constexpr TypedWhichId<SwFormatLineBreak> RES_TXTATR_LINEBREAK(61);
289 inline constexpr TypedWhichId<SfxBoolItem> RES_TXTATR_DUMMY1(62);
290 inline constexpr sal_uInt16 RES_TXTATR_NOEND_END(63);
291 inline constexpr sal_uInt16 RES_TXTATR_END(RES_TXTATR_NOEND_END);
293 inline constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END);
294 inline constexpr TypedWhichId<SvxLineSpacingItem> RES_PARATR_LINESPACING(RES_PARATR_BEGIN); // 63
295 inline constexpr TypedWhichId<SvxAdjustItem> RES_PARATR_ADJUST(64);
296 inline constexpr TypedWhichId<SvxFormatSplitItem> RES_PARATR_SPLIT(65);
297 inline constexpr TypedWhichId<SvxOrphansItem> RES_PARATR_ORPHANS(66);
298 inline constexpr TypedWhichId<SvxWidowsItem> RES_PARATR_WIDOWS(67);
299 inline constexpr TypedWhichId<SvxTabStopItem> RES_PARATR_TABSTOP(68);
300 inline constexpr TypedWhichId<SvxHyphenZoneItem> RES_PARATR_HYPHENZONE(69);
301 inline constexpr TypedWhichId<SwFormatDrop> RES_PARATR_DROP(70);
302 inline constexpr TypedWhichId<SwRegisterItem> RES_PARATR_REGISTER(71);
303 inline constexpr TypedWhichId<SwNumRuleItem> RES_PARATR_NUMRULE(72);
304 inline constexpr TypedWhichId<SvxScriptSpaceItem> RES_PARATR_SCRIPTSPACE(73);
305 inline constexpr TypedWhichId<SvxHangingPunctuationItem> RES_PARATR_HANGINGPUNCTUATION(74);
306 inline constexpr TypedWhichId<SvxForbiddenRuleItem> RES_PARATR_FORBIDDEN_RULES(75);
307 inline constexpr TypedWhichId<SvxParaVertAlignItem> RES_PARATR_VERTALIGN(76);
308 inline constexpr TypedWhichId<SvxParaGridItem> RES_PARATR_SNAPTOGRID(77);
309 inline constexpr TypedWhichId<SwParaConnectBorderItem> RES_PARATR_CONNECT_BORDER(78);
310 inline constexpr TypedWhichId<SfxUInt16Item> RES_PARATR_OUTLINELEVEL(79);
311 inline constexpr TypedWhichId<SvxRsidItem> RES_PARATR_RSID(80);
312 inline constexpr TypedWhichId<SfxGrabBagItem> RES_PARATR_GRABBAG(81);
313 inline constexpr sal_uInt16 RES_PARATR_END(82);
315 // list attributes for paragraphs.
316 // intentionally these list attributes are not contained in paragraph styles
317 inline constexpr sal_uInt16 RES_PARATR_LIST_BEGIN(RES_PARATR_END);
318 inline constexpr TypedWhichId<SfxStringItem> RES_PARATR_LIST_ID(RES_PARATR_LIST_BEGIN); // 82
319 inline constexpr TypedWhichId<SfxInt16Item> RES_PARATR_LIST_LEVEL(83);
320 inline constexpr TypedWhichId<SfxBoolItem> RES_PARATR_LIST_ISRESTART(84);
321 inline constexpr TypedWhichId<SfxInt16Item> RES_PARATR_LIST_RESTARTVALUE(85);
322 inline constexpr TypedWhichId<SfxBoolItem> RES_PARATR_LIST_ISCOUNTED(86);
323 inline constexpr TypedWhichId<SwFormatAutoFormat>
324 RES_PARATR_LIST_AUTOFMT(87); //TypedWhichId<SfxSetItem>(87)
325 inline constexpr sal_uInt16 RES_PARATR_LIST_END(88);
327 inline constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END);
328 inline constexpr TypedWhichId<SwFormatFillOrder> RES_FILL_ORDER(RES_FRMATR_BEGIN);
329 inline constexpr TypedWhichId<SwFormatFrameSize> RES_FRM_SIZE(89);
330 inline constexpr TypedWhichId<SvxPaperBinItem> RES_PAPER_BIN(90);
331 inline constexpr TypedWhichId<SvxFirstLineIndentItem> RES_MARGIN_FIRSTLINE(91);
332 inline constexpr TypedWhichId<SvxTextLeftMarginItem> RES_MARGIN_TEXTLEFT(92);
333 inline constexpr TypedWhichId<SvxRightMarginItem> RES_MARGIN_RIGHT(93);
334 inline constexpr TypedWhichId<SvxLeftMarginItem> RES_MARGIN_LEFT(94);
335 inline constexpr TypedWhichId<SvxGutterLeftMarginItem> RES_MARGIN_GUTTER(95);
336 inline constexpr TypedWhichId<SvxGutterRightMarginItem> RES_MARGIN_GUTTER_RIGHT(96);
337 inline constexpr TypedWhichId<SvxLRSpaceItem> RES_LR_SPACE(97);
338 inline constexpr TypedWhichId<SvxULSpaceItem> RES_UL_SPACE(98);
339 inline constexpr TypedWhichId<SwFormatPageDesc> RES_PAGEDESC(99);
340 inline constexpr TypedWhichId<SvxFormatBreakItem> RES_BREAK(100);
341 inline constexpr TypedWhichId<SwFormatContent> RES_CNTNT(101);
342 inline constexpr TypedWhichId<SwFormatHeader> RES_HEADER(102);
343 inline constexpr TypedWhichId<SwFormatFooter> RES_FOOTER(103);
344 inline constexpr TypedWhichId<SvxPrintItem> RES_PRINT(104);
345 inline constexpr TypedWhichId<SvxOpaqueItem> RES_OPAQUE(105);
346 inline constexpr TypedWhichId<SvxProtectItem> RES_PROTECT(106);
347 inline constexpr TypedWhichId<SwFormatSurround> RES_SURROUND(107);
348 inline constexpr TypedWhichId<SwFormatVertOrient> RES_VERT_ORIENT(108);
349 inline constexpr TypedWhichId<SwFormatHoriOrient> RES_HORI_ORIENT(109);
350 inline constexpr TypedWhichId<SwFormatAnchor> RES_ANCHOR(110);
351 inline constexpr TypedWhichId<SvxBrushItem> RES_BACKGROUND(111);
352 inline constexpr TypedWhichId<SvxBoxItem> RES_BOX(112);
353 inline constexpr TypedWhichId<SvxShadowItem> RES_SHADOW(113);
354 inline constexpr TypedWhichId<SvxMacroItem> RES_FRMMACRO(114);
355 inline constexpr TypedWhichId<SwFormatCol> RES_COL(115);
356 inline constexpr TypedWhichId<SvxFormatKeepItem> RES_KEEP(116);
357 inline constexpr TypedWhichId<SwFormatURL> RES_URL(117);
358 inline constexpr TypedWhichId<SwFormatEditInReadonly> RES_EDIT_IN_READONLY(118);
359 inline constexpr TypedWhichId<SwFormatLayoutSplit> RES_LAYOUT_SPLIT(119);
360 inline constexpr TypedWhichId<SwFormatChain> RES_CHAIN(120);
361 inline constexpr TypedWhichId<SwTextGridItem> RES_TEXTGRID(121);
362 inline constexpr TypedWhichId<SwFormatLineNumber> RES_LINENUMBER(122);
363 inline constexpr TypedWhichId<SwFormatFootnoteAtTextEnd> RES_FTN_AT_TXTEND(123);
364 inline constexpr TypedWhichId<SwFormatEndAtTextEnd> RES_END_AT_TXTEND(124);
365 inline constexpr TypedWhichId<SwFormatNoBalancedColumns> RES_COLUMNBALANCE(125);
366 inline constexpr TypedWhichId<SvxFrameDirectionItem> RES_FRAMEDIR(126);
367 inline constexpr TypedWhichId<SwHeaderAndFooterEatSpacingItem> RES_HEADER_FOOTER_EAT_SPACING(127);
368 inline constexpr TypedWhichId<SwFormatRowSplit> RES_ROW_SPLIT(128);
369 inline constexpr TypedWhichId<SwFormatFlySplit> RES_FLY_SPLIT(129);
370 inline constexpr TypedWhichId<SwFormatFollowTextFlow> RES_FOLLOW_TEXT_FLOW(130);
371 inline constexpr TypedWhichId<SfxBoolItem> RES_COLLAPSING_BORDERS(131);
372 inline constexpr TypedWhichId<SwFormatWrapInfluenceOnObjPos> RES_WRAP_INFLUENCE_ON_OBJPOS(132);
373 inline constexpr TypedWhichId<SwFormatAutoFormat> RES_AUTO_STYLE(133);
374 inline constexpr TypedWhichId<SfxStringItem> RES_FRMATR_STYLE_NAME(134);
375 inline constexpr TypedWhichId<SfxStringItem> RES_FRMATR_CONDITIONAL_STYLE_NAME(135);
376 inline constexpr TypedWhichId<SfxGrabBagItem> RES_FRMATR_GRABBAG(136);
377 inline constexpr TypedWhichId<SdrTextVertAdjustItem> RES_TEXT_VERT_ADJUST(137);
378 inline constexpr TypedWhichId<SfxBoolItem> RES_BACKGROUND_FULL_SIZE(138);
379 inline constexpr TypedWhichId<SfxBoolItem> RES_RTL_GUTTER(139);
380 inline constexpr TypedWhichId<SfxBoolItem> RES_DECORATIVE(140);
381 inline constexpr TypedWhichId<SwFormatWrapTextAtFlyStart> RES_WRAP_TEXT_AT_FLY_START(141);
382 inline constexpr sal_uInt16 RES_FRMATR_END(142);
384 inline constexpr sal_uInt16 RES_GRFATR_BEGIN(RES_FRMATR_END);
385 inline constexpr TypedWhichId<SwMirrorGrf> RES_GRFATR_MIRRORGRF(RES_GRFATR_BEGIN);
386 inline constexpr TypedWhichId<SwCropGrf> RES_GRFATR_CROPGRF(143);
388 inline constexpr TypedWhichId<SwRotationGrf> RES_GRFATR_ROTATION(144);
389 inline constexpr TypedWhichId<SwLuminanceGrf> RES_GRFATR_LUMINANCE(145);
390 inline constexpr TypedWhichId<SwContrastGrf> RES_GRFATR_CONTRAST(146);
391 inline constexpr TypedWhichId<SwChannelRGrf> RES_GRFATR_CHANNELR(147);
392 inline constexpr TypedWhichId<SwChannelGGrf> RES_GRFATR_CHANNELG(148);
393 inline constexpr TypedWhichId<SwChannelBGrf> RES_GRFATR_CHANNELB(149);
394 inline constexpr TypedWhichId<SwGammaGrf> RES_GRFATR_GAMMA(150);
395 inline constexpr TypedWhichId<SwInvertGrf> RES_GRFATR_INVERT(151);
396 inline constexpr TypedWhichId<SwTransparencyGrf> RES_GRFATR_TRANSPARENCY(152);
397 inline constexpr TypedWhichId<SwDrawModeGrf> RES_GRFATR_DRAWMODE(153);
399 inline constexpr TypedWhichId<SfxBoolItem> RES_GRFATR_DUMMY4(154);
400 inline constexpr TypedWhichId<SfxBoolItem> RES_GRFATR_DUMMY5(155);
401 inline constexpr sal_uInt16 RES_GRFATR_END(156);
403 inline constexpr sal_uInt16 RES_BOXATR_BEGIN(RES_GRFATR_END);
404 inline constexpr TypedWhichId<SwTableBoxNumFormat> RES_BOXATR_FORMAT(RES_BOXATR_BEGIN);
405 inline constexpr TypedWhichId<SwTableBoxFormula> RES_BOXATR_FORMULA(157);
406 inline constexpr TypedWhichId<SwTableBoxValue> RES_BOXATR_VALUE(158);
407 inline constexpr sal_uInt16 RES_BOXATR_END(159);
409 inline constexpr sal_uInt16 RES_UNKNOWNATR_BEGIN(RES_BOXATR_END);
410 inline constexpr TypedWhichId<SvXMLAttrContainerItem>
411 RES_UNKNOWNATR_CONTAINER(RES_UNKNOWNATR_BEGIN);
412 inline constexpr sal_uInt16 RES_UNKNOWNATR_END(160);
414 inline constexpr sal_uInt16 POOLATTR_END(RES_UNKNOWNATR_END);
416 // Format IDs
417 inline constexpr sal_uInt16 RES_FMT_BEGIN(RES_UNKNOWNATR_END);
418 inline constexpr TypedWhichId<SwCharFormat> RES_CHRFMT(RES_FMT_BEGIN);
419 inline constexpr TypedWhichId<SwFrameFormat> RES_FRMFMT(161);
420 inline constexpr TypedWhichId<SwFlyFrameFormat> RES_FLYFRMFMT(162);
421 inline constexpr TypedWhichId<SwTextFormatColl> RES_TXTFMTCOLL(163);
422 inline constexpr TypedWhichId<SwGrfFormatColl> RES_GRFFMTCOLL(164);
423 inline constexpr TypedWhichId<SwDrawFrameFormat> RES_DRAWFRMFMT(165);
424 inline constexpr TypedWhichId<SwConditionTextFormatColl> RES_CONDTXTFMTCOLL(166);
425 inline constexpr sal_uInt16 RES_FMT_END(167);
427 // ID's for Messages in the Formats
428 inline constexpr sal_uInt16 RES_FORMAT_MSG_BEGIN(RES_FMT_END);
429 inline constexpr TypedWhichId<SwPtrMsgPoolItem> RES_OBJECTDYING(RES_FORMAT_MSG_BEGIN); // 167
430 inline constexpr sal_uInt16 RES_UPDATEATTR_FMT_CHG(
431 168); // used by SwUpdateAttr just as an ID to communicate what has changed
432 inline constexpr sal_uInt16 RES_UPDATEATTR_ATTRSET_CHG(
433 169); // used by SwUpdateAttr just as an ID to communicate what has changed
434 inline constexpr TypedWhichId<SwUpdateAttr> RES_UPDATE_ATTR(170);
435 // empty
436 inline constexpr sal_uInt16 RES_FORMAT_MSG_END(190);
438 // An ID for the RTF-reader. The stylesheets are treated like attributes,
439 // i.e. there is a StyleSheet-attribute. To avoid collision with other
440 // Which()-values, the value is listed here. (The help system too defines
441 // new attributes!)
442 inline constexpr sal_uInt16 RES_FLTRATTR_BEGIN(RES_FORMAT_MSG_END);
443 inline constexpr TypedWhichId<SfxStringItem> RES_FLTR_BOOKMARK(RES_FLTRATTR_BEGIN);
444 inline constexpr TypedWhichId<SwFltAnchor> RES_FLTR_ANCHOR(191);
445 inline constexpr TypedWhichId<SfxStringItem> RES_FLTR_NUMRULE(192);
446 inline constexpr TypedWhichId<SwFltTOX> RES_FLTR_TOX(193);
447 inline constexpr TypedWhichId<SwFltRedline> RES_FLTR_REDLINE(194);
448 inline constexpr TypedWhichId<CntUInt16Item> RES_FLTR_ANNOTATIONMARK(195);
449 inline constexpr TypedWhichId<SwFltRDFMark> RES_FLTR_RDFMARK(196);
450 inline constexpr sal_uInt16 RES_FLTRATTR_END(197);
452 inline constexpr sal_uInt16 RES_TBX_DUMMY(RES_FLTRATTR_END + 1);
454 inline constexpr TypedWhichId<SfxStringItem> HINT_END(RES_TBX_DUMMY);
456 // Error recognition!!
457 inline constexpr sal_uInt16 INVALID_HINT(HINT_END);
458 inline constexpr sal_uInt16 RES_WHICHHINT_END(HINT_END);
460 inline bool isATR(const sal_uInt16 nWhich)
462 return (RES_CHRATR_BEGIN <= nWhich) && (RES_UNKNOWNATR_END > nWhich);
464 inline bool isCHRATR(const sal_uInt16 nWhich)
466 return (RES_CHRATR_BEGIN <= nWhich) && (RES_CHRATR_END > nWhich);
468 inline bool isTXTATR_WITHEND(const sal_uInt16 nWhich)
470 return (RES_TXTATR_WITHEND_BEGIN <= nWhich) && (RES_TXTATR_WITHEND_END > nWhich);
472 inline bool isTXTATR_NOEND(const sal_uInt16 nWhich)
474 return (RES_TXTATR_NOEND_BEGIN <= nWhich) && (RES_TXTATR_NOEND_END > nWhich);
476 inline bool isTXTATR(const sal_uInt16 nWhich)
478 return (RES_TXTATR_BEGIN <= nWhich) && (RES_TXTATR_END > nWhich);
480 inline bool isPARATR(const sal_uInt16 nWhich)
482 return (RES_PARATR_BEGIN <= nWhich) && (RES_PARATR_END > nWhich);
484 inline bool isPARATR_LIST(const sal_uInt16 nWhich)
486 return (RES_PARATR_LIST_BEGIN <= nWhich) && (RES_PARATR_LIST_END > nWhich);
488 inline bool isFRMATR(const sal_uInt16 nWhich)
490 return (RES_FRMATR_BEGIN <= nWhich) && (RES_FRMATR_END > nWhich);
492 inline bool isDrawingLayerAttribute(const sal_uInt16 nWhich)
494 return (XATTR_START <= nWhich) && (XATTR_END > nWhich);
496 inline bool isGRFATR(const sal_uInt16 nWhich)
498 return (RES_GRFATR_BEGIN <= nWhich) && (RES_GRFATR_END > nWhich);
500 inline bool isBOXATR(const sal_uInt16 nWhich)
502 return (RES_BOXATR_BEGIN <= nWhich) && (RES_BOXATR_END > nWhich);
504 inline bool isUNKNOWNATR(const sal_uInt16 nWhich)
506 return (RES_UNKNOWNATR_BEGIN <= nWhich) && (RES_UNKNOWNATR_END > nWhich);
508 inline bool isFormatMessage(const sal_uInt16 nWhich)
510 return (RES_FORMAT_MSG_BEGIN <= nWhich) && (RES_FORMAT_MSG_END > nWhich);
513 // Take the respective default attribute from the statistical default
514 // attributes table over the Which-value.
515 // If none exists, return a 0 pointer!!!
516 // This function is implemented in Init.cxx. It is declared here as external
517 // in order to allow the formats to access it.
518 // Inline in PRODUCT.
519 class SfxPoolItem;
520 struct SfxItemInfo;
521 typedef std::vector<SfxPoolItem*> SwDfltAttrTab;
523 /** Get the default attribute from corresponding default attribute table.
525 @param[in] nWhich Position in table
526 @return Attribute if found, null pointer otherwise
528 SW_DLLPUBLIC const SfxPoolItem* GetDfltAttr(sal_uInt16 nWhich);
530 template <class T> inline const T* GetDfltAttr(TypedWhichId<T> nWhich)
532 return static_cast<const T*>(GetDfltAttr(sal_uInt16(nWhich)));
535 SW_DLLPUBLIC sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript);
537 template <class T>
538 inline TypedWhichId<T> GetWhichOfScript(TypedWhichId<T> nWhich, sal_uInt16 nScript)
540 return TypedWhichId<T>(GetWhichOfScript(sal_uInt16(nWhich), nScript));
543 // return for the given TextAttribute without an end the correct character.
544 // This function returns
545 // CH_TXTATR_BREAKWORD for Textattribute which breaks a word (default)
546 // CH_TXTATR_INWORD for Textattribute which doesn't breaks a word
547 class SwTextAttr;
548 sal_Unicode GetCharOfTextAttr(const SwTextAttr& rAttr);
550 // all Sets defined in init.cxx
552 // AttrSet-Range for the 3 Break-Attribute
553 extern WhichRangesContainer const aBreakSetRange;
554 // AttrSet-Range for TextFormatColl
555 extern WhichRangesContainer const aTextFormatCollSetRange;
556 // AttrSet-Range for GrfFormatColl
557 extern WhichRangesContainer const aGrfFormatCollSetRange;
558 // AttrSet-Range for TextNode
559 SW_DLLPUBLIC extern WhichRangesContainer const aTextNodeSetRange;
560 // AttrSet-Range for NoTextNode
561 extern WhichRangesContainer const aNoTextNodeSetRange;
562 // AttrSet-Range for SwTable
563 extern WhichRangesContainer const aTableSetRange;
564 // AttrSet-Range for SwTableLine
565 extern WhichRangesContainer const aTableLineSetRange;
566 // AttrSet-Range for SwTableBox
567 extern WhichRangesContainer const aTableBoxSetRange;
568 // AttrSet-Range for SwFrameFormat
569 SW_DLLPUBLIC extern WhichRangesContainer const aFrameFormatSetRange;
570 // AttrSet-Range for SwCharFormat
571 extern WhichRangesContainer const aCharFormatSetRange;
572 // AttrSet-Range for the autostyles
573 extern WhichRangesContainer const aCharAutoFormatSetRange;
574 // AttrSet-Range for SwPageDescFormat
575 extern WhichRangesContainer const aPgFrameFormatSetRange;
577 // check if ID is InRange of AttrSet-Ids
578 bool IsInRange(const WhichRangesContainer& pRange, const sal_uInt16 nId);
580 #endif
582 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */