/* * (c) Copyright Ascensio System SIA 2010-2023 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish * street, Riga, Latvia, EU, LV-1050. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #pragma once #ifndef OOX_LOGIC_SDT_INCLUDE_H_ #define OOX_LOGIC_SDT_INCLUDE_H_ #include "../WritingElement.h" #include "RunProperty.h" #include "../../Common/ComplexTypes.h" namespace ComplexTypes { namespace Word { //-------------------------------------------------------------------------------- // SdtListItem 17.5.2.21 (Part 1) //-------------------------------------------------------------------------------- class CSdtListItem : public ComplexType { public: ComplexTypes_AdditionConstructors(CSdtListItem) CSdtListItem(); virtual ~CSdtListItem(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable_string m_sDisplayText; nullable_string m_sValue; }; //-------------------------------------------------------------------------------- // DataBinding 17.5.2.6 (Part 1) //-------------------------------------------------------------------------------- class CDataBinding : public ComplexType { public: ComplexTypes_AdditionConstructors(CDataBinding) CDataBinding(); virtual ~CDataBinding(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable_string m_sPrefixMappings; nullable_string m_sStoreItemID; nullable_string m_sXPath; //ext w15 nullable_string m_sStoreItemChecksum; }; //-------------------------------------------------------------------------------- // CalendarType 17.5.2.3 (Part 1) //-------------------------------------------------------------------------------- class CCalendarType : public ComplexType { public: ComplexTypes_AdditionConstructors(CCalendarType) CCalendarType(); virtual ~CCalendarType(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: SimpleTypes::CCalendarType m_oVal; }; //-------------------------------------------------------------------------------- // SdtDateMappingType 17.5.2.40 (Part 1) //-------------------------------------------------------------------------------- class CSdtDateMappingType : public ComplexType { public: ComplexTypes_AdditionConstructors(CSdtDateMappingType) CSdtDateMappingType(); virtual ~CSdtDateMappingType(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: SimpleTypes::CSdtDateMappingType m_oVal; }; //-------------------------------------------------------------------------------- // Lock 17.5.2.23 (Part 1) //-------------------------------------------------------------------------------- class CLock : public ComplexType { public: ComplexTypes_AdditionConstructors(CLock) CLock(); virtual ~CLock(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: SimpleTypes::CLock m_oVal; }; //-------------------------------------------------------------------------------- // SdtText 17.5.2.44 (Part 1) //-------------------------------------------------------------------------------- class CSdtText : public ComplexType { public: ComplexTypes_AdditionConstructors(CSdtText) CSdtText(); virtual ~CSdtText(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oMultiLine; }; //-------------------------------------------------------------------------------- // SdtAppearance 2.5.4.2 ([MS-DOCX]) //-------------------------------------------------------------------------------- class CSdtAppearance : public ComplexType { public: ComplexTypes_AdditionConstructors(CSdtAppearance) CSdtAppearance(); virtual ~CSdtAppearance(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oVal; }; //Not from specification class CComb : public ComplexType { public: ComplexTypes_AdditionConstructors(CComb) CComb(); virtual ~CComb(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oWRule; nullable_int m_oWidth; nullable_string m_oSym; nullable_string m_oFont; }; //Not from specification class CTextFormFormat : public ComplexType { public: ComplexTypes_AdditionConstructors(CTextFormFormat) CTextFormFormat(); virtual ~CTextFormFormat(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oType; nullable_string m_oVal; nullable_string m_oSymbols; }; } // Word } // ComplexTypes namespace OOX { namespace Logic { //Not from specification class CFormPr : public WritingElement { public: WritingElement_AdditionMethods(CFormPr) CFormPr(OOX::Document *pMain = NULL); virtual ~CFormPr(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable_string m_oKey; nullable_string m_oLabel; nullable_string m_oHelpText; nullable_bool m_oRequired; nullable m_oBorder; nullable m_oShd; nullable m_oFieldRid; }; //Not from specification class CTextFormPr : public WritingElement { public: WritingElement_AdditionMethods(CTextFormPr) CTextFormPr(OOX::Document *pMain = NULL); virtual ~CTextFormPr(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oComb; nullable m_oMaxCharacters; nullable m_oCombBorder; nullable_bool m_oAutoFit; nullable_bool m_oMultiLine; nullable m_oFormat; }; //Not from specification class CComplexFormPr : public WritingElement { public: WritingElement_AdditionMethods(CComplexFormPr) CComplexFormPr(OOX::Document *pMain = NULL); virtual ~CComplexFormPr(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oType; }; //-------------------------------------------------------------------------------- // CSdtComboBox 17.5.2.5 (Part 1) //-------------------------------------------------------------------------------- class CSdtComboBox : public WritingElement { public: WritingElement_AdditionMethods(CSdtComboBox) CSdtComboBox(OOX::Document *pMain = NULL); virtual ~CSdtComboBox(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oFormat; nullable m_sLastValue; std::vector m_arrListItem; }; //-------------------------------------------------------------------------------- // CDate 17.5.2.7 (Part 1) //-------------------------------------------------------------------------------- class CDate : public WritingElement { public: WritingElement_AdditionMethods(CDate) CDate(OOX::Document *pMain = NULL); virtual ~CDate(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oFullDate; nullable m_oCalendar; nullable m_oDateFormat; nullable m_oLid; nullable m_oStoreMappedDateAs; }; //-------------------------------------------------------------------------------- // CSdtDocPart 17.5.2.12 (Part 1) //-------------------------------------------------------------------------------- class CSdtDocPart : public WritingElement { public: WritingElement_AdditionMethods(CSdtDocPart) CSdtDocPart(OOX::Document *pMain = NULL); virtual ~CSdtDocPart(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; std::wstring toXML2(const std::wstring& sName) const; virtual EElementType getType() const; public: nullable m_oDocPartCategory; nullable m_oDocPartGallery; nullable m_oDocPartUnique; }; //-------------------------------------------------------------------------------- // CSdtDropDownList 17.5.2.15 (Part 1) //-------------------------------------------------------------------------------- class CSdtDropDownList : public WritingElement { public: WritingElement_AdditionMethods(CSdtDropDownList) CSdtDropDownList(OOX::Document *pMain = NULL); virtual ~CSdtDropDownList(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable_string m_sLastValue; std::vector m_arrListItem; }; //-------------------------------------------------------------------------------- // CPlaceHolder 17.5.2.25 (Part 1) //-------------------------------------------------------------------------------- class CPlaceHolder : public WritingElement { public: WritingElement_AdditionMethods(CPlaceHolder) CPlaceHolder(OOX::Document *pMain = NULL); virtual ~CPlaceHolder(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; public: // Nodes nullable m_oDocPart; }; //-------------------------------------------------------------------------------- // SdtEndPr 17.5.2.37 (Part 1) //-------------------------------------------------------------------------------- class CSdtEndPr : public WritingElement { public: WritingElement_AdditionMethods(CSdtEndPr) CSdtEndPr(OOX::Document *pMain = NULL); virtual ~CSdtEndPr(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; public: nullable m_oRPr; }; class CSdtCheckBoxSymbol : public WritingElement { public: WritingElement_AdditionMethods(CSdtCheckBoxSymbol) CSdtCheckBoxSymbol(OOX::Document *pMain = NULL); virtual ~CSdtCheckBoxSymbol(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; std::wstring ToString() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oVal; nullable m_oFont; }; class CSdtCheckBox : public WritingElement { public: WritingElement_AdditionMethods(CSdtCheckBox) CSdtCheckBox(OOX::Document *pMain = NULL); virtual ~CSdtCheckBox(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; public: nullable m_oChecked; nullable m_oCheckedState; nullable m_oUncheckedState; nullable m_oGroupKey;//Not from specification }; class CSdtPicture : public WritingElement { public: WritingElement_AdditionMethods(CSdtPicture) CSdtPicture(OOX::Document *pMain = NULL); virtual ~CSdtPicture(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable_int m_oScaleFlag; nullable_bool m_oLockProportions; nullable_bool m_oRespectBorders; nullable_double m_oShiftX; nullable_double m_oShiftY; nullable_bool m_oSignature; }; //-------------------------------------------------------------------------------- // SdtEndPr 17.5.2.38 (Part 1) //-------------------------------------------------------------------------------- enum ESdtType { sdttypeUnknown = -1, sdttypeBibliography = 0, sdttypeCitation = 1, sdttypeComboBox = 2, sdttypeDate = 3, sdttypeDocPartList = 4, sdttypeDocPartObj = 5, sdttypeDropDownList = 6, sdttypeEquation = 7, sdttypeGroup = 8, sdttypePicture = 9, sdttypeRichText = 10, sdttypeText = 11, sdttypeCheckBox = 12 }; class CSdtPr : public WritingElement { public: WritingElement_AdditionMethods(CSdtPr) CSdtPr(OOX::Document *pMain = NULL); virtual ~CSdtPr(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); std::wstring toXMLStart() const; std::wstring toXMLEnd() const; virtual std::wstring toXML() const; virtual EElementType getType() const; ESdtType m_eType; nullable m_oAlias; nullable m_oAppearance; nullable m_oComboBox; nullable m_oColor; nullable m_oDataBinding; nullable m_oDate; nullable m_oDocPartList; nullable m_oDocPartObj; nullable m_oDropDownList; nullable m_oId; nullable m_oLabel; nullable m_oLock; nullable m_oPlaceHolder; nullable m_oRPr; nullable m_oShowingPlcHdr; nullable m_oTabIndex; nullable m_oTag; nullable m_oTemporary; nullable m_oText; nullable m_oCheckbox; nullable m_oFormPr; //Not from specification nullable m_oTextFormPr; //Not from specification nullable m_oPicture; //Not from specification nullable m_oComplexFormPr; // Not from specification nullable m_oBorder; // Not from specification nullable m_oShd; // Not from specification }; //-------------------------------------------------------------------------------- // SdtContent 17.5.2.38 (Part 1) //-------------------------------------------------------------------------------- class CSdtContent : public WritingElementWithChilds<> { public: WritingElement_AdditionMethods(CSdtContent) CSdtContent(OOX::Document *pMain = NULL); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; // Childs }; //-------------------------------------------------------------------------------- // Sdt 17.5.2.29 - 17.5.2.32 (Part 1) //-------------------------------------------------------------------------------- class CSdt : public WritingElement { public: WritingElement_AdditionMethods(CSdt) CSdt(OOX::Document *pMain = NULL); virtual ~CSdt(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; public: nullable m_oSdtContent; nullable m_oSdtEndPr; nullable m_oSdtPr; }; } // namespace Logic } // namespace OOX #endif // OOX_LOGIC_SDT_INCLUDE_H_