1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _HINTIDS_HXX 24 #define _HINTIDS_HXX 25 26 #include <tools/solar.h> // fuer __FAR_DATA 27 #include <sal/types.h> // for sal_Unicode 28 #include "swdllapi.h" 29 30 // fuer SwTxtHints ohne Endindex wird folgendes Zeichen eingefuegt: 31 //JP 24.05.00: for the new UniCode Version: 32 #define CH_TXTATR_BREAKWORD ((sal_Unicode)0x01) 33 #define CH_TXTATR_INWORD ((sal_Unicode)0x02) 34 #define CH_TXTATR_TAB ((sal_Unicode)'\t') 35 #define CH_TXTATR_NEWLINE ((sal_Unicode)'\n') 36 #define CH_TXT_ATR_FIELDSTART ((sal_Unicode)0x04) 37 #define CH_TXT_ATR_FIELDEND ((sal_Unicode)0x05) 38 #define CH_TXT_ATR_SUBST_FIELDSTART ("[") 39 #define CH_TXT_ATR_SUBST_FIELDEND ("]") 40 #define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)0x06) 41 42 /* 43 * Hier kommen erst mal die enums fuer die Hints 44 */ 45 46 #define HINT_BEGIN 1 47 48 #define POOLATTR_BEGIN HINT_BEGIN 49 #define POOLATTR_END RES_UNKNOWNATR_END 50 51 // Bereiche fuer die Id's der einzelnen Format-Attribute 52 // die Which-Werte fuer die Charakter-Format Attribute 53 enum RES_CHRATR 54 { 55 RES_CHRATR_BEGIN = HINT_BEGIN, 56 RES_CHRATR_CASEMAP = RES_CHRATR_BEGIN, // 1 57 RES_CHRATR_CHARSETCOLOR, // 2 58 RES_CHRATR_COLOR, // 3 59 RES_CHRATR_CONTOUR, // 4 60 RES_CHRATR_CROSSEDOUT, // 5 61 RES_CHRATR_ESCAPEMENT, // 6 62 RES_CHRATR_FONT, // 7 63 RES_CHRATR_FONTSIZE, // 8 64 RES_CHRATR_KERNING, // 9 65 RES_CHRATR_LANGUAGE, // 10 66 RES_CHRATR_POSTURE, // 11 67 RES_CHRATR_PROPORTIONALFONTSIZE, // 12 68 RES_CHRATR_SHADOWED, // 13 69 RES_CHRATR_UNDERLINE, // 14 70 RES_CHRATR_WEIGHT, // 15 71 RES_CHRATR_WORDLINEMODE, // 16 72 RES_CHRATR_AUTOKERN, // 17 73 RES_CHRATR_BLINK, // 18 74 RES_CHRATR_NOHYPHEN, // 19 75 RES_CHRATR_NOLINEBREAK, // 20 76 RES_CHRATR_BACKGROUND, // 21 77 RES_CHRATR_CJK_FONT, // 22 78 RES_CHRATR_CJK_FONTSIZE, // 23 79 RES_CHRATR_CJK_LANGUAGE, // 24 80 RES_CHRATR_CJK_POSTURE, // 25 81 RES_CHRATR_CJK_WEIGHT, // 26 82 RES_CHRATR_CTL_FONT, // 27 83 RES_CHRATR_CTL_FONTSIZE, // 28 84 RES_CHRATR_CTL_LANGUAGE, // 29 85 RES_CHRATR_CTL_POSTURE, // 30 86 RES_CHRATR_CTL_WEIGHT, // 31 87 RES_CHRATR_ROTATE, // 32 88 RES_CHRATR_EMPHASIS_MARK, // 33 89 RES_CHRATR_TWO_LINES, // 34 90 RES_CHRATR_SCALEW, // 35 91 RES_CHRATR_RELIEF, // 36 92 RES_CHRATR_HIDDEN, // 37 93 RES_CHRATR_OVERLINE, // 38 94 RES_CHRATR_DUMMY1, // 39 95 RES_CHRATR_DUMMY2, // 40 96 RES_CHRATR_END 97 }; 98 99 // diese Attribute stehen nur im SwpAttr-Array vom TextNode 100 enum RES_TXTATR 101 { 102 RES_TXTATR_BEGIN = RES_CHRATR_END, 103 104 /** text attributes with start and end. 105 #i105453#: 106 Hints (SwTxtAttr) with the same start and end position are sorted by 107 WhichId, i.e., the TXTATR constants defined here. 108 The text formatting (SwAttrIter) poses some requirements on TXTATR order: 109 - AUTOFMT must precede CHARFMT, so that auto style can overwrite char style. 110 - INETFMT must precede CHARFMT, so that link style can overwrite char style. 111 (this is actually surprising: CHARFMT hints are not split at INETFMT 112 hints on insertion, but on exporting to ODF. if CHARFMT would precede 113 INETFMT, then exporting and importing will effectively change precedence) 114 115 Nesting hints (SwTxtAttrNesting) also have requirements on TXTATR order, 116 to ensure proper nesting (because CJK_RUBY and INETFMT have no CH_TXTATR): 117 - INETFMT should precede CJK_RUBY (for UNO API it does not matter...) 118 - META and METAFIELD must precede CJK_RUBY and INETFMT 119 */ 120 RES_TXTATR_WITHEND_BEGIN = RES_TXTATR_BEGIN , 121 RES_TXTATR_REFMARK = RES_TXTATR_WITHEND_BEGIN, // 41 122 RES_TXTATR_TOXMARK, // 42 123 RES_TXTATR_META, // 43 124 RES_TXTATR_METAFIELD, // 44 125 RES_TXTATR_AUTOFMT, // 45 126 RES_TXTATR_INETFMT, // 46 127 RES_TXTATR_CHARFMT, // 47 128 RES_TXTATR_CJK_RUBY, // 48 129 RES_TXTATR_UNKNOWN_CONTAINER, // 49 130 RES_TXTATR_DUMMY5, // 50 131 RES_TXTATR_WITHEND_END, 132 133 // alle TextAttribute ohne ein Ende 134 RES_TXTATR_NOEND_BEGIN = RES_TXTATR_WITHEND_END, 135 RES_TXTATR_FIELD = RES_TXTATR_NOEND_BEGIN, // 51 136 RES_TXTATR_FLYCNT, // 52 137 RES_TXTATR_FTN, // 53 138 RES_TXTATR_DUMMY4, // 54 139 RES_TXTATR_DUMMY3, // 55 140 RES_TXTATR_DUMMY1, // 56 141 RES_TXTATR_DUMMY2, // 57 142 RES_TXTATR_NOEND_END, 143 RES_TXTATR_END = RES_TXTATR_NOEND_END 144 }; 145 146 enum RES_PARATR 147 { 148 RES_PARATR_BEGIN = RES_TXTATR_END, 149 RES_PARATR_LINESPACING = RES_PARATR_BEGIN, // 58 150 RES_PARATR_ADJUST, // 59 151 RES_PARATR_SPLIT, // 60 152 RES_PARATR_ORPHANS, // 61 153 RES_PARATR_WIDOWS, // 62 154 RES_PARATR_TABSTOP, // 63 155 RES_PARATR_HYPHENZONE, // 64 156 RES_PARATR_DROP, // 65 157 RES_PARATR_REGISTER, // 66 158 RES_PARATR_NUMRULE, // 67 159 RES_PARATR_SCRIPTSPACE, // 68 160 RES_PARATR_HANGINGPUNCTUATION, // 69 161 RES_PARATR_FORBIDDEN_RULES, // 70 162 RES_PARATR_VERTALIGN, // 71 163 RES_PARATR_SNAPTOGRID, // 72 164 RES_PARATR_CONNECT_BORDER, // 73 165 RES_PARATR_OUTLINELEVEL, // 74 166 RES_PARATR_END 167 }; 168 169 // --> OD 2008-02-25 #refactorlists# 170 // list attributes for paragraphs. 171 // intentionally these list attributes are not contained in paragraph styles 172 enum RES_PARATR_LIST 173 { 174 RES_PARATR_LIST_BEGIN = RES_PARATR_END, 175 RES_PARATR_LIST_ID = RES_PARATR_LIST_BEGIN, // 75 176 RES_PARATR_LIST_LEVEL, // 76 177 RES_PARATR_LIST_ISRESTART, // 77 178 RES_PARATR_LIST_RESTARTVALUE, // 78 179 RES_PARATR_LIST_ISCOUNTED, // 79 180 RES_PARATR_LIST_END 181 }; 182 // <-- 183 184 enum RES_FRMATR 185 { 186 RES_FRMATR_BEGIN = RES_PARATR_LIST_END, 187 RES_FILL_ORDER = RES_FRMATR_BEGIN, // 80 188 RES_FRM_SIZE, // 81 189 RES_PAPER_BIN, // 82 190 RES_LR_SPACE, // 83 191 RES_UL_SPACE, // 84 192 RES_PAGEDESC, // 85 193 RES_BREAK, // 86 194 RES_CNTNT, // 87 195 RES_HEADER, // 88 196 RES_FOOTER, // 89 197 RES_PRINT, // 90 198 RES_OPAQUE, // 91 199 RES_PROTECT, // 92 200 RES_SURROUND, // 93 201 RES_VERT_ORIENT, // 94 202 RES_HORI_ORIENT, // 95 203 RES_ANCHOR, // 96 204 RES_BACKGROUND, // 97 205 RES_BOX, // 98 206 RES_SHADOW, // 99 207 RES_FRMMACRO, // 100 208 RES_COL, // 101 209 RES_KEEP, // 102 210 RES_URL, // 103 211 RES_EDIT_IN_READONLY, // 104 212 RES_LAYOUT_SPLIT, // 105 213 RES_CHAIN, // 106 214 RES_TEXTGRID, // 107 215 RES_LINENUMBER , // 108 216 RES_FTN_AT_TXTEND, // 109 217 RES_END_AT_TXTEND, // 110 218 RES_COLUMNBALANCE, // 111 219 RES_FRAMEDIR, // 112 220 RES_HEADER_FOOTER_EAT_SPACING, // 113 221 RES_ROW_SPLIT, // 114 222 // OD 18.09.2003 #i18732# - insert new item and 5 dummies 223 RES_FOLLOW_TEXT_FLOW, // 115 224 // --> collapsing borders FME 2005-05-27 #i29550# 225 RES_COLLAPSING_BORDERS, // 116 226 // <-- collapsing 227 // OD 2004-05-04 #i28701# - use dummy1 for new item 228 RES_WRAP_INFLUENCE_ON_OBJPOS, // 117 229 RES_AUTO_STYLE, // 118 230 RES_FRMATR_STYLE_NAME, // 119 231 RES_FRMATR_CONDITIONAL_STYLE_NAME, // 120 232 RES_FRMATR_END 233 }; 234 235 enum RES_GRFATR 236 { 237 RES_GRFATR_BEGIN = RES_FRMATR_END, 238 RES_GRFATR_MIRRORGRF = RES_GRFATR_BEGIN, // 121 239 RES_GRFATR_CROPGRF, // 122 240 241 RES_GRFATR_ROTATION, // 123 242 RES_GRFATR_LUMINANCE, // 124 243 RES_GRFATR_CONTRAST, // 125 244 RES_GRFATR_CHANNELR, // 126 245 RES_GRFATR_CHANNELG, // 127 246 RES_GRFATR_CHANNELB, // 128 247 RES_GRFATR_GAMMA, // 129 248 RES_GRFATR_INVERT, // 130 249 RES_GRFATR_TRANSPARENCY, // 131 250 RES_GRFATR_DRAWMODE, // 132 251 252 RES_GRFATR_DUMMY1, // 133 253 RES_GRFATR_DUMMY2, // 134 254 RES_GRFATR_DUMMY3, // 135 255 RES_GRFATR_DUMMY4, // 136 256 RES_GRFATR_DUMMY5, // 137 257 RES_GRFATR_END 258 }; 259 260 enum RES_BOXATR 261 { 262 RES_BOXATR_BEGIN = RES_GRFATR_END, 263 RES_BOXATR_FORMAT = RES_BOXATR_BEGIN, // 138 264 RES_BOXATR_FORMULA, // 139 265 RES_BOXATR_VALUE, // 140 266 RES_BOXATR_END 267 }; 268 269 enum RES_UNKNOWNATR 270 { 271 RES_UNKNOWNATR_BEGIN = RES_BOXATR_END, 272 RES_UNKNOWNATR_CONTAINER = RES_UNKNOWNATR_BEGIN,// 141 273 RES_UNKNOWNATR_END 274 }; 275 276 277 278 // ID-s fuer die Formate 279 enum RES_FMT 280 { 281 RES_FMT_BEGIN = RES_UNKNOWNATR_END, 282 RES_CHRFMT = RES_FMT_BEGIN, 283 RES_FRMFMT, 284 RES_FLYFRMFMT, 285 RES_TXTFMTCOLL, 286 RES_GRFFMTCOLL, 287 RES_DRAWFRMFMT, 288 RES_CONDTXTFMTCOLL, 289 RES_FMT_END 290 }; 291 292 // die ID's fuer Messages in den Formaten 293 enum RES_MSG 294 { 295 RES_MSG_BEGIN = RES_FMT_END, 296 RES_OBJECTDYING = RES_MSG_BEGIN, 297 RES_FMT_CHG, 298 RES_ATTRSET_CHG, 299 RES_FRM_SIZECHG, 300 RES_TXTATR_FLDCHG, 301 RES_TXTATR_EMPTYCHG, 302 RES_INS_CHR, 303 RES_INS_TXT, 304 RES_DEL_CHR, 305 RES_DEL_TXT, 306 RES_UPDATE_ATTR, 307 RES_PAGEDESC_FTNINFO, 308 RES_REFMARKFLD_UPDATE, 309 RES_DOCPOS_UPDATE, 310 RES_TABLEFML_UPDATE, 311 RES_UPDATEDDETBL, 312 RES_TBLHEADLINECHG, 313 RES_AUTOFMT_DOCNODE, 314 RES_REPAINT, 315 RES_DOC_DTOR, 316 RES_SECTION_HIDDEN, 317 RES_SECTION_NOT_HIDDEN, 318 RES_GRAPHIC_ARRIVED, 319 RES_GRAPHIC_PIECE_ARRIVED, 320 RES_HIDDENPARA_PRINT, 321 RES_CONDCOLL_CONDCHG, 322 RES_VIRTPAGENUM_INFO, 323 // --> OD 2008-02-25 #refactorlists# 324 // RES_GETNUMNODES, 325 // <-- 326 RES_GETLOWERNUMLEVEL, 327 RES_RESET_FMTWRITTEN, 328 RES_REMOVE_UNO_OBJECT, 329 RES_GRF_REREAD_AND_INCACHE, 330 RES_SECTION_RESETHIDDENFLAG, 331 RES_FINDNEARESTNODE, 332 RES_CONTENT_VISIBLE, 333 RES_FOOTNOTE_DELETED, 334 RES_REFMARK_DELETED, 335 RES_TOXMARK_DELETED, 336 RES_GRAPHIC_SWAPIN, 337 RES_FIELD_DELETED, 338 RES_NAME_CHANGED, 339 RES_TITLE_CHANGED, 340 RES_DESCRIPTION_CHANGED, 341 RES_UNOCURSOR_LEAVES_SECTION, 342 RES_LINKED_GRAPHIC_STREAM_ARRIVED, 343 RES_MSG_END 344 }; 345 346 347 // eine ID fuer den RTF-Reader. Die Stylesheets werden wie 348 // Attribute behandelt, d.H. es gibt ein StyleSheet Attribut. Um 349 // nicht mit anderen Which()-Werten zu kollidieren, ist der Wert 350 // hier mit aufgefuehrt. (Auch das Hilfesystem definiert neue 351 // Attribute !!) 352 enum RES_FLTRATTR 353 { 354 RES_FLTRATTR_BEGIN = RES_MSG_END, 355 RES_FLTR_STYLESHEET = RES_FLTRATTR_BEGIN, 356 RES_FLTR_BOOKMARK, 357 RES_FLTR_ANCHOR, 358 RES_FLTR_BORDER, 359 RES_FLTR_NUMRULE, 360 RES_FLTR_NUMRULE_NUM, 361 RES_FLTR_SDR_ANCHOR, 362 RES_FLTR_TOX, 363 RES_FLTR_SECTION, 364 RES_FLTR_REDLINE, 365 RES_FLTR_SCRIPTTYPE, 366 RES_FLTRATTR_END 367 }; 368 369 #define RES_TBX_DUMMY RES_FLTRATTR_END + 1 370 371 #define HINT_END RES_TBX_DUMMY 372 373 // Fehler-Erkennung !! 374 #define INVALID_HINT HINT_END 375 #define RES_WHICHHINT_END HINT_END 376 377 378 inline bool isATR(const sal_uInt16 nWhich) 379 { 380 return (RES_CHRATR_BEGIN <= nWhich) && (RES_UNKNOWNATR_END > nWhich); 381 } 382 inline bool isCHRATR(const sal_uInt16 nWhich) 383 { 384 return (RES_CHRATR_BEGIN <= nWhich) && (RES_CHRATR_END > nWhich); 385 } 386 inline bool isTXTATR_WITHEND(const sal_uInt16 nWhich) 387 { 388 return (RES_TXTATR_WITHEND_BEGIN <= nWhich) 389 && (RES_TXTATR_WITHEND_END > nWhich); 390 } 391 inline bool isTXTATR_NOEND(const sal_uInt16 nWhich) 392 { 393 return (RES_TXTATR_NOEND_BEGIN <= nWhich) 394 && (RES_TXTATR_NOEND_END > nWhich); 395 } 396 inline bool isTXTATR(const sal_uInt16 nWhich) 397 { 398 return (RES_TXTATR_BEGIN <= nWhich) && (RES_TXTATR_END > nWhich); 399 } 400 inline bool isPARATR(const sal_uInt16 nWhich) 401 { 402 return (RES_PARATR_BEGIN <= nWhich) && (RES_PARATR_END > nWhich); 403 } 404 inline bool isPARATR_LIST(const sal_uInt16 nWhich) 405 { 406 return (RES_PARATR_LIST_BEGIN <= nWhich) && (RES_PARATR_LIST_END > nWhich); } 407 inline bool isFRMATR(const sal_uInt16 nWhich) 408 { 409 return (RES_FRMATR_BEGIN <= nWhich) && (RES_FRMATR_END > nWhich); 410 } 411 inline bool isGRFATR(const sal_uInt16 nWhich) 412 { 413 return (RES_GRFATR_BEGIN <= nWhich) && (RES_GRFATR_END > nWhich); 414 } 415 inline bool isBOXATR(const sal_uInt16 nWhich) 416 { 417 return (RES_BOXATR_BEGIN <= nWhich) && (RES_BOXATR_END > nWhich); 418 } 419 inline bool isUNKNOWNATR(const sal_uInt16 nWhich) 420 { 421 return (RES_UNKNOWNATR_BEGIN <= nWhich) && (RES_UNKNOWNATR_END > nWhich); 422 } 423 424 425 /* 426 * hole aus der statischen Default-Attribut Tabelle ueber den Which-Wert 427 * das entsprechende default Attribut. 428 * Ist keines vorhanden, returnt ein 0-Pointer !!! 429 * 430 * Diese Funktion ist im Init.CXX implementiert. Damit die Formate darauf 431 * zugreifen koennen, ist sie hier als extern deklariert. 432 * Im PRODUCT ist das Teil inline. 433 */ 434 class SfxPoolItem; 435 struct SfxItemInfo; 436 typedef SfxPoolItem* SwDfltAttrTab[ POOLATTR_END - POOLATTR_BEGIN ]; 437 438 extern SwDfltAttrTab __FAR_DATA aAttrTab; 439 extern SfxItemInfo __FAR_DATA aSlotTab[]; 440 441 SW_DLLPUBLIC const SfxPoolItem* GetDfltAttr( sal_uInt16 nWhich ); 442 443 SW_DLLPUBLIC sal_uInt16 GetWhichOfScript( sal_uInt16 nWhich, sal_uInt16 nScript ); 444 445 // return for the given TextAttribut without an end the correct character. 446 // This function returns 447 // CH_TXTATR_BREAKWORD for Textattribut which breaks a word (default) 448 // CH_TXTATR_INWORD for Textattribut which dont breaks a word 449 class SwTxtAttr; 450 sal_Unicode GetCharOfTxtAttr( const SwTxtAttr& rAttr ); 451 452 // alle Sets stehen im init.cxx 453 454 // AttrSet-Range fuer die 3 Break-Attribute 455 extern sal_uInt16 __FAR_DATA aBreakSetRange[]; 456 // AttrSet-Range fuer die TxtFmtColl 457 extern sal_uInt16 __FAR_DATA aTxtFmtCollSetRange[]; 458 // AttrSet-Range fuer die GrfFmtColl 459 extern sal_uInt16 __FAR_DATA aGrfFmtCollSetRange[]; 460 // AttrSet-Range fuer die TextNode 461 SW_DLLPUBLIC extern sal_uInt16 __FAR_DATA aTxtNodeSetRange[]; 462 // AttrSet-Range fuer die NoTxtNode 463 extern sal_uInt16 __FAR_DATA aNoTxtNodeSetRange[]; 464 // AttrSet-Range fuer die SwTable 465 extern sal_uInt16 __FAR_DATA aTableSetRange[]; 466 // AttrSet-Range fuer die SwTableLine 467 extern sal_uInt16 __FAR_DATA aTableLineSetRange[]; 468 // AttrSet-Range fuer die SwTableBox 469 extern sal_uInt16 __FAR_DATA aTableBoxSetRange[]; 470 // AttrSet-Range fuer die SwFrmFmt 471 SW_DLLPUBLIC extern sal_uInt16 __FAR_DATA aFrmFmtSetRange[]; 472 // AttrSet-Range fuer die SwCharFmt 473 extern sal_uInt16 __FAR_DATA aCharFmtSetRange[]; 474 // AttrSet-Range fuer die character autostyles 475 extern sal_uInt16 __FAR_DATA aCharAutoFmtSetRange[]; 476 // AttrSet-Range fuer die SwPageDescFmt 477 extern sal_uInt16 __FAR_DATA aPgFrmFmtSetRange[]; 478 479 // check if ID is InRange of AttrSet-Ids 480 sal_Bool IsInRange( const sal_uInt16* pRange, const sal_uInt16 nId ); 481 482 #endif 483