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
,
231 RTF_ALLOWFIELDENDSEL
,
359 RTF_CFOLLOWEDHYPERLINK
,
467 RTF_COLORSCHEMEMAPPING
,
538 RTF_DONOTEMBEDLINGDATA
,
539 RTF_DONOTEMBEDSYSFONT
,
540 RTF_DONOTSHOWCOMMENTS
,
823 RTF_IGNOREMIXEDCONTENT
,
872 RTF_LEVELPICTURENOSIZE
,
902 RTF_LISTOVERRIDECOUNT
,
903 RTF_LISTOVERRIDEFORMAT
,
904 RTF_LISTOVERRIDESTARTAT
,
905 RTF_LISTOVERRIDETABLE
,
928 RTF_LSDSEMIHIDDENDEF
,
931 RTF_LSDUNHIDEUSEDDEF
,
1032 RTF_MMCONNECTSTRDATA
,
1036 RTF_MMDATATYPEACCESS
,
1037 RTF_MMDATATYPEEXCEL
,
1048 RTF_MMFTTYPEADDRESS
,
1049 RTF_MMFTTYPEBARCODE
,
1050 RTF_MMFTTYPEDBCOLUMN
,
1053 RTF_MMFTTYPESALUTATION
,
1058 RTF_MMMAINTYPECATALOG
,
1059 RTF_MMMAINTYPEEMAIL
,
1060 RTF_MMMAINTYPEENVELOPES
,
1062 RTF_MMMAINTYPELABELS
,
1063 RTF_MMMAINTYPELETTERS
,
1071 RTF_MMODSOFLDMPDATA
,
1075 RTF_MMODSOMAPPEDNAME
,
1077 RTF_MMODSORECIPDATA
,
1083 RTF_MMODSOUNIQUETAG
,
1162 RTF_NOCOMPATOPTIONS
,
1168 RTF_NOFEATURETHROTTLE
,
1187 RTF_NOTBRKCNSTFRCTBL
,
1466 RTF_RAWCLBGDKDCROSS
,
1474 RTF_READONLYRECOMMENDED
,
1479 RTF_REMPERSONALINFO
,
1564 RTF_SECTSPECIFYGENN
,
1598 RTF_SHOWPLACEHOLDTEXT
,
1630 RTF_SNAPTOGRIDINCELL
,
1661 RTF_STYLELOCKBACKCOMP
,
1662 RTF_STYLELOCKENFORCED
,
1666 RTF_STYLESORTMETHOD
,
1743 RTF_TRACKFORMATTING
,
1816 RTF_TRUNCATEFONTHEIGHT
,
1842 RTF_TSCBANDHORZEVEN
,
1846 RTF_TSCBANDVERTEVEN
,
1880 RTF_TXBXTWFIRSTLAST
,
1911 RTF_USENORMSTYFORLIST
,
1949 RTF_WRITERESERVATION
,
1950 RTF_WRITERESERVHASH
,
1981 const char* keywordToString(RTFKeyword nKeyword
);
1983 /// Types of an RTF Control Word
1984 enum RTFControlTypes
1986 CONTROL_FLAG
, // eg \sbknone takes no parameter
1987 CONTROL_DESTINATION
, // eg \fonttbl, if ignored, the whole group should be skipped
1988 CONTROL_SYMBOL
, // eg \tab
1989 CONTROL_TOGGLE
, // eg \b (between on and off)
1990 CONTROL_VALUE
// eg \fs (requires parameter)
1993 /// Represents an RTF Control Word
1996 const char* m_sKeyword
;
1998 RTFKeyword m_nIndex
;
2000 int m_nDefValue
; ///< Most of the control words default to 0.
2003 RTFSymbol() = default;
2004 RTFSymbol(const char* sKeyword
, int nControlType
= 0, RTFKeyword nIndex
= RTF_invalid
,
2006 : m_sKeyword(sKeyword
)
2007 , m_nControlType(nControlType
)
2009 , m_nDefValue(nDefValue
)
2013 const char* GetKeyword() const { return m_sKeyword
; }
2015 int GetControlType() const { return m_nControlType
; }
2017 RTFKeyword
GetIndex() const { return m_nIndex
; }
2019 int GetDefValue() const { return m_nDefValue
; }
2022 extern RTFSymbol
const aRTFControlWords
[];
2023 extern int nRTFControlWords
;
2025 /// Represents an RTF Math Control Word
2028 RTFKeyword m_eKeyword
;
2029 int m_nToken
; ///< This is the OOXML token equivalent.
2030 Destination m_eDestination
;
2033 RTFMathSymbol(RTFKeyword eKeyword
, int nToken
= 0,
2034 Destination eDestination
= Destination::NORMAL
)
2035 : m_eKeyword(eKeyword
)
2037 , m_eDestination(eDestination
)
2041 int GetToken() const { return m_nToken
; }
2043 Destination
GetDestination() const { return m_eDestination
; }
2045 bool operator<(const RTFMathSymbol
& rOther
) const;
2048 extern RTFMathSymbol
const aRTFMathControlWords
[];
2049 extern int nRTFMathControlWords
;
2051 } // namespace rtftok
2052 } // namespace writerfilter
2054 #endif // INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFCONTROLWORDS_HXX
2056 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */