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/.
10 #ifndef INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFCONTROLWORDS_HXX
11 #define INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFCONTROLWORDS_HXX
13 namespace writerfilter
18 * An RTF destination state is the last open destination control word.
20 * Note that this is not a 1:1 mapping between destination control
21 * words, e.g. RTF_PICT gets mapped to Destination::PICT or
22 * Destination::SHAPEPROPERTYVALUEPICT.
24 enum class Destination
53 SHAPEPROPERTYVALUEPICT
,
54 NESTEDTABLEPROPERTIES
,
85 PARAGRAPHNUMBERING_TEXTBEFORE
,
86 PARAGRAPHNUMBERING_TEXTAFTER
,
91 ANNOTATIONREFERENCESTART
,
92 ANNOTATIONREFERENCEEND
,
230 RTF_ALLOWFIELDENDSEL
,
358 RTF_CFOLLOWEDHYPERLINK
,
466 RTF_COLORSCHEMEMAPPING
,
537 RTF_DONOTEMBEDLINGDATA
,
538 RTF_DONOTEMBEDSYSFONT
,
539 RTF_DONOTSHOWCOMMENTS
,
822 RTF_IGNOREMIXEDCONTENT
,
871 RTF_LEVELPICTURENOSIZE
,
901 RTF_LISTOVERRIDECOUNT
,
902 RTF_LISTOVERRIDEFORMAT
,
903 RTF_LISTOVERRIDESTARTAT
,
904 RTF_LISTOVERRIDETABLE
,
927 RTF_LSDSEMIHIDDENDEF
,
930 RTF_LSDUNHIDEUSEDDEF
,
1031 RTF_MMCONNECTSTRDATA
,
1035 RTF_MMDATATYPEACCESS
,
1036 RTF_MMDATATYPEEXCEL
,
1047 RTF_MMFTTYPEADDRESS
,
1048 RTF_MMFTTYPEBARCODE
,
1049 RTF_MMFTTYPEDBCOLUMN
,
1052 RTF_MMFTTYPESALUTATION
,
1057 RTF_MMMAINTYPECATALOG
,
1058 RTF_MMMAINTYPEEMAIL
,
1059 RTF_MMMAINTYPEENVELOPES
,
1061 RTF_MMMAINTYPELABELS
,
1062 RTF_MMMAINTYPELETTERS
,
1070 RTF_MMODSOFLDMPDATA
,
1074 RTF_MMODSOMAPPEDNAME
,
1076 RTF_MMODSORECIPDATA
,
1082 RTF_MMODSOUNIQUETAG
,
1161 RTF_NOCOMPATOPTIONS
,
1167 RTF_NOFEATURETHROTTLE
,
1186 RTF_NOTBRKCNSTFRCTBL
,
1465 RTF_RAWCLBGDKDCROSS
,
1473 RTF_READONLYRECOMMENDED
,
1478 RTF_REMPERSONALINFO
,
1563 RTF_SECTSPECIFYGENN
,
1597 RTF_SHOWPLACEHOLDTEXT
,
1629 RTF_SNAPTOGRIDINCELL
,
1660 RTF_STYLELOCKBACKCOMP
,
1661 RTF_STYLELOCKENFORCED
,
1665 RTF_STYLESORTMETHOD
,
1742 RTF_TRACKFORMATTING
,
1815 RTF_TRUNCATEFONTHEIGHT
,
1841 RTF_TSCBANDHORZEVEN
,
1845 RTF_TSCBANDVERTEVEN
,
1879 RTF_TXBXTWFIRSTLAST
,
1910 RTF_USENORMSTYFORLIST
,
1948 RTF_WRITERESERVATION
,
1949 RTF_WRITERESERVHASH
,
1980 const char* keywordToString(RTFKeyword nKeyword
);
1982 /// Types of an RTF Control Word
1983 enum RTFControlTypes
1985 CONTROL_FLAG
, // eg \sbknone takes no parameter
1986 CONTROL_DESTINATION
, // eg \fonttbl, if ignored, the whole group should be skipped
1987 CONTROL_SYMBOL
, // eg \tab
1988 CONTROL_TOGGLE
, // eg \b (between on and off)
1989 CONTROL_VALUE
// eg \fs (requires parameter)
1992 /// Represents an RTF Control Word
1995 const char* sKeyword
;
1999 int nDefValue
; //For most of the ControlWords, default is 0.
2001 bool operator<(const RTFSymbol
& rOther
) const;
2004 extern RTFSymbol
const aRTFControlWords
[];
2005 extern int nRTFControlWords
;
2007 /// Represents an RTF Math Control Word
2008 struct RTFMathSymbol
2010 RTFKeyword eKeyword
;
2011 int nToken
; ///< This is the OOXML token equivalent.
2012 Destination eDestination
;
2013 bool operator<(const RTFMathSymbol
& rOther
) const;
2016 extern RTFMathSymbol
const aRTFMathControlWords
[];
2017 extern int nRTFMathControlWords
;
2019 } // namespace rtftok
2020 } // namespace writerfilter
2022 #endif // INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFCONTROLWORDS_HXX
2024 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */