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