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