1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hintids.hxx,v $
10 * $Revision: 1.36.136.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 #include <tools/solar.h> // fuer __FAR_DATA
34 #include <sal/types.h> // for sal_Unicode
37 // fuer SwTxtHints ohne Endindex wird folgendes Zeichen eingefuegt:
38 //JP 24.05.00: for the new UniCode Version:
39 #define CH_TXTATR_BREAKWORD ((sal_Unicode)0x01)
40 #define CH_TXTATR_INWORD ((sal_Unicode)0x02)
41 #define CH_TXTATR_TAB ((sal_Unicode)'\t')
42 #define CH_TXTATR_NEWLINE ((sal_Unicode)'\n')
43 #define CH_TXT_ATR_FIELDSTART ((sal_Unicode)0x04)
44 #define CH_TXT_ATR_FIELDEND ((sal_Unicode)0x05)
45 #define CH_TXT_ATR_SUBST_FIELDSTART ("[")
46 #define CH_TXT_ATR_SUBST_FIELDEND ("]")
47 #define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)0x06)
50 * Hier kommen erst mal die enums fuer die Hints
55 #define POOLATTR_BEGIN HINT_BEGIN
56 #define POOLATTR_END RES_UNKNOWNATR_END
58 // Bereiche fuer die Id's der einzelnen Format-Attribute
59 // die Which-Werte fuer die Charakter-Format Attribute
62 RES_CHRATR_BEGIN
= HINT_BEGIN
,
63 RES_CHRATR_CASEMAP
= RES_CHRATR_BEGIN
, // 1
64 RES_CHRATR_CHARSETCOLOR
, // 2
65 RES_CHRATR_COLOR
, // 3
66 RES_CHRATR_CONTOUR
, // 4
67 RES_CHRATR_CROSSEDOUT
, // 5
68 RES_CHRATR_ESCAPEMENT
, // 6
70 RES_CHRATR_FONTSIZE
, // 8
71 RES_CHRATR_KERNING
, // 9
72 RES_CHRATR_LANGUAGE
, // 10
73 RES_CHRATR_POSTURE
, // 11
74 RES_CHRATR_PROPORTIONALFONTSIZE
, // 12
75 RES_CHRATR_SHADOWED
, // 13
76 RES_CHRATR_UNDERLINE
, // 14
77 RES_CHRATR_WEIGHT
, // 15
78 RES_CHRATR_WORDLINEMODE
, // 16
79 RES_CHRATR_AUTOKERN
, // 17
80 RES_CHRATR_BLINK
, // 18
81 RES_CHRATR_NOHYPHEN
, // 19
82 RES_CHRATR_NOLINEBREAK
, // 20
83 RES_CHRATR_BACKGROUND
, // 21
84 RES_CHRATR_CJK_FONT
, // 22
85 RES_CHRATR_CJK_FONTSIZE
, // 23
86 RES_CHRATR_CJK_LANGUAGE
, // 24
87 RES_CHRATR_CJK_POSTURE
, // 25
88 RES_CHRATR_CJK_WEIGHT
, // 26
89 RES_CHRATR_CTL_FONT
, // 27
90 RES_CHRATR_CTL_FONTSIZE
, // 28
91 RES_CHRATR_CTL_LANGUAGE
, // 29
92 RES_CHRATR_CTL_POSTURE
, // 30
93 RES_CHRATR_CTL_WEIGHT
, // 31
94 RES_CHRATR_ROTATE
, // 32
95 RES_CHRATR_EMPHASIS_MARK
, // 33
96 RES_CHRATR_TWO_LINES
, // 34
97 RES_CHRATR_SCALEW
, // 35
98 RES_CHRATR_RELIEF
, // 36
99 RES_CHRATR_HIDDEN
, // 37
100 RES_CHRATR_OVERLINE
, // 38
101 RES_CHRATR_DUMMY1
, // 39
102 RES_CHRATR_DUMMY2
, // 40
106 // diese Attribute stehen nur im SwpAttr-Array vom TextNode
109 RES_TXTATR_BEGIN
= RES_CHRATR_END
,
111 // alle TextAttribute mit einem Ende
112 // JP 12.07.96: die Ids RES_TXTATR_NOLINEBREAK und RES_TXTATR_NOHYPHEN
113 // wanderten in den Bereich der CharAttr. Die Ids selbst muessen
114 // aber als Dummies noch erhalten bleiben. Der SwG-/Sw3 Reader
115 // merkt sich die Ids immer als Offset zum Start der Gruppe!!!
116 // Aus dem RES_TXTATR_NOLINEBREAK ist jetzt RES_TXTATR_INETFMT geworden.
117 RES_TXTATR_WITHEND_BEGIN
= RES_TXTATR_BEGIN
,
118 RES_TXTATR_AUTOFMT
= RES_TXTATR_WITHEND_BEGIN
, // 41
119 RES_TXTATR_INETFMT
, // 42
120 RES_TXTATR_REFMARK
, // 43
121 RES_TXTATR_TOXMARK
, // 44
122 RES_TXTATR_CHARFMT
, // 45
123 RES_TXTATR_DUMMY5
, // 46
124 RES_TXTATR_CJK_RUBY
, // 47
125 RES_TXTATR_UNKNOWN_CONTAINER
, // 48
126 RES_TXTATR_META
, // 49
127 RES_TXTATR_METAFIELD
, // 50
128 RES_TXTATR_WITHEND_END
,
130 // alle TextAttribute ohne ein Ende
131 RES_TXTATR_NOEND_BEGIN
= RES_TXTATR_WITHEND_END
,
132 RES_TXTATR_FIELD
= RES_TXTATR_NOEND_BEGIN
, // 51
133 RES_TXTATR_FLYCNT
, // 52
134 RES_TXTATR_FTN
, // 53
135 RES_TXTATR_DUMMY4
, // 54
136 RES_TXTATR_DUMMY3
, // 55
137 RES_TXTATR_DUMMY1
, // 56
138 RES_TXTATR_DUMMY2
, // 57
139 RES_TXTATR_NOEND_END
,
140 RES_TXTATR_END
= RES_TXTATR_NOEND_END
145 RES_PARATR_BEGIN
= RES_TXTATR_END
,
146 RES_PARATR_LINESPACING
= RES_PARATR_BEGIN
, // 58
147 RES_PARATR_ADJUST
, // 59
148 RES_PARATR_SPLIT
, // 60
149 RES_PARATR_ORPHANS
, // 61
150 RES_PARATR_WIDOWS
, // 62
151 RES_PARATR_TABSTOP
, // 63
152 RES_PARATR_HYPHENZONE
, // 64
153 RES_PARATR_DROP
, // 65
154 RES_PARATR_REGISTER
, // 66
155 RES_PARATR_NUMRULE
, // 67
156 RES_PARATR_SCRIPTSPACE
, // 68
157 RES_PARATR_HANGINGPUNCTUATION
, // 69
158 RES_PARATR_FORBIDDEN_RULES
, // 70
159 RES_PARATR_VERTALIGN
, // 71
160 RES_PARATR_SNAPTOGRID
, // 72
161 RES_PARATR_CONNECT_BORDER
, // 73
162 RES_PARATR_OUTLINELEVEL
, // 74
166 // --> OD 2008-02-25 #refactorlists#
167 // list attributes for paragraphs.
168 // intentionally these list attributes are not contained in paragraph styles
171 RES_PARATR_LIST_BEGIN
= RES_PARATR_END
,
172 RES_PARATR_LIST_ID
= RES_PARATR_LIST_BEGIN
, // 75
173 RES_PARATR_LIST_LEVEL
, // 76
174 RES_PARATR_LIST_ISRESTART
, // 77
175 RES_PARATR_LIST_RESTARTVALUE
, // 78
176 RES_PARATR_LIST_ISCOUNTED
, // 79
183 RES_FRMATR_BEGIN
= RES_PARATR_LIST_END
,
184 RES_FILL_ORDER
= RES_FRMATR_BEGIN
, // 80
198 RES_VERT_ORIENT
, // 94
199 RES_HORI_ORIENT
, // 95
201 RES_BACKGROUND
, // 97
208 RES_EDIT_IN_READONLY
, // 104
209 RES_LAYOUT_SPLIT
, // 105
212 RES_LINENUMBER
, // 108
213 RES_FTN_AT_TXTEND
, // 109
214 RES_END_AT_TXTEND
, // 110
215 RES_COLUMNBALANCE
, // 111
217 RES_HEADER_FOOTER_EAT_SPACING
, // 113
218 RES_ROW_SPLIT
, // 114
219 // OD 18.09.2003 #i18732# - insert new item and 5 dummies
220 RES_FOLLOW_TEXT_FLOW
, // 115
221 // --> collapsing borders FME 2005-05-27 #i29550#
222 RES_COLLAPSING_BORDERS
, // 116
224 // OD 2004-05-04 #i28701# - use dummy1 for new item
225 RES_WRAP_INFLUENCE_ON_OBJPOS
, // 117
226 RES_AUTO_STYLE
, // 118
227 RES_FRMATR_STYLE_NAME
, // 119
228 RES_FRMATR_CONDITIONAL_STYLE_NAME
, // 120
234 RES_GRFATR_BEGIN
= RES_FRMATR_END
,
235 RES_GRFATR_MIRRORGRF
= RES_GRFATR_BEGIN
, // 121
236 RES_GRFATR_CROPGRF
, // 122
238 RES_GRFATR_ROTATION
, // 123
239 RES_GRFATR_LUMINANCE
, // 124
240 RES_GRFATR_CONTRAST
, // 125
241 RES_GRFATR_CHANNELR
, // 126
242 RES_GRFATR_CHANNELG
, // 127
243 RES_GRFATR_CHANNELB
, // 128
244 RES_GRFATR_GAMMA
, // 129
245 RES_GRFATR_INVERT
, // 130
246 RES_GRFATR_TRANSPARENCY
, // 131
247 RES_GRFATR_DRAWMODE
, // 132
249 RES_GRFATR_DUMMY1
, // 133
250 RES_GRFATR_DUMMY2
, // 134
251 RES_GRFATR_DUMMY3
, // 135
252 RES_GRFATR_DUMMY4
, // 136
253 RES_GRFATR_DUMMY5
, // 137
259 RES_BOXATR_BEGIN
= RES_GRFATR_END
,
260 RES_BOXATR_FORMAT
= RES_BOXATR_BEGIN
, // 138
261 RES_BOXATR_FORMULA
, // 139
262 RES_BOXATR_VALUE
, // 140
268 RES_UNKNOWNATR_BEGIN
= RES_BOXATR_END
,
269 RES_UNKNOWNATR_CONTAINER
= RES_UNKNOWNATR_BEGIN
,// 141
275 // ID-s fuer die Formate
278 RES_FMT_BEGIN
= RES_UNKNOWNATR_END
,
279 RES_CHRFMT
= RES_FMT_BEGIN
,
289 // die ID's fuer Messages in den Formaten
292 RES_MSG_BEGIN
= RES_FMT_END
,
293 RES_OBJECTDYING
= RES_MSG_BEGIN
,
304 RES_PAGEDESC_FTNINFO
,
305 RES_REFMARKFLD_UPDATE
,
314 RES_SECTION_NOT_HIDDEN
,
316 RES_GRAPHIC_PIECE_ARRIVED
,
317 RES_HIDDENPARA_PRINT
,
318 RES_CONDCOLL_CONDCHG
,
319 RES_VIRTPAGENUM_INFO
,
320 // --> OD 2008-02-25 #refactorlists#
323 RES_GETLOWERNUMLEVEL
,
324 RES_RESET_FMTWRITTEN
,
325 RES_REMOVE_UNO_OBJECT
,
326 RES_GRF_REREAD_AND_INCACHE
,
327 RES_SECTION_RESETHIDDENFLAG
,
330 RES_FOOTNOTE_DELETED
,
337 RES_DESCRIPTION_CHANGED
,
338 RES_UNOCURSOR_LEAVES_SECTION
,
339 RES_LINKED_GRAPHIC_STREAM_ARRIVED
,
344 // eine ID fuer den RTF-Reader. Die Stylesheets werden wie
345 // Attribute behandelt, d.H. es gibt ein StyleSheet Attribut. Um
346 // nicht mit anderen Which()-Werten zu kollidieren, ist der Wert
347 // hier mit aufgefuehrt. (Auch das Hilfesystem definiert neue
351 RES_FLTRATTR_BEGIN
= RES_MSG_END
,
352 RES_FLTR_STYLESHEET
= RES_FLTRATTR_BEGIN
,
357 RES_FLTR_NUMRULE_NUM
,
366 #define RES_TBX_DUMMY RES_FLTRATTR_END + 1
368 #define HINT_END RES_TBX_DUMMY
370 // Fehler-Erkennung !!
371 #define INVALID_HINT HINT_END
372 #define RES_WHICHHINT_END HINT_END
375 inline bool isATR(const USHORT nWhich
)
377 return (RES_CHRATR_BEGIN
<= nWhich
) && (RES_UNKNOWNATR_END
> nWhich
);
379 inline bool isCHRATR(const USHORT nWhich
)
381 return (RES_CHRATR_BEGIN
<= nWhich
) && (RES_CHRATR_END
> nWhich
);
383 inline bool isTXTATR_WITHEND(const USHORT nWhich
)
385 return (RES_TXTATR_WITHEND_BEGIN
<= nWhich
)
386 && (RES_TXTATR_WITHEND_END
> nWhich
);
388 inline bool isTXTATR_NOEND(const USHORT nWhich
)
390 return (RES_TXTATR_NOEND_BEGIN
<= nWhich
)
391 && (RES_TXTATR_NOEND_END
> nWhich
);
393 inline bool isTXTATR(const USHORT nWhich
)
395 return (RES_TXTATR_BEGIN
<= nWhich
) && (RES_TXTATR_END
> nWhich
);
397 inline bool isPARATR(const USHORT nWhich
)
399 return (RES_PARATR_BEGIN
<= nWhich
) && (RES_PARATR_END
> nWhich
);
401 inline bool isPARATR_LIST(const USHORT nWhich
)
403 return (RES_PARATR_LIST_BEGIN
<= nWhich
) && (RES_PARATR_LIST_END
> nWhich
); }
404 inline bool isFRMATR(const USHORT nWhich
)
406 return (RES_FRMATR_BEGIN
<= nWhich
) && (RES_FRMATR_END
> nWhich
);
408 inline bool isGRFATR(const USHORT nWhich
)
410 return (RES_GRFATR_BEGIN
<= nWhich
) && (RES_GRFATR_END
> nWhich
);
412 inline bool isBOXATR(const USHORT nWhich
)
414 return (RES_BOXATR_BEGIN
<= nWhich
) && (RES_BOXATR_END
> nWhich
);
416 inline bool isUNKNOWNATR(const USHORT nWhich
)
418 return (RES_UNKNOWNATR_BEGIN
<= nWhich
) && (RES_UNKNOWNATR_END
> nWhich
);
423 * hole aus der statischen Default-Attribut Tabelle ueber den Which-Wert
424 * das entsprechende default Attribut.
425 * Ist keines vorhanden, returnt ein 0-Pointer !!!
427 * Diese Funktion ist im Init.CXX implementiert. Damit die Formate darauf
428 * zugreifen koennen, ist sie hier als extern deklariert.
429 * Im PRODUCT ist das Teil inline.
433 typedef SfxPoolItem
* SwDfltAttrTab
[ POOLATTR_END
- POOLATTR_BEGIN
];
435 extern SwDfltAttrTab __FAR_DATA aAttrTab
;
436 extern SfxItemInfo __FAR_DATA aSlotTab
[];
438 SW_DLLPUBLIC
const SfxPoolItem
* GetDfltAttr( USHORT nWhich
);
440 SW_DLLPUBLIC USHORT
GetWhichOfScript( USHORT nWhich
, USHORT nScript
);
442 // return for the given TextAttribut without an end the correct character.
443 // This function returns
444 // CH_TXTATR_BREAKWORD for Textattribut which breaks a word (default)
445 // CH_TXTATR_INWORD for Textattribut which dont breaks a word
447 sal_Unicode
GetCharOfTxtAttr( const SwTxtAttr
& rAttr
);
449 // alle Sets stehen im init.cxx
451 // AttrSet-Range fuer die 3 Break-Attribute
452 extern USHORT __FAR_DATA aBreakSetRange
[];
453 // AttrSet-Range fuer die TxtFmtColl
454 extern USHORT __FAR_DATA aTxtFmtCollSetRange
[];
455 // AttrSet-Range fuer die GrfFmtColl
456 extern USHORT __FAR_DATA aGrfFmtCollSetRange
[];
457 // AttrSet-Range fuer die TextNode
458 SW_DLLPUBLIC
extern USHORT __FAR_DATA aTxtNodeSetRange
[];
459 // AttrSet-Range fuer die NoTxtNode
460 extern USHORT __FAR_DATA aNoTxtNodeSetRange
[];
461 // AttrSet-Range fuer die SwTable
462 extern USHORT __FAR_DATA aTableSetRange
[];
463 // AttrSet-Range fuer die SwTableLine
464 extern USHORT __FAR_DATA aTableLineSetRange
[];
465 // AttrSet-Range fuer die SwTableBox
466 extern USHORT __FAR_DATA aTableBoxSetRange
[];
467 // AttrSet-Range fuer die SwFrmFmt
468 SW_DLLPUBLIC
extern USHORT __FAR_DATA aFrmFmtSetRange
[];
469 // AttrSet-Range fuer die SwCharFmt
470 extern USHORT __FAR_DATA aCharFmtSetRange
[];
471 // AttrSet-Range fuer die character autostyles
472 extern USHORT __FAR_DATA aCharAutoFmtSetRange
[];
473 // AttrSet-Range fuer die SwPageDescFmt
474 extern USHORT __FAR_DATA aPgFrmFmtSetRange
[];
476 // check if ID is InRange of AttrSet-Ids
477 BOOL
IsInRange( const USHORT
* pRange
, const USHORT nId
);