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