LibreOffice Module sw (master)  1
hintids.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SW_INC_HINTIDS_HXX
20 #define INCLUDED_SW_INC_HINTIDS_HXX
21 
22 #include <tools/solar.h>
23 #include <sal/types.h>
24 #include <svx/xdef.hxx>
25 #include "swdllapi.h"
26 #include <vector>
27 
28 // For SwTextHints without end index the following char is added:
29 
30 #define CH_TXTATR_BREAKWORD u'\x0001'
31 #define CH_TXTATR_INWORD u'\xFFF9'
32 #define CH_TXTATR_TAB u'\t'
33 #define CH_TXTATR_NEWLINE u'\n'
34 #define CH_TXT_ATR_INPUTFIELDSTART u'\x0004'
35 #define CH_TXT_ATR_INPUTFIELDEND u'\x0005'
36 
37 #define CH_TXT_ATR_FORMELEMENT u'\x0006'
38 
39 #define CH_TXT_ATR_FIELDSTART u'\x0007'
40 #define CH_TXT_ATR_FIELDEND u'\x0008'
41 #define CH_TXT_ATR_SUBST_FIELDSTART ("[")
42 #define CH_TXT_ATR_SUBST_FIELDEND ("]")
43 
44 /*
45  * Enums for the hints
46  */
47 
48 #define HINT_BEGIN 1
49 
50 #define POOLATTR_BEGIN HINT_BEGIN
51 #define POOLATTR_END RES_UNKNOWNATR_END
52 
53 // Ranges for the IDs of the format-attributes.
54 // Which-values for character-format attributes.
56 {
104 };
105 
106 // this Attribute used only in a TextNodes SwpAttr-Array
108 {
110 
139 
140 // all TextAttributes without an end
151 };
152 
154 {
176 };
177 
178 // list attributes for paragraphs.
179 // intentionally these list attributes are not contained in paragraph styles
181 {
189 };
190 
192 {
200  RES_BREAK, // 93
201  RES_CNTNT, // 94
202  RES_HEADER, // 95
203  RES_FOOTER, // 96
204  RES_PRINT, // 97
205  RES_OPAQUE, // 98
206  RES_PROTECT, // 99
207  RES_SURROUND, // 100
210  RES_ANCHOR, // 103
212  RES_BOX, // 105
213  RES_SHADOW, // 106
214  RES_FRMMACRO, // 107
215  RES_COL, // 108
216  RES_KEEP, // 109
217  RES_URL, // 110
220  RES_CHAIN, // 113
221  RES_TEXTGRID, // 114
222  RES_LINENUMBER , // 115
226  RES_FRAMEDIR, // 119
238 };
239 
241 {
245 
256 
263 };
264 
266 {
272 };
273 
275 {
279 };
280 
281 // Format IDs
283 {
286  RES_FRMFMT, // 152
293 };
294 
295 // ID's for Messages in the Formats
297 {
331 };
332 
333 // An ID for the RTF-reader. The stylesheets are treated like attributes,
334 // i.e. there is a StyleSheet-attribute. To avoid collision with other
335 // Which()-values, the value is listed here. (The help system too defines
336 // new attributes!)
338 {
348 };
349 
350 #define RES_TBX_DUMMY RES_FLTRATTR_END + 1
351 
352 #define HINT_END RES_TBX_DUMMY
353 
354 // Error recognition!!
355 #define INVALID_HINT HINT_END
356 #define RES_WHICHHINT_END HINT_END
357 
358 inline bool isATR(const sal_uInt16 nWhich)
359 {
360  return (RES_CHRATR_BEGIN <= nWhich) && (RES_UNKNOWNATR_END > nWhich);
361 }
362 inline bool isCHRATR(const sal_uInt16 nWhich)
363 {
364  return (RES_CHRATR_BEGIN <= nWhich) && (RES_CHRATR_END > nWhich);
365 }
366 inline bool isTXTATR_WITHEND(const sal_uInt16 nWhich)
367 {
368  return (RES_TXTATR_WITHEND_BEGIN <= nWhich)
369  && (RES_TXTATR_WITHEND_END > nWhich);
370 }
371 inline bool isTXTATR_NOEND(const sal_uInt16 nWhich)
372 {
373  return (RES_TXTATR_NOEND_BEGIN <= nWhich)
374  && (RES_TXTATR_NOEND_END > nWhich);
375 }
376 inline bool isTXTATR(const sal_uInt16 nWhich)
377 {
378  return (RES_TXTATR_BEGIN <= nWhich) && (RES_TXTATR_END > nWhich);
379 }
380 inline bool isPARATR(const sal_uInt16 nWhich)
381 {
382  return (RES_PARATR_BEGIN <= nWhich) && (RES_PARATR_END > nWhich);
383 }
384 inline bool isPARATR_LIST(const sal_uInt16 nWhich)
385 {
386  return (RES_PARATR_LIST_BEGIN <= nWhich) && (RES_PARATR_LIST_END > nWhich);
387 }
388 inline bool isFRMATR(const sal_uInt16 nWhich)
389 {
390  return (RES_FRMATR_BEGIN <= nWhich) && (RES_FRMATR_END > nWhich);
391 }
392 inline bool isDrawingLayerAttribute(const sal_uInt16 nWhich)
393 {
394  return (XATTR_START <= nWhich) && (XATTR_END > nWhich);
395 }
396 inline bool isGRFATR(const sal_uInt16 nWhich)
397 {
398  return (RES_GRFATR_BEGIN <= nWhich) && (RES_GRFATR_END > nWhich);
399 }
400 inline bool isBOXATR(const sal_uInt16 nWhich)
401 {
402  return (RES_BOXATR_BEGIN <= nWhich) && (RES_BOXATR_END > nWhich);
403 }
404 inline bool isUNKNOWNATR(const sal_uInt16 nWhich)
405 {
406  return (RES_UNKNOWNATR_BEGIN <= nWhich) && (RES_UNKNOWNATR_END > nWhich);
407 }
408 
409 // Take the respective default attribute from the statistical default
410 // attributes table over the Which-value.
411 // If none exists, return a 0 pointer!!!
412 // This function is implemented in Init.cxx. It is declared here as external
413 // in order to allow the formats to access it.
414 // Inline in PRODUCT.
415 class SfxPoolItem;
416 struct SfxItemInfo;
417 typedef std::vector<SfxPoolItem*> SwDfltAttrTab;
418 
419 extern SwDfltAttrTab aAttrTab;
420 extern SfxItemInfo aSlotTab[];
421 
427 SW_DLLPUBLIC const SfxPoolItem* GetDfltAttr( sal_uInt16 nWhich );
428 
429 SW_DLLPUBLIC sal_uInt16 GetWhichOfScript( sal_uInt16 nWhich, sal_uInt16 nScript );
430 
431 // return for the given TextAttribute without an end the correct character.
432 // This function returns
433 // CH_TXTATR_BREAKWORD for Textattribute which breaks a word (default)
434 // CH_TXTATR_INWORD for Textattribute which doesn't breaks a word
435 class SwTextAttr;
437 
438 // all Sets defined in init.cxx
439 
440 // AttrSet-Range for the 3 Break-Attribute
441 extern sal_uInt16 aBreakSetRange[];
442 // AttrSet-Range for TextFormatColl
443 extern sal_uInt16 aTextFormatCollSetRange[];
444 // AttrSet-Range for GrfFormatColl
445 extern sal_uInt16 aGrfFormatCollSetRange[];
446 // AttrSet-Range for TextNode
447 SW_DLLPUBLIC extern sal_uInt16 aTextNodeSetRange[];
448 // AttrSet-Range for NoTextNode
449 extern sal_uInt16 aNoTextNodeSetRange[];
450 // AttrSet-Range for SwTable
451 extern sal_uInt16 aTableSetRange[];
452 // AttrSet-Range for SwTableLine
453 extern sal_uInt16 aTableLineSetRange[];
454 // AttrSet-Range for SwTableBox
455 extern sal_uInt16 aTableBoxSetRange[];
456 // AttrSet-Range for SwFrameFormat
457 SW_DLLPUBLIC extern sal_uInt16 aFrameFormatSetRange[];
458 // AttrSet-Range for SwCharFormat
459 extern sal_uInt16 aCharFormatSetRange[];
460 // AttrSet-Range for the autostyles
461 extern sal_uInt16 aCharAutoFormatSetRange[];
462 // AttrSet-Range for SwPageDescFormat
463 extern sal_uInt16 aPgFrameFormatSetRange[];
464 
465 // check if ID is InRange of AttrSet-Ids
466 bool IsInRange( const sal_uInt16* pRange, const sal_uInt16 nId );
467 
468 #endif
469 
470 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool isUNKNOWNATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:404
sal_uInt16 aTextFormatCollSetRange[]
Definition: init.cxx:146
sal_Unicode GetCharOfTextAttr(const SwTextAttr &rAttr)
Definition: thints.cxx:3418
RES_GRFATR
Definition: hintids.hxx:240
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:362
SW_DLLPUBLIC const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:127
SW_DLLPUBLIC sal_uInt16 aTextNodeSetRange[]
Definition: init.cxx:167
bool isFRMATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:388
bool isTXTATR_WITHEND(const sal_uInt16 nWhich)
Definition: hintids.hxx:366
bool isTXTATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:376
bool isTXTATR_NOEND(const sal_uInt16 nWhich)
Definition: hintids.hxx:371
RES_FRMATR
Definition: hintids.hxx:191
#define XATTR_START
bool isATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:358
bool isDrawingLayerAttribute(const sal_uInt16 nWhich)
Definition: hintids.hxx:392
sal_uInt16 aTableSetRange[]
Definition: init.cxx:188
sal_uInt16 aTableLineSetRange[]
Definition: init.cxx:204
RES_FMT
Definition: hintids.hxx:282
sal_uInt16 sal_Unicode
SW_DLLPUBLIC sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
Definition: hints.cxx:169
bool isGRFATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:396
sal_uInt16 aCharAutoFormatSetRange[]
Definition: init.cxx:248
sal_uInt16 aNoTextNodeSetRange[]
Definition: init.cxx:181
RES_PARATR
Definition: hintids.hxx:153
#define HINT_BEGIN
Definition: hintids.hxx:48
RES_TXTATR
Definition: hintids.hxx:107
RES_CHRATR
Definition: hintids.hxx:55
RES_PARATR_LIST
Definition: hintids.hxx:180
sal_uInt16 aTableBoxSetRange[]
Definition: init.cxx:216
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
sal_uInt16 aPgFrameFormatSetRange[]
Definition: init.cxx:256
bool isPARATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:380
RES_UNKNOWNATR
Definition: hintids.hxx:274
SwDfltAttrTab aAttrTab
sal_uInt16 aGrfFormatCollSetRange[]
Definition: init.cxx:159
sal_uInt16 aCharFormatSetRange[]
Definition: init.cxx:241
RES_MSG
Definition: hintids.hxx:296
SfxItemInfo aSlotTab[]
Definition: init.cxx:265
SW_DLLPUBLIC sal_uInt16 aFrameFormatSetRange[]
Definition: init.cxx:230
std::vector< SfxPoolItem * > SwDfltAttrTab
Definition: hintids.hxx:416
text attributes with start and end.
Definition: hintids.hxx:127
#define XATTR_END
bool isBOXATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:400
RES_FLTRATTR
Definition: hintids.hxx:337
RES_BOXATR
Definition: hintids.hxx:265
sal_uInt16 aBreakSetRange[]
Definition: init.cxx:138
bool isPARATR_LIST(const sal_uInt16 nWhich)
Definition: hintids.hxx:384
bool IsInRange(const sal_uInt16 *pRange, const sal_uInt16 nId)
check if ID is in range of attribute set IDs
Definition: swatrset.cxx:459